[vtkusers] Extract de pixels colours in a image

beth at portugalmail.pt beth at portugalmail.pt
Thu Jun 19 07:27:07 EDT 2008


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



More information about the vtkusers mailing list