- Hello, and welcome to Code Clinic.
My name is Dan Gookin.
Code Clinic is a course where a unique problem
is introduced to a collection of lynda.com authors.
In response, each author creates a solution
using their programming language of choice.
You can learn several things from Code Clinic,
different approaches to solving a problem,
the pros and cons of different languages,
and some tips and tricks to incorporate
into your own coding practices.
For this chapter,
the problem deals with Image Analysis.
In one sense, this topic is simply data analysis.
Images are really nothing more than specialized
and well-defined sets of data.
An image consists of pixels.
Pixels consist of data representing
the color of the pixel, and in some cases,
the pixel's transparency.
The pixels are arranged in rows and columns.
When assembled correctly, they represent an image.
Our brains are very good at recognizing patterns
but computers are not.
Think about CAPTCHA security devices,
those puzzles you sometimes see
when logging into a website.
The CAPTCHA asks what letters
and numbers are in the image.
Information obscured by random lines and sometimes
overlapping transparent blocks of color.
All of those intersecting shapes make it difficult
for a computer program to separate
the background noise from the actual data.
Another example are the Ishihara Tests,
used to determine color blindness.
Letters and numbers are hidden in a circle
filled with different colored dots.
If you're color blind,
you won't be able to see the numbers.
For a computer program, this task can be
incredibly difficult, as it requires detecting an edge
as well as recognizing the overall shape.
Such a thing is difficult,
even for the most advanced programmer.
This chapter's problem deals with a common issue
for many photographers.
Plagiarism.
A photographer will take a picture
and post it on the Internet, only to discover
someone has stolen their image and placed
a subset of that image on a website.
For example, here is an image.
And then a cropped version of that image.
It would be extremely handy for a photographer
if a program was available to search the Internet
for cropped versions of an original image.
That would help the photographer protect his rights.
In fact, Google Image Search does just that.
But have you ever been curious as to how it works
and what the required code might look like?
Here's the challenge.
Given two images, determine whether one image
is a subset of the other image.
Assume both images are JPEG files
and that the resolution and bit depth
on each image is identical.
A set of sample images has been provided
with the exercise files.
The program solution should return
a table showing which images
are cropped versions of other images.
Perhaps you wanna pursue
and create a solution of your own.
How would you solve this problem?
In the next few movies,
I'll show you how I solve the challenge.