opencv-0.0.2.1: Haskell binding to OpenCV-3.x

Safe HaskellNone
LanguageHaskell2010

OpenCV.ImgProc.StructuralAnalysis

Synopsis

Documentation

contourArea Source #

Arguments

:: IsPoint2 point2 CFloat 
=> Vector (point2 CFloat)

Input vector of 2D points (contour vertices).

-> ContourAreaOriented

Signed or unsigned area

-> CvExcept Double 

Calculates a contour area.

The function computes a contour area. Similarly to moments, the area is computed using the Green formula. Thus, the returned area and the number of non-zero pixels, if you draw the contour using drawContours or fillPoly, can be different. Also, the function will most certainly give a wrong results for contours with self-intersections.

OpenCV Sphinx doc

pointPolygonTest Source #

Arguments

:: (IsPoint2 contourPoint2 CFloat, IsPoint2 testPoint2 CFloat) 
=> Vector (contourPoint2 CFloat)

Contour.

-> testPoint2 CFloat

Point tested against the contour.

-> Bool

If true, the function estimates the signed distance from the point to the nearest contour edge. Otherwise, the function only checks if the point is inside a contour or not.

-> CvExcept Double 

Performs a point-in-contour test.

The function determines whether the point is inside a contour, outside, or lies on an edge (or coincides with a vertex). It returns positive (inside), negative (outside), or zero (on an edge) value, correspondingly. When measureDist=false , the return value is +1, -1, and 0, respectively. Otherwise, the return value is a signed distance between the point and the nearest contour edge.

OpenCV Sphinx doc

data ContourAreaOriented Source #

Oriented area flag.

Constructors

ContourAreaOriented

Return a signed area value, depending on the contour orientation (clockwise or counter-clockwise). Using this feature you can determine orientation of a contour by taking the sign of an area.

ContourAreaAbsoluteValue

Return the area as an absolute value.

data ContourRetrievalMode Source #

Constructors

ContourRetrievalExternal

Retrieves only the extreme outer contours.

ContourRetrievalList

Retrieves all of the contours without establishing any hierarchical relationships.

ContourRetrievalCComp

Retrieves all of the contours and organizes them into a two-level hierarchy. At the top level, there are external boundaries of the components. At the second level, there are boundaries of the holes. If there is another contour inside a hole of a connected component, it is still put at the top level.

ContourRetrievalTree

Retrieves all of the contours and reconstructs a full hierarchy of nested contours.

data ContourApproximationMethod Source #

Constructors

ContourApproximationNone

Stores absolutely all the contour points. That is, any 2 subsequent points (x1,y1) and (x2,y2) of the contour will be either horizontal, vertical or diagonal neighbors, that is, max(abs(x1-x2),abs(y2-y1)) == 1.

ContourApproximationSimple

Compresses horizontal, vertical, and diagonal segments and leaves only their end points. For example, an up-right rectangular contour is encoded with 4 points.

ContourApproximationTC89L1 
ContourApproximationTC89KCOS 

approxPolyDP Source #

Arguments

:: IsPoint2 point2 Int32 
=> Vector (point2 Int32) 
-> Double

epsilon

-> Bool

is closed

-> Vector Point2i 

Approximates a polygonal curve(s) with the specified precision.

The functions approxPolyDP approximate a curve or a polygon with another curve/polygon with less vertices so that the distance between them is less or equal to the specified precision. It uses the Douglas-Peucker algorithm

http://docs.opencv.org/3.0-last-rst/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html?highlight=contourarea#approxpolydp

arcLength Source #

Arguments

:: IsPoint2 point2 Int32 
=> Vector (point2 Int32) 
-> Bool

is closed

-> CvExcept Double