Jump to content
  • 0

OpenCV and Pcam5-c


Esti.A

Question

Hi everyone,

I am working in teh demo that was created by Digilent to get images from teh Pcam5-c that is connected by a MIPI CSI-2 interface to teh zybo z7-020 board. In this case, I was wondering if I decide to do the processing of the image (edge detection, enhancement of light,...) I would need to use SDx. I have seen that there are plenty of solutions in OpenCv but I dont know how the hardware proyect and the SDx project can be linked. Note, in this initial design I have teh initiallization od teh camara and platform in a C++ application file that I dont know how if I should export to sdx file and how does this interact with the platform.

Anothr queation I have is that for interacting with the openCv set-up do I must use Linux ?

Kind regards

Esti

 

Link to comment
Share on other sites

Recommended Posts

23 hours ago, Esti.A said:

Hi @jpeyron,

My question is how sdx is helping me to create a proyect managing all the libraries of Open CV, because as far as I know I could use OpenCv without xfopenCv whic is integrated in SDx. Another thing that is not clear is how should the set-up done to get a connection with teh actual PCam and OpenCV.

 

Thanks

 

Esti

 

 

Hi @Esti.A,

SDx, which includes SDSoC (Software Defined System on Chip), is a development environment that allows you to develop a computer vision application, in your case, using C/C++ and OpenCV library. The target of SDx-built applications are Xilinx systems on chip (SoC) (Zynq-7000 or Zynq Ultrascale+). Xilinx SoC architecture has two main components: ARM processor (single or multi core) named Processing System (PS) and FPGA, named Programmable Logic (PL). Using SDx to build an application for SoC allows you to choose which functions from your algorithm are executed in PS and which ones are executed in PL. SDx will generate all data movers and dependencies that you need to move data between PS, DDR memory and PL. The PL is suitable for operations that can be easily executed in parallel. So if you are going to choose a median filter function to be executed in PL, instead of PS, you will obtain a better throughput from your system.

As you said, you can use OpenCV to develop your application. You have to take into account that OpenCV library was developed with CPU architecture in mind. So the library was designed to obtain the best performance on some specific CPU architectures (x86-64, ARM, etc.). If you are trying to accelerate an OpenCV function in PL using SDx you will obtain a poor performance. To overcome this issue, Xilinx has developed xfopencv, which is a subset if OpenCV library functions. The functionalities of xfopecv functions and OpenCV functions  are the same but the xfopencv functions are implemented having FPGA architecture in mind. xfopencv was developed in C/C++ following some coding guideline. When you are building a project, the C/C++ code is given as input to Xilinx HLS (High Level Synthesis) tool that will convert it to HDL (Hardware Description Language) that will be synthetized for FPGA. The above mentioned coding guideline provides information about how to write C/C++ code that will be implemented efficiently in FPGA. To have a better understanding on xfopencv consult this documentation.

So SDx helps you to obtain a better performance by offloading PS and by taking advantage of parallel execution capabilities of PL. Have a look on SDSoC documentation. For more details check this.

An SoC is a complex system composed by a Zynq (ARM + FPGA), DDR memory and many types of peripherals. Above those,  one can run a Linux distribution (usually Petalinux, from Xilinx) and above the Linux distribution, the user application will run. The user application may access the DDR memory and different types of peripherals (PCam in your case). Also, it may accelerate some functions in FPGA to obtain a better performance. To simplify the development pipeline Xilinx provides an abstract way to interact with, named SDSoC platform. SDSoC platform has two components: Software Component and Hardware Component that describes the system from the hardware to the operating system. Your application will interact with this platform. You are not supposed to know all details about this platform. This was the idea, to abstract things. Usually, the SDSoC platforms are provided by the SoC development boards providers, like Digilent.

All you have to do is to download the last SDSoC platform release from github. You have to use SDx 2017.4. You don't have to build your own SDSoC platform. This is a complex task. You can follow these steps in order to build your first project that will use PCam and Zybo Z7 board. The interaction between PCam and the user application is done in the following way: there is an IP in FPGA that acquires live video stream from the camera, the video stream is written into DDR memory. This pipeline is abstracted by the SDSoC platform. The user application can access the video frames by Video4Linux (V4L2). The Live I/O for PCam demo shows you how to do this.

I suggest you to read the proposed documentation to obtain a basic knowledge needed for SDSoC projects development.

Best regards,

Bogdan D.

Link to comment
Share on other sites

Hi @jpeyron,

My question is how sdx is helping me to create a proyect managing all the libraries of Open CV, because as far as I know I could use OpenCv without xfopenCv whic is integrated in SDx. Another thing that is not clear is how should the set-up done to get a connection with teh actual PCam and OpenCV.

 

Thanks

 

Esti

 

 

Link to comment
Share on other sites

Hi @Esti.A,

I would suggest using the version of Vivado/SDK/Petalinux that the project was made in and for. If you are typing to update an existing project to an newer version there are alot of potential issues that could occur. We do not have a tutorial on how to do this. I would suggest looking through the xilinx petalinux documentation like the petalinux wiki. Here is a forum thread that might be helpful as well.

best regards,

Jon

Link to comment
Share on other sites

Hi @jpeyron,

And consequently the SDx version should match with the petalinux version. So how I am supossed to build projects in other vivado versions? cause I am getting quite a lot of error to configure the petalinux project.  Can this be due to the bsp file definition?

As I have read, I have to create a hdf file and try to match it withe the created project, so what is not making sense?

Thanks

Esti

 

Screenshot from 2019-04-05 15-56-20.png

Link to comment
Share on other sites

Thank you @jpeyron for your quick answer. I see that I should install linux to work with these softwares as most of them are only suported by Linux. Another thing I dont understand is if I can use Vivado 2018.2 for the hardware design but a SDx 2017.4 for the same proyect or not.

Thank you very much

Esti

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...