Square detection doesn't find squares

前端 未结 2 1312
我在风中等你
我在风中等你 2020-11-27 04:58

I\'m using the program squares.c available in the samples of OpenCV libraries. It works well with every image, but I really can\'t figure it out why it does

2条回答
  •  心在旅途
    2020-11-27 05:37

    I would suggest that your square in this image is too thin. The first step in squares.c is to scale the image down and back up to reduce noise before passing to the Canny edge detector.

    The scaling convolves with a 5x5 kernel, so in your case this could result in losing any gradient in such a thin edge.

    Try making your square's edges at least 5 pixels if you are going to overlay them on a continuous background.

提交回复
热议问题