Using Adobe Photoshop for Research and Profit

Photoshop CS3 Extended is a powerhouse. Beside the usual support for making fake celebrity nudes and airbrushing out your blemishes for Facebook profile pictures, did you know it has support for a wide selection of image measurements?

Simple image processing can be fun and easy with Photoshop. Various books have even been published on the use of Photoshop in forensic science!

I recently watched a Lynda.com tutorial on using Photoshop for Biomedical research and Photoshop for Research Methods and Workflows. The latter included a step-by-step guide for image processing techniques from analyzing protein expression in microarrays to obtaining penetration data in tissue sample. But I think it’s safe to assume that most reader’s aren’t concerned with biomedical research, so I decided to take the measurement idea and run with it.

In this post I’ll outline some applications of Photoshop’s measurement tools which should not be missed! Note that this tutorial assumes you already have basic knowledge of opening images, working with layers, and making selections.

Measuring the Lean of a Leaning Tower of Jenga

Tower of Jenga Pisa

How would one go about comparing the leanosity of this Leaning Tower of Jenga compared to the real Leaning Tower of Pisa?

  1. Just use the Ruler Tool across the edge of the tower and read it off the “A value” in the Options toolbar across the top of the window 
  2. Alternatively you can select Record Measurements from the Analysis drop down menu and scroll over Measurements Log to Angle.

Turns out the real Leaning Tower is about 86.03°. Pretty accurate lean!

How to Measure the Circularity of the Moon
Circularity of Moon Phases

Adobe writes “Circularity is the calculation 4pi(area/perimeter^2). A value of 1.0 indicates a perfect circle. As the value approaches 0.0, it indicates an increasingly elongated polygon. Values may not be valid for very small selections”.

One can do many interesting things with this measurement. For example, you may be interested in comparing the circularity of your head to that of a friends.

I was more interested in the practical measurement of the circularity of the moon during the lunar cycle as depicted above.

  1. Use the Magic Wand to select the emptiness of space
  2. Invert the selection with Select > Inverse, and subtracted the moons from the selection I wasn’t interested in using the Rectangular Marquee. 
  3. Goto Analysis and Record Observations in a manner similar to the previous example.
  4. Record the value of the Circularity heading in the Measurement Log.

All werewolves know that there are approximately 30 days between each full moon. Using this fact, along with Photoshop, and a digital camera one could determine the day of the month based on circularity alone!

Counting Candies in a Candy Bowl

Highlighted Green M&M\'s

  1. Using the Magic Wand Tool, one can select a region of a single green colored M&M from this delicious bowl. 
  2. Once you have a green M&M selected, choose the Similar option from the Select drop-down you can expand this selection to the entire image. You may have to play a bit with the tolerance of the initial selection. 
  3. Once you have a decent selection, goto Analysis > Record Observations
  4. By observing the Count heading of the Measurement Log you can see exactly how many M&M’s are selected.

I manually counted 74 and using the steps outlined above I got a count of 70. This technique could be used to count freckles, stars, or any distinctly colored/separated objects! 

Measuring the Efficacy of Teeth Whitening Products

Crest Teeth Whitening Quantitatively Compared

You must have heard of these teeth whitening products by now. Typical they are hydrogen peroxide gel-based and bleach the yellow out of your gnarly coffee teeth. I searched all over the internet for a review of the damn things but all I could find was dentistry spam! Wouldn’t it be nice if someone actually reviewed them with real quantitative data? If you have Photoshop it’s way easier than you think.

  1. Bring a close-up photo of your smile into Photoshop CS3 Extended
  2. Use the Rectangular Marquee to select a sample of color on your teeth
  3. Goto Analysis and Record Measurements
  4. On the pop-up observations box just scroll over to “Mean Gray Value” and record that number. 
  5. Repeat steps 1-4 throughout your whitening procedure and graph the whitening over time!

Note: The gray value will likely be a number from 0 to 255. Also, the pictures above are from actual dentistry work and not an over the counter bleaching product!

Calculating the Height of Kirsten Dunst

Calculating the Height of Kirsten Dunst

Sometimes you’ll catch Kirsten Dunst on the beach reading Carl Sagan’s “The Varieties of Scientific Experience“. Using the fact that the book is 9.2 inches high according to Amazon we can calculate Kirsten’s height with a fair degree of certainty.
  1. Access the Analysis menu option Set Measurement Scale > Custom so you can set a new measurement scale for the ruler tool. 
  2. Once the Measurement Scale dialog box is open, click and drag using the Ruler tool across the edge of the book
  3. Fill in the values for the logical book length as 9.2 inches and press Ok, all further Ruler measurements are scaled by this length. 
  4. Use a series of Ruler measurements to total up Kirsten’s height.

