Skip to content

Commit f3b958a

Browse files
committed
-p- finally updated PCConfiguration -- Realsense and openni drivers added.
1 parent 6505280 commit f3b958a

3 files changed

Lines changed: 20 additions & 39 deletions

File tree

calibration/PCConfiguration/PCConfiguration.pde

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import org.bytedeco.javacv.CanvasFrame;
2525

2626
import java.io.*;
2727
import java.nio.channels.FileChannel;
28-
28+
import org.openni.*;
2929

3030
Skatolo skatolo;
3131

@@ -124,12 +124,12 @@ void cameraTypeChooser(int value){
124124
cameraFormatText.hide();
125125
}
126126

127-
if(value == Camera.Type.OPEN_KINECT.ordinal()){
127+
if(value == Camera.Type.OPEN_KINECT.ordinal()
128+
|| value == Camera.Type.OPENNI2.ordinal()
129+
|| value == Camera.Type.REALSENSE.ordinal()){
128130
cameraSubType.show();
129-
130131
int currentType = getDepthType(value);
131132
depthCameraType.activate(currentType);
132-
133133
} else {
134134
cameraSubType.hide();
135135
}

calibration/PCConfiguration/testView.pde

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,7 @@ class TestView extends PApplet {
8383
if(depthCameraConfig.getCameraType() == Camera.Type.FAKE){
8484
return;
8585
}
86-
<<<<<<< HEAD:papart-examples/calibration/PCConfiguration/testView.pde
8786
depthCameraConfig.setCameraName(depthCameraIdText.getText());
88-
89-
camera = depthCameraConfig.createCamera();
90-
camera.setParent(this);
91-
92-
=======
93-
depthCameraConfig.setCameraName(cameraIdText.getText());
9487

9588
try{
9689
camera = depthCameraConfig.createCamera();
@@ -100,29 +93,6 @@ class TestView extends PApplet {
10093
}
10194
camera.setParent(this);
10295

103-
try{
104-
105-
if(depthCameraConfig.getCameraType() == Camera.Type.OPEN_KINECT_2){
106-
depthCamera = new KinectOne(this, camera);
107-
}
108-
109-
>>>>>>> 1.1-rc:calibration/PCConfiguration/testView.pde
110-
if(depthCameraConfig.getCameraType() == Camera.Type.OPEN_KINECT){
111-
depthCamera = new Kinect360(this, camera);
112-
}
113-
114-
<<<<<<< HEAD:papart-examples/calibration/PCConfiguration/testView.pde
115-
=======
116-
if(depthCameraConfig.getCameraType() == Camera.Type.REALSENSE){
117-
depthCamera = new RealSense(this, camera);
118-
}
119-
120-
}catch(CannotCreateCameraException e){
121-
println("Error cannot create the depth camera !");
122-
exit();
123-
}
124-
125-
>>>>>>> 1.1-rc:calibration/PCConfiguration/testView.pde
12696
((CameraRGBIRDepth)camera).actAsDepthCamera();
12797
// camera.setThread();
12898

calibration/PCConfiguration/ui.pde

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ PImage testCameraImg;
2020

2121
boolean useCameraCalibration;
2222

23+
24+
2325
final int RGB_FORMAT=0;
2426
final int IR_FORMAT=1;
2527
final int DEPTH_FORMAT=2;
@@ -134,6 +136,8 @@ void initCameraUI() {
134136
.addItem("FFMPEG", Camera.Type.FFMPEG.ordinal())
135137
.addItem("Processing", Camera.Type.PROCESSING.ordinal())
136138
.addItem("OpenKinect",Camera.Type.OPEN_KINECT.ordinal())
139+
.addItem("Realsense",Camera.Type.REALSENSE.ordinal())
140+
.addItem("OpenNI2",Camera.Type.OPENNI2.ordinal())
137141
.addItem("FlyCapture", Camera.Type.FLY_CAPTURE.ordinal())
138142
.activate(cameraConfig.getCameraType().ordinal())
139143
;
@@ -178,7 +182,7 @@ void initCameraUI() {
178182

179183
startCameraButton = skatolo.addButton("testCameraButton")
180184
.setPosition(611, 369)
181-
.setLabel("Test the camera")
185+
.setLabel("Test camera")
182186
.setSize(110, 20)
183187
;
184188

@@ -190,12 +194,17 @@ void initCameraUI() {
190194

191195
}
192196

197+
// Order of the buttons
193198
int getDepthType(int t){
194-
if(t == Camera.Type.OPEN_KINECT.ordinal())
199+
if(t == Camera.Type.OPENNI2.ordinal())
195200
return 0;
196-
if(t == Camera.Type.FAKE.ordinal())
201+
if(t == Camera.Type.REALSENSE.ordinal())
197202
return 1;
198-
return 1;
203+
if(t == Camera.Type.OPEN_KINECT.ordinal())
204+
return 2;
205+
if(t == Camera.Type.FAKE.ordinal())
206+
return 3;
207+
return 3;
199208
}
200209

201210
void initDepthCameraUI() {
@@ -206,6 +215,8 @@ void initDepthCameraUI() {
206215
.setPosition(50, 652)
207216
.setItemWidth(20)
208217
.setItemHeight(20)
218+
.addItem("OpenNI (Orbbec Astra)", Camera.Type.OPENNI2.ordinal())
219+
.addItem("Realsense (SR300 - F200)", Camera.Type.REALSENSE.ordinal())
209220
.addItem("OpenKinect (xbox360)", Camera.Type.OPEN_KINECT.ordinal())
210221
.addItem("No DepthCamera", Camera.Type.FAKE.ordinal())
211222
.setColorLabel(color(255))
@@ -225,7 +236,7 @@ void initDepthCameraUI() {
225236

226237
startDepthCameraButton = skatolo.addButton("testDepthCameraButton")
227238
.setPosition(611, 656)
228-
.setLabel("Test the kinect")
239+
.setLabel("Test depthcam")
229240
.setSize(110, 20)
230241
;
231242

0 commit comments

Comments
 (0)