Automatic face detection using Picasa API to extract individual images

前端 未结 7 1197
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-13 01:15

(A similar question has been asked on superuser for answers related to applications. The question is posted here to gather programmable solutions for the same)

7条回答
  •  醉梦人生
    2020-12-13 01:40

    Your solution to the problem is overkill. Ignore the faces. What you have is a solid white background and a bunch of rectangular images on it. All you need to do is find the rectangle that encloses each image and crop.

    Start by running a filter over the original image that marks all non-background pixels. This will take some tuning because sometimes the background will have a touch of tint in it (dirt) or the photo will have some pixels that look like the background (really white teeth).

    Now you look for large areas with no background color in them. Crop those into rectangles.

    Since you are the one doing the scanning, why not make the background green? Green might be an easier color to filter, especially since the passport photos are taken on a white background.

提交回复
热议问题