摘要: 通过求外接椭圆,算出纠正角度// ration2.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "highgui.h"#include "cv.h"#include "cxcore.h"#ifdef DEBUG#pragma comment(lib," opencv_core231d.lib")#pragma comment(lib,"opencv_features2d231d.lib")#pragma comment(l 阅读全文
posted @ 2012-07-04 15:40 小马_xiaoLV2 阅读(612) 评论(0) 推荐(0) 编辑
摘要: 对于直线倾斜的成串字符 可以通过 开运算连成一片 在用细化算法 求直线 算出倾斜角度 以此纠正// ration1.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "highgui.h"#include "cv.h"#include "cxcore.h"#ifdef DEBUG#pragma comment(lib," opencv_core231d.lib")#pragma comment(lib,"opencv_features2 阅读全文
posted @ 2012-07-04 15:40 小马_xiaoLV2 阅读(1137) 评论(0) 推荐(0) 编辑
摘要: 极坐标通常用于校正图像中的圆形物体或者包含在圆环中的物体。如上图所示 : 设原图变换的中心坐标(即圆心坐标)为 (Mr,Mc),图像上一点(r,c)极坐标变换后为(d,theta)则 d = sqrt((r - Mr) * (r - Mr) + (c-Mc) * (c -Mc)) theta = atan2( - (r - Mr) / (c - Mc))其反变换形式为 r = Mr - d sin(theta) c= Mc + d cos(theta)本程序基于opencv2.3// polar.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h&quo 阅读全文
posted @ 2012-06-19 16:22 小马_xiaoLV2 阅读(4076) 评论(4) 推荐(1) 编辑
摘要: halcon打开USB摄像头本人用的大街上卖的那种傻瓜式USB摄像头基本步骤dev_update_window('off')set_system ('do_low_error', 'true')close_all_framegrabbers()AcqName :='DirectShow'open_framegrabber (AcqName, 1, 1, 0, 0, 0, 0, 'default', -1, 'rgb',\-1, 'false', 'default', 阅读全文
posted @ 2012-06-01 13:51 小马_xiaoLV2 阅读(1273) 评论(2) 推荐(0) 编辑
摘要: HALCON 10.0 II-B3.1 Gray-Value-Based Matching基于灰度的匹配是一个非常经典的方法,它仅适用于对象的不模糊,不缺失,灰度值不变化。适用于对象旋转转。注意对于所有的应用,相关性和基于形状的匹配是要优先考虑的。使用灰度匹配的理由可能是由于匹配的对象和灰度有关系。The rare cases in which the very slow classical gray-valuebased matching is to be preferred comprise the case that the matching must be illumination-v 阅读全文
posted @ 2012-03-27 10:35 小马_xiaoLV2 阅读(2007) 评论(0) 推荐(0) 编辑
摘要: 基于像素的匹配1、归一化积相关灰度匹配: 模板图像 以窗口滚动的方式 在源图像中 扫一遍。 具体运算公式如下:R(i,j) = dSigmaST / (dSigmaT * dSigmaS)对应上公式; R(i,j)=[0,1]M ,N 模板大小对于公式的解释: dSimgmaST -- 在 在原图(i ,j) 位置 模板图像每个像素与对应原图像素的积 的和)dSigmaT -- 模板图像每个像素的积 的和dSigmaS -- 在原图(i,j)位置,模板图像对应的原图的每个像素的积的和R(i,j)最大的位置就是最匹配的位置。/*函数:NormalizeGrayMatch功能:归一化灰度值匹配参数 阅读全文
posted @ 2012-01-06 16:44 小马_xiaoLV2 阅读(5169) 评论(12) 推荐(2) 编辑
摘要: 关于canny算法的原理和实现这篇博客有详细的介绍 http://blog.csdn.net/likezhaobin/article/details/6892629下面是本人源码,和opencv的cvcanny的不同之处1.有高斯滤波 , cvcanny 无。2. 上下阈值自动设定,opencv手动设定。// createGuassFilter.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <cv.h>#include <highgui.h>#include <cxcore.h>#if 阅读全文
posted @ 2012-01-06 16:37 小马_xiaoLV2 阅读(1746) 评论(2) 推荐(0) 编辑
摘要: Coutours 属于XLD结构a) 图 边缘覆盖在原始图像上b)缩放 a)中的 矩形区域,凸显控制点c)轮廓可以分割成线。圆。椭圆等,可以得出它们的 角度 中心 半径等Basic Conceptcreate XLD contours最常用的方法是 用Extract Edges Or Lines方法,结果将转化为XLDProcess XLD Contours典型的情况 如 a)所示,只作用于指定的区域许多时候 ROI选择过大 如图 b) ,这个时候要把 轮廓进行分割,只选择平行的部分 如图 c) 另外的原因,处理轮廓是因为包换了不希望得到的噪声,比如低对比度。Perform Fitting通过 阅读全文
posted @ 2011-12-28 15:00 小马_xiaoLV2 阅读(7319) 评论(0) 推荐(1) 编辑
摘要: Basic ConceptExtended ConceptExtract Edges or LinesHALCON offers various operators for the subpixel-accurate extraction of contours. The standard oper-ator is based on the first derivative. It takes the image as input and returns the XLD contours. Whenusing the second derivatives, first a Laplace oper 阅读全文
posted @ 2011-12-28 14:59 小马_xiaoLV2 阅读(3815) 评论(0) 推荐(0) 编辑
摘要: 1. 一般过程 ********************************************* sobel_amp(Image : EdgeAmplitude : FilterType, Size : )* 不能完全排除虚假边缘,检测出的结果容易出现多像素边缘* sobel算子由两个卷积核组成*a = 1 2 1 0 0 0 -1 -2 -1 b = 1 0 -1 2 0 -2 1 0 -1EdgeAmplitude output -- 边缘强度图像FilterType 'sum_sqrt' sqrt(a^2 + b^2) / 4 'sum_abs' 阅读全文
posted @ 2011-12-28 14:58 小马_xiaoLV2 阅读(4466) 评论(0) 推荐(0) 编辑