Sunday, November 22, 2009

Image Segmentation using Histogram Backprojection


Can you spot the difference? Clue: RGB. nyargh! hehe the left pic is the Red Channel of the original image(see below for the orig true color pic), and the right pic is the Green Channel. What about the Blue Channel? sorry, i'm from U.P., blue=ateneo:) haha joke.:)

and there you have it!:) haha, read on so that you get why this post is entitled as such.

We were given an activity that would enable us to do some tracking from images. The end-goal: object tracking in videos using chromaticity as main feature. Why chromaticity? Well, it's because our skin (everybody's) only falls within a small locus of the chromaticity region (whoa! that's how i understand it) and that the difference in skin "color" is actually just a function of brightness/intensity.

Face detection is one cool application (for webcams, videocams, digicams, cellphone cams, etc...) that should use this "chromaticity-as-skin-info" concept.:)

As an exercise, last friday (Nov 20, 2009), we had an image segmentation lab activity:

- Select an Image where you have an object you wish to detect/identify (and eventually segment from the rest of the image). Note: better start with objects that are easily identifiable:)

For my selection: Davao Eden Nature Park Jump Shot with Friends!:)


- Crop a Sample of the Region of Interest (ROI) from the image(say, for my selected image, i wanted to segment the shirt of Kim GuanHing)

So i got a kim shirt sample:


- Get the Histogram of the Sample. Now, we have the representative feature that we want to detect in the original image and in future images (with the sample being kim's shirt - which is the object that we will detect and later on "track")



- Load the Image that you want to segment/detect/identify IF the sample(object to be tracked) exists in the image(and where in the image it is).

- Run the the Histogram Backprojection code which does this: for each pixel in the loaded image, get the chromaticity value (red and green channels) and look-up the new_value of the pixel using the Sample's(Kim's shirt) histogram as your "re-mapper" (i.e. for a given r and g, you can get the new_value) Note that the values in the histogram of kim's shirt will be high for those pixels that are "like" kim's shirt and low for those un-like kim's shirt:)

Segmented Kim Shirt (creepy?):)


side comment: interesting app for baduy-colored shirts worn in malls?:) hehe i actually want to run this algorithm for cars in the carpark of malls and integrate with the parking payment system:) suuuuuuppppppppppeeeeeeeeeeeeer cheap sol'n to an intelligent car park system:)

to do: try other kim shirt pics and see if the algo can detec kim's shirt in those pics!:)

hopya-layk-eat!:)

-------
Self Grade: Uno:) or from 0-10: 10!:) kasi naman from zero scilab experience ito:) and then ang laki ng learning leap sa chromaticity plus the backprojection implementation (Apir!):)

-------

lochinvar's note to self: must try python implementation (use your openCV webcam, for face detection!)

Wednesday, November 11, 2009

"In my world..."

"...everyone's a pony. They all eat rainbows... and poop butterflies!" - Katie (Horton Hears A Who)

and that's what kids digest in their open, sponge-like minds and what we young adults laugh at and find cute.:)

This is my first blog, and I congratulate Ma'am J for successfully "encouraging" me to make one *ahem*. Blog Reports, 70%! yep, that's the weight of these future reports(for an image processing course). 70% of my final grade will come from the blog reports(which we are supposed to grade ourselves by the way, yippee!! or not?:) )

I like geeky things, they make me feel alive and working.:) I love intelligent people, especially those who know how to say "I don't know.". I admire loving people, especially those that show it in deeds.

I love life. and, in my world, i hope to give meaning to it.=)