Guest User

Untitled

a guest
Jan 22nd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. #include <opencv2/core/core.hpp>
  2. #include <opencv2/highgui/highgui.hpp>
  3.  
  4. #include <stdio.h>
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8. cv::Mat image = cv::imread("img.jpg");
  9.  
  10. if( image.data == NULL )
  11. {
  12. printf( "file cannot be loadedn");
  13. return 1;
  14. }
  15.  
  16. cv::namedWindow("My");
  17. cv::imshow("My", image);
  18.  
  19. cv::Mat result;
  20. cv::cvtColor(image, result, CV_BGR2Luv);
  21.  
  22. cv::imwrite("outImg.jpg", result);
  23.  
  24. cv::waitKey(0);
  25.  
  26. return 0;
  27. }
  28.  
  29. make: Entering directory `/home/swaroop/Work/ai-junkies/cuda/uc_davis/opencv2.x/OpenCV2Test'
  30. g++ -g -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4 -I/usr/include/opencv -I. -o main.o main.cpp
  31. main.cpp: In function 'int main(int, char**)':
  32. main.cpp:22:29: error: 'CV_BGR2Luv' was not declared in this scope
  33. main.cpp:22:39: error: 'cvtColor' was not declared in this scope
  34.  
  35. #include <opencv2/imgproc/imgproc.hpp>
  36.  
  37. #include <opencv2/opencv.hpp>
Add Comment
Please, Sign In to add comment