/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
/* Reconstruction of contour skeleton */
#include "_cvaux.h"
#include <time.h>
#define NEXT_SEQ(seq,seq_first) ((seq) == (seq_first) ? seq->v_next : seq->h_next)
#define SIGN(x) ( x<0 ? -1:( x>0 ? 1:0 ) )
const float LEE_CONST_ZERO = 1e-6f;
const float LEE_CONST_DIFF_POINTS = 1e-2f;
const float LEE_CONST_ACCEPTABLE_ERROR = 1e-4f;
/****************************************************************************************\
* Auxiliary struct definitions *
\****************************************************************************************/
template<class T>
struct CvLeePoint
{
T x,y;
};
typedef CvLeePoint<float> CvPointFloat;
typedef CvLeePoint<float> CvDirection;
struct CvVoronoiSiteInt;
struct CvVoronoiEdgeInt;
struct CvVoronoiNodeInt;
struct CvVoronoiParabolaInt;
struct CvVoronoiChainInt;
struct CvVoronoiHoleInt;
struct CvVoronoiDiagramInt
{
CvSeq* SiteSeq;
CvSeq* EdgeSeq;
CvSeq* NodeSeq;
CvSeq* ChainSeq;
CvSeq* ParabolaSeq;
CvSeq* DirectionSeq;
CvSeq* HoleSeq;
CvVoronoiSiteInt* reflex_site;
CvVoronoiHoleInt* top_hole;
};
struct CvVoronoiStorageInt
{
CvMemStorage* SiteStorage;
CvMemStorage* EdgeStorage;
CvMemStorage* NodeStorage;
CvMemStorage* ChainStorage;
CvMemStorage* ParabolaStorage;
CvMemStorage* DirectionStorage;
CvMemStorage* HoleStorage;
};
struct CvVoronoiNodeInt
{
CvPointFloat node;
float radius;
};
struct CvVoronoiSiteInt
{
CvVoronoiNodeInt* node1;
CvVoronoiNodeInt* node2;
CvVoronoiEdgeInt* edge1;
CvVoronoiEdgeInt* edge2;
CvVoronoiSiteInt* next_site;
CvVoronoiSiteInt* prev_site;
CvDirection* direction;
};
struct CvVoronoiEdgeInt
{
CvVoronoiNodeInt* node1;
CvVoronoiNodeInt* node2;
CvVoronoiSiteInt* site;
CvVoronoiEdgeInt* next_edge;
CvVoronoiEdgeInt* prev_edge;
CvVoronoiEdgeInt* twin_edge;
CvVoronoiParabolaInt* parabola;
CvDirection* direction;
};
struct CvVoronoiParabolaInt
{
float map[6];
float a;
CvVoronoiNodeInt* focus;
CvVoronoiSiteInt* directrice;
};
struct CvVoronoiChainInt
{
CvVoronoiSiteInt * first_site;
CvVoronoiSiteInt * last_site;
CvVoronoiChainInt* next_chain;
};
struct CvVoronoiHoleInt
{
CvSeq* SiteSeq;
CvSeq* ChainSeq;
CvVoronoiSiteInt* site_top;
CvVoronoiSiteInt* site_nearest;
CvVoronoiSiteInt* site_opposite;
CvVoronoiNodeInt* node;
CvVoronoiHoleInt* next_hole;
bool error;
float x_coord;
};
typedef CvVoronoiSiteInt* pCvVoronoiSite;
typedef CvVoronoiEdgeInt* pCvVoronoiEdge;
typedef CvVoronoiNodeInt* pCvVoronoiNode;
typedef CvVoronoiParabolaInt* pCvVoronoiParabola;
typedef CvVoronoiChainInt* pCvVoronoiChain;
typedef CvVoronoiHoleInt* pCvVoronoiHole;
typedef CvPointFloat* pCvPointFloat;
typedef CvDirection* pCvDirection;
/****************************************************************************************\
* Function definitions *
\****************************************************************************************/
/*F///////////////////////////////////////////////////////////////////////////////////////
// Author: Andrey Sobolev
// Name: _cvLee
// Purpose: Compute Voronoi Diagram for one given polygon with holes
// Context:
// Parameters:
// ContourSeq : in, vertices of polygon.
// VoronoiDiagramInt : in&out, pointer to struct, which contains the
// description of Voronoi Diagram.
// VoronoiStorage: in, storage for Voronoi Diagram.
// contour_type: in, type of vertices.
// The possible values are CV_LEE_INT,CV_LEE_FLOAT,CV_LEE_DOUBLE.
// contour_orientation: in, orientation of polygons.
// = 1, if contour is left - oriented in left coordinat system
// =-1, if contour is left - oriented in right coordinat system
// attempt_number: in, number of unsuccessful attemts made by program to compute
// the Voronoi Diagram befor return the error
//
// Returns: 1, if Voronoi Diagram was succesfully computed
// 0, if some error occures
//F*/
static int _cvLee(CvSeq* ContourSeq,
CvVoronoiDiagramInt* pVoronoiDiagramInt,
CvMemStorage* VoronoiStorage,
CvLeeParameters contour_type,
int contour_orientation,
int attempt_number);
/*F///////////////////////////////////////////////////////////////////////////////////////
// Author: Andrey Sobolev
// Name: _cvConstuctSites
// Purpose : Compute sites for given polygon with holes
// (site is an edge of polygon or a reflex vertex).
// Context:
// Parameters:
// ContourSeq : in, vertices of polygon
// pVoronoiDiagram : in, pointer to struct, which contains the
// description of Voronoi Diagram
// contour_type: in, type of vertices. The possible values are
// CV_LEE_INT,CV_LEE_FLOAT,CV_LEE_DOUBLE.
// contour_orientation: in, orientation of polygons.
// = 1, if contour is left - oriented in left coordinat system
// =-1, if contour is left - oriented in right coordinat system
// Return: 1, if sites were succesfully constructed
// 0, if some error occures
//F*/
static int _cvConstuctSites(CvSeq* ContourSeq,
CvVoronoiDiagramInt* pVoronoiDiagram,
CvLee
没有合适的资源?快使用搜索试试~ 我知道了~
以C++Buider6 將 IplImage顯示在 Image元件上
共354个文件
cpp:197个
h:54个
am:14个
需积分: 9 16 下载量 31 浏览量
2010-08-20
13:42:48
上传
评论
收藏 5.34MB RAR 举报
温馨提示
可以將 OpenCV中的 IplImage直接顯示在 Image元件上,不須另開視窗,且已經解決Resize後會發生的錯亂問題
资源推荐
资源详情
资源评论
收起资源包目录
以C++Buider6 將 IplImage顯示在 Image元件上 (354个子文件)
Makefile.am 2KB
Makefile.am 2KB
Makefile.am 2KB
Makefile.am 1KB
Makefile.am 953B
Makefile.am 223B
Makefile.am 219B
Makefile.am 206B
Makefile.am 82B
Makefile.am 55B
Makefile.am 40B
Makefile.am 25B
Makefile.am 23B
Makefile.am 23B
viewR.bmp 1.36MB
viewL.bmp 1.36MB
Project1.bpr 5KB
cvlee.cpp 175KB
cxmatmul.cpp 165KB
cxpersistence.cpp 152KB
cxdxt.cpp 124KB
cvepilines.cpp 110KB
cxdatastructs.cpp 107KB
cvcolor.cpp 106KB
cvfilter.cpp 103KB
cxouttext.cpp 101KB
cvimgwarp.cpp 97KB
cxarray.cpp 93KB
cvtrifocal.cpp 87KB
cxarithm.cpp 84KB
cxdrawing.cpp 82KB
cvhaar.cpp 79KB
cxmathfuncs.cpp 77KB
cvpyramids.cpp 76KB
cvcap_v4l.cpp 76KB
cxconvert.cpp 76KB
cvhistogram.cpp 75KB
cxmatrix.cpp 69KB
cxnorm.cpp 67KB
cveigenobjects.cpp 67KB
cvcam.cpp 60KB
cxcmp.cpp 59KB
cvlevmarprojbandle.cpp 59KB
cvpyrsegmentation.cpp 58KB
cvcalibration.cpp 57KB
cvscanlines.cpp 57KB
cvhmm.cpp 56KB
grfmt_jpeg.cpp 55KB
enmin.cpp 51KB
cvcap_qt.cpp 50KB
blobtrackanalysishist.cpp 50KB
cvcontours.cpp 48KB
cvvideo.cpp 48KB
testseq.cpp 47KB
cvsamplers.cpp 46KB
cvlmeds.cpp 46KB
cxsumpixels.cpp 45KB
window_w32.cpp 44KB
cvmorph.cpp 44KB
cxsvd.cpp 42KB
cvfloodfill.cpp 41KB
cvfundam.cpp 40KB
cvvecfacetracking.cpp 39KB
blobtrackingmsfg.cpp 39KB
cxmeansdv.cpp 38KB
cvcalibinit.cpp 38KB
cvhmm1d.cpp 38KB
cvshapedescr.cpp 38KB
enteringblobdetection.cpp 37KB
cvsmooth.cpp 37KB
cvderiv.cpp 37KB
cvhough.cpp 36KB
cvlkpyramid.cpp 36KB
cvcorrimages.cpp 36KB
window_gtk.cpp 36KB
cvemd.cpp 35KB
cvaccum.cpp 34KB
cxcopy.cpp 34KB
cvinpaint.cpp 33KB
cvcap_dc1394.cpp 32KB
cvapprox.cpp 31KB
cvmoments.cpp 28KB
cxlogic.cpp 27KB
cxrand.cpp 27KB
cvbgfg_acmmm2003.cpp 26KB
cvlcm.cpp 26KB
cvmorphcontours.cpp 26KB
window_carbon.cpp 26KB
cvconvhull.cpp 26KB
cvcontourtree.cpp 25KB
cvcorner.cpp 25KB
grfmt_tiff.cpp 25KB
cvcalibfilter.cpp 25KB
cvcap_xine.cpp 24KB
cvsubdivision2d.cpp 24KB
cvcap_ffmpeg.cpp 24KB
cxswitcher.cpp 24KB
bitstrm.cpp 24KB
dialogs.cpp 23KB
grfmt_exr.cpp 23KB
共 354 条
- 1
- 2
- 3
- 4
资源评论
skywalker353
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功