Discussion:
problem using cvCvtColor BGR2HSV
nadeem2001
2008-02-06 14:39:14 UTC
Permalink
Dear all, I am new to openCv. I am converting the BGR to HSV. I have
my input from an uncompressed AVI file. when i display input
frame/image its displays fine.
When i use the

cvCvtColor(imageBGR,ImageHSV,CV_BGR2HSV);

both imageBGR and ImageHSV are same type. i.e. 8bit unsigned and 3
channel.

teh result I get is when displayed is not accurate in appearnce, it
look very strange and very strange colors.

Not only that but also the image is upside down.

What i am doing wrong or what shall i do to correct the proble. can
the show image display a HSV image. Does it means the values of my
HSV image are wrong or does it mean that showimage can not show HSV
image.

Please give yoru feeedback as soosn as possible thanks a lot.




Change settings: http://www.yahoogroups.com/mygroups, select
Get Emails (get all posts)
Daily Digest (one summary email per day)
Read on the web (read posts on the web only)Or Unsubscribe by mailing OpenCV-***@yahoogroups.com
Phani Bhushan Tholeti
2008-02-06 15:09:02 UTC
Permalink
hi Nadeem,
cvShowImage displays only BGR images - not RGB or HSV
The image being inverted I'm not sure why it's happening (if at all).
Also check the OpenCV documentation for cvCvtColor - the HSV color
conversion doesn't seem to be too good :( (instead of 360 u get only 180
hues
- and that by division, so be careful using it)
Post by nadeem2001
Dear all, I am new to openCv. I am converting the BGR to HSV. I have
my input from an uncompressed AVI file. when i display input
frame/image its displays fine.
When i use the
cvCvtColor(imageBGR,ImageHSV,CV_BGR2HSV);
both imageBGR and ImageHSV are same type. i.e. 8bit unsigned and 3
channel.
teh result I get is when displayed is not accurate in appearnce, it
look very strange and very strange colors.
Not only that but also the image is upside down.
What i am doing wrong or what shall i do to correct the proble. can
the show image display a HSV image. Does it means the values of my
HSV image are wrong or does it mean that showimage can not show HSV
image.
Please give yoru feeedback as soosn as possible thanks a lot.
--
Lots o' Luv,
Phani Bhushan


[Non-text portions of this message have been removed]



Change settings: http://www.yahoogroups.com/mygroups, select
Get Emails (get all posts)
Daily Digest (one summary email per day)
Read on the web (read posts on the web only)Or Unsubscribe by mailing OpenCV-***@yahoogroups.com
nadeem2001
2008-02-11 08:51:39 UTC
Permalink
Thanks.
I did figure out the reason for image inversion. so that is solved.
However when you say it snot save then can you suggest some
alternative to adopt to do the imgae color scale converison in
openCV. I want to separate the luminance component so that i can work
on the color parts of the signal and detect the object based on color
alone. thereby avoidnig any mis comparison caused by changing light
conditions.

regards
Post by Phani Bhushan Tholeti
hi Nadeem,
cvShowImage displays only BGR images - not RGB or HSV
The image being inverted I'm not sure why it's happening (if at all).
Also check the OpenCV documentation for cvCvtColor - the HSV color
conversion doesn't seem to be too good :( (instead of 360 u get only 180
hues
- and that by division, so be careful using it)
Post by nadeem2001
Dear all, I am new to openCv. I am converting the BGR to HSV. I have
my input from an uncompressed AVI file. when i display input
frame/image its displays fine.
When i use the
cvCvtColor(imageBGR,ImageHSV,CV_BGR2HSV);
both imageBGR and ImageHSV are same type. i.e. 8bit unsigned and 3
channel.
teh result I get is when displayed is not accurate in appearnce, it
look very strange and very strange colors.
Not only that but also the image is upside down.
What i am doing wrong or what shall i do to correct the proble. can
the show image display a HSV image. Does it means the values of my
HSV image are wrong or does it mean that showimage can not show HSV
image.
Please give yoru feeedback as soosn as possible thanks a lot.
--
Lots o' Luv,
Phani Bhushan
[Non-text portions of this message have been removed]
Change settings: http://www.yahoogroups.com/mygroups, select
Get Emails (get all posts)
Daily Digest (one summary email per day)
Read on the web (read posts on the web only)Or Unsubscribe by mailing OpenCV-***@yahoogroups.com
Phani Bhushan Tholeti
2008-02-11 13:25:39 UTC
Permalink
hi,
I use my own conversion routines from RGB to HSV and back. So, there's no
validation in them. I am attaching the code of the routines, feel free to
modify them
as per your requirement. Also there are not any comments :( - though the
logic is pretty simple :)

