资源简介
高性能的blob分析代码,在缺陷检测,目标定位中有着重要应用。希望对大家有帮助。
代码片段和文件信息
// cvblobDLL.cpp
// A C style dynamic library (DLL) to encapsulate CvBlob functions
// Copyright (C) 2010 by Giandomenico De Sanctis
// gidesay@yahoo.it
// Use CvBlob C++ library: Copyright (C) 2007 by Crist骲al Carnero Li襻n grendel.ccl@gmail.com
#include
#include “stdafx.h“
#include “cvblobDLL.h“
#include “cvblob.h“
using namespace cvb;
#define MIN_HOLE_POINTS 10
typedef std::vector memVect;
memVect pAllocatedMem;
int nAllocatedMem=0;
void* cvBlobDAlloc(int bytes)
{
void* p = malloc(bytes);
if (p) {
pAllocatedMem.push_back(p);
nAllocatedMem++;
};
return p;
};
CVBLOBDLL_API CDECL void cvBlobDRelease()
{
CV_FUNCNAME( “cvBlobDRelease“ );
__BEGIN__;
memVect::const_iterator costIter = pAllocatedMem.begin();
for(; costIter != pAllocatedMem.end(); costIter++)
{
void* P = (void*)(*costIter);
free(P);
};
pAllocatedMem.clear();
nAllocatedMem = 0;
__END__;
};
BOOLEAN cvBlobDContour(CvSeq** seqCont const CvContourChainCode blobListElem CvMemStorage * memstor)
{
BOOLEAN res = FALSE;
CV_FUNCNAME( “cvBlobDContour“ );
__BEGIN__;
if (( !seqCont ) || ( !(&blobListElem) ))
CV_ERROR( CV_StsNullPtr ““ );
*seqCont = NULL;
{ // init block with iterators
CvContourPolygon* pPolyg = cvConvertChainCodesToPolygon(&blobListElem);
if (pPolyg->size() == 0) { delete pPolyg; return res; };
// simplify a bit the contour
CvContourPolygon* pContour = cvSimplifyPolygon(pPolyg 5.0);
delete pPolyg;
CvSeq* seqpoints = NULL;
seqpoints = cvCreateSeq(CV_SEQ_CONTOUR sizeof(CvSeq) sizeof(CvPoint) memstor);
CvPoint* pNewPoint = (CvPoint*) cvBlobDAlloc(sizeof(CvPoint)*pContour->size());
if (( !pNewPoint ) )
CV_ERROR( CV_StsNullPtr “Not enough memory for contour points“ );
CvContourPolygon::const_iterator pcontIter = pContour->begin();
for(; pcontIter != pContour->end(); pcontIter++)
{
pNewPoint->x = (*pcontIter).x;
pNewPoint->y = (*pcontIter).y;
void* newElem = (void*) cvSeqPush((CvSeq*) seqpoints (void*) pNewPoint);
pNewPoint++;
};
*seqCont = seqpoints;
delete pContour;
}; // end block with iterators
__END__;
return res;
};
CVBLOBDLL_API CDECL unsigned int cvBlobDLabel
(IplImage const *img IplImage *imgOut CvMemStorage * memstor CvSeq** sblobs
int minArea int flags const IplImage* colorImg)
{
int res;
CvBlobs lblobs;
CV_FUNCNAME( “cvBlobDLabel“ );
__BEGIN__;
if (( !memstor ) || ( !img ) || ( !imgOut ))
CV_ERROR( CV_StsNullPtr ““ );
if ( !CV_IS_STORAGE( memstor ))
CV_ERROR( CV_StsBadArg “1st param not a CvMemStorage“ );
if ( !CV_IS_IMAGE( img ))
CV_ERROR( CV_StsBadArg “2st param not an IplImage“ );
if ( !CV_IS_IMAGE( imgOut ))
CV_ERROR( CV_StsBadArg “3st param not an IplImage“ );
if ( (colorImg) && (!CV_IS_IMAGE( colorImg )) )
CV_ERROR( CV_StsBadArg “colorImg param not an IplImage“ );
res = cvLabel(img imgOut lblobs);
if (minArea<10)
minArea = 10;
cvFilterByArea(
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-01-17 12:57 cvblob\
文件 6185 2011-01-26 18:48 cvblob\CMakeLists.txt
目录 0 2014-01-17 12:57 cvblob\CMakesc
文件 585 2010-11-12 20:21 cvblob\CMakesc
文件 35147 2008-09-08 16:20 cvblob\COPYING
文件 7639 2008-09-08 16:20 cvblob\COPYING.LESSER
文件 6130 2012-05-25 18:07 cvblob\ChangeLog
文件 56244 2009-09-22 18:50 cvblob\Doxyfile
文件 2014 2011-03-11 02:58 cvblob\README
目录 0 2014-01-17 12:57 cvblob\contrib\
目录 0 2014-01-17 12:57 cvblob\contrib\cvBlobDLL\
文件 531 2010-12-17 23:41 cvblob\contrib\cvBlobDLL\README
目录 0 2014-01-17 12:57 cvblob\contrib\cvBlobDLL\TestDLL\
目录 0 2014-11-15 17:27 cvblob\contrib\cvBlobDLL\TestDLL\Debug\
文件 1302 2010-12-17 20:57 cvblob\contrib\cvBlobDLL\TestDLL\ReadMe.txt
目录 0 2014-11-15 17:27 cvblob\contrib\cvBlobDLL\TestDLL\Release\
文件 1731 2010-12-17 20:57 cvblob\contrib\cvBlobDLL\TestDLL\TestDLL.c
文件 4964 2010-12-17 20:57 cvblob\contrib\cvBlobDLL\TestDLL\TestDLL.vcproj
文件 8661 2010-12-17 20:57 cvblob\contrib\cvBlobDLL\TestDLL\imgout.png
文件 294 2010-12-17 20:57 cvblob\contrib\cvBlobDLL\TestDLL\stdafx.cpp
文件 320 2010-12-17 20:57 cvblob\contrib\cvBlobDLL\TestDLL\stdafx.h
文件 765 2010-12-17 20:57 cvblob\contrib\cvBlobDLL\TestDLL\targetver.h
文件 3433 2010-12-17 20:57 cvblob\contrib\cvBlobDLL\TestDLL\test.png
目录 0 2014-01-17 12:57 cvblob\contrib\cvBlobDLL\cvblobDLL\
目录 0 2014-11-15 17:27 cvblob\contrib\cvBlobDLL\cvblobDLL\Debug\
目录 0 2014-11-15 17:27 cvblob\contrib\cvBlobDLL\cvblobDLL\Release\
文件 5237 2011-05-26 17:38 cvblob\contrib\cvBlobDLL\cvblobDLL\cvblobDLL.cpp
文件 2968 2010-12-17 20:57 cvblob\contrib\cvBlobDLL\cvblobDLL\cvblobDLL.h
文件 1350 2010-12-17 20:57 cvblob\contrib\cvBlobDLL\cvblobDLL\cvblobDLL.sln
文件 39936 2010-12-17 20:57 cvblob\contrib\cvBlobDLL\cvblobDLL\cvblobDLL.suo
文件 5494 2010-12-17 20:57 cvblob\contrib\cvBlobDLL\cvblobDLL\cvblobDLL.vcproj
............此处省略28个文件信息
相关资源
- GrabCut算法详解
- opencv中图片添加文字
- 自动聚焦源程序(基于openCV)
- QT+OpenCV+USB摄像头
- SIFT算法实现及代码详解
- opencv使用圆靶标标定相机参数
- OpenCV轮廓匹配
- OpenCVForUnity,Unity插件
- opencv 320 编译需要 vgg_generated 包
- qt+openc循线四旋翼
- Camshift 全自动跟踪算法/opencv
- OPENCV函数手册(带目录)pdf
- OpenCV3.3
- opencv实现两种手势识别
- Delphi将图片以二进制方式存储在数据
- OpenCV+SVM简单应用-------路面箭头分类
- 基于Qt与OpenCV的图片读取、保存,并利
- Cannot load info library for OpenCV解决方案文
- Xvid-1.1.3-27042008
- 使用VIBE算法进行车流量检测并消除鬼
- opencv库文件
- opencv中的cvaux.lib文件
-
opencv的各种haarcascade.xm
l文件 - opencv实现的SIFT特征提取与匹配算法
- 《学习opecnv》第十二章鸟瞰图变换可
- 批量图像自动分割 opencv grabcut
- Opencv实现特征点提取和匹配
- 基 于OpenCV 的动态背景下的运动目标检
- Ubuntu和Zedboard都可实现的opencv人脸识别
- opencv 人脸识别 代码
评论
共有 条评论