FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   Reading pixels
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: Reading pixels  (Read 968 times)
inadaze


Reading pixels
« on: Oct 12th, 2004, 4:34am »

I am about to start a project which consists of a sort of palm reading.  I was wondering if anyone could suggest a method of reading the lines in a persons hand(either a scan of the hand or a scan of an ink print of the hand) and then using the information to compare to preset hand line shapes?
I was thinking if I could get processing to read the darker pixels of the hand, these would be the lines in the hand.  And then i could have a sort of database of positions of lines and use it to compare to the scanned lines of the hand.
 
Any ideas?
Thanks  
Jay
 
Frederik

WWW Email
Re: Reading pixels
« Reply #1 on: Oct 13th, 2004, 1:00am »

Pretty ambitious. What you've got there is basically a pattern recognition problem. Entire courses could -and are- devoted to this...
 
I would start with something small first, like writing an applet that recognizes user drawn input from a set of different geometries (circle, square, cross, triangle). If you figure out how to do this, you're on the right way
 
The representation of the data is essential. Working purely on pixels won't get you far. It's very hard to account for rotations. And generally occuring patterns, like finding a "V"-line anywhere on the scan, are bothersome to check, basically you have to correlate the scan with some template for every conceivable translation, very slow...
 
You need some way of extracting and storing the different line patterns. (The first start of finding a good data representation is asking yourself "how would I describe a certain line pattern, in a general way?" )
 
So three parts:
 
1) looking for the lines
2) storing the lines in suitable way
3) comparing to template data
 
Robust algorithms for step 1 and step 2 aren't easy...
 
Seeya,
 
Frederik
 
inadaze


Re: Reading pixels
« Reply #2 on: Oct 13th, 2004, 6:42pm »

I didn't think it was that hard (I have a tendency to think too big).  But if the image is a scanned print of a hand, then the image would be an array of pixels with different black and white(and gray) pixels.  I could just run something lile a histogram to find out the distribution of the pixels and compare them with other arrays of pixels distribution already entered in a sort of database.  Whichever the palm print resembles closest is the result.  
I could break up the hand into pieces for each line and run seperate tests for each.  
Am I still too far out there?  Or does it sound plausible?
 
Jay
 
TomC

WWW
Re: Reading pixels
« Reply #3 on: Oct 13th, 2004, 6:57pm »

A histogram throws away the spatial data, so that's not going to cut it if you want it to be accurate.
 
That said, it should provide sufficient variation so you could fake it  So it depends if you want to be scientific or not.
 
You can find lines with something like a Hough Transform (normally used for circles) which requires an edge detector which gives edge strength and direction (e.g. Sobel).  For the latter, you'll need to be able to do convolutions, for the former, you need a good book/resource in order to get your head around what's really happening.
 
There are other techniques to find lines in images (vega's blob detection might work... at least it would let you segment the hand and the background).
 
Let us know how you get on...
 
fjen

WWW
Re: Reading pixels
« Reply #4 on: Oct 14th, 2004, 3:29pm »

found something which might be intresting (Leaves Recognition v1.0):
 
http://damato.light-speed.de/lrecog/
 
/F
 
inadaze


Re: Reading pixels
« Reply #5 on: Oct 15th, 2004, 3:16am »

If I scan an image of a print of a palm(sort of like a police finger print but of the entire hand) I would have a black image with white lines where the indentations of the lines on the hand are.  Wouldn't these lines be rather easy to detect if everything around them is black?  Then I could store the information of the white pixels in an array and run an for statement through each array comparing this array with preset data of "types of lines".  When there is a close match then it would choose this "type" of line as output.  
Does this sound possible?  I don't know much about the histogram function, but if it finds the values of the image and plots it on a graph, I could use this to make the comparrison.
I am just throwing out ideas to see if they float...
 
PS thanks for the link. that could help.  I will read it thoroughly.  
 
Thanks everyone!
Jay
 
fjen

WWW
Re: Reading pixels
« Reply #6 on: Oct 18th, 2004, 5:12am »

yeah in theory this sounds ok, but consider:
 
- even two scans of the same hand of one person will not exactly be equal. especially when the hand has been moved (rotated, shifted, ...).
 
- comparing arrays of data can be very slow. you might want to compare with a lower "resolution" first
 
- how would you define a "line of pixels" ("types of lines")?
 
just some thoughts ... i'm really looking forward to what you come up with ... btw. i've seen an installation been done with palm-scanning: they took a digital picture from below (thru) a tinted glass (kinda like a scanner). because the hand-palm is kind of humid, it gives a good, distinct image, like pressing your face to a window ...
 
/F
 
Allen


Re: Reading pixels
« Reply #7 on: Oct 18th, 2004, 10:27am »

on Oct 18th, 2004, 5:12am, fjen wrote:
yeah in theory this sounds ok, but consider:
 
- even two scans of the same hand of one person will not exactly be equal. especially when the hand has been moved (rotated, shifted, ...).

 
This is the biggest problem as far as I see it. 'Not exactly' is being too kind.
 
... but then again, palm reading isn't exactly a delicate 'science'.
« Last Edit: Oct 19th, 2004, 2:00am by Allen »  
inadaze


Re: Reading pixels
« Reply #8 on: Oct 18th, 2004, 4:29pm »

I plan only to have one scan of the users palm.  If they were to go through the process more than once it would always give a different output.  I am  just looking for a way of doing it properly once(hopefully they will be so happy with the first result they will be content forever!ha!).
I was thinking of storing the information of types of lines in sections.  Cutting the hand up in say four horizontal strips and having different possibilities stored as pixel information.  Ex: have a database of arrays of black and white pixels which each have a shape of white pixels throught the black pixels.  this would be the line in the palm.  Then, if I could subtract the white pixels of the scanned image from those of the stored arrays, whichever output has the smallest number of white pixels left would be chosen because it would be the closest in shape.
 
Where did you see the installation piece of the scanned hand.  I would REALLY like to look into that!!
 
Thanks
Jay
 
st33d

WWW Email
Re: Reading pixels
« Reply #9 on: Oct 18th, 2004, 6:40pm »

Funny how I know more about the occult than programming, but... There's a lot more to consider in palm reading that just the lines. Each hand is broken down into mounts that are governed by the different planets. On your thumb is the mount of Venus. Under your index finger the mount of Jupiter, Under the middle finger the mount of Saturn, under the ring finger the mount of Apollo (the sun) and the little finger has mercury's mount. And those fingers are also related to those planets. The fleshy pad on the other side of your palm to your thumb breaks into Luna (the bottom bit) and Upper mars (the top bit). The bit above your wrist is the mount of neptune. You also get lines on the mount of mercury and apollo that denote communication and artistic ability also.
 
Completely useless wives tale information I know. But its something to consider that it might be a little easier to measure the mounts instead of trying to measure the lines inbetween. The mounts sound more like a pixel measuring operation than the lines which are more of a pixel to vector conversion (which I'm working on and its problematic). Just a thought.
 

I could murder a pint.
inadaze


Re: Reading pixels
« Reply #10 on: Oct 21st, 2004, 11:53pm »

If I was to read the mounds and shape of the hand instead of the lines of the hand, how would I go about this with the pixels information?
 
Thanks
JAy
 
Pages: 1 

« Previous topic | Next topic »