Elliptic_axis [HALCON Operator Reference / Version 12.0.2]
Có thể bạn quan tâm
- HDevelop
- .NET
- C++
- C++ (legacy)
- COM
- C
| Operators |
Name
elliptic_axis — Calculate the parameters of the equivalent ellipse.
Signature
elliptic_axis(Regions : : : Ra, Rb, Phi)
Herror elliptic_axis(const Hobject Regions, double* Ra, double* Rb, double* Phi)
Herror T_elliptic_axis(const Hobject Regions, Htuple* Ra, Htuple* Rb, Htuple* Phi)
Herror elliptic_axis(Hobject Regions, double* Ra, double* Rb, double* Phi)
Herror elliptic_axis(Hobject Regions, HTuple* Ra, HTuple* Rb, HTuple* Phi)
double HRegion::EllipticAxis(double* Rb, double* Phi) const
HTuple HRegionArray::EllipticAxis(HTuple* Rb, HTuple* Phi) const
void EllipticAxis(const HObject& Regions, HTuple* Ra, HTuple* Rb, HTuple* Phi)
HTuple HRegion::EllipticAxis(HTuple* Rb, HTuple* Phi) const
double HRegion::EllipticAxis(double* Rb, double* Phi) const
void HOperatorSetX.EllipticAxis([in] IHUntypedObjectX* Regions, [out] VARIANT* Ra, [out] VARIANT* Rb, [out] VARIANT* Phi)
VARIANT HRegionX.EllipticAxis([out] VARIANT* Rb, [out] VARIANT* Phi)
static void HOperatorSet.EllipticAxis(HObject regions, out HTuple ra, out HTuple rb, out HTuple phi)
HTuple HRegion.EllipticAxis(out HTuple rb, out HTuple phi)
double HRegion.EllipticAxis(out double rb, out double phi)
Description
The operator elliptic_axis calculates the radii Ra and Rb and the orientation Phi of the ellipse having the same orientation and the same aspect ratio as the input region in Regions. Several input regions can be passed as tuples. Ra represents the main radius of the ellipse whereas the radius Rb represents the secondary radius of the ellipse. The orientation of the main axis with regard to the x-axis is returned in Phi which is represented in radians. The principle axis of the ellipse is equivalent to the principle axis of the inertia moment of the input region.
In the documentation of the operator region_features, you can find an image illustrating regions which vary in their Phi, Ra and Rb.
Calculation:
If the moments , and are normalized and passed to the area (see moments_region_2nd), the radii Ra and Rb are calculated as:
The orientation Phi is defined by:
If more than one region is passed, the results are stored in tuples. The index of an resulting tuple element corresponds to the index of the respective input region.
If an empty region is passed, all parameters have the value 0.0 if no other behavior was set (see set_system('no_object_result',<Result>)).
Attention
It should be noted that, like for all region-moments-based operators, the region's pixels are regarded as mathematical, infinitely small points that are represented by the center of the pixels. This means that Ra and Rb can assume the value 0. In particular, for an empty region and a region containing a single point Ra = Rb = 0 is returned. Furthermore, for regions whose points lie exactly on a straight line (e.g., one pixel high horizontal regions or one pixel wide vertical regions), Rb = 0 is returned.
Parallelization
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Automatically parallelized on tuple level.
Parameters
Regions (input_object) region(-array) → objectInput regions.
Ra (output_control) real(-array) → (real)Main radius (normalized to the area).
Assertion: Ra >= 0.0
Rb (output_control) real(-array) → (real)Secondary radius (normalized to the area).
Assertion: Rb >= 0.0 && Rb <= Ra
Phi (output_control) real(-array) → (real)Angle between main radius and x-axis in radians.
Assertion: - pi / 2 < Phi && Phi <= pi / 2
Example (HDevelop)
read_image(Image,'fabrik') regiongrowing(Image,Seg,5,5,6,100) elliptic_axis(Seg,Ra,Rb,Phi) area_center(Seg,_,Row,Column) gen_ellipse(Ellipses,Row,Column,Phi,Ra,Rb) dev_set_draw('margin') dev_display(Ellipses)Example (C)
read_image(&Image,"fabrik"); open_window(0,0,-1,-1,0,"visible","",&WindowHandle); regiongrowing(Image,&Seg,5,5,6.0,100); T_elliptic_axis(Seg,&Ra,&Rb,&Phi); T_area_center(Seg,NULL,&Row,&Column); T_gen_ellipse(&Ellipses,Row,Column,Phi,Ra,Rb); set_draw(WindowHandle,"margin"); disp_region(Ellipses,WindowHandle);Example (HDevelop)
read_image(Image,'fabrik') regiongrowing(Image,Seg,5,5,6,100) elliptic_axis(Seg,Ra,Rb,Phi) area_center(Seg,_,Row,Column) gen_ellipse(Ellipses,Row,Column,Phi,Ra,Rb) dev_set_draw('margin') dev_display(Ellipses)Example (HDevelop)
read_image(Image,'fabrik') regiongrowing(Image,Seg,5,5,6,100) elliptic_axis(Seg,Ra,Rb,Phi) area_center(Seg,_,Row,Column) gen_ellipse(Ellipses,Row,Column,Phi,Ra,Rb) dev_set_draw('margin') dev_display(Ellipses)Example (HDevelop)
read_image(Image,'fabrik') regiongrowing(Image,Seg,5,5,6,100) elliptic_axis(Seg,Ra,Rb,Phi) area_center(Seg,_,Row,Column) gen_ellipse(Ellipses,Row,Column,Phi,Ra,Rb) dev_set_draw('margin') dev_display(Ellipses)Example (HDevelop)
read_image(Image,'fabrik') regiongrowing(Image,Seg,5,5,6,100) elliptic_axis(Seg,Ra,Rb,Phi) area_center(Seg,_,Row,Column) gen_ellipse(Ellipses,Row,Column,Phi,Ra,Rb) dev_set_draw('margin') dev_display(Ellipses)Complexity
If F is the area of a region the mean runtime complexity is O(sqrt(F)).
Result
The operator elliptic_axis returns the value 2 (H_MSG_TRUE) if the input is not empty. The behavior in case of empty input (no input regions available) is set via the operator set_system('no_object_result',<Result>). The behavior in case of empty region (the region is the empty set) is set via set_system('empty_region_result',<Result>). If necessary an exception is raised.
Possible Predecessors
threshold, regiongrowing, connection
Possible Successors
gen_ellipse
Alternatives
smallest_rectangle2, orientation_region
See also
moments_region_2nd, select_shape, set_shape
References
R. Haralick, L. Shapiro “Computer and Robot Vision” Addison-Wesley, 1992, pp. 73-75
Module
Foundation
| Operators |
Từ khóa » Phi X Axis
-
The Diagonal Angle Between A Theta And Phi Vector And The X Axis As ...
-
If A Normal Of Curve`x^(2//3)+y^(2//3)=a^(2//3)` Makes An Angle `phi ...
-
Spherical Coordinates - Math Insight
-
Euler Angles - Wikipedia
-
Complex Numbers: Angles And Polar Coordinates - Clark University
-
If The Normal To The Curve X^[2/3]+y^[2/3]=a^[2/3] Makes An Angle Phi ...
-
Vector Components
-
MATLAB Phitheta2azel - MathWorks
-
Cumulative Grain Size Frequency Plot. The X Axis Is The Phi Scale
-
If The Normal To The Curve X^2/3 + Y^2/3 = A^2/3 Makes An Angle φ ...
-
Trajectories Of The Glycosidic Torsion Angles Φ ( X -axis) And Ψ ( Y...
-
[PDF] Y-axis X-axis Theta Angle Phi-angle (x,y) --- Pivot Point
-
Source Direction And Polarization Conventions In Finite Element Solvers