added camname with suffix when open a camera and server

This commit is contained in:
ori agranat
2019-09-23 09:22:05 -07:00
parent c50b8093f8
commit 5389d79532
3 changed files with 11 additions and 9 deletions

View File

@@ -39,11 +39,11 @@ public class Camera {
}
public Camera(String cameraName, double fov) {
this(CameraManager.AllUsbCameraInfosByName.get(cameraName), fov);
this(cameraName,CameraManager.AllUsbCameraInfosByName.get(cameraName), fov);
}
public Camera(UsbCameraInfo usbCamInfo, double fov) {
this(usbCamInfo, fov, new HashMap<>(), 0);
public Camera(String cameraName, UsbCameraInfo usbCamInfo, double fov) {
this(cameraName ,usbCamInfo, fov, new HashMap<>(), 0);
}
public Camera(String cameraName, double fov, int videoModeIndex) {
@@ -51,12 +51,12 @@ public class Camera {
}
public Camera(String cameraName, double fov, HashMap<Integer, Pipeline> pipelines, int videoModeIndex) {
this(CameraManager.AllUsbCameraInfosByName.get(cameraName), fov, pipelines, videoModeIndex);
this(cameraName, CameraManager.AllUsbCameraInfosByName.get(cameraName), fov, pipelines, videoModeIndex);
}
public Camera(UsbCameraInfo usbCamInfo, double fov, HashMap<Integer, Pipeline> pipelines, int videoModeIndex) {
public Camera(String cameraName, UsbCameraInfo usbCamInfo, double fov, HashMap<Integer, Pipeline> pipelines, int videoModeIndex) {
FOV = fov;
name = usbCamInfo.name;
name = cameraName;
path = usbCamInfo.path;
UsbCam = new UsbCamera(name, path);

View File

@@ -228,8 +228,8 @@ public class VisionProcess implements Runnable {
lastFrameEndNanosec = System.nanoTime();
processTimeMs = (lastFrameEndNanosec - startTime) * 1e-6;
fps = 1000 / processTimeMs;
System.out.printf("%s - Process time: %-5.2fms, FPS: %-5.2f, FoundContours: %d, FilteredContours: %d, GroupedContours: %d\n", cameraName, processTimeMs, fps, FoundContours.size(), FilteredContours.size(), GroupedContours.size());
//please dont enable if you are not debugging
// System.out.printf("%s - Process time: %-5.2fms, FPS: %-5.2f, FoundContours: %d, FilteredContours: %d, GroupedContours: %d\n", cameraName, processTimeMs, fps, FoundContours.size(), FilteredContours.size(), GroupedContours.size());
}
}
}