imshow doesn’t need convert from BGR to RGB

BGR and RGB are not color spaces, they are just conventions for the order of the different color channels. cv2.cvtColor(img, cv2.COLOR_BGR2RGB) doesn’t do any computations (like a conversion to say HSV would), it just switches around the order. Any ordering would be valid – in reality, the three values (red, green and blue) are stacked … Read more

What is the algorithm that opencv uses for finding contours?

If you read the documentation it is mentioned this function implements the algorithm of: Suzuki, S. and Abe, K., Topological Structural Analysis of Digitized Binary Images by Border Following. CVGIP 30 1, pp 32-46 (1985) OpenCV is open source if you want to see how this is implemented just need to read the code: https://github.com/opencv/opencv/blob/master/modules/imgproc/src/contours.cpp#L1655 … Read more

how to use gpu::Stream in OpenCV?

By default all gpu module functions are synchronous, i.e. current CPU thread is blocked until operation finishes. gpu::Stream is a wrapper for cudaStream_t and allows to use asynchronous non-blocking call. You can also read “CUDA C Programming Guide” for detailed information about CUDA asynchronous concurrent execution. Most gpu module functions have additional gpu::Stream parameter. If … Read more

Undefined Reference To ‘cv::initModule_nonfree()’ In Android

My development environment is set up as follows: android-ndk-r10d (install path: D:\adt-bundle-windows-x86_64-20140702\android-ndk-r10d\) OpenCV-2.4.10-android-sdk (install path: D:\CODE\OpenCV-2.4.10-android-sdk\), Download link OpenCV-2.4.10 (install path: D:\CODE\OpenCV-2.4.10\), Download link Building the nonfree module We actually only need to copy a few files from OpenCV-2.4.10 source code to OpenCV-2.4.10-android-sdk, namely: Copy the nonfree folder from OpenCV-2.4.10\sources\modules\nonfree\include\opencv2\ to OpenCV-2.4.10-android-sdk\sdk\native\jni\include\opencv2. Create a folder … Read more