yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
Transbot SE📖
01.Introduction to Transbot SE
  • 01. Introduction to Transbot SE
  • 02. Precautions for use and battery safety
  • 03. First Trial
02.First Trial
  • 2.1.APP control
  • 2.2.USB wireless handle control(Optional)
  • 2.3.Handle video control Transbot(Optional)
  • 2.4.Network configuration tutorial in hotspot mode
03.Hardware control course
  • 3.1About expansion board and update firmware
  • 3.2.Close self-starting process
  • 3.3.Install Transbot library
  • 3.4.Control buzzer and button
  • 3.5.Control PWM servo
  • 3.6.Control bus servo
  • 3.7.Control motor
  • 3.8.Control robot movement
04.Linux operating system
  • 1. Virtual machine installation and use
  • 2. Linux basics
  • 3. Remote control
  • 4. Multi-machine communication configuration
  • 5. Static IP and hotspot mode
  • 6. Web page real-time monitoring
  • 7. Expansion tutorial
  • 8. Write system images
05.Docker couse(For Pi5)
  • 1.Docker overview and docker installation
  • 2.Common commands for docker image containers
  • 3.Docker images deeply understand and publish images
  • 4.Docker hardware interaction and data processing
  • 5.Start the transbot se container
06.ROS basic course
  • 1.ROS introduction
  • 2.Project file structure
  • 3.Common commands and tools
  • 4.Publisher
  • 5.Subscribers
  • 6.Customize topic messages and use
  • 7.Client
  • 8.Server
  • 9.Custom service messages and usage
  • 10.TF release and monitoring
07.OpenCV courses
  • 1. Getting started with Open Source CV
  • 2. Open Source CV geometric transformation
  • 3. Open Source CV image processing and drawing text line segments
  • 4. Open Source CV image beautification
  • 5. Opencv application
  • 6. AR vision
  • 7. AR QR code
  • 8. ROS+Opencv foundation
  • 9. ROS+Opencv application
  • 10. MediaPipe development
08.ROS robot course
  • 1.PID algorithm
  • 2.Basic communication
  • 3.Keyboard control
  • 4.Handle control(Optional)
  • 5.Robot state estimation
  • 6.Data calibration
09.ROS simple camera course
  • 1.HD camera calibration
  • 2.HD camera color tracking
  • 3.HD camera color tracking (robotic arm)
  • 4.HD camera object tracking
  • 5. KCF target tracking
  • 6.HD camera face tracking
  • 7.HD camera robotic arm carrying
  • 8.HD camera Autopilot
10.ROS robotic arm control tutorial
  • 1.MoveIt configuration
  • 2.MoveIt control the real machine
  • 3.MoveIt moves randomly
  • 4.MoveIt kinematics design
  • 5.MoveIt cartesian path
  • 6.MoveIt avoiding
  • 7.MoveIt scene design
  • 8.MoveIt trajectory planning
  • 9.Mediapipe palm control car
  • 10.Mediapipe gesture control robotic arm
  • 11.Mediapipe gesture control car
  • 12.Mediapipe arm attitude control robotic arm
11.ROS multi-robot control(Optional)
  • 1. Multi-robot control(Optional)
  • 2. Multi-robot queue performance(Optional)
  • 3. Multi-robot robot arm dancing(Optional)
12.Deep learning courses
  • 1.KNN recognizes handwritten digits
  • 2.Basic use of TensorFlow
  • 3.Basic use of PyTorch(jetson)
  • 4.yolov5 model training(jetson)
  • 5.yolov5+tensorrt acceleration(jetson)
  • 6.yolov4-tiny
13.Installation Video
  • Part18
  • Part1-6
  • Part7-12
  • Part13.1-13.3.3
  • Part13.4.1-17
14.FAQnew
  • 1.Using your own Jetson board,Transbot-SE cannot start normally
Download
  • APP(iOS/Android)
  • System_File-Pi5
  • System_File-Pi4
  • System_File-Jetson
  • VM_File
  • Appendix
  • Code
  • InstructionManual
  • Jetson_Boot_USB.tar.gz
  • Hardware_Info
Download ZIP

