Get a specific pixel coordinates where your mouse on (cc)
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Get a specific pixel coordinates where your mouse on (cc)相关的知识,希望对你有一定的参考价值。
- #include <cv.h>
- #include <highgui.h>
- #include <stdio.h>
- IplImage* src=0;
- void on_mouse( int event, int x, int y, int flags, void* ustc)
- {
- CvFont font;
- cvInitFont(&font, CV_FONT_HERSHEY_SIMPLEX, 0.5, 0.5, 0, 1, CV_AA);
- if( event == CV_EVENT_LBUTTONDOWN )
- {
- CvPoint pt = cvPoint(x,y);
- char temp[16];
- sprintf(temp,"(%d,%d)",pt.x,pt.y);
- cvPutText(src,temp, pt, &font, cvScalar(255, 255, 255, 0));
- cvCircle( src, pt, 2,cvScalar(255,0,0,0) ,CV_FILLED, CV_AA, 0 );
- cvShowImage( "src", src );
- }
- }
- int main()
- {
- src=cvLoadImage("lena.jpg",1);
- cvNamedWindow("src",1);
- cvSetMouseCallback( "src", on_mouse, 0 );
- cvShowImage("src",src);
- cvWaitKey(0);
- cvDestroyAllWindows();
- cvReleaseImage(&src);
- return 0;
- }
以上是关于Get a specific pixel coordinates where your mouse on (cc)的主要内容,如果未能解决你的问题,请参考以下文章
pandas使用groupby函数进行分组聚合使用get_group函数获取指定分组的数据(extract specific group after groupby in dataframe)