我正在尝试使用JavaCV跟踪亮点(激光笔),但我很难弄清楚如何将图像或IplImage分割成HSV通道来跟踪这一点。
给出更明确的答案:
IplImage orgImg = cvLoadImage( ... );
IplImage hsv = IplImage.create( orgImg.width(), orgImg.height(), orgImg.depth(), orgImg.nChannels() );
IplImage hue = IplImage.create( orgImg.width(), orgImg.height(), orgImg.depth(), CV_8UC1 );
IplImage sat = IplImage.create( orgImg.width(), orgImg.height(), orgImg.depth(), CV_8UC1 );
IplImage val = IplImage.create( orgImg.width(), orgImg.height(), orgImg.depth(), CV_8UC1 );
cvCvtColor( orgImg, hsv, CV_BGR2HLS );
cvSplit( hsv, hue, sat, val, null );