Skip to content

line_descriptor_KeyLine

line_descriptorclassOpenCV 5.0.0
import { line_descriptor_KeyLine } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSConstructor or factory
CLASSline_descriptor_KeyLine
RETURN TYPEOwned native handle
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Native object: release it with using or delete(). Factories can return null; check before calling methods.

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.

Constructors and members

static new

line_descriptor_KeyLine.new: constructor

new(): line_descriptor_KeyLine;
Returns

The line_descriptor_KeyLine result.

clone

Create another handle to the same native object. This retains the object without copying its pixels or algorithm state; dispose both handles separately.

clone(): this;
Returns

The this result.

angle

orientation of the line

angle: number;

class_id

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

class_id: number;

octave

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

octave: number;

pt

coordinates of the middlepoint

pt: Point2f;

response

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

response: number;

size

minimum area containing line

size: number;

startPointX

lines's extremes in original image

startPointX: number;

startPointY

lines's extremes in original image

startPointY: number;

endPointX

lines's extremes in original image

endPointX: number;

endPointY

lines's extremes in original image

endPointY: number;

sPointInOctaveX

line's extremes in image it was extracted from

sPointInOctaveX: number;

sPointInOctaveY

line's extremes in image it was extracted from

sPointInOctaveY: number;

ePointInOctaveX

line's extremes in image it was extracted from

ePointInOctaveX: number;

ePointInOctaveY

line's extremes in image it was extracted from

ePointInOctaveY: number;

lineLength

the length of line

lineLength: number;

numOfPixels

number of pixels covered by the line

numOfPixels: number;

getStartPoint

Returns the start point of the line in the original image

getStartPoint(): Point2f;
Returns

The Point2f result.

getEndPoint

Returns the end point of the line in the original image

getEndPoint(): Point2f;
Returns

The Point2f result.

getStartPointInOctave

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

getStartPointInOctave(): Point2f;
Returns

The Point2f result.

getEndPointInOctave

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

getEndPointInOctave(): Point2f;
Returns

The Point2f result.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.