Be careful to use CV_BGR2HSV, the detail of the manual shows:
// In case of 8-bit and 16-bit images
// R, G and B are converted to floating-point format and scaled to fit 0..1 range
V <- max(R,G,B)
S <- (V-min(R,G,B))/V if V≠0, 0 otherwise
(G - B)*60/S, if V=R
H <- 180+(B - R)*60/S, if V=G
240+(R - G)*60/S, if V=B
if H<0 then H<-H+360
On output 0≤V≤1, 0≤S≤1, 0≤H≤360.
The values are then converted to the destination data type:
8-bit images:
V <- V*255, S <- S*255, H <- H/2 (to fit to 0..255)
16-bit images (currently not supported):
V <- V*65535, S <- S*65535, H <- H
32-bit images:
H, S, V are left as is
If the original image is float, you should manually convert the pixel values in the original image to [0, 1].
Friday, May 27, 2011
The ICRA 2011 conference at Shanghai, China
Well, ICRA2011 was a very amazing conference, where I met a lot of famous experts in robotics and computer vision, such as Marc Pollefeys, Stan Birchfield, Shoudong Huang, Chieh-Chih Wang, Larry Matthies and Ryan Eustice, etc. Although I did not try to talk with them all because I am a little nervous and shy, I am very exciting to see them face to face.
About my talk, it was my first conference talk, so some mistakes happened, for instance, wrong pronunciation for some words. I forgive myself here. This experience will let me learn and make further progress on the next conferences.
Thanks my friends and prior college Kejun Ning, who made a photo when I gave the talk.
About my talk, it was my first conference talk, so some mistakes happened, for instance, wrong pronunciation for some words. I forgive myself here. This experience will let me learn and make further progress on the next conferences.
Thanks my friends and prior college Kejun Ning, who made a photo when I gave the talk.
Thursday, May 26, 2011
opencv2.0: a bug in the function convertBGRImageToOpponentColorSpace
The O1 in the opponent color space should be red - green, but in the code, it shows:
int value = static_cast( static_cast(static_cast(*gIt)-static_cast(*rIt)) * factor );
which is wrong.
int value = static_cast
which is wrong.
Thursday, May 5, 2011
UBUNTU 11.04 again can not boot because the NVIDIA driver
Yesterday I update the other computer's system to Ubuntu 11.04. The result was very disappointment.
The system went to die when it rebooted. The reason behind this is the graphic card driver: NVIDIA. I download the new version NVIDIA driver for my computer, and try to reinstall the driver.
There is the other problem show up : it can't find the header file of linux kernel.
Then I use the --kernel-source-path to tell the program where the headers are.
The other problem turn out: the "nvidia.ko" can not be loaded because the kernel version doesn't match. The kernel version can be found out by command "uname -al".
The corresponding kernel header which is ending with "pae" which I don't have. Then I use aptitude to install this header and compile the nvidia driver again. Now it works.
The system went to die when it rebooted. The reason behind this is the graphic card driver: NVIDIA. I download the new version NVIDIA driver for my computer, and try to reinstall the driver.
There is the other problem show up : it can't find the header file of linux kernel.
Then I use the --kernel-source-path to tell the program where the headers are.
The other problem turn out: the "nvidia.ko" can not be loaded because the kernel version doesn't match. The kernel version can be found out by command "uname -al".
The corresponding kernel header which is ending with "pae" which I don't have. Then I use aptitude to install this header and compile the nvidia driver again. Now it works.
Subscribe to:
Posts (Atom)