Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

Problem with HSV

$
0
0
Need some help, i am not able to find the desired contour Input: ![image description](/upfiles/148298804134565.jpg) After applying binary filter: ![image description](/upfiles/14829881046754387.jpg) After applying HSV filter: ![image description](/upfiles/14829881766591961.jpg) Output: ![image description](/upfiles/14829882485662751.jpg) However, the desired output should have been: ![image description](/upfiles/14829882931051294.png) Need some help, this is my code for hsv: #include "opencv2/core/core.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "iostream" using namespace cv; using namespace std; int main() { Mat image; image = imread("C:/Proj/Denoised.jpg", CV_LOAD_IMAGE_COLOR); if (!image.data) { cout << "Could not open the denoised image" << std::endl; return -1; } // Create a new matrix to hold the hsv image Mat HSV; // convert RGB image to hsv image cvtColor(image, HSV, CV_BGR2HSV); namedWindow("Display RGB image", CV_WINDOW_AUTOSIZE); imshow("Display RGB image", image); //DISPLAY image namedWindow("Result : HSV image", CV_WINDOW_AUTOSIZE); imshow("Result : HSV image", HSV); //save the HSV image imwrite("C:/Proj/HSVimage.jpg", HSV); waitKey(0); return 0; }

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>