mini camera

1.Identify camera

The development board provides 1 MIPI CSI interface (interface 2), which can realize the access of MIPI camera. The camera module is connected to the development board through a 24pin different-sided FPC cable. Note that the blue sides of the cable are inserted into the connector.

Note: It is strictly forbidden to plug and unplug the camera when the development board is not powered off, otherwise it is very easy to burn the camera module

wiring diagram:

After the installation is complete, the user can use the i2cdetect command to confirm whether the I2C address of the module can be detected normally. If it cannot be detected, the user needs to check whether the FPC cable connection is normal. When the I2C address is successfully detected, the log print is as follows:

2.Install

You can use the following command to install the C language development package of RDK X3:

After the installation is successful, the corresponding header files will be installed in the /usr/include directory, the library files will be installed in the /usr/lib directory, and the sample programs will be installed in /app/media_cdev and /app/bpu_cdev directory

Notice! ! ! If the camera cannot be found after rebooting, please execute bpu_cdev/go.sh once. This script is used to reset and start the camera

3.Preview camera video

This sample code completes opening the mipi camera to obtain video data and display it in real time through HDMI

Environmental preparation:

Connection Diagram:

Enter the command to run the code in the terminal:

expected result:

The make command completes the compilation of the program, and the ./vio2display command executes the program. After the program runs correctly, the monitor connected to the HDMI of Sunrise X3 will display the real-time images captured by the MIPI camera

Effect demo picture:

4.Fcos target detection algorithm based on mipi camera

In this example, we will implement the following content:

Environmental preparation:

Enter the following command in the terminal:

expected result:

After the program is executed, the command line will output the version information of the DNN module, the Sensor initialization information and the result output of the visual detection algorithm (target type, confidence), as shown below:

Physical renderings:

 

5.Fcos target detection algorithm based on MIPI camera (Web display)

The goal of this example:

Start the web_service service:

Before using the web display, make sure the board is in the same network segment as the personal PC, and the PC can ping the IP of the board.

Execute the following command to start the web service:

Matters needing attention:

If the following error is reported when running start_nginx.sh, it means that port 80 of tcp is already occupied.

  1. Caused by repeated execution of start_nginx.sh, this situation does not need to be dealt with
  2. There is already a httpd service running on the device, you need to find and end the process occupying port 80, execute the command lsof -i:80, get the process information and its PID occupying the port, and use kill -9 PID Just end the process

View the display effect on the web

Open a browser on your x3 pie and write your own ip address in the address bar to view the model detection results in real time.

 

Effect demo picture: