[vtkusers] Suggestions on extracting certain pixels by color

Arturo Caissut arturo_caissut at tiscali.it
Fri Jan 16 14:56:47 EST 2009


Hi everyone,

I need to extract a certain region from an OpenGL buffer of pixels. As 
certain people suggests on the Internet, first of all I used OpenGL's 
glReadPixels function to copy all of the interesting area's pixels to a 
buffer, and then I used vtkImageImport. Now I'd like to separate all the 
red pixels (by "red" I mean their RGB value to be 1, 0, 0) and put them 
on some vtkObject (later I'll have to get contour of the red area of the 
image I'm working on).
How can I separate red pixels from the rest of the buffer?
Have I got to use something similar to a threshold filter?
Perhaps there is some vtkImageImport method to do that from the 
beginning of my vtk pipeline?

Thank you, best regards

Arturo Caissut



More information about the vtkusers mailing list