Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. *****error LNK2019: unresolved external symbol _cvExtractSURF referenced in function _main
  2. 1>SAMPLE.obj : error LNK2019: unresolved external symbol _cvSURFParams referenced in function _main*****
  3.  
  4. #include <stdio.h>
  5. #include <opencv2/features2d/features2d.hpp>
  6. #include <opencv2/highgui/highgui.hpp>
  7. #include <opencv2/imgproc/imgproc_c.h>
  8. #include <opencv2objdetectobjdetect.hpp>
  9. #include <opencv2calib3dcalib3d.hpp>
  10. #include <opencv2corecore.hpp>
  11. #include <opencv2legacylegacy.hpp>
  12. #include <opencv2legacycompat.hpp>
  13. #include <opencv2/nonfree/nonfree.hpp>
  14. #include <opencvopensurfsurf.h>
  15. using namespace cv;
  16. using namespace std;
  17. int main(int argc, char** argv)
  18. {
  19. CvMemStorage* storage = cvCreateMemStorage(0);
  20. cvNamedWindow("Image", 1);
  21. int key = 0;
  22. static CvScalar red_color[] ={0,0,255};
  23. IplImage* capture= cvLoadImage( "testface.jpg");
  24.  
  25. CvMat* prevgray = 0, *image = 0, *gray =0;
  26. while( key != 'q' )
  27. {
  28. int firstFrame = gray == 0;
  29. IplImage* frame =capture;
  30. if(!frame)
  31. break;
  32. if(!gray)
  33. {
  34. image = cvCreateMat(frame->height, frame->width, CV_8UC1);
  35. }
  36.  
  37. //Convert the RGB image obtained from camera into Grayscale
  38. cvCvtColor(frame, image, CV_BGR2GRAY);
  39.  
  40. //Define sequence for storing surf keypoints and descriptors
  41. CvSeq *imageKeypoints = 0, *imageDescriptors = 0;
  42.  
  43. int i;
  44.  
  45. //Extract SURF points by initializing parameters
  46. CvSURFParams params = cvSURFParams(500,1);
  47. cvExtractSURF( image, 0, &imageKeypoints, &imageDescriptors, storage, params );
  48. printf("Image Descriptors: %dn", imageDescriptors->total);
  49.  
  50. //draw the keypoints on the captured frame
  51. for( i = 0; i < imageKeypoints->total; i++ )
  52. {
  53. CvSURFPoint* r = (CvSURFPoint*)cvGetSeqElem( imageKeypoints, i );
  54. CvPoint center;
  55. int radius;
  56. center.x = cvRound(r->pt.x);
  57. center.y = cvRound(r->pt.y);
  58. radius = cvRound(r->size*1.2/9.*2);
  59. cvCircle( frame, center, radius, red_color[0], 1, 8, 0 );
  60. }
  61. cvShowImage( "Image", frame );
  62.  
  63. cvWaitKey(0);
  64. }
  65. cvDestroyWindow("Image");
  66. return 0
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement