amuck
amuck
amuck
amuck

Near Duplicate Image Identification

About my work in developing my own near duplicate image identification algorithm.

Defining Metrics.

February 14, 2008
By

This post has 64 words. It will take approximately 38 secondes for reading it.

A key to Near-Duplicate Image Detection is the metrics used to define an image. This is turning out to be more complicated than I originally thought. However, I might have had a breakthrough after deciding to use the brightness attribute of the HSB color format as a way to define brighter points. Let me try to describe this a little better. Read more »

Epiphany! HSB would work better than RGB for the algorithms … DUH!

February 11, 2008
By

This post has 298 words. It will take approximately 2 minutes, 58 secondes for reading it.

Don’t you hate it when you are deep into a project and you kind of have an epiphany about how something should work? Well that is what happened to me today. I realized I’ve been going about this whole color format issue the wrong way. Some time ago (around the time I started this project) I read this article at CodeProject, however I didn’t really think any thing of it other than, “Hey that’s a pretty neat idea and something that I might need in the future”. Then I started working on ways to reduce the RGB to Single and Integer datatypes. Talk about stupid things to do. If you look at the HSB setup the values are 0 – 360 for H and 0 to 100% for both S and B. H which stands for Hue tells you what color it is (wow look a single number for color slap me with a wet fish), S is for saturation or how much of the color is present, and B is for Brightness with 0 being black and 100 being either white or what ever the saturation of the given Hue (boy to I have egg on my face). Not only does the article describe the differences of RGB and HSB but it also shows you how to convert from RGB to HSB (as well as some others but that’s more than I think I need right now). Now I’m going to re-look my code for the wavelet, and if I can’t really do that too well (I’m not sure if the return conversion from array of singles to image will actually work right) I’m going to at least use it for my metrics because I think it will make things much simpler to deal with.

Introducing "My Wavelet Class"

January 30, 2008
By

This post has 134 words. It will take approximately 1 minute, 20 secondes for reading it.

I’ve been promising to release some code on how I’m handling the Haar Wavelet transformation and doing the work needed for creating metrics for the Photo Manager Project, so here it comes. I’m going to make this a more type post so that people who don’t want to see a lot of source code can skip it ;)

I know it isn’t perfect and I know that I still have a lot to do with the code to make it usable (I’m missing the output for the Metrics) but once I’ve got that down the functionality should work. I’m defining my own class to store metrics right now. Once that is finished I’ll finish up this class to make it more user friendly :D

Read more »

Image Identification Signatures Using Haar Wavelet

January 29, 2008
By

This post has 448 words. It will take approximately 4 minutes, 28 secondes for reading it.

So I finally have done some more work on actually trying to detect differences in the images. Up to this point I’d been spending most of my time trying to better my use of the Haar Wavelet. I’m not going to go into the Haar Wavelet Implementation here, I’m going to cover that more in another post. What I would like to do is show you the results I’m getting.

First I’ll show you my original image: Children Playing I had to do the image as a link for some reason WordPress can’t thumbnail large images but it asks me if I want to thumbnail my thumbnails.

Yeah I know it’s big so now I reduce it to a 256 X 256 image. Remember in my application it doesn’t matter about the aspect ration when it comes to image identification.

b1.jpg

Now the image is ready to run through the Haar Wavelet and it produces this:

b2.jpg

If you notice the original 256 X 256 image is now rendered as a 128 X 128 in the upper left corner. The information I want is in the opposite corner the lower right. So now we’ll crop this out so we can work with it.

b3.jpg

Yeah I know it doesn’t look like much but there are differences in some of the pixels. So we want to find where there are more pixels above a certain level. What we do now is to run this image through another check which chops the image into 8 X 8 Pixel chunks (64 pixels total) and counts the number of pixels above the RGB 65, 65, 65 or in HEX #414141. Why did I choose that color? Well basically it is dark but not completely black. Honestly I’m not sure why I chose this but right now it seems like a good choice. I’m sure we can say that the color is variable. If you are curious what color #414141 is it should look like this (HEX #414141). The identifier routine that I’ve built at this point only highlights the 8 X 8 chunks that fall within the calculated threshold for the image. So you can see the results look like this:

b4.jpg

At this point we can see the grouping of the red squares seems focused around where the children are in the picture.

I’m still working on the rest of all this, I just wanted to share what I’ve come up with so far. Once I’ve experimented with this a bit more I’ll be happy to release the code that does this much (at least what I can, I’m still waiting to hear from the guy who wrote the C++ code to begin with).

Near-Duplicate Image Detection

January 25, 2008
By

This post has 424 words. It will take approximately 4 minutes, 14 secondes for reading it.

One portion of the photo manager project is the Near-Duplicate Image Detection functionality. This is so that if I have my library of images I can make sure the same one is only in there once and not multiple times.

Now normally this would be easy because if you copy a file and rename it the data inside is not changed and so you can do a hash function on it and compare the hashes. But this is only good if you have not edited one of the images. Say you edited the image to change resolution or size of the image? A hash compare won’t work because the binary data of the image would change. A change of one bit is enough to change the entire hash. So you need to come up with a way to compare the image portion of the file when it is rendered to your computer screen. Interestingly this is fairly easy for our own eyes to do. Our mind and eyes can scan two pictures and identify them as being Near-Duplicate or not. However, this process is by far slower and more monotonous than to have a computer do it. So the question is raised how to make an image into something that a computer can identify? Answer, not very easily. The problems come from the size of the images. Even if you resize the image to say 256 X 256 you still have 65536 pixels to check against. No matter how good of a programmer you are you are going to have some performance issues if you compared two images pixel by pixel. Now image doing that for thousands or tens of thousands of pictures … Yeah your program could be doing that for weeks without stopping. So you have to come up with other ideas.

I’ve been doing some research into this matter so that I can include this into my application. What I’m working on is a way to reduce the image to something more manageable. So how do you take an image that is 700 X 1024 pixels in size with 16 million+ colors and reduce it to something that is unique for that picture but small enough to be used? From my research I found that you use an algorithm called Wavelets. In particular I’m going to use the Haar Wavelet. This is because the Haar Wavelet is the simplest to use and provides some useful data. I will follow up this post with another post on how I’m implementing this into my application.

Project: Photo Manager

January 25, 2008
By

This post has 158 words. It will take approximately 1 minute, 34 secondes for reading it.

I’m working on building a photo management software that will help me organize, store, sort, and find duplicates of my family photos. The main application I’m writing in Visual Basic 2005 and I’m using a SQL Server 2005 Database backend (future planning will be to move this to a access database but with the option to continue using a more powerful database).

This project is already underway, and I’m finding it quite a bit of work because the information on dealing with images seems heavily weighted towards C++ and C#.  However, I’m getting creative enough to find way of porting the information I’m finding to Visual Basic. Not without some hair pulling, but still the results are quite surprising.

At this point the application will only support JPEG because that is what my camera creates. I would eventually attempt to handle other image types but right now I need to stick to the basics.

Search

Important Pages

Calendar

February 2012
M T W T F S S
« Oct    
 12345
6789101112
13141516171819
20212223242526
272829