Wednesday, August 7, 2013

Work In Progress: Photo Formatting Program

Because I don't have enough things I'm concurrently working on (and none of this stuff obviously has a deadline), I thought I would work on a program that would prepare my digital photos for my two digital frames. I have a little programming experience, I took some classes in college and have done a little over the years though grad school and work, but I'm so out of practice and do it so infrequently, I might as well be a beginner. Hopefully if I give myself software projects I can improve my skills a little, as well as automate some of the digital grunt work in my life.

I have two frames, one is a standard 7" digital frame with 800x600 resolution and the second is a converted 19" LCD monitor operating at 1920×1080 (i.e. 1080p). I don't like it when portrait photographs are displayed on the frames leaving dark margins on the edges. I tried using the smaller frame in portrait mode, but I don't like how it looks. If I were to use it this way, it still wouldn't be labor free since the as far as I can tell the frame doesn't have a setting to automatically rotate each image. I would have to manually rotate them. Digital camera photos tend to have a 1.33 aspect ratio while my converted monitor has a 1.78 aspect ratio. Previously I prepared photos for this frame by resizing the photos to a width of 1920 pixels then cropping out a section1080 pixels high. For a few photos I cropped out a 1920x1080 section without resizing, but this tends to look too big. My plan is to take the landscape photos and resize and crop them for the larger frame and take the portrait photos and resize and crop out a 800x600 portrait section for the smaller frame.

Here's what I would like the program to do:
  • Decide if a photo is portrait or landscape, and sort them into different directory
  • Resize the images to the appropriate size
  • Find the faces in the images
  • Find the centroid of the faces and put it in the top 1/3 line of the crop region, making sure that nobody is cut off.
  • crop and save the images.
We'll see how my automated cropping plan works.  If it doesn't work out I'll have it pop open a selection window to manually choose a crop region with the defined size. As a feasibility exercise, I was able to get this face detection function working in Matlab. Ideally, I'd ultimately like to have a standalone program rather than Matlab, but that may take considerably longer.

No comments:

Post a Comment