Missing Function in OpenCV4Tegra?

001

I’m building code with Jetson TK1 and ZED Camera.

I’m using OpenCV for vision based object tracking.

in windows, I can find OpenCV library files in programfiles\zed\dependencies folder.

but now I feel confused about where I can found library files.

I found it on usr/include/opencv2/

is it correct?
(it is not important question though…)

002

it is important question…

when I compile code in windows it work very well

I can use

‘connectedComponentsWithStats’ Function and

‘CAP_PROP_FRAME_HEIGHT’

‘CAP_PROP_FPS’

‘CAP_PROP_WIDTH’

‘CC_STAT_AREA’

‘CC_STAT_HEIGHT’

in imgproc.hpp

but I can’t use this functions and variables in Jetson TK1

when I compile same code with window I met this error :

/home/ubuntu/WebcamLabelingOpenCV/src/main.cpp: In function ‘int main()’:
/home/ubuntu/WebcamLabelingOpenCV/src/main.cpp:55:13: error: ‘CAP_PROP_FRAME_WIDTH’ was not declared in this scope
cap.set(CAP_PROP_FRAME_WIDTH,320);
^
/home/ubuntu/WebcamLabelingOpenCV/src/main.cpp:56:13: error: ‘CAP_PROP_FRAME_HEIGHT’ was not declared in this scope
cap.set(CAP_PROP_FRAME_HEIGHT,240);
^
/home/ubuntu/WebcamLabelingOpenCV/src/main.cpp:104:27: error: ‘CAP_PROP_FPS’ was not declared in this scope
int fps = cap.get(CAP_PROP_FPS);
^
/home/ubuntu/WebcamLabelingOpenCV/src/main.cpp:146:79: error: ‘connectedComponentsWithStats’ was not declared in this scope
stats, centroids, 8,CV_32S);
^
/home/ubuntu/WebcamLabelingOpenCV/src/main.cpp:152:45: error: ‘CC_STAT_AREA’ was not declared in this scope
int area = stats.at(j, CC_STAT_AREA);
^
/home/ubuntu/WebcamLabelingOpenCV/src/main.cpp:161:43: error: ‘CC_STAT_LEFT’ was not declared in this scope
int left = stats.at(idx, CC_STAT_LEFT);
^
/home/ubuntu/WebcamLabelingOpenCV/src/main.cpp:162:43: error: ‘CC_STAT_TOP’ was not declared in this scope
int top = stats.at(idx, CC_STAT_TOP);
^
/home/ubuntu/WebcamLabelingOpenCV/src/main.cpp:163:44: error: ‘CC_STAT_WIDTH’ was not declared in this scope
int width = stats.at(idx, CC_STAT_WIDTH);
^
/home/ubuntu/WebcamLabelingOpenCV/src/main.cpp:164:46: error: ‘CC_STAT_HEIGHT’ was not declared in this scope
int height = stats.at(idx, CC_STAT_HEIGHT);
^
make[2]: *** [CMakeFiles/ZED_with_OpenCV.dir/src/main.o] Error 1
make[1]: *** [CMakeFiles/ZED_with_OpenCV.dir/all] Error 2
make: *** [all] Error 2

How Can I solve this problem?

I searched usr/include/opencv2/imgproc/imgproc.hpp and there were no such a variables and functions…

I just followed this instruction to install opencv.

https://www.stereolabs.com/documentation/overview/getting-started/application-development.html

is the cause of problem?

I didnt install OpenCV4Tegra directly

and just installed Jetpack.

and zed SDK

Sorry, it turns out that the cause was version’s difference of OpenCV4Tegra and OpenCV3.0

“connectedComponentsWithStats” this function is for OpenCV 3.0 and OpenCV4Tegra is OpenCV 2.4

So it didnt matched and there was error message.

I wonder OpenCV 3.0 in Jetson TK1 board is much worse than OpenCV4Tegra…

is OpenCV 3.0 in Jetson TK1 board able to use GPU?

or just use CPU? I wonder…

Hi Dodeca,

We don’t own Opencv3.0, but there is a guide for building opencv2.4.9 on TK1.

http://elinux.org/Jetson/Installing_OpenCV

Do you enable CUDA when build opencv3.0?