Welcome to AI View Depth camera repository
5.Pixel Operation
OpenCV pixel operations
For pixel operations, we can change any position to a new pixel color. Here we first read the image, and then assign an area to white.
Start Docker
After entering the Raspberry Pi 5 desktop, open a terminal and run the following command to start the container corresponding to Dofbot:
xxxxxxxxxx./Docker_Ros.sh
Access Jupyter Lab within Docker:
xxxxxxxxxxIP:9999 // Example: 192.168.1.11:9999
Code path:
/root/Dofbot/4.opencv/1.OpenCV_basic/04_pixel_pic.ipynb
The main code is as follows:
ximport cv2
img = cv2.imread('yahboom.jpg',1)(b,g,r) = img[100,100]print(b,g,r)# bgr#10 100 --- 110 100i=j=0for j in range(1,500): img[i,j] = (255,255,255) &nb