Skip to content

Commit 05bfdea

Browse files
committed
New example for realsense
1 parent b4bb98e commit 05bfdea

File tree

3 files changed

+34
-353
lines changed

3 files changed

+34
-353
lines changed

doc/tutorials/app/intelperc.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,5 @@ there are two flags that should be used to set/get property of the needed genera
8181
flag value is assumed by default if neither of the two possible values of the property is set.
8282

8383
For more information please refer to the example of usage
84-
[videocapture_intelperc.cpp](https://github.com/opencv/opencv/tree/master/samples/cpp/videocapture_intelperc.cpp)
84+
[videocapture_realsense.cpp](https://github.com/opencv/opencv/tree/master/samples/cpp/videocapture_realsense.cpp)
8585
in opencv/samples/cpp folder.

samples/cpp/videocapture_intelperc.cpp

Lines changed: 0 additions & 352 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#include "opencv2/videoio.hpp"
2+
#include "opencv2/highgui.hpp"
3+
#include "opencv2/imgproc.hpp"
4+
5+
using namespace cv;
6+
using namespace std;
7+
8+
int main()
9+
{
10+
VideoCapture capture(CAP_INTELPERC);
11+
for(;;)
12+
{
13+
Mat depthMap;
14+
Mat image;
15+
Mat irImage;
16+
Mat adjMap;
17+
18+
capture.grab();
19+
capture.retrieve(depthMap,CAP_INTELPERC_DEPTH_MAP);
20+
capture.retrieve(image,CAP_INTELPERC_IMAGE);
21+
capture.retrieve(irImage,CAP_INTELPERC_IR_MAP);
22+
23+
normalize(depthMap, adjMap, 0, 255, NORM_MINMAX, CV_8UC1);
24+
applyColorMap(adjMap, adjMap, COLORMAP_JET);
25+
26+
imshow("RGB", image);
27+
imshow("IR", irImage);
28+
imshow("DEPTH", adjMap);
29+
if( waitKey( 30 ) >= 0 )
30+
break;
31+
}
32+
return 0;
33+
}

0 commit comments

Comments
 (0)