#include "cv.h"
#include "highgui.h"
#pragma comment(lib,"cxcore200.lib")
#pragma comment(lib,"highgui200.lib")
using namespace cv;
void
mouseHandler(int event, int x, int y, int flags, void* param)
{
IplImage* img0, * img1;
CvFont font;
uchar* ptr;
char label[20];
img0 = (IplImage*) param;
img1 = cvCloneImage(img0);
cvInitFont(&font, CV_FONT_HERSHEY_PLAIN, .8, .8, 0, 1, 8);
if (event == CV_EVENT_LBUTTONDOWN)
{
/* read pixel */
ptr = cvPtr2D(img1, y, x, NULL);
最后
以上就是有魅力柜子最近收集整理的关于用opencv读取图像的每个像素值,鼠标点击获取每一个点,并显示像素的全部内容,更多相关用opencv读取图像内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复