I got a height of 67 inches, or 5’7. I guess I overshot her height a little bit according to Chickipedia.

Estimating the Number of Chickens in Africa

Africa\'s Chicken Population Density

Determining the number of chickens in Africa would be impossible without a Chicken population density map. Thankfully, I discovered one on Google. This is a more involved example, but mostly because of the pre-processing needed on the particular map I discovered.
Ideally, the measurement one would use for this in Photoshop is “Integrated Density“, which is equivalent to the product of the area and mean gray value of the particular selection.
To prepare the sketchy map I got, I needed to do the following super boring things which I will not go into detail about:
  1. Had to save a selection of Africa and its islands with a contracted edge.
  2. Had to set a calibration scale to kilometers using a superimposed world map.
  3. Forced to replace the black lined borders inside Africa with colors similar to neighboring regions.
  4. Needed to accurately convert the image and color coding to grayscale.

After way too much work, you select Africa and click Analysis > Record Measurements. There will be many measurement entries but the one with multiple values in count should be the combined selection of Africa and its islands. I obtained an area of 30.11 million square kilometers which compares well with the actual value of around 30 million km^2.

Unfortunately, you can’t use the Integrated Density in this case, since mean gray value which is a value from 0 to 255. Although, we can scale our mean gray value (36.32) by dividing it by 255 and multiplying by 125. I chose 125 as the maximum number of chickens per square kilometer. This gives a Mean Chicken Population/km^2 of 18.

Using the M.C.P./km^2 multiplied by area of Africa it is certain that there are around 542 million chickens. 18 Chickens per kilometer sort of seems like a lot when you consider the desert, but who knows!

As you can see, Photoshop is such a powerful tool it’s no wonder it cost $1000 to purchase! Can you think of any other interesting image measurements I could make?

26 thoughts on “Using Adobe Photoshop for Research and Profit

  1. ImageJ from the NIH is a free, open-source, cross-platform Java application for doing these sort of image analyses. The UI may be a bit rough, but between its excellent scriptability, the different plug-ins available, and being free, it shouldn’t go unmentioned.

  2. agm:
    are you suggesting there are undocumented underground chickens?

    ben:
    what else am i going to call it, the page break?

    zachrahan:
    i’ll definitely take a look at ImageJ

    will:
    thanks, fixed!

  3. Measuring the Efficacy of Crest White Strips:

    Photoshop will also tell you that there has been more work than the whitening. If you look at the shapeof the “before” and “after” pictures you will see that the “after” teeth are longer, straightened and it appears with added structure. Not a good example at all of whitening, but going to a dentist. Interesting that you did advertising for one brand name as opposed to just specifying “whitening” – advertising like that destroys credibility.

  4. whatever dude:
    Thanks for making me feel like an advertising jerk! But I see where you are coming from and I fixed that passage to be more general.

  5. Huhh. Look at the leaning bottle of water at the feet of the tower! Not the tower, but the camera is leaning…

  6. In the leaning tower of Pisa example, you’re assuming that the horizon is level in the photo, but if you look at the ceiling in the background, you can see that it is not. The “level” angle should be parallel with the ceiling.

  7. You guys are pretty negative and hardcore. Give the guy a break. All he was trying to do was to show some interesting uses for Photoshop’s analysis function. Independent of mentioning brand names what’s the big problem?

    Go spend your free time doing something construstive like scraping Orbit gum off of the sidewalk and we Photoshop users will continue to enjoy fun tips without your harsh comments.

  8. I agree with Rob about the negativity, and I’m one of the guilty parties. In my comment where I mentioned the non-level horizon, I wish I had ALSO mentioned that I enjoyed this post, and found the ideas interesting even if the execution wasn’t perfect.

    Some of us are just a little obsessive-compulsive. Let me demonstrate:
    If you use the ceiling, doorway, water bottle, and copy machine (or whatever that is) as horizontal/vertical reference objects, the tower is leaning about 2 degrees less than estimated–an angle of 87.35 degrees, or 2.65 degrees from being vertical.

  9. I like the helpful info you provide in your articles.
    I will bookmark your weblog and check again here frequently.
    I am quite sure I will learn lots of new stuff right here!
    Best of luck for the next!

  10. I do not drop a leave a response, but I read a few of the comments here
    Jacks of Science Blog Archive Using Adobe Photoshop for
    Research and Profit. I actually do have 2 questions for you if it’s allright. Is it just me or does it look like like a few of these responses look like they are left by brain dead people? :-P And, if you are writing on additional sites, I would like to keep up with you. Would you post a list of every one of your social networking sites like your twitter feed, Facebook page or linkedin profile?

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>