This guide is for the wslg feature of windows 11.
Check for display:
1 | $ echo $DISPLAY |
if not, change it with:
1 | $ export DISPLAY=:0 |
check for X11 display socket
1 | $ ls -la /tmp/.X11-unix |
This is setup during WSL’s INIT.
If doesn’t exist, re-create it to try things out:
1 | $ sudo rm -r /tmp/.X11-unix |
Check whether X11 server is running:
1 | $ ls /tmp/.X11-unix |
What is TC?
Communication that presents specific information to a specific audience for a specific purpose
Criteria of TC:
Topics:
Requirements
Tenses
Voices
Components:
Notes:
Three different levels of formality:
Be careful when using !, it is super strong tone, meaning frustrated, very very angry.
Common traits
How to state your impact?
Name & Time:
#CV
Sections:
Process
General Rule : if not cited, you are claiming that it is your own work.
Five-consecutive-word Rule
So we need paraphrasing
Style:
Deliverables:
TC element
General Design Logic
CADC Ground Investigation Visual Solution
We want to apply computer vision to the plane to fullfill ground investigation task automatically.
The input image looks like this:
And we hope the output prediction to be 56.
(requirment.txt will be added afterwards)
Basic OpenCV methods is required.
Recommended learning site:
Source code
in detect.py
, there are two large function
1 | def detect_target(image): |
detect_target
receive image data(three channels, BGR), detect the colored targets and returns the index of them.
index:
rect
, indicating the information of the minimum bounding rectangleNote: What is Box2D type rect
?
index | description |
---|---|
rect[0] | the location of the box’s center (x,y) |
rect[1][0] | width of the box(the length of the side which will be first reached by the horizontal line when rotating counter-clockwise) |
rect[1][1] | height |
rect[2] | rotation angle |
First we need to convert the color layout from BGR to HSV, which is easier to judge color.
1 | image_hsv=cv2.cvtColor(image_cut,cv2.COLOR_BGR2HSV) |
Then define a mask that filter the color(hue) range from 160-179 or 0-10 (red),
1 | red1=np.array([0,100,100]) |
And apply the mask to the picture
1 | after_mask=cv2.add(image_cut, np.zeros(np.shape(image_cut), dtype=np.uint8), mask=mask) |
Turn the after mask image into binary image and adapt close and open processing to fill holes and cancel noise.
1 | kernel=np.ones([3,3],np.uint8) |
Then, find the contours of the processed image.
For each contour, adapt filters such as area, the ratio of the height and width of bounding rectangle.
If these restrictions are fullfilled, append the index of bounding rectangle and min area rectangle to two lists respectively, and return the lists.
1 | contours, hier=cv2.findContours(Open,cv2.RETR_EXTERNAL,cv2.CHAIN_APPROX_NONE) |
Study note for ROS subscriber.
How to realize a subscriber
Also we put this node into function package learning_topic
Create velocity_publisher.cpp
file in learning_topic/src
:
1 |
|
Note
Steps same as publisher
Add two lines to learning\_topic/CMakeLists.txt
(in build part):
1 | add_executable(velocity_publisher src/pose_subscriber.cpp) |
1 | $ cd ~/ROS_study/catkin_ws |
The output of pose_subscriber:
1 | ... |
Study note for ROS publisher.
Take turtlesim as the example.
We write a program acting like a publisher and sending controlling messages.
1 | $ cd catkin_ws/src |
can see:
1 | $ ls |
How to realize a publisher?
create velocity_publisher.cpp
file in learning_topic/src
1 |
|
What is queue length?
Steps:
Add two lines to learning\_topic/CMakeLists.txt
(in build part):
1 | add_executable(velocity_publisher src/velocity_publisher.cpp) |
1 | $ cd ~/ROS_study/catkin_ws |
Then, you can see turtle:
And outputs:
1 | ... |