0

I am using BGR to HSV conversion of image using OpenCV. Since I am new to this field and software, I may sound incorrect so please let me know if I am wrong.

Now, in my school project i want to work with HSV image, which is easily converted using

cvtColor(src, dst, CV_BGR2HSV);

I suppose, that imread() function reads image in a uchar format which is 8bit unsigned image (i suppose). In that case imshow() is also uchar.

But to work with HSV image, I am not sure but I feel i need to convert use Mat3b perhaps for the distinctive H, S and V channels of the image.

Incase if I am wrong, that I want to work with H channel of the HSV image only so how can i print, or modify this channel information.

Many thanks

rish
  • 5,575
  • 6
  • 22
  • 27

1 Answers1

2

Perhaps you can use cv::split to devide the HSV to 3 one-channel Mat. I think this topic OpenCV:split HSV image and scan through H channel may solve your problem.

Community
  • 1
  • 1
flyzhao
  • 348
  • 4
  • 15
  • thanks but let me ask u, in HSV, H is between 0-360, S & V is between 0 -100. However when i print the values its seems to exceed the 0-100 range. For example {118, 26, 248}. Is there any problem in my conversion – rish May 23 '13 at 04:55
  • 1
    Different lib have different HSV value range, I think you can check here [Choosing correct HSV values for OpenCV thresholding with InRangeS][1] [1]: http://stackoverflow.com/questions/10948589/choosing-correct-hsv-values-for-opencv-thresholding-with-inranges – flyzhao May 23 '13 at 05:42