crazy float number from image pixels [closed]
hello,
I am trying to get pixels values from an image
if I use this line : Vec3b col = imageSource.at<vec3bf>(kp.y, kp.x); I get regular color bytes values
If I use shis one : Vec3f col = imageSource.at<vec3f>(kp.y, kp.x); rgb values are like 1.1234e36 or something
so I would expect values from 0.0 to 1.0 or 0.0 to 255.0 but e+36 ??
I'll go for the bytes version, but the float seemed neat as they are intended for opengl colors floats
Vec3f <--> Vec3f .... you see the mismatch ?
only one of them can be valid at the same time.
if img.type() == CV_8UC3 , then Vec3b, if img.type() == CV_32FC3 , then Vec3f.
use
imageSource.convertTo(imageDest, CV_32FC3);
to get a float img.ok I missed that reading the doc thx