image processing - how can I make a rectangle on a cluster of tiny edges after opencv's canny detection? -


I am new and dip, currently I need to find a rectangular area with a low quality picture, in which only rectangular areas Page of - Land.

I have used detector detector to achieve many small edges, which makes several rectangular areas, and some different noise-like edges

So experts, how is this mid-output image to find out the meaning of this meaningful rectangle?

Thanks a lot!

The first thing to do is to leave any edges that are not related to the rectangle The best case is that if your rectangle is oriented in the same direction as the camera. In that case, abandon any side not north-south or east-west, if the rectangles have all the same orientation, but there is no camera, then the effective direction module 9 degrees, and discard any outer edges. The worst case scenario occurs when the rectangles have different tilt. In that case, you can still see the close clusters of the cluster in the cluster: for each edge, there should be at least one parallel and two orthogonal edges. Leave any incomparable edge ( assumes that you feel the edges are more than a few pixels, it is difficult to reduce the angle of the lower edges. )

After finishing the fake edges with the guidelines, the next step is to see if you can connect them or not. You should still group them from angle from the previous step. Now assume that coalitioned edges are related to the same rectangle, and replace them with a long edge, this coalition can be the reason for counterfeit edges between rectangles. This is probably not a big problem, but if it is, then correct it with a verification step at the end.

It is possible that you will not work well near the corner corners, because the real direction suddenly changes direction. Therefore, which edges should be extended to you, which you get from a few pixels.

The extended edges will now create a whole bunch of crossings. Again, take advantage of the fact that you have ordered your edges from the direction. Just check crossing the approximate orthogonal edges. If you find them, then create a "crossing object" and add it to two edges. They are the floating corners.

Once you do this, look at the edges that are at least 2 crossings and see if you can match them. Depending on the quality of your data, you might want to decide that you got rectangle in 3 or 4 corners. If you get a lot of crossings on one side, then maybe you are connected to the edges of two aligned rectangles. This can be particularly difficult if you have rectangular rectangles on both sides:

  _ _ | _ | _ |  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -