2.Young Lettuce Detection - Grzegorr/ROS-Thorvald-Robot GitHub Wiki

Introduction:

The underlying principle for this detection algorithm is to produce two masks. One capturing everything green and another capturing only the crop. To get a final output the crop mask is subtracted from mask capturing all green areas.

Nodes:

This feature is contained in a "weed_detection" node, which is contained in "weedDetection.py" script in package ROS. NOTICE: it will be run only when this specific camera mode is chosen, and only on the capture of a new frame.

Topics Subscribed:

/thorvald_001/kinect2_camera/hd/image_color_rect - topic to get a picture from a camera from
/camera_mode - the topic which features information from a path controller and determines which detection algorithm will be used.

Topics Published on:

NONE - it passes a mask of where it believes to see weeds to single map generation feature inside the same node.

Description of Working Principles:

Detection starts with bluring the image with 5x5 kernel and changing the input picture to hsv color space. Then two masks are computed: one for all plants on the screen and the other only for the crop. H and S channels are used for it. Nxt the cabbage mask is dilated to form some safe space for the crops. Then masks are combined with bitwise operation to form a mask showing weeds only. This is then eroded and diluted to get rid of noise.

How to run:

There are two ways to run this node. One is to use a "FullLaunch.launch" file in package "ROS", which starts the whole system. Otherwise, "BasicLaunch.launch" can be used and the "weed_detection" node by running a "weedDetection.py" script from package "myOpenCV"

Known Issues:

Some blobs are not detected