opencv::line_descriptor

Struct 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: f32

orientation of the line

§class_id: i32

object ID, that can be used to cluster keylines by the line they represent

§octave: i32

octave (pyramid layer), from which the keyline has been extracted

§pt: Point2f

coordinates of the middlepoint

§response: f32

the 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: f32

minimum area containing line

§start_point_x: f32

lines’s extremes in original image

§start_point_y: f32§end_point_x: f32§end_point_y: f32§s_point_in_octave_x: f32

line’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: f32

the length of line

§num_of_pixels: i32

number of pixels covered by the line

Implementations§

source§

impl KeyLine

source

pub fn get_start_point(self) -> Result<Point2f>

Returns the start point of the line in the original image

source

pub fn get_end_point(self) -> Result<Point2f>

Returns the end point of the line in the original image

source

pub fn get_start_point_in_octave(self) -> Result<Point2f>

Returns the start point of the line in the octave it was extracted from

source

pub fn get_end_point_in_octave(self) -> Result<Point2f>

Returns the end point of the line in the octave it was extracted from

source

pub fn default() -> Result<KeyLine>

constructor

Trait Implementations§

source§

impl Clone for KeyLine

source§

fn clone(&self) -> KeyLine

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for KeyLine

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for KeyLine

source§

fn eq(&self, other: &KeyLine) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for KeyLine

source§

impl StructuralPartialEq for KeyLine

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.