我正在尝试使用JavaCV跟踪亮点(激光指针),但我无法弄清楚如何将图像或IplImage分割成HSV通道来跟踪这一点。
答案 0 :(得分:2)
要给出更明确的答案:
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 );