1. Introduction to OpenCV

Before running the sample program, you need to switch to the directory where the code is located.

After SSH connects the car, it runs at the terminal.

1.1. Image loading and saving

After the car terminal switches to the directory where the code is located, run the program.

When run, the program reads the figures/yahboom.jpg image and saves the read image as figures/1_1.jpg.

SSH to the car in VSCode, access path.

You can view the read image yahboom.jpg and the saved image 1_1.jpg:

1684999768676

Note: opencv also has an important function cv.imshow(), which is used for image display. Since the car system has no graphical interface can not use this function to show, so here is not introduced, and will not be used later.

1.2. Camera reading and displaying

Note: This step applies to cars equipped with depth cameras.

After the car terminal switches to the directory where the code is located, run the program.

After running, the program reads a frame of camera image data and saves the read frame to figures/1_2.jpg.

1685001319891

1.3. Reading and Modifying pixels

After the car terminal switches to the directory where the code is located, run the program.

The terminal outputs the pixel value at the position of coordinates (100, 100).

1685002015448

After saving, some pixels in the upper left corner of the image are changed to black.

1685001980683