Struct opencv::line_descriptor::KeyLine
source · #[repr(C)]pub struct KeyLine {Show 16 fields
pub angle: f32,
pub class_id: i32,
pub octave: i32,
pub pt: Point2f,
pub response: f32,
pub size: f32,
pub start_point_x: f32,
pub start_point_y: f32,
pub end_point_x: f32,
pub end_point_y: f32,
pub s_point_in_octave_x: f32,
pub s_point_in_octave_y: f32,
pub e_point_in_octave_x: f32,
pub e_point_in_octave_y: f32,
pub line_length: f32,
pub num_of_pixels: i32,
}Expand description
A class to represent a line
As aformentioned, it is been necessary to design a class that fully stores the information needed to characterize completely a line and plot it on image it was extracted from, when required.
KeyLine class has been created for such goal; it is mainly inspired to Feature2d’s KeyPoint class, since KeyLine shares some of KeyPoint’s fields, even if a part of them assumes a different meaning, when speaking about lines. In particular:
- the class_id field is used to gather lines extracted from different octaves which refer to same line inside original image (such lines and the one they represent in original image share the same class_id value)
- the angle field represents line’s slope with respect to (positive) X axis
- the pt field represents line’s midpoint
- the response field is computed as the ratio between the line’s length and maximum between image’s width and height
- the size field is the area of the smallest rectangle containing line
Apart from fields inspired to KeyPoint class, KeyLines stores information about extremes of line in original image and in octave it was extracted from, about line’s length and number of pixels it covers.
Fields§
§angle: f32orientation of the line
class_id: i32object ID, that can be used to cluster keylines by the line they represent
octave: i32octave (pyramid layer), from which the keyline has been extracted
pt: Point2fcoordinates of the middlepoint
response: f32the response, by which the strongest keylines have been selected. It’s represented by the ratio between line’s length and maximum between image’s width and height
size: f32minimum area containing line
start_point_x: f32lines’s extremes in original image
start_point_y: f32§end_point_x: f32§end_point_y: f32§s_point_in_octave_x: f32line’s extremes in image it was extracted from
s_point_in_octave_y: f32§e_point_in_octave_x: f32§e_point_in_octave_y: f32§line_length: f32the length of line
num_of_pixels: i32number of pixels covered by the line
Implementations§
source§impl KeyLine
impl KeyLine
sourcepub fn get_start_point(self) -> Result<Point2f>
pub fn get_start_point(self) -> Result<Point2f>
Returns the start point of the line in the original image
sourcepub fn get_end_point(self) -> Result<Point2f>
pub fn get_end_point(self) -> Result<Point2f>
Returns the end point of the line in the original image
sourcepub fn get_start_point_in_octave(self) -> Result<Point2f>
pub fn get_start_point_in_octave(self) -> Result<Point2f>
Returns the start point of the line in the octave it was extracted from
sourcepub fn get_end_point_in_octave(self) -> Result<Point2f>
pub fn get_end_point_in_octave(self) -> Result<Point2f>
Returns the end point of the line in the octave it was extracted from