UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor twlee2
Visitor
215 Views
Registered: ‎11-12-2018

Opencv Problem in SDx 2017.4

Jump to solution

I am trying to capture video using cv::VideoCapture and my code is like below

#include <opencv2/opencv.hpp>

using namespace std;

int main(int argc, char **argv) {

cv::VideoCapture zed_cap(0);
cv::Mat img;

However, when I compile the code I get the following error:

main.cpp:(.text.startup+0x54): undefined reference to `cv::VideoCapture::VideoCapture(int)'
main.cpp:(.text.startup+0xa4): undefined reference to `cv::VideoCapture::retrieve(cv::Mat&, int)'
main.cpp:(.text.startup+0xcc): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
main.cpp:(.text.startup+0xd8): undefined reference to `cv::imshow(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_InputArray const&)'
main.cpp:(.text.startup+0xf0): undefined reference to `cv::waitKey(int)'
main.cpp:(.text.startup+0xf8): undefined reference to `cv::VideoCapture::grab()'
main.cpp:(.text.startup+0x110): undefined reference to `cv::VideoCapture::~VideoCapture()'
main.cpp:(.text.startup+0x134): undefined reference to `cv::VideoCapture::~VideoCapture()'
collect2.exe: error: ld returned 1 exit status
ERROR: [SdsCompiler 83-5019] Exiting sds++ : Error when calling 'aarch64-linux-gnu-g++ H:/Xilinx/work/zed/Release/src/main.o H:/Xilinx/work/zed/Release/_sds/swstubs/portinfo.o {-LC:\Xilinx\SDK\2017.4\data\embeddedsw\ThirdParty\opencv\aarch64\lib} -lopencv_core -lopencv_imgproc -L C:/Xilinx/SDx/2017.4/target/aarch64-linux/lib -LH:/Xilinx/work/zed/Release/_sds/swstubs -Wl,--start-group -Wl,--end-group -Wl,--start-group -lpthread -lsds_lib -lxlnk_stub -Wl,--end-group -o H:/Xilinx/work/zed/Release/_sds/swstubs/zed.elf'
sds++ log file saved as H:/Xilinx/work/zed/Release/_sds/reports/sds.log
ERROR: [SdsCompiler 83-5004] Build failed

I set the libraries as following:

Libraries (-l)

opencv_core

opencv_imgproc

Library search path (-L)

"C:\Xilinx\SDK\2017.4\data\embeddedsw\ThirdParty\opencv\aarch64\lib"

It seems a linking problem but I am not sure how to solve this.

Please advise!

Thank you in advance. 

 

0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
106 Views
Registered: ‎08-20-2018

Re: Opencv Problem in SDx 2017.4

Jump to solution

Hi @twlee2

Please check xfopencv once.

https://github.com/Xilinx/xfopencv

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
3 Replies
Xilinx Employee
Xilinx Employee
142 Views
Registered: ‎08-20-2018

Re: Opencv Problem in SDx 2017.4

Jump to solution

Hi @twlee2

Please refer below forum post

https://forums.xilinx.com/t5/SDSoC-Environment-and-reVISION/ZCU104-video-capture-with-opencv-library-issue/td-p/891127

 

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
Visitor twlee2
Visitor
123 Views
Registered: ‎11-12-2018

Re: Opencv Problem in SDx 2017.4

Jump to solution

 

Thank you for your response.

I checked that message but I am still not sure in windows what is correct library search path.

Is "C:\Xilinx\SDK\2017.4\data\embeddedsw\ThirdParty\opencv\aarch64\lib" this a right library search path?

Obviously this doesn't work for me in windows.

Please advise!

0 Kudos
Xilinx Employee
Xilinx Employee
107 Views
Registered: ‎08-20-2018

Re: Opencv Problem in SDx 2017.4

Jump to solution

Hi @twlee2

Please check xfopencv once.

https://github.com/Xilinx/xfopencv

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos