Trait FastLineDetectorTrait

Source
pub trait FastLineDetectorTrait: AlgorithmTrait + FastLineDetectorTraitConst {
    // Required method
    fn as_raw_mut_FastLineDetector(&mut self) -> *mut c_void;

    // Provided methods
    fn detect(
        &mut self,
        image: &impl ToInputArray,
        lines: &mut impl ToOutputArray,
    ) -> Result<()> { ... }
    fn draw_segments(
        &mut self,
        image: &mut impl ToInputOutputArray,
        lines: &impl ToInputArray,
        draw_arrow: bool,
        linecolor: Scalar,
        linethickness: i32,
    ) -> Result<()> { ... }
    fn draw_segments_def(
        &mut self,
        image: &mut impl ToInputOutputArray,
        lines: &impl ToInputArray,
    ) -> Result<()> { ... }
}
Expand description

Required Methods§

Provided Methods§

Source

fn detect( &mut self, image: &impl ToInputArray, lines: &mut impl ToOutputArray, ) -> Result<()>

@example fld_lines.cpp An example using the FastLineDetector

Finds lines in the input image. This is the output of the default parameters of the algorithm on the above shown image.

  ![image](https://docs.opencv.org/4.11.0/corridor_fld.jpg)
§Parameters
  • image: A grayscale (CV_8UC1) input image. If only a roi needs to be selected, use: fld_ptr-\>detect(image(roi), lines, ...); lines += Scalar(roi.x, roi.y, roi.x, roi.y);
  • lines: A vector of Vec4f elements specifying the beginning and ending point of a line. Where Vec4f is (x1, y1, x2, y2), point 1 is the start, point 2 - end. Returned lines are directed so that the brighter side is on their left.
Source

fn draw_segments( &mut self, image: &mut impl ToInputOutputArray, lines: &impl ToInputArray, draw_arrow: bool, linecolor: Scalar, linethickness: i32, ) -> Result<()>

Draws the line segments on a given image.

§Parameters
  • image: The image, where the lines will be drawn. Should be bigger or equal to the image, where the lines were found.
  • lines: A vector of the lines that needed to be drawn.
  • draw_arrow: If true, arrow heads will be drawn.
  • linecolor: Line color.
  • linethickness: Line thickness.
§C++ default parameters
  • draw_arrow: false
  • linecolor: Scalar(0,0,255)
  • linethickness: 1
Source

fn draw_segments_def( &mut self, image: &mut impl ToInputOutputArray, lines: &impl ToInputArray, ) -> Result<()>

Draws the line segments on a given image.

§Parameters
  • image: The image, where the lines will be drawn. Should be bigger or equal to the image, where the lines were found.
  • lines: A vector of the lines that needed to be drawn.
  • draw_arrow: If true, arrow heads will be drawn.
  • linecolor: Line color.
  • linethickness: Line thickness.
§Note

This alternative version of FastLineDetectorTrait::draw_segments function uses the following default values for its arguments:

  • draw_arrow: false
  • linecolor: Scalar(0,0,255)
  • linethickness: 1

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§