crazy float number from image pixels [closed]

asked 2014-09-08 11:31:39 -0600

curtis newton gravatar image

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

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2016-01-17 18:13:37.567860

Comments

1

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.

berak gravatar imageberak ( 2014-09-08 11:40:57 -0600 )edit

ok I missed that reading the doc thx

curtis newton gravatar imagecurtis newton ( 2014-09-08 14:09:37 -0600 )edit