Detecting edges of a card with rounded corners

前端 未结 4 520
不思量自难忘°
不思量自难忘° 2020-12-24 09:06

Hi currently i am working on an OCR reading app where i have successfully able to capture the card image by using AVFoundation framework.

For next step, i need to fi

4条回答
  •  庸人自扰
    2020-12-24 09:39

    instead of "pure" rectangular blobs, try to go for nearly rectangular ones.

    1- gaussian blur

    2- grayscale and canny edge detection

    3- extract all blobs (contours) in your image and filter out small ones. you will use findcontours and contourarea functions for that purpose.

    4- using moments, filter out non-rectangular ones. First you need to check out moments of rectangle-like objects. You can do it by yourself or google it. Then list those moments and find similarity between objects, create your filter as such.

    Ex: After test, say you found out central moment m30's are similar for rectangle-like objects -> filter out objects having inaccurate m30.

提交回复
热议问题