Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *****error LNK2019: unresolved external symbol _cvExtractSURF referenced in function _main
- 1>SAMPLE.obj : error LNK2019: unresolved external symbol _cvSURFParams referenced in function _main*****
- #include <stdio.h>
- #include <opencv2/features2d/features2d.hpp>
- #include <opencv2/highgui/highgui.hpp>
- #include <opencv2/imgproc/imgproc_c.h>
- #include <opencv2objdetectobjdetect.hpp>
- #include <opencv2calib3dcalib3d.hpp>
- #include <opencv2corecore.hpp>
- #include <opencv2legacylegacy.hpp>
- #include <opencv2legacycompat.hpp>
- #include <opencv2/nonfree/nonfree.hpp>
- #include <opencvopensurfsurf.h>
- using namespace cv;
- using namespace std;
- int main(int argc, char** argv)
- {
- CvMemStorage* storage = cvCreateMemStorage(0);
- cvNamedWindow("Image", 1);
- int key = 0;
- static CvScalar red_color[] ={0,0,255};
- IplImage* capture= cvLoadImage( "testface.jpg");
- CvMat* prevgray = 0, *image = 0, *gray =0;
- while( key != 'q' )
- {
- int firstFrame = gray == 0;
- IplImage* frame =capture;
- if(!frame)
- break;
- if(!gray)
- {
- image = cvCreateMat(frame->height, frame->width, CV_8UC1);
- }
- //Convert the RGB image obtained from camera into Grayscale
- cvCvtColor(frame, image, CV_BGR2GRAY);
- //Define sequence for storing surf keypoints and descriptors
- CvSeq *imageKeypoints = 0, *imageDescriptors = 0;
- int i;
- //Extract SURF points by initializing parameters
- CvSURFParams params = cvSURFParams(500,1);
- cvExtractSURF( image, 0, &imageKeypoints, &imageDescriptors, storage, params );
- printf("Image Descriptors: %dn", imageDescriptors->total);
- //draw the keypoints on the captured frame
- for( i = 0; i < imageKeypoints->total; i++ )
- {
- CvSURFPoint* r = (CvSURFPoint*)cvGetSeqElem( imageKeypoints, i );
- CvPoint center;
- int radius;
- center.x = cvRound(r->pt.x);
- center.y = cvRound(r->pt.y);
- radius = cvRound(r->size*1.2/9.*2);
- cvCircle( frame, center, radius, red_color[0], 1, 8, 0 );
- }
- cvShowImage( "Image", frame );
- cvWaitKey(0);
- }
- cvDestroyWindow("Image");
- return 0
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement