Daniel Marquez (C:)

8 object(s)
© Daniel Marquez 2021

PassportCV

PassportCV

During my first software engineering internship at Deloitte, I created a solution for an existing project that involved handling passport images. Using Python, OpenCV and Haar Cascade Classifiers, I developed a robust system dubbed PassportCV that determines, with a 96% accuracy, whether user-uploaded images meet the official passport standards of the State Department. PassportCV did the following:

  • Face recognition and placement: Identify the face (general face shape and eyes) and upper body, then crop the image to the dimensions specified by the US Department of State.

1 2 3 4

  • Evaluating an image quantitatively: figured the best method to look at an image in terms of numbers instead of not-numbers was to create a histogram (plot of image intensity vs. pixel count) in each color. Used this as the primary method of evaluating the images.

  • Grayscale peak detection: Each valid image has a white/off-white background that makes up a certain image proportion. This results in a significant peak in the histogram of approved images. If the image is over or underexposed, this peak shifts.

  • White pixel abundance: In an image with the correct exposure, there are almost no stark-white pixels; however, there are many of these in an overexposed image. I implemented a test to calculate the relative abundance of these pixels.

  • Color skew: Sometimes, the wrong light/settings on a camera can cause color shifting, aka the image will appear primarily blue, green, red, or yellow. This test compared the abundance of each of these colors to see if they were balanced.

5 6 7 8

  • Background obstruction: Is there something in the background? Is the background not flat and plain? PassportCV detected the edges outside of the subject and calculated the density and relative abundance of these edges.

9 10 11 12

  • Blur detection: Calculated the Laplacian Variance (abundance of high and low frequencies). If there is a low amount of high and low frequencies, it is likely a blurred image.

13 14 15 16