[vtkusers] Suggestions on extracting certain pixels by color

Francois Bertel francois.bertel at kitware.com
Fri Jan 16 15:13:55 EST 2009


First the first part, If your OpenGL colorbuffer comes from a
vtkRenderWindow, use GetPixelData() or GetRGBAPixelData() methods of
this class instead. They actually use glReadPixels().

http://www.vtk.org/doc/nightly/html/classvtkRenderWindow.html


On Fri, Jan 16, 2009 at 2:56 PM, Arturo Caissut
<arturo_caissut at tiscali.it> wrote:
> 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
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



-- 
François Bertel, PhD  | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
                      | Clifton Park NY 12065, USA



More information about the vtkusers mailing list