I use scaling to get from 360 to 255, u could use a 32F image and avoid the
scaling to 255.
All the best!!!
Post by nadeem2001
Thanks.
I did figure out the reason for image inversion. so that is solved.
However when you say it snot save then can you suggest some
alternative to adopt to do the imgae color scale converison in
openCV. I want to separate the luminance component so that i can work
on the color parts of the signal and detect the object based on color
alone. thereby avoidnig any mis comparison caused by changing light
conditions.
regards
Post by Phani Bhushan Tholeti
hi Nadeem,
cvShowImage displays only BGR images - not RGB or HSV
The image being inverted I'm not sure why it's happening (if at
all).
Post by Phani Bhushan Tholeti
Also check the OpenCV documentation for cvCvtColor - the HSV color
conversion doesn't seem to be too good :( (instead of 360 u get
only 180
Post by Phani Bhushan Tholeti
hues
- and that by division, so be careful using it)
Post by nadeem2001
Dear all, I am new to openCv. I am converting the BGR to HSV. I
have
Post by Phani Bhushan Tholeti
Post by nadeem2001
my input from an uncompressed AVI file. when i display input
frame/image its displays fine.
When i use the
cvCvtColor(imageBGR,ImageHSV,CV_BGR2HSV);
both imageBGR and ImageHSV are same type. i.e. 8bit unsigned and 3
channel.
teh result I get is when displayed is not accurate in appearnce,
it
Post by Phani Bhushan Tholeti
Post by nadeem2001
look very strange and very strange colors.
Not only that but also the image is upside down.
What i am doing wrong or what shall i do to correct the proble.
can
Post by Phani Bhushan Tholeti
Post by nadeem2001
the show image display a HSV image. Does it means the values of my
HSV image are wrong or does it mean that showimage can not show
HSV
Post by Phani Bhushan Tholeti
Post by nadeem2001
image.
Please give yoru feeedback as soosn as possible thanks a lot.
--
Lots o' Luv,
Phani Bhushan
[Non-text portions of this message have been removed]
--
Lots o' Luv,
Phani Bhushan


[Non-text portions of this message have been removed]



Change settings: http://www.yahoogroups.com/mygroups, select
Get Emails (get all posts)
Daily Digest (one summary email per day)
Read on the web (read posts on the web only)Or Unsubscribe by mailing OpenCV-***@yahoogroups.com
AG Rana
2008-11-05 03:24:51 UTC
Permalink
I am facing the same problem with BGR2YCbCr . If we cannot display our resultant image (YcbCr) using cvImageshow , then what is the other way to display it?
 
Rana 

--- On Mon, 11/2/08, Phani Bhushan Tholeti <***@gmail.com> wrote:

From: Phani Bhushan Tholeti <***@gmail.com>
Subject: Re: [OpenCV] Re: problem using cvCvtColor BGR2HSV
To: ***@yahoogroups.com
Date: Monday, 11 February, 2008, 8:25 AM






hi,
I use my own conversion routines from RGB to HSV and back. So, there's no
validation in them. I am attaching the code of the routines, feel free to
modify them
as per your requirement. Also there are not any comments :( - though the
logic is pretty simple :)

I use scaling to get from 360 to 255, u could use a 32F image and avoid the
scaling to 255.
All the best!!!
Post by nadeem2001
Thanks.
I did figure out the reason for image inversion. so that is solved.
However when you say it snot save then can you suggest some
alternative to adopt to do the imgae color scale converison in
openCV. I want to separate the luminance component so that i can work
on the color parts of the signal and detect the object based on color
alone. thereby avoidnig any mis comparison caused by changing light
conditions.
regards
Post by Phani Bhushan Tholeti
hi Nadeem,
cvShowImage displays only BGR images - not RGB or HSV
The image being inverted I'm not sure why it's happening (if at
all).
Post by Phani Bhushan Tholeti
Also check the OpenCV documentation for cvCvtColor - the HSV color
conversion doesn't seem to be too good :( (instead of 360 u get
only 180
Post by Phani Bhushan Tholeti
hues
- and that by division, so be careful using it)
Post by nadeem2001
Dear all, I am new to openCv. I am converting the BGR to HSV. I
have
Post by Phani Bhushan Tholeti
Post by nadeem2001
my input from an uncompressed AVI file. when i display input
frame/image its displays fine.
When i use the
cvCvtColor(imageBGR ,ImageHSV, CV_BGR2HSV) ;
both imageBGR and ImageHSV are same type. i.e. 8bit unsigned and 3
channel.
teh result I get is when displayed is not accurate in appearnce,
it
Post by Phani Bhushan Tholeti
Post by nadeem2001
look very strange and very strange colors.
Not only that but also the image is upside down.
What i am doing wrong or what shall i do to correct the proble.
can
Post by Phani Bhushan Tholeti
Post by nadeem2001
the show image display a HSV image. Does it means the values of my
HSV image are wrong or does it mean that showimage can not show
HSV
Post by Phani Bhushan Tholeti
Post by nadeem2001
image.
Please give yoru feeedback as soosn as possible thanks a lot.
--
Lots o' Luv,
Phani Bhushan
[Non-text portions of this message have been removed]
--
Lots o' Luv,
Phani Bhushan

[Non-text portions of this message have been removed]


















[Non-text portions of this message have been removed]


------------------------------------

Change settings: http://www.yahoogroups.com/mygroups, select
Get Emails (get all posts)
Daily Digest (one summary email per day)
Read on the web (read posts on the web only)Or Unsubscribe by mailing OpenCV-***@yahoogroups.com
Loading...