CurveMatching-master
所属分类:图形图像处理
开发工具:Visual C++
文件大小:46KB
下载次数:24
上传日期:2015-08-10 19:14:34
上 传 者:
mrmuto2
说明: 基于曲线的模板匹配,能完美解决部分遮挡,旋转和尺度变化
(Based on the template matching curves can be the perfect solution to partial occlusion, rotation and scale changes)
文件列表:
CMake (0, 2013-06-11)
CMake\cotire.cmake (121708, 2013-06-11)
CMakeLists.txt (469, 2013-06-11)
CurveCSS.cpp (16378, 2013-06-11)
CurveCSS.h (8425, 2013-06-11)
CurveSignature.cpp (16974, 2013-06-11)
CurveSignature.h (14576, 2013-06-11)
MathGLTools.h (5341, 2013-06-11)
match_two_curves.cpp (3865, 2013-06-11)
std.h (2311, 2013-06-11)
CurveMatching
=============
Matching 2D curves in OpenCV
See http://www.morethantechnical.com/2012/12/26/2d-curve-matching-w-code/ for details.
Sample Usage
------------
vector
a,b;
//Get curve from image
GetCurveForImage("binary_image_with_silhuette.png", a, false);
ResampleCurve(a, a, 200, false);
vector a_p2d;
ConvertCurve(a, a_p2d);
//rotate and scale
Scalar meanpt = mean(a);
Mat_ trans_to = getRotationMatrix2D(Point2f(meanpt[0],meanpt[1]), 5, 0.65);
//create target curve from original curve
vector b_p2d;
cv::transform(a_p2d,b_p2d,trans_to);
ConvertCurve(b_p2d, b);
//Compare curves
int a_len,a_off,b_len,b_off;
double compare_score;
CompareCurvesUsingSignatureDB(a,
b,
a_len,
a_off,
b_len,
b_off,
compare_score
);
vector a_subset(a.begin() + _a_off, a.begin() + _a_off + _a_len);
vector b_subset(b.begin() + _b_off, b.begin() + _b_off + _b_len);
ResampleCurve(a_subset, a_subset, 200, true);
ResampleCurve(b_subset, b_subset, 200, true);
Mat trans = Find2DRigidTransform(a_subset, b_subset);
cout << trans << endl;
vector a_trans;
cv::transform(a_subset,a_trans,trans);
Compile
-------
mkdir build
cd build
cmake ..
make
近期下载者:
相关文件:
收藏者: