[vtkusers] Extract de pixels colours in a image

beth at portugalmail.pt beth at portugalmail.pt
Fri Jun 20 09:55:40 EDT 2008


Hi Amy,


Thank you for your answer, however that's not exactly what I'm looking for...

I want to take each pixel from each picture (located at the same row and line) 
and calculate the HSV value for the new one (that's going to be created based 
on the other 2), based on the average value of those before. In this way, for 
instance, considering that px1 and px2 are pixels located at the first line and 
row of the respectives images (first and second), the resulting image, will 
have a pixel value calculate like:

px = (px1 + px2)/2

or better saying:

px.H = (px1.H + px2.H)/2 in the case of the H colour component, and the 
approach will be used to S and V components...

I actually do need to access each colour component present in each picture.

Thanks and regards,

Beth


Citando Amy Squillacote <ahs at cfdrc.com>:

 Hi Elizabeth,
 
 It sounds like vtkImageBlend 
 (http://www.vtk.org/doc/nightly/html/classvtkImageBlend.html) is what 
 you're looking for.
 
 - Amy
 
 beth at portugalmail.pt wrote:
 > Hi all,
 >
 > I would like to read a image and then extract its pixel colour in order to
 do 
 > some calculations on it.
 >
 > In my case, I'm using 2 jpeg images. I intend to turn its colour mode from
 RGB 
 > to HSV. Then, I would like to go through its lines and columms, extracting 
 > their pixel colours (HSV components) in order to combine bothe images into 
 > another one.
 >
 > My pice of code till now looks like this:
 >
 > 	vtkJPEGReader *imagem1 = vtkJPEGReader::New();
 > 	vtkJPEGReader *imagem2 = vtkJPEGReader::New();
 > 	imagem1->SetFileName("imagem1.jpg");
 > 	imagem2->SetFileName("imagem2.jpg");
 >
 > 	vtkImageRGBToHSV *imagemConv1 = vtkImageRGBToHSV::New();
 > 	vtkImageRGBToHSV *imagemConv2 = vtkImageRGBToHSV::New();
 > 	imagemConv1->SetInputConnection(imagem1->GetOutputPort());
 > 	imagemConv2->SetInputConnection(imagem2->GetOutputPort());
 >
 > Then I don't no what method/class to use in order to implement the rest!
 >
 > I'm wandering if it could be something like this:
 >
 > 	vtkImageData *data1 = vtkImageData::New();
 > 	vtkSource *source1 = vtkSource::New();
 > 	source1->SetInputConnection(imagemConv1->GetOutputPort());
 > 	data1->SetSource(source1);
 >
 > them try through data1 to access the colours componenents, but too many
 doubts 
 > are forcing me to send this help to you...
 >
 > Thannks and best regards,
 >
 > Elizabeth
 >
 >
 > __________________________________________________________
 > O email preferido dos portugueses agora com
 > 2 000 MB de espaço e acesso gratuito à Internet
 > http://www.portugalmail.pt/2000mb
 > _______________________________________________
 > 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
 >
 >
 >   
 
 -- 
 Amy Squillacote                    Phone: (256) 726-4839
 Computer Scientist                 Fax: (256) 726-4806
 CFD Research Corporation           Web: http://www.cfdrc.com
 215 Wynn Drive, Suite 501
 Huntsville, AL  35805
 
 
 



__________________________________________________________
Sabe quanto gasta com a sua ligação à Internet?
Verifique aqui: http://acesso.portugalmail.pt/contas



More information about the vtkusers mailing list