![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
OpenCV
Went89
这个作者很懒,什么都没留下…
展开
-
Read media
#include "stdafx.h"#include #include "opencv2/opencv.hpp"using namespace std;using namespace cv;int _tmain(int argc, _TCHAR* argv[]){//read media c style cvNamedWindow("test2", CV_WINDOW_A原创 2012-09-05 12:27:28 · 363 阅读 · 0 评论 -
Sobel operator
int _tmain(int argc, _TCHAR* argv[]) { IplImage *src = cvLoadImage("LenaGray.jpg"); IplImage *dst = cvCreateImage(cvGetSize(src), IPL_DEPTH_16S, 3); cvSobel(src, dst, 1, 0, 7); cvNamedWindow("Te原创 2012-09-18 09:51:07 · 637 阅读 · 0 评论 -
Canny operator
//Canny operator//int _tmain(int argc, _TCHAR* argv[]) { IplImage *img = cvLoadImage("E:\\ProgramData\\data\\LenaGr.jpg", 0);//0 means get the gray img IplImage *edgesCanny = cvCreateImage(cvGetSi原创 2012-09-18 16:58:43 · 728 阅读 · 0 评论 -
cvHoughCircles
int _tmain(int argc, _TCHAR* argv[]) { IplImage *image = cvLoadImage("LenaGr.jpg", 0); CvMemStorage *storage = cvCreateMemStorage(0); cvSmooth(image, image, CV_GAUSSIAN, 5, 5); CvSeq *results = c原创 2012-09-18 20:51:37 · 579 阅读 · 0 评论 -
Template matching
int _tmain(int argc, _TCHAR* argv[]) { IplImage *src, *templ, *ftmp[6]; //ftmp will hold results int i; //Read in the source image to be searched src = cvLoadImage("face.jpg", 1); if (!src) { p原创 2012-09-19 15:54:15 · 579 阅读 · 0 评论 -
use cvFindContours
IplImage *g_image = NULL;IplImage *g_gray = NULL;int g_thresh = 100;CvMemStorage *g_storage = NULL;void on_trackbar(int) { if (g_storage == NULL) { g_gray = cvCreateImage(cvGetSize(g_image), 8原创 2012-09-20 10:36:52 · 543 阅读 · 0 评论 -
cvGaussBGModel
int _tmain(int argc, _TCHAR* argv[]) { IplImage* pFrame = NULL; IplImage* pFrImg = NULL; IplImage* pBkImg = NULL; CvCapture* pCapture = NULL; int nFrmNum = 0; cvNamedWindow原创 2012-09-21 09:23:49 · 3397 阅读 · 1 评论 -
resize image
int _tmain(int argc, _TCHAR* argv[]) { IplImage *src = NULL; IplImage *dst = NULL; float scale = 0.618; CvSize dst_cvsize; src = cvLoadImage("Lena.jpg", CV_LOAD_IMAGE_COLOR); dst_cvsize.width原创 2012-09-21 09:38:05 · 695 阅读 · 0 评论 -
simple image processing
int _tmain(int argc, _TCHAR* argv[]) { IplImage *src = NULL; IplImage *tmp = NULL; IplImage *src_bg = NULL; IplImage *dst_gray = NULL; IplImage *dst_bw = NULL; IplImage *dst_contours = NULL; Ip原创 2012-09-22 18:20:36 · 466 阅读 · 0 评论 -
invert color of image
int _tmain(int argc, _TCHAR* argv[]) { IplImage *img = NULL; int height, width, step, channels; uchar *data; int i, j, k; //load an image img = cvLoadImage("Lena.jpg"); if(!img) { perror("Can原创 2012-09-22 18:43:37 · 747 阅读 · 0 评论 -
use cvThreshold in three channel and truncate values above 100
void sum_rgb(IplImage *src, IplImage *dst) { //Allocate individual image planes. IplImage *r = cvCreateImage(cvGetSize(src), IPL_DEPTH_8U, 1); IplImage *g = cvCreateImage(cvGetSize(src), IPL_DEPTH_原创 2012-09-11 14:51:08 · 400 阅读 · 0 评论 -
use cvPrySegmentation
//use cvPrySegmentationvoid f( IplImage *src, IplImage *dst ) { CvMemStorage *storage = cvCreateMemStorage(0); CvSeq *comp = NULL; cvPyrSegmentation( src, dst, sto原创 2012-09-11 09:19:23 · 442 阅读 · 0 评论 -
Read Image
#include "stdafx.h"#include #include "opencv2/opencv.hpp"using namespace std;using namespace cv;int _tmain(int argc, _TCHAR* argv[]){ //read image c style IplImage *img = cvLoadImag原创 2012-09-05 12:15:55 · 598 阅读 · 0 评论 -
Transform img to 1/2
IplImage* doPyrDown( IplImage* in){ // Best to make sure input image is divisible by two. // assert( in->width%2 == 0 && in->height%2 == 0 ); IplImage* out = cvCreateImage(原创 2012-09-07 20:29:24 · 511 阅读 · 0 评论 -
capture from the camera
int _tmain(int argc, _TCHAR* argv[]) { cvNamedWindow("Example2_9", CV_WINDOW_AUTOSIZE); CvCapture *capture; capture = cvCreateCameraCapture(0); assert(capture != NULL); IplImage *frame; whi原创 2012-09-08 15:45:56 · 733 阅读 · 0 评论 -
Gaussian Smooth
#include "stdafx.h"#include #include "opencv2/opencv.hpp"using namespace std;using namespace cv;void example2_4( IplImage* image ){ // Create some windows to show the input // and out原创 2012-09-07 20:07:39 · 1182 阅读 · 0 评论 -
Fast corner detection
int _tmain(int argc, _TCHAR* argv[]) { Mat img = imread("LenaGr.jpg", 0); //vector of KeyPoints vector keyPoints; //construction of the fast feature detector object FastFeatureDetector fast(40)原创 2012-09-26 15:15:16 · 2251 阅读 · 1 评论 -
use slider to realize the button function
int g_switch_value = 1;void switch_off_function() {printf("Pause\n");};void switch_on_function() {printf("Run\n");}; //This will be the callback that we give to //the trackbar.void switch_callba原创 2012-09-10 16:14:04 · 529 阅读 · 0 评论 -
RGB to gray
//use cvCvtColorint _tmain(int argc, _TCHAR* argv[]) { IplImage *src = cvLoadImage("Lena.jpg"); IplImage *dst = cvCreateImage( cvGetSize(src), src ->depth, 1 ); cvCvtColor(src, dst, CV_RGB原创 2012-09-09 19:14:38 · 1602 阅读 · 0 评论 -
save and load a matix
int _tmain(int argc, _TCHAR* argv[]) { CvMat *the_matrix_data = cvCreateMat(5,5,CV_32FC1); float element_3_2 = 7.7; *((float*)CV_MAT_ELEM_PTR( *the_matrix_data, 3,2) ) = element_3_2; cvmS原创 2012-09-09 20:37:21 · 484 阅读 · 0 评论 -
draw rectangle
//Define out callback which we will install//for mouse events.void my_mouse_callback( int event, int x, int y, int flags, void *param );CvRect box;bool drawing_box = false;//A little subr原创 2012-09-10 14:30:40 · 1499 阅读 · 0 评论 -
fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏
全盘搜索cvtres.exe把搜索到的位于vs目录下的该文件删除或重命名即可。转载 2014-12-13 11:54:19 · 519 阅读 · 0 评论