3.Grown Lettice Detection - Grzegorr/ROS-Thorvald-Robot GitHub Wiki

Introduction:

Grown Lettice is detected by computing two masks - one to capture all plants and other which captures a fair bit of lettice an no weeds. The lettice mask then receives a treatment with morphological operations to ensure the whole lettice is covered. The lettice mask is then remocved from the other mask to give final output.

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:

The algorithm starts with blurring the received image and applying a blur with 5x5 kernel. then, two masks are computed - one to capture all plants on the frame, and other which captures a fair bit of crops, while removing all weeds. The crop masks has wholes in the crops detected which are patched using dilate operation. Erosion is also applied in between dilates to deal with noise. Then using bitwise operations areas containing crops on the all plants are removed to leave out only the weeds.

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