Welcome to Transbot SE repository

1. Getting started with Open Source CV

1.Getting started with Open Source CV

1.Getting started with Open Source CV1.1, Introduction to OpenCV1.2. OpenCV image reading and display1.2.1. Reading of images:1.2.2. Image display1.2.3. Code and actual effect display1. 3. OpenCV image writing1.3.1. Function method: cv2.imwrite('new_img_name', img)1.3.2. Code and actual effect display1.4. OpenCV camera reading and displaying video1.4.1. Camera reading1.4.2. Display camera video1.4.3. Code and actual effect display1.5. OpenCV pixel operation1.5.1. Pixel operation, we can change any position to a new pixel color.1.5.2. Code and actual effect display

1.1, Introduction to OpenCV

image-20220217202241894

What is OpenCV? Its full name is Open source Computer Vision Library, an open source computer vision library. As shown in the picture above, what we see is the OpenCV logo. We can see three small circles made of distinct R, G, and B colors. Composition, that is to say, it is a set of open source API function libraries about computer vision. This also means,

(1) Whether it is scientific research or commercial application, it can be used for development;

(2) The source code of all API functions is public, and you can see the program steps of its internal implementation;

(3) You can modify the source code of OpenCV and compile and generate the specific API functions you need.

Image processing on ROSMASTER uses certain functions of the OpenCV function library, or it can be said that it is inseparable from most image processing design fields. It has been used in intrusion detection and specific target tracking many years ago. , target detection, face detection, face recognition, face tracking and other fields, OpenCV can be said to show its talents, and these are just the tip of the iceberg of its applications. Now that we realize that OpenCV is so universal, in this chapter we will introduce you to some very basic image processing functions that we use in our courses, as well as some universal functions. Here we first have a general understanding of this knowledge. After a while, there are two practical projects in the back to teach you how to get started, including color recognition and tracking, and face recognition and tracking. However, the powerful application functions provided by OpenCV are far more than this. If you are interested in the development of Opencv computer vision library and want to go deeper. If you know more about it, here are several websites for your reference and study:

OpenCV official homepage: https://www.opencv.org

OpenCV Chinese Forum: http://www.opencv.org.cn

OpenCV CSDN Forum: https://bbs.csdn.net/forums/OpenCV

1.2. OpenCV image reading and display

1.2.1. Reading of images:

img = cv2.imread('yahboom.jpg', 0) The first parameter is the path of the image, and the second parameter is how to read the image.

cv2.IMREAD_UNCHANGED: Keep the original format unchanged, -1;

cv2.IMREAD_GRAYSCALE: Read the image in grayscale mode, which can be represented by 0;

cv2.IMREAD_COLOR:, read a color picture, which can be represented by 1; default value

cv2.IMREAD_UNCHANGED: Read in an image and include its alpha channel, which can be represented by 2.

1.2.2. Image display

cv.imshow('frame', frame): Open a window named frame and display frame data (image/video data)

Parameter meaning:

The first parameter represents the name of the window that is created and opened.

The second parameter represents the image to be displayed

1.2.3. Code and actual effect display

Run program

jetson motherboard/Raspberry Pi 4B

cd ~/transbot_ws/src/transbot_visual/opencv
python 1_1.py

Raspberry Pi 5

Before running, please confirm that the large program has been permanently closed

Enter docker

Note: If there is a terminal that automatically starts docker, or there is a docker terminal that has been opened, you can directly enter the docker terminal to run the command, and there is no need to manually start docker

Start docker manually

xxxxxxxxxx
./run_docker.sh

Run program

xxxxxxxxxx
cd ~/transbot_ws/src/transbot_visual/opencv
python 1_1.py
​x
import cv2 as cv

if __name__ == '__main__':
img = cv.imread('yahboom.jpg')
while True :
cv.imshow("frame",img)
action = cv.waitKey(10) & 0xFF
if action == ord('q') or action == 113:
break
img.release()
cv.destroyAllWindows()

image-20220211155455979

1. 3. OpenCV image writing

1.3.1. Function method: cv2.imwrite('new_img_name', img)

Parameter meaning:

