accessing pixel values


I have tried everything and i still can't access pixel RGB values in float format.

i tried vec3b which produces strange characters which i can't covert to float as it says no suitable function exists.

i tried vector<float> RGB;

with RGB =<vector<float>>(row,col);
i get a unhandled exception error.

so whatever i do, if it is syntax correct i get unhandled exception error.
if it should work i get this stupid error.

someone help. i need it for chroma keying.

What lib are you using?

What type is 'image'?
Thanks but i got it working.

i am using opencv and image is captured from camera.

how would i create a mask and apply to image?

Hmm, I have done this, but it is a long time ago :S

But, I remember that it's not TOO complicated. The OpenCV documentation is, actually, not so bad. Take a look at it!



is not an explanation of masks, but, it uses at least one, so you might be able to use that as, at least, a starting point.

I Could post my code from then, But, I don't have it ;)
Last edited on
Thanks, i will take a look at those sites, opencv is soo annoying because of the unhandled exception i error keep on getting or the unavailability of constructors for some functions to perform conversions soo anoying, i prefer matlab.

and you only can use vec3b others like vector<float> = RGB(3) don't work.

yeah sure post the code, but you don't have to post it now when done.
i have been able to generate mask from the tennis site. didn't know creating a matrix for a mask was this tricky.

so how do i apply it to the image so that i only get the image without a background (transparent).

do i create a matrix like the mask but create 3 channel as size as original image and do something where i copy only the pixels which are 255 to the new matrix image.

would that work.
thanks for the help
Topic archived. No new replies allowed.