Search code examples
iosswiftrectanglesdetect

rectangle detection only detecting large rectangles not smaller ones? iOS, Swift


I am using vision to detect rectangles but it only seems to be detecting larger rectangles that are more square than rectangle. Is there a way to detect longer rectangles?


Solution

  • You have to adjust the minimumAspectRatio of the VNDetectRectanglesRequest which is 0.5 per default. The green rectangle seems to have a much lower one.