C# 클래스 OpenCvSharp.Blob.CvBlobLib

Functions of cvblob library
파일 보기 프로젝트 열기: shimat/opencvsharp 1 사용 예제들

공개 메소드들

메소드 설명
BlobMeanColor ( CvBlobs blobs, CvBlob targetBlob, Mat originalImage ) : Scalar

Calculates mean color of a blob in an image.

CalcAngle ( CvBlob blob ) : double

Calculates angle orientation of a blob. This function uses central moments so cvCentralMoments should have been called before for this blob. (cvAngle)

CalcCentroid ( CvBlob blob ) : Point2d

Calculates centroid. Centroid will be returned and stored in the blob structure. (cvCentroid)

ContourChainCodePerimeter ( CvContourChainCode cc ) : double

Calculates perimeter of a chain code contour.

ContourPolygonArea ( CvContourPolygon polygon ) : double

Calculates area of a polygonal contour.

ContourPolygonCircularity ( CvContourPolygon polygon ) : double

Calculates the circularity of a polygon (compactness measure).

ContourPolygonPerimeter ( CvContourPolygon polygon ) : double

Calculates perimeter of a chain code contour.

ConvertChainCodesToPolygon ( CvContourChainCode cc ) : CvContourPolygon

Convert a chain code contour to a polygon.

FilterByArea ( CvBlobs blobs, int minArea, int maxArea ) : void

Filter blobs by area. Those blobs whose areas are not in range will be erased from the input list of blobs. (cvFilterByArea)

FilterByLabel ( CvBlobs blobs, int label ) : void

Filter blobs by label. Delete all blobs except those with label l.

FilterLabels ( CvBlobs blobs, Mat imgOut ) : void

Draw a binary image with the blobs that have been given. (cvFilterLabels)

GetLabel ( CvBlobs blobs, int x, int y ) : int

Get the label value from a labeled image.

GreaterBlob ( CvBlobs blobs ) : CvBlob

Find greater blob. (cvGreaterBlob)

Label ( Mat img, CvBlobs blobs ) : int

Label the connected parts of a binary image. (cvLabel)

LargestBlob ( CvBlobs blobs ) : CvBlob

Find the largest blob. (cvLargestBlob)

PolygonContourConvexHull ( CvContourPolygon polygon ) : CvContourPolygon

Calculates convex hull of a contour. Uses the Melkman Algorithm. Code based on the version in http://w3.impa.br/~rdcastan/Cgeometry/.

RenderBlob ( LabelData labels, CvBlob blob, Mat imgSource, Mat imgDest ) : void

Draws or prints information about a blob.

RenderBlob ( LabelData labels, CvBlob blob, Mat imgSource, Mat imgDest, RenderBlobsMode mode ) : void

Draws or prints information about a blob.

RenderBlob ( LabelData labels, CvBlob blob, Mat imgSource, Mat imgDest, RenderBlobsMode mode, Scalar color, double alpha = 1.0 ) : void

Draws or prints information about a blob.

RenderBlobs ( CvBlobs blobs, Mat imgSource, Mat imgDest ) : void

Draws or prints information about blobs. (cvRenderBlobs)

RenderBlobs ( CvBlobs blobs, Mat imgSource, Mat imgDest, RenderBlobsMode mode, double alpha = 1.0 ) : void

Draws or prints information about blobs. (cvRenderBlobs)

RenderContourChainCode ( CvContourChainCode contour, Mat img ) : void

Draw a contour.

RenderContourChainCode ( CvContourChainCode contour, Mat img, Scalar color ) : void

Draw a contour.

RenderContourPolygon ( CvContourPolygon contour, Mat img ) : void

Draw a polygon.

RenderContourPolygon ( CvContourPolygon contour, Mat img, Scalar color ) : void

Draw a polygon.

RenderTracks ( CvTracks tracks, Mat imgSource, Mat imgDest ) : void

Prints tracks information.

RenderTracks ( CvTracks tracks, Mat imgSource, Mat imgDest, RenderTracksMode mode ) : void

Prints tracks information.

