Basic collision avoidance system using a Canny filter
Hello,
I have developed a very basic yet effective collision avoidance system using contour detection (a Canny filter) and determining free and occupied space in a binary way processing frames retrieved from a monocular camera.
Frames are first de-noised with a Gaussian filter and a subsequent erode/dilate to smooth the background reflections.
The outcome is a frame where the white areas represent free space and the black ones obstacles, colouring the frame in black once the first obstacle contour is detected.
Now I need to find the highest white point cluster and determine its relative position in the frame, as I mapped 10px=1° of relative heading.
However, I would like to exclude the noise-related extremely small peaks, less than a few pixels in width, so that the robot will choose a suitable course to steer.
Do you have any idea on how to do it?
Thanks
A few images to clarify
This is the frame, specifically depicting the two legs of a table. The robot will turn right or proceed in the between if it fits.
Here the example of a peak to be disregarded as due to noise
Not clear, are you using camera input or some sensor? Do you need to remove noise from normal 2D picture, or that narrow peaks from the presented examples?
I explained a bit more. It's a monocular camera, the peaks are actually non-removable so the algorithm computing the highest point should simply disregard them.
If you want to remove small granular noise from the picture, the standard approach is to downsample the image, then upsample back. One moment... I will find an example.
I have found the example, but looks like you already do de-noising. Then, where that peaks come from? Explain better how you create these images from the initial frames.
wouldn't it be easier to simply cluster white areas and skip those whose width is less than say 5px?