[vtkusers] Display OpenCV Image (IplImage) in VTK

Samunda Perera samunda_n at yahoo.com
Sun May 9 05:30:22 EDT 2010


Hi Anant,

I think i just found the problem, (not a bug).

Since opencv defaults to BGR memory style vtk reads these data as R<--B, G<--G, B<--R.

so displayed image does not appear as the real one.

however when input image is converted to RGB style  (ex: cvCvtColor(img,img,CV_RGB2BGR); ) looks ok!.

Regards,
samu




________________________________
From: Samunda Perera <samunda_n at yahoo.com>
To: vtkusers at vtk.org
Sent: Sun, May 9, 2010 2:37:41 PM
Subject: Re: Display OpenCV Image (IplImage) in VTK


Hi Anant,

Thanks for the code, yes seems like a bug.

Regards,
samu




________________________________
From: Samunda Perera <samunda_n at yahoo.com>
To: vtkusers at vtk.org
Sent: Tue, May 4, 2010 12:32:31 PM
Subject: Display OpenCV Image (IplImage) in VTK


Dear all,

I have a pointer to a image stored in memory (example void* frame or similar data type obtained from opencv) .
How to display this 2D image data as a image in VTK window?

Thanks & Regards,
Samu


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100509/9ed472b0/attachment.htm>


More information about the vtkusers mailing list