convertToGrayscalePlanarImages problem

Hi all,

Just a quick question, I’m really stucked.

I was trying to track colors, using HSV and I have some weird problems.

using the simple:

  
vidGrabber.grabFrame();                                         	  
colorImg.setFromPixels(vidGrabber.getPixels(), camWidth, camHeight);  
colorImgHSV = colorImg;   
colorImgHSV.convertRgbToHsv();	  
colorImgHSV.convertToGrayscalePlanarImages(hueImg, satImg, briImg)  
unsigned char * huePixels = hueImg.getPixels();   

All the pixels value of hueImg, satImg, briImg are black… So I can’t make anything.

Any idea ?

Milles mercis

Hey Martial,

I was having the same problem. I’m not sure if its a bug inside OF or not but the images arn’t updating when you call convertToGrayscalePlanarImages(). So if you call img.flagImageChanged() after it should fix your promblem.

eg

  
vidGrabber.grabFrame();                                              
colorImg.setFromPixels(vidGrabber.getPixels(), camWidth, camHeight);  
colorImgHSV = colorImg;  
colorImgHSV.convertRgbToHsv();     
colorImgHSV.convertToGrayscalePlanarImages(hueImg, satImg, briImg);  
  
hueImg.flagImageChanged();  
satImg.flagImageChanged();  
briImg.flagImageChanged();  
  
unsigned char * huePixels = hueImg.getPixels();   

Hope that helps