Herror ::add_noise_white_contour_xld (
    Hobject Contours,
    Hobject *NoisyContours,
    const HTuple &NumRegrPoints,
    const HTuple &Amp
)
HXLDCont HXLDCont::AddNoiseWhiteContourXld (
    const HTuple &NumRegrPoints,
    const HTuple &Amp
) const
HXLDContArray HXLDContArray::AddNoiseWhiteContourXld (
    const HTuple &NumRegrPoints,
    const HTuple &Amp
) const

Add noise to XLD contours.

::add_noise_white_contour_xld adds noise to the input XLD contours Contours and returns the noisy contours in NoisyContours. For each point along the original contours the local regression line (i.e. a least-squares approximating line) based on NumRegrPoints 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 [-Amp,Amp] generated by using the C function ``drand48'' with an initial time dependent seed.


Parameters

Contours (input_object)
xld_cont(-array) -> Hobject: HXLDCont(Array)
Original contours.

NoisyContours (output_object)
xld_cont(-array) -> Hobject * : HXLDCont(Array)
Noisy contours.

NumRegrPoints (input_control)
integer -> HTuple.long
Number of points used to calculate the regression line.
Default value: 5
Suggested values: 3, 5, 7, 9
Restriction: (NumRegrPoints >= 3) && odd(NumRegrPoints)

Amp (input_control)
real -> HTuple.double
Maximum amplitude of the added noise (equally distributed in [-Amp,Amp]).
Default value: 1.0
Suggested values: 0.25, 0.5, 1.0, 1.5, 2.0, 3.0, 4.0, 5.0, 10.0
Restriction: Amp > 0


Example
draw_ellipse(WindowHandle,&Row,&Column,&Phi,&Radius1,&Radius2);
gen_ellipse_contour_xld(&Ellipse,Row,Column,Phi,Radius1,Radius2,0,6.28319,
                        "positive");
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_xld returns H_MSG_TRUE if all parameter values are correct. If the input is empty the behaviour can be set via ::set_system('no_object_result',<Result>). If necessary, an exception is raised.


Possible Predecessors

::gen_contours_skeleton_xld, ::lines_gauss, ::lines_facet, ::edges_sub_pix, ::gen_ellipse_contour_xld


Possible Successors

::smooth_contours_xld


See also

::smooth_contours_xld, ::add_noise_white


Module

Sub-pixel operators



Copyright © 1996-2002 MVTec Software GmbH