This week I improved my CVÂ target detection code and helped the group with more drop tests and some integration tasks. For integration we finally combined the propulsion system inside the housing with the PWM generation code that Daniel prepared and the CV code that I worked on. Daniel and I built an apparatus, pictured in the team report, to hang the device from for our demo. I uploaded my code to the Raspberry Pi, and adjusted it to the new camera. The fish eye lens was different from that of my laptop camera so I had to reduce the perfectness parameter and increase the maximum radius from 30 to 50 pixels to make it visible at the distance fit for our use case.
The earlier part of the week I spent making my CV more robust. I did a number of things to address problems like false circles and misattribution of the target. These changes have made the algorithm more robust, and affected the latency minimally. We measured about 6fps before and 5fps after.
- I performed HoughCircles on a thresholded image instead of the original grayscale image. This means the image was changed to binary, with pixel values above a certain value turned to 255, and the rest to 0. Our target is black against white, so circles where the gradient is less will not be present in the thresholded image.
- When the circle is lost, most likely due to motion blur, the last known location of the target is stored.
- When there are multiple circles, we choose the one whose center is the least Euclidean distance from where the target was last found.