RenderTracks ( CvTracks tracks, Mat imgSource, Mat imgDest, RenderTracksMode mode, Scalar textColor, HersheyFonts fontFace = HersheyFonts.HersheySimplex, double fontScale = 1d, int thickness = 1 ) : void

Prints tracks information.

SaveImageBlob ( string fileName, Mat img, CvBlob blob ) : void

Save the image of a blob to a file. The function uses an image (that can be the original pre-processed image or a processed one, or even the result of cvRenderBlobs, for example) and a blob structure. Then the function saves a copy of the part of the image where the blob is.

SimplifyPolygon ( CvContourPolygon polygon ) : CvContourPolygon

Simplify a polygon reducing the number of vertex according the distance "delta". Uses a version of the Ramer-Douglas-Peucker algorithm (http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm).

SimplifyPolygon ( CvContourPolygon polygon, double delta ) : CvContourPolygon

Simplify a polygon reducing the number of vertex according the distance "delta". Uses a version of the Ramer-Douglas-Peucker algorithm (http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm).

UpdateTracks ( CvBlobs blobs, CvTracks tracks, double thDistance, int thInactive ) : void

Updates list of tracks based on current blobs.

UpdateTracks ( CvBlobs blobs, CvTracks tracks, double thDistance, int thInactive, int thActive ) : void

Updates list of tracks based on current blobs.

Tracking based on: A. Senior, A. Hampapur, Y-L Tian, L. Brown, S. Pankanti, R. Bolle. Appearance Models for Occlusion Handling. Second International workshop on Performance Evaluation of Tracking and Surveillance Systems & CVPR'01. December, 2001. (http://www.research.ibm.com/peoplevision/PETS2001.pdf)

WriteContourPolygonCsv ( CvContourPolygon polygon, string filename ) : void

Write a contour to a CSV (Comma-separated values) file.

WriteContourPolygonSvg ( CvContourPolygon polygon, string fileName ) : void

Write a contour to a SVG file.

WriteContourPolygonSvg ( CvContourPolygon polygon, string fileName, Scalar stroke, Scalar fill ) : void

Write a contour to a SVG file.

메소드 상세

BlobMeanColor() 공개 정적인 메소드

Calculates mean color of a blob in an image.
public static BlobMeanColor ( CvBlobs blobs, CvBlob targetBlob, Mat originalImage ) : Scalar
blobs CvBlobs Blob list
targetBlob CvBlob The target blob
originalImage Mat Original image.
리턴 Scalar

CalcAngle() 공개 정적인 메소드

Calculates angle orientation of a blob. This function uses central moments so cvCentralMoments should have been called before for this blob. (cvAngle)
public static CalcAngle ( CvBlob blob ) : double
blob CvBlob Blob.
리턴 double

CalcCentroid() 공개 정적인 메소드

Calculates centroid. Centroid will be returned and stored in the blob structure. (cvCentroid)
public static CalcCentroid ( CvBlob blob ) : Point2d
blob CvBlob Blob whose centroid will be calculated.
리턴 Point2d

ContourChainCodePerimeter() 공개 정적인 메소드

Calculates perimeter of a chain code contour.
public static ContourChainCodePerimeter ( CvContourChainCode cc ) : double
cc CvContourChainCode Contour (chain code type).
리턴 double

ContourPolygonArea() 공개 정적인 메소드

Calculates area of a polygonal contour.
public static ContourPolygonArea ( CvContourPolygon polygon ) : double
polygon CvContourPolygon Contour (polygon type).
리턴 double

ContourPolygonCircularity() 공개 정적인 메소드

Calculates the circularity of a polygon (compactness measure).
public static ContourPolygonCircularity ( CvContourPolygon polygon ) : double
polygon CvContourPolygon Contour (polygon type).
리턴 double

ContourPolygonPerimeter() 공개 정적인 메소드

Calculates perimeter of a chain code contour.
public static ContourPolygonPerimeter ( CvContourPolygon polygon ) : double
polygon CvContourPolygon Contour (polygon type).
리턴 double

ConvertChainCodesToPolygon() 공개 정적인 메소드

