Line Tracking Example
HUSKYLENS 2 line tracking reads route length, angle and XY data, like a smart ruler following a drawn road, and reports branches, nearest line features and total line count for code control
1.Line Tracking
Before You Start:
1.1 Line Tracking Output Data
Under the Line Tracking function, HUSKYLENS 2 can mark the route’s path in the image and obtain the current route’s length, angle, and X/Y components. When the route has branches, it can acquire the number of branches and the corresponding data of each branch in the counterclockwise direction.
The sample program is as follows.
Result:As shown in the figure, aim the HUSKYLENS camera on a map with a route. The serial monitor will output the current route’s length, angle, and other data. When multiple branches exist, the number of branches will be output.Read:Line Tracking.
1.2 Line Tracking Blocks Description
| block | description |
|---|---|
|
Used to obtain one set of Line Tracking data under the Line Tracking function of HUSKYLENS 2. |
|
Determines whether lines exist in the current frame. |
|
Obtains data for the line closest to the crosshair, including X component,Y component,angle,length. |
|
Gets the total number of detected lines on the screen. |
|
When multiple lines appear, obtaining the data of a specified body. |
Was this article helpful?
