Android OpenCV Find Largest Square or Rectangle

后端 未结 3 886
盖世英雄少女心
盖世英雄少女心 2020-12-02 16:14

This might have been answered but I desperately need an answer for this. I want to find the largest square or rectangle in an image using OpenCV in Android. All of the solut

3条回答
  •  悲哀的现实
    2020-12-02 16:40

    There are some related questions here in SO. Check them out:

    • OpenCV C++/Obj-C: Detecting a sheet of paper / Square Detection

    • How do I recognize squares in this image?

    There is also an example shipped with OpenCV:

    • https://code.ros.org/trac/opencv/browser/trunk/opencv/samples/cpp/squares.cpp?rev=4079

    Once you have the rectangle, you can align the picture by computing the homography with the rectangle corners and applying a perspective transform.

提交回复
热议问题