Convert a chain code contour to a polygon.
public static ConvertChainCodesToPolygon ( CvContourChainCode cc ) : CvContourPolygon
cc CvContourChainCode Chain code contour.
리턴 CvContourPolygon

FilterByArea() 공개 정적인 메소드

Filter blobs by area. Those blobs whose areas are not in range will be erased from the input list of blobs. (cvFilterByArea)
public static FilterByArea ( CvBlobs blobs, int minArea, int maxArea ) : void
blobs CvBlobs List of blobs.
minArea int Minimun area.
maxArea int Maximun area.
리턴 void

FilterByLabel() 공개 정적인 메소드

Filter blobs by label. Delete all blobs except those with label l.
public static FilterByLabel ( CvBlobs blobs, int label ) : void
blobs CvBlobs List of blobs.
label int Label to leave.
리턴 void

FilterLabels() 공개 정적인 메소드

Draw a binary image with the blobs that have been given. (cvFilterLabels)
public static FilterLabels ( CvBlobs blobs, Mat imgOut ) : void
blobs CvBlobs List of blobs to be drawn.
imgOut Mat Output binary image (depth=IPL_DEPTH_8U and nchannels=1).
리턴 void

GetLabel() 공개 정적인 메소드

Get the label value from a labeled image.
public static GetLabel ( CvBlobs blobs, int x, int y ) : int
blobs CvBlobs Blob data.
x int X coordenate.
y int Y coordenate.
리턴 int

GreaterBlob() 공개 정적인 메소드

Find greater blob. (cvGreaterBlob)
public static GreaterBlob ( CvBlobs blobs ) : CvBlob
blobs CvBlobs List of blobs.
리턴 CvBlob

Label() 공개 정적인 메소드

Label the connected parts of a binary image. (cvLabel)
public static Label ( Mat img, CvBlobs blobs ) : int
img Mat Input binary image (depth=IPL_DEPTH_8U and num. channels=1).
blobs CvBlobs List of blobs.
리턴 int

LargestBlob() 공개 정적인 메소드

Find the largest blob. (cvLargestBlob)
public static LargestBlob ( CvBlobs blobs ) : CvBlob
blobs CvBlobs List of blobs.
리턴 CvBlob

PolygonContourConvexHull() 공개 정적인 메소드

Calculates convex hull of a contour. Uses the Melkman Algorithm. Code based on the version in http://w3.impa.br/~rdcastan/Cgeometry/.
public static PolygonContourConvexHull ( CvContourPolygon polygon ) : CvContourPolygon
polygon CvContourPolygon Contour (polygon type).
리턴 CvContourPolygon

RenderBlob() 공개 정적인 메소드

Draws or prints information about a blob.
public static RenderBlob ( LabelData labels, CvBlob blob, Mat imgSource, Mat imgDest ) : void
labels LabelData Label data.
blob CvBlob Blob.
imgSource Mat Input image (depth=IPL_DEPTH_8U and num. channels=3).
imgDest Mat Output image (depth=IPL_DEPTH_8U and num. channels=3).
리턴 void

RenderBlob() 공개 정적인 메소드

Draws or prints information about a blob.
public static RenderBlob ( LabelData labels, CvBlob blob, Mat imgSource, Mat imgDest, RenderBlobsMode mode ) : void
labels LabelData Label data.
blob CvBlob Blob.
imgSource Mat Input image (depth=IPL_DEPTH_8U and num. channels=3).
imgDest Mat Output image (depth=IPL_DEPTH_8U and num. channels=3).
mode RenderBlobsMode Render mode. By default is CV_BLOB_RENDER_COLOR|CV_BLOB_RENDER_CENTROID|CV_BLOB_RENDER_BOUNDING_BOX|CV_BLOB_RENDER_ANGLE.
리턴 void

RenderBlob() 공개 정적인 메소드

