Log in

View Full Version : How do i keep camera going without stopping every time in JAVA?


Luther4021
19-02-2016, 17:22
public void Camera() {

NIVision.IMAQdxStartAcquisition(session);
NIVision.IMAQdxGrab(session, frame, 1);
CameraServer.getInstance().setImage(frame);
NIVision.IMAQdxStopAcquisition(session);

}

This is our code, I have tried many things to try and fix it, but all i got is errors. I've tried while loops and ifs nothing worked.

Thanks

kmodos
19-02-2016, 17:26
public void Camera() {

NIVision.IMAQdxStartAcquisition(session);
NIVision.IMAQdxGrab(session, frame, 1);
CameraServer.getInstance().setImage(frame);
NIVision.IMAQdxStopAcquisition(session);

}

This is our code, I have tried many things to try and fix it, but all i got is errors. I've tried while loops and ifs nothing worked.

Thanks

You need to open your camera and start capture before you try to grab an image.

Team4021
19-02-2016, 17:52
You need to open your camera and start capture before you try to grab an image.

The StartAcquisition is Starting the camera before it starts the capture. I just don't want the StopAcquisition in there. It loops through so the Camera is constantly turning on and off. So it makes our programs pretty laggy and delayed.

kmodos
19-02-2016, 18:45
The StartAcquisition is Starting the camera before it starts the capture. I just don't want the StopAcquisition in there. It loops through so the Camera is constantly turning on and off. So it makes our programs pretty laggy and delayed.

Put the stop acquisition outside the loop then?

Luther4021
19-02-2016, 19:37
I've done that, nothing but errors.

kmodos
19-02-2016, 20:38
I've done that, nothing but errors.

What is the error? Without the stacktrace, it is hard to debug.