0
這是我的代碼。它繼續顯示此消息「方法getBufferedImage()未定義類型opencv_core.IplImage」。我怎樣才能擺脫它?有沒有其他的方式獲得緩衝圖像?如果有人有任何想法,請儘快告訴我如何清除此錯誤「方法getBufferedImage()未定義類型opencv_core.IplImage」
public IplImage snapIm = null;
public Rectangle faceRect;
public void paintComponent(Graphics g){
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
if (snapIm != null)
g2.drawImage(snapIm.getBufferedImage(), 0, 0, this); //This Line is causing problem
drawRect(g2);
writeStats(g2);
writeName(g2);
}
public void recogFace(IplImage img)
{
BufferedImage clipIm = null;
synchronized(faceRect) {
if (faceRect.width == 0) {
System.out.println("No face selected");
return;
}
clipIm = ImageUtils.clipToRectangle(img.getBufferedImage(),faceRect.x, faceRect.y, faceRect.width, faceRect.height); //This Line is causing problem
}
if (clipIm != null)
matchClip(clipIm);
}