Draws or prints information about a blob.
public static RenderBlob ( LabelData labels, CvBlob blob, Mat imgSource, Mat imgDest, RenderBlobsMode mode, Scalar color, double alpha = 1.0 ) : void
labels LabelData Label data.
blob CvBlob Blob.
imgSource Mat Input image (depth=IPL_DEPTH_8U and num. channels=3).
imgDest Mat Output image (depth=IPL_DEPTH_8U and num. channels=3).
mode RenderBlobsMode Render mode. By default is CV_BLOB_RENDER_COLOR|CV_BLOB_RENDER_CENTROID|CV_BLOB_RENDER_BOUNDING_BOX|CV_BLOB_RENDER_ANGLE.
color Scalar Color to render (if CV_BLOB_RENDER_COLOR is used).
alpha double If mode CV_BLOB_RENDER_COLOR is used. 1.0 indicates opaque and 0.0 translucent (1.0 by default).
리턴 void

RenderBlobs() 공개 정적인 메소드

Draws or prints information about blobs. (cvRenderBlobs)
public static RenderBlobs ( CvBlobs blobs, Mat imgSource, Mat imgDest ) : void
blobs CvBlobs List of blobs.
imgSource Mat Input image (depth=IPL_DEPTH_8U and num. channels=3).
imgDest Mat Output image (depth=IPL_DEPTH_8U and num. channels=3).
리턴 void

RenderBlobs() 공개 정적인 메소드

Draws or prints information about blobs. (cvRenderBlobs)
public static RenderBlobs ( CvBlobs blobs, Mat imgSource, Mat imgDest, RenderBlobsMode mode, double alpha = 1.0 ) : void
blobs CvBlobs List of blobs.
imgSource Mat Input image (depth=IPL_DEPTH_8U and num. channels=3).
imgDest Mat Output image (depth=IPL_DEPTH_8U and num. channels=3).
mode RenderBlobsMode Render mode. By default is CV_BLOB_RENDER_COLOR|CV_BLOB_RENDER_CENTROID|CV_BLOB_RENDER_BOUNDING_BOX|CV_BLOB_RENDER_ANGLE.
alpha double If mode CV_BLOB_RENDER_COLOR is used. 1.0 indicates opaque and 0.0 translucent (1.0 by default).
리턴 void

RenderContourChainCode() 공개 정적인 메소드

Draw a contour.
public static RenderContourChainCode ( CvContourChainCode contour, Mat img ) : void
contour CvContourChainCode Chain code contour.
img Mat Image to draw on.
리턴 void

RenderContourChainCode() 공개 정적인 메소드

Draw a contour.
public static RenderContourChainCode ( CvContourChainCode contour, Mat img, Scalar color ) : void
contour CvContourChainCode Chain code contour.
img Mat Image to draw on.
color Scalar Color to draw (default, white).
리턴 void

RenderContourPolygon() 공개 정적인 메소드

Draw a polygon.
public static RenderContourPolygon ( CvContourPolygon contour, Mat img ) : void
contour CvContourPolygon Polygon contour.
img Mat Image to draw on.
리턴 void

RenderContourPolygon() 공개 정적인 메소드

Draw a polygon.
public static RenderContourPolygon ( CvContourPolygon contour, Mat img, Scalar color ) : void
contour CvContourPolygon Polygon contour.
img Mat Image to draw on.
color Scalar Color to draw (default, white).
리턴 void

RenderTracks() 공개 정적인 메소드

Prints tracks information.
public static RenderTracks ( CvTracks tracks, Mat imgSource, Mat imgDest ) : void
tracks CvTracks List of tracks.
imgSource Mat Input image (depth=IPL_DEPTH_8U and num. channels=3).
imgDest Mat Output image (depth=IPL_DEPTH_8U and num. channels=3).
리턴 void

RenderTracks() 공개 정적인 메소드

Prints tracks information.
public static RenderTracks ( CvTracks tracks, Mat imgSource, Mat imgDest, RenderTracksMode mode ) : void
tracks CvTracks List of tracks.
imgSource Mat Input image (depth=IPL_DEPTH_8U and num. channels=3).
imgDest Mat Output image (depth=IPL_DEPTH_8U and num. channels=3).
mode RenderTracksMode Render mode. By default is CV_TRACK_RENDER_ID.
리턴 void

RenderTracks() 공개 정적인 메소드

