Ask Your Question
1

HSV value of a RGB pixel

asked 2015-09-23 02:46:55 -0600

sarjoondeen gravatar image

updated 2015-09-23 02:47:55 -0600

  1. Original.jpg

  2. HSV.jpg

The first image is the orginal BGR image and second (HSV.jpg) is the HSV color converted image

I opened the original image in GIMP editor and I checked the coordinate (300,300) and in that coordinate following values I found B:74 G:70 R:75 H:312 S:7 V:29

Then the same coordinate (300,300) when I checked in HSV converted image (HSV.jpg) I didn't find these "312,7,29" HSV values instead I found its RGB value.

I know that opencv doesn't display as HSV values, but then through what ways I will be able to get the HSV value of that particular coordinates(300,300) RGB pixel.

I thought conversion of BGR2HSV will do that and will give that values(312,7,29) but it didn't give those values Please help me understand with this.

Thanks in Advance Sarjoon.

edit retag flag offensive close merge delete

Comments

4

I think your answer is here

LBerger gravatar imageLBerger ( 2015-09-23 03:28:06 -0600 )edit
2

Check out the answer here, which will display BGR value and corresponding HSV value http://answers.opencv.org/question/30...

And if you want to segment the object then the answer here might be helpful http://answers.opencv.org/question/28...

Haris gravatar imageHaris ( 2015-09-23 04:20:36 -0600 )edit
4

also, since H has to fit into a [0..255] byte in opencv, the value is divided by 2, so in the [0..180] range, thus your example hsv values would be (156,7,29) in opencv

berak gravatar imageberak ( 2015-09-23 04:29:11 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-09-24 06:51:01 -0600

sarjoondeen gravatar image

Thanks for the answers.. I understood how it works in Opencv.. Cheers :)

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-09-23 02:46:55 -0600

Seen: 7,904 times

Last updated: Sep 23 '15