opencv 2.4.3 无法打开文件"opencv_highgui.lib"
#include"iostream"usingnamespacestd;#include"stdafx.h"#include"cv.h"#include"highgui....
#include "iostream"
using namespace std;
#include "stdafx.h"
#include "cv.h"
#include "highgui.h"
#include "math.h"
#pragma comment(lib,"highgui.lib")
#pragma comment(lib,"cv.lib")
#pragma comment(lib,"cvaux.lib")
#pragma comment(lib,"cxcore.lib")
const char* filename1 = "n2.jpg";
const char* filename2 = "che.jpg";
int main( int argc, char** argv )
{
IplImage *img;
IplImage *tpl;
IplImage *res;
CvPoint minloc, maxloc;
double minval, maxval;
int img_width, img_height;
int tpl_width, tpl_height;
int res_width, res_height;
img = cvLoadImage( filename1, CV_LOAD_IMAGE_COLOR );
tpl = cvLoadImage( filename2, CV_LOAD_IMAGE_COLOR );
if( tpl == 0 )
{
fprintf( stderr, "Cannot load file %s!\n", argv[2] );
return 1;
}
cvNamedWindow( "src", CV_WINDOW_AUTOSIZE );
cvShowImage( "src", img );
cvNamedWindow( "template", CV_WINDOW_AUTOSIZE );
cvShowImage( "template", tpl );
/* get image's properties */
img_width = img->width;
img_height = img->height;
tpl_width = tpl->width;
tpl_height = tpl->height;
res_width = img_width - tpl_width + 1;
res_height = img_height - tpl_height + 1; 展开
using namespace std;
#include "stdafx.h"
#include "cv.h"
#include "highgui.h"
#include "math.h"
#pragma comment(lib,"highgui.lib")
#pragma comment(lib,"cv.lib")
#pragma comment(lib,"cvaux.lib")
#pragma comment(lib,"cxcore.lib")
const char* filename1 = "n2.jpg";
const char* filename2 = "che.jpg";
int main( int argc, char** argv )
{
IplImage *img;
IplImage *tpl;
IplImage *res;
CvPoint minloc, maxloc;
double minval, maxval;
int img_width, img_height;
int tpl_width, tpl_height;
int res_width, res_height;
img = cvLoadImage( filename1, CV_LOAD_IMAGE_COLOR );
tpl = cvLoadImage( filename2, CV_LOAD_IMAGE_COLOR );
if( tpl == 0 )
{
fprintf( stderr, "Cannot load file %s!\n", argv[2] );
return 1;
}
cvNamedWindow( "src", CV_WINDOW_AUTOSIZE );
cvShowImage( "src", img );
cvNamedWindow( "template", CV_WINDOW_AUTOSIZE );
cvShowImage( "template", tpl );
/* get image's properties */
img_width = img->width;
img_height = img->height;
tpl_width = tpl->width;
tpl_height = tpl->height;
res_width = img_width - tpl_width + 1;
res_height = img_height - tpl_height + 1; 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询