Prints tracks information.
public static RenderTracks ( CvTracks tracks, Mat imgSource, Mat imgDest, RenderTracksMode mode, Scalar textColor, HersheyFonts fontFace = HersheyFonts.HersheySimplex, double fontScale = 1d, int thickness = 1 ) : void
tracks CvTracks List of tracks.
imgSource Mat Input image (depth=IPL_DEPTH_8U and num. channels=3).
imgDest Mat Output image (depth=IPL_DEPTH_8U and num. channels=3).
mode RenderTracksMode Render mode. By default is CV_TRACK_RENDER_ID.
textColor Scalar
fontFace HersheyFonts
fontScale double
thickness int
리턴 void

SaveImageBlob() 공개 정적인 메소드

Save the image of a blob to a file. The function uses an image (that can be the original pre-processed image or a processed one, or even the result of cvRenderBlobs, for example) and a blob structure. Then the function saves a copy of the part of the image where the blob is.
public static SaveImageBlob ( string fileName, Mat img, CvBlob blob ) : void
fileName string Name of the file.
img Mat Image.
blob CvBlob Blob.
리턴 void

SimplifyPolygon() 공개 정적인 메소드

Simplify a polygon reducing the number of vertex according the distance "delta". Uses a version of the Ramer-Douglas-Peucker algorithm (http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm).
public static SimplifyPolygon ( CvContourPolygon polygon ) : CvContourPolygon
polygon CvContourPolygon Contour (polygon type).
리턴 CvContourPolygon

SimplifyPolygon() 공개 정적인 메소드

Simplify a polygon reducing the number of vertex according the distance "delta". Uses a version of the Ramer-Douglas-Peucker algorithm (http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm).
public static SimplifyPolygon ( CvContourPolygon polygon, double delta ) : CvContourPolygon
polygon CvContourPolygon Contour (polygon type).
delta double Minimun distance.
리턴 CvContourPolygon

UpdateTracks() 공개 정적인 메소드

Updates list of tracks based on current blobs.
public static UpdateTracks ( CvBlobs blobs, CvTracks tracks, double thDistance, int thInactive ) : void
blobs CvBlobs List of blobs.
tracks CvTracks List of tracks.
thDistance double Max distance to determine when a track and a blob match.
thInactive int Max number of frames a track can be inactive.
리턴 void

UpdateTracks() 공개 정적인 메소드

Updates list of tracks based on current blobs.
Tracking based on: A. Senior, A. Hampapur, Y-L Tian, L. Brown, S. Pankanti, R. Bolle. Appearance Models for Occlusion Handling. Second International workshop on Performance Evaluation of Tracking and Surveillance Systems & CVPR'01. December, 2001. (http://www.research.ibm.com/peoplevision/PETS2001.pdf)
public static UpdateTracks ( CvBlobs blobs, CvTracks tracks, double thDistance, int thInactive, int thActive ) : void
blobs CvBlobs List of blobs.
tracks CvTracks List of tracks.
thDistance double Max distance to determine when a track and a blob match.
thInactive int Max number of frames a track can be inactive.
thActive int If a track becomes inactive but it has been active less than thActive frames, the track will be deleted.
리턴 void

WriteContourPolygonCsv() 공개 정적인 메소드

Write a contour to a CSV (Comma-separated values) file.
public static WriteContourPolygonCsv ( CvContourPolygon polygon, string filename ) : void
polygon CvContourPolygon Polygon contour.
filename string File name.
리턴 void

WriteContourPolygonSvg() 공개 정적인 메소드

Write a contour to a SVG file.
public static WriteContourPolygonSvg ( CvContourPolygon polygon, string fileName ) : void
polygon CvContourPolygon Polygon contour.
fileName string File name.
리턴 void

WriteContourPolygonSvg() 공개 정적인 메소드

Write a contour to a SVG file.
public static WriteContourPolygonSvg ( CvContourPolygon polygon, string fileName, Scalar stroke, Scalar fill ) : void
polygon CvContourPolygon Polygon contour.
fileName string File name.
stroke Scalar Stroke color (black by default).
fill Scalar Fill color (white by default).
리턴 void