diff --git a/.gitmodules b/.gitmodules index 98ab8ff31c..581f0ccb44 100644 --- a/.gitmodules +++ b/.gitmodules @@ -25,6 +25,7 @@ [submodule "sw/ext/opencv_bebop"] path = sw/ext/opencv_bebop url = https://github.com/tudelft/opencv_bebop.git + ignore = dirty [submodule "sw/ext/TRICAL"] path = sw/ext/TRICAL url = https://github.com/sfwa/TRICAL.git diff --git a/conf/modules/cv_opencvdemo.xml b/conf/modules/cv_opencvdemo.xml index 7a8eee0d48..360c97fdaa 100644 --- a/conf/modules/cv_opencvdemo.xml +++ b/conf/modules/cv_opencvdemo.xml @@ -21,18 +21,28 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + nps.CXXFLAGS += $(shell pkg-config opencv --cflags) + nps.LDFLAGS += -lopencv_imgproc -lopencv_highgui -lopencv_core + + diff --git a/sw/airborne/modules/computer_vision/opencv_example.cpp b/sw/airborne/modules/computer_vision/opencv_example.cpp index 0d7dcfe51d..b4b148b64e 100644 --- a/sw/airborne/modules/computer_vision/opencv_example.cpp +++ b/sw/airborne/modules/computer_vision/opencv_example.cpp @@ -40,20 +40,20 @@ int opencv_example(char *img, int width, int height) Mat M(height, width, CV_8UC2, img); Mat image; // If you want a color image, uncomment this line - cvtColor(M, image, CV_YUV2BGR_Y422); +// cvtColor(M, image, CV_YUV2BGR_Y422); // For a grayscale image, use this one -// cvtColor(M, image, CV_YUV2GRAY_Y422); + cvtColor(M, image, CV_YUV2GRAY_Y422); // Blur it, because we can - blur(image, image, Size(5, 5)); +// blur(image, image, Size(5, 5)); // Canny edges, only works with grayscale image -// int edgeThresh = 35; -// Canny(image, image, edgeThresh, edgeThresh * 3); + int edgeThresh = 35; + Canny(image, image, edgeThresh, edgeThresh * 3); // Convert back to YUV422, and put it in place of the original image -// grayscale_opencv_to_yuv422(image, img, width, height); - colorrgb_opencv_to_yuv422(image, img, width, height); + grayscale_opencv_to_yuv422(image, img, width, height); +// colorrgb_opencv_to_yuv422(image, img, width, height); return 0; }