The first parameter is the saved file name

The second parameter is the saved image

1.3.2. Code and actual effect display

jetson motherboard/Raspberry Pi 4B

xxxxxxxxxx
cd ~/transbot_ws/src/transbot_visual/opencv
python 1_2.py

Raspberry Pi 5

Before running, please confirm that the large program has been permanently closed

Enter docker

Note: If you have a terminal that automatically starts docker, you can directly enter the docker terminal to run the command, and there is no need to manually start docker

Start docker manually

xxxxxxxxxx
./run_docker.sh

Run program

xxxxxxxxxx
cd ~/transbot_ws/src/transbot_visual/opencv
python 1_2.py
xxxxxxxxxx
import cv2 as cv

if __name__ == '__main__':
img = cv.imread('yahboom.jpg')
cv.imwrite("yahboom_new.jpg",img) #Create a new file yahboom_new.jpg and write yahboom.jpg into it
new_img = cv.imread('yahboom_new.jpg') #Read the newly written picture
while True :
cv.imshow("frame",img)
cv.imshow("new_frame",new_img)
action = cv.waitKey(10) & 0xFF
if action == ord('q') or action == 113:
break
img.release()
cv.destroyAllWindows()

image-20220211160650131

1.4. OpenCV camera reading and displaying video

1.4.1. Camera reading

capture=cv.VideoCapture(0)

Parameter meaning:

The parameter in VideoCapture() is 0, which means opening the laptop's built-in camera. If the parameter is the video file path, the video will be opened, such as cap = cv2.VideoCapture("../test.avi")

1.4.2. Display camera video

ret,img = frame.read()

Return value meaning:

ret: ret is a bool value to determine whether the correct frame is read back

img: image data of each frame

1.4.3. Code and actual effect display

jetson motherboard/Raspberry Pi 4B

xxxxxxxxxx
cd ~/transbot_ws/src/transbot_visual/opencv
python 1_3.py

Raspberry Pi 5

Before running, please confirm that the large program has been permanently closed

Enter docker

Note: If you have a terminal that automatically starts docker, you can directly enter the docker terminal to run the command, and there is no need to manually start docker

Start docker manually

xxxxxxxxxx
./run_docker.sh

Run program

xxxxxxxxxx
cd ~/transbot_ws/src/transbot_visual/opencv
python 1_3.py
xxxxxxxxxx
import cv2 as cv
if __name__ == '__main__':
frame = cv.VideoCapture(0)
     while frame.isOpened():
ret,img = frame.read()
         cv.imshow('frame',img)
         action = cv.waitKey(10) & 0xFF
if action == ord('q') or action == 113:
break
frame.release()
cv.destroyAllWindows()

Screenshot from 2022-02-09 14-38-31

1.5. OpenCV pixel operation

1.5.1. Pixel operation, we can change any position to a new pixel color.

First, we need to read the image, then modify the value of bgr and assign an area to black.

1.5.2. Code and actual effect display

jetson motherboard/Raspberry Pi 4B

xxxxxxxxxx
cd ~/transbot_ws/src/transbot_visual/opencv
python 1_4.py

Raspberry Pi 5

Before running, please confirm that the large program has been permanently closed

Enter docker

Note: If you have a terminal that automatically starts docker, you can directly enter the docker terminal to run the command, and there is no need to manually start docker

Start docker manually

xxxxxxxxxx
./run_docker.sh

Run program

xxxxxxxxxx
cd ~/transbot_ws/src/transbot_visual/opencv
python 1_4.py
xxxxxxxxxx
import cv2
if __name__ == '__main__':
img = cv2.imread('yahboom.jpg')
(b,g,r) = img[100,100]
print(b,g,r)
i=j=0
for j in range(1,255):
img[i,j] = (0,0,0)
for j in range(1,255):
img[i,j] = (0,0,0)
while True :
cv2.imshow("frame",img)
action = cv2.waitKey(10) & 0xFF
if action == ord('q') or action == 113:
break
img.release()
cv2.destroyAllWindows()

image-20220211163651407

The red box part is the modified pigment value.

TF release and monitoring
Open Source CV geometric transformation

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文