I am using the vision framework to detect rectangles off a live feed then drawing a border and coloring the inside of the rectangle. In doing so the rectangle I draw comes and goes with every new detection causing a jarring flicker. How can I mitigate/remove this visual hick up ?
I am following this project https://github.com/Tratt0re/AutoCropBox_Medium
but changed the recognition specifications in the controller-
detectRectangle method to the following:
request.maximumObservations = 10
request.minimumAspectRatio = 0.3
request.maximumAspectRatio = 0.8
request.minimumSize = 0.5
request.quadratureTolerance = 20.0
request.minimumConfidence = 0.2