Skip to content

add_noise_white_contour_xldadd_noise_white_contour_xldAddNoiseWhiteContourXldAddNoiseWhiteContourXldadd_noise_white_contour_xldadd_noise_white_contour_xldπŸ”—

Short descriptionπŸ”—

add_noise_white_contour_xldadd_noise_white_contour_xldAddNoiseWhiteContourXldAddNoiseWhiteContourXldadd_noise_white_contour_xldadd_noise_white_contour_xld β€” Add noise to XLD contours.

SignatureπŸ”—

add_noise_white_contour_xld( xld_cont Contours, out xld_cont NoisyContours, integer NumRegrPoints, real Amp )add_noise_white_contour_xld( Contours : NoisyContours : NumRegrPoints, Amp : )void AddNoiseWhiteContourXld( const HObject& Contours, HObject* NoisyContours, const HTuple& NumRegrPoints, const HTuple& Amp )static void HOperatorSet.AddNoiseWhiteContourXld( HObject contours, out HObject noisyContours, HTuple numRegrPoints, HTuple amp )def add_noise_white_contour_xld( contours: HObject, num_regr_points: int, amp: float ) -> HObject

Herror add_noise_white_contour_xld( const Hobject Contours, Hobject* NoisyContours, const Hlong NumRegrPoints, double Amp )

Herror T_add_noise_white_contour_xld( const Hobject Contours, Hobject* NoisyContours, const Htuple NumRegrPoints, const Htuple Amp )

HXLDCont HXLDCont::AddNoiseWhiteContourXld( Hlong NumRegrPoints, double Amp ) const

HXLDCont HXLDCont.AddNoiseWhiteContourXld( int numRegrPoints, double amp )

DescriptionπŸ”—

add_noise_white_contour_xldAddNoiseWhiteContourXld adds noise to the input XLD contours Contourscontourscontours and returns the noisy contours in NoisyContoursnoisyContoursnoisy_contours. For each point along the original contours the local regression line (i.e., a least-squares approximating line) based on NumRegrPointsnumRegrPointsnum_regr_points neighboring points is determined. Then the point is shifted perpendicular to this line. The length of the shifts corresponds to white noise, equally distributed in the interval [-Ampampamp,Ampampamp].

The random noise is generated using the C function β€œdrand48()”. See the parameter 'seed_rand'"seed_rand" of set_systemSetSystem for information on the used random seed.

Execution informationπŸ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

ParametersπŸ”—

Contourscontourscontours (input_object) xld_cont(-array) β†’ objectobjectHObjectHXLDContHObjectHobject

Original contours.

NoisyContoursnoisyContoursnoisy_contours (output_object) xld_cont(-array) β†’ objectobjectHObjectHXLDContHObjectHobject *

Noisy contours.

NumRegrPointsnumRegrPointsnum_regr_points (input_control) integer β†’ (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Number of points used to calculate the regression line.

Default: 55
Suggested values: 3, 5, 7, 93, 5, 7, 9
Restriction: NumRegrPoints >= 3 && odd(NumRegrPoints)

Ampampamp (input_control) real β†’ (real)(real)HTuple (double)HTuple (double)floatHtuple (double)

Maximum amplitude of the added noise (equally distributed in [-Amp,Amp]).

Default: 1.01.0
Suggested values: 0.25, 0.5, 1.0, 1.5, 2.0, 3.0, 4.0, 5.0, 10.00.25, 0.5, 1.0, 1.5, 2.0, 3.0, 4.0, 5.0, 10.0
Restriction: Amp > 0

ExampleπŸ”—

(HDevelop)


draw_ellipse(WindowHandle,Row,Column,Phi,Radius1,Radius2)
gen_ellipse_contour_xld(Ellipse,Row,Column,Phi,Radius1,Radius2,0,6.28319, \
                        'positive', 1.5)
add_noise_white_contour_xld(Ellipse,NoisyEllipse,5,0.5)
fit_ellipse_contour_xld (NoisyEllipse, 'fitzgibbon', -1, 2, 0, 200, 3, 2.0, \
                         ERow, EColumn, EPhi, ERadius1, ERadius2, \
                         EStartPhi, EEndPhi, EPointOrder)
(C)
draw_ellipse(WindowHandle,&Row,&Column,&Phi,&Radius1,&Radius2)\;
gen_ellipse_contour_xld(&Ellipse,Row,Column,Phi,Radius1,Radius2,0,6.28319,
                        "positive",1.5)\;
add_noise_white_contour_xld(Ellipse,&NoisyEllipse,5,0.5)\;
fit_ellipse_contour_xld (NoisyEllipse, "fitzgibbon", -1, 2, 0, 200, 3, 2.0,
                         &ERow, &EColumn, &EPhi, &ERadius1, &ERadius2,
                         &EStartPhi, &EEndPhi, &EPointOrder)\;

ResultπŸ”—

add_noise_white_contour_xldAddNoiseWhiteContourXld returns 2 (H_MSG_TRUE) if all parameter values are correct. If the input is empty the behavior can be set via set_system('no_object_result',<Result>). If necessary, an exception is raised.

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

gen_contours_skeleton_xldGenContoursSkeletonXld, lines_gaussLinesGauss, lines_facetLinesFacet, edges_sub_pixEdgesSubPix, gen_ellipse_contour_xldGenEllipseContourXld

Possible successors

smooth_contours_xldSmoothContoursXld

See also

smooth_contours_xldSmoothContoursXld, add_noise_whiteAddNoiseWhite

ModuleπŸ”—

Foundation