如何从 import com.googlecode.javacv.cpp.opencv_core.IplImage
中删除错误?
在这里,我试图访问我的网络摄像头拍摄一些快照,我在某个地方找到了代码但是导入错误该怎么办,因为我不知道这些导入的api。
import com.googlecode.javacv.CanvasFrame;
import com.googlecode.javacv.FrameGrabber;
import com.googlecode.javacv.VideoInputFrameGrabber;
import com.googlecode.javacv.cpp.opencv_core.IplImage;
public class Wbcm implements Runnable {
IplImage image;
CanvasFrame canvas = new CanvasFrame("Web Cam");
public Wbcm() {
canvas.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
}
@Override
public void run() {
FrameGrabber grabber = new VideoInputFrameGrabber(0);
int i=0;
try {
grabber.start();
IplImage img;
while (true) {
img = grabber.grab();
if (img != null) {
cvFlip(img, img, 1);// l-r = 90_degrees_steps_anti_clockwise
cvSaveImage((i++)+"-capture.jpg", img);
// show image on window
canvas.showImage(img);
}
//Thread.sleep(INTERVAL);
}
} catch (Exception e) {
}
}
}