- 23rd December 2004, 06:25 #1

- Join Date
- Sep 2004
- Posts
- 43
- Helped
- 1 / 1
- Points
- 3,078
- Level
- 13

## image processing spur removal

hi,

i have been trying to do edge sharpening in fingerprint images.

i have tried laplacian, sobel and prewitt methods to enhance the edges.

but after each method the image gets distorted.

i understand that these operators are sensitive to noise, is it because of the noise that the edge operation fails or is not a good practice to use these operators on fingerprint images??

(if it is noise, then i even tried it after removing noise by median filter.)

if you have had some exposure to this area, please help me out in suggesting a best edge operator for fingerprint images ,or any idea why these operations fail..

thanks for any help...

- 23rd December 2004, 07:55 #2

- Join Date
- Dec 2004
- Location
- Pune, INDIA.
- Posts
- 25
- Helped
- 2 / 2
- Points
- 1,929
- Level
- 10

## fingerprint image processing

Hi!!!

Well, this problem is bound to happen!!

The edge detection filters work on the principle of derivative. One mask can detect only rising or falling edge... The masks in consideration are those of Sobel, Prewitt. Hence, when you try to use them, you will not get a continuos edge but broken edges. Noise has nothing to do with it.

Try one thing... Take an image of a black square (not filled). Prepare it in paint. The square should be hollow... It will be just a thick square boundary... Run Prewitt or Sobel mask on this image and you will get what I am trying to say...

When I did this project, I did not use edge detection at all... I used noise filtering and then thinning directly followed by edge linking.

What approach are you planning to use... minutae or something else? Give me the operation flow..!

Regards,

asybian.

- 23rd December 2004, 09:48 #3

- Join Date
- Sep 2004
- Posts
- 43
- Helped
- 1 / 1
- Points
- 3,078
- Level
- 13

## edge sharpening matlab

hi,

thanks for the reply..

this is my flow,

1.histogram equalisation

2.median filtering

3.edge crispening

4.binarization

5.thinning

6.thinning artefacts removal

7.minutiae points locating

and subsequent matching..

i am sucessful with median filtering, binarizing and thinning. histogram and egde enhancement are turning out bad.

so the artefacts after thinning are more.

interestingly, now i tried edge enhancement with laplacian mask AFTER binarizing and got some satisfactory result, but if i try thinnig after this process, it fails.

rather confusing..

and i have trouble doing edge linking and artefacts removal, any help on that will be great..

thanks.

1 members found this post helpful.

- 23rd December 2004, 12:02 #4

- Join Date
- Dec 2004
- Location
- Pune, INDIA.
- Posts
- 25
- Helped
- 2 / 2
- Points
- 1,929
- Level
- 10

## how to close holes in fingerprint image in matlab

Hmmm...

I did not go for edge detection or crispening at all. Instead I used Median filter and simple noise filtering (LPF)... Histogram equalisation is not necessarily good. It makes the probablity distribution uniform. Try contrast stretching... it is way better. If you see the Histogram, it should be two peaks, one on white side representing the background and one on dark side rep. the ridges. You have to stretch the histogram to use all of the dynamic range.**Try "contrast stretching" and not histogram equalisation.**

What books are you refering? Gonzalez, Pratt, A K Jain?

Next, dont go for edge crispening at all. Do binarisation straight away! Find the threshold dynamically! That will ensure that the algorithm will work over all images. Then go for thinning and edge linking..

Hope this will work. Keep in touch.

Regards,

asymbian.

- 23rd December 2004, 12:51 #5

- Join Date
- Sep 2004
- Posts
- 43
- Helped
- 1 / 1
- Points
- 3,078
- Level
- 13

## sharpening of an image

thanks again,

i am refering pratt and ross.

i get confused what histogram equalisation and contrat stretching means.

this is what i have tried.

Code:for(u=0;u<256;u++) //clear HIST array { HIST[u]=0; } for(x=0;x<R;x++) { for(y=0;y<C;y++) { v=image[x][y]; if(v>255) //boundary values 0 to 255 { image[x][y]=255; } if(v<0) { image[x][y]=0; } HIST[v]=HIST[v]+1; //extract histogram } } for(x=0;x<R;x++) { for(y=0;y<C;y++) { val=image[x][y]; for(i=0;i<val;i++) { hist_n=hist_n+HIST[i]; } image[x][y]=(255*hist_n)/(R*C); } }

the output image is fully black.

and i use adaptive thresholding for binarisation.

i am doing edge linking, spur removal, short valley, bridge removal.

i am all at sea as how to implement it in C.

how did you do edge linking??

and how did you do segmentation of fingerprint part from the background part.

i have also attached a output bmp file i get after smoothing, binarizing and thinning.

Regards,

dalaharp

- 23rd December 2004, 12:51

- 23rd December 2004, 14:43 #6

- Join Date
- Aug 2001
- Location
- israel
- Posts
- 130
- Helped
- 12 / 12
- Points
- 4,139
- Level
- 15

## raymond thai mistakes formula

i did a small work on fingerprints you welcome to use i. i added in the attachment the matlab code. i would have add the report as well but unfotunatly its not in english.

mayyan

- 23rd December 2004, 14:43

- 23rd December 2004, 15:35 #7

- Join Date
- Sep 2004
- Posts
- 43
- Helped
- 1 / 1
- Points
- 3,078
- Level
- 13

## broken edges matlab edge image

thanks a lot.

will check them out..

- 24th December 2004, 06:21 #8

- Join Date
- Dec 2004
- Location
- Pune, INDIA.
- Posts
- 25
- Helped
- 2 / 2
- Points
- 1,929
- Level
- 10

## edge linking

Hey!

Histogram equalisation is the technique of spreading the histogram over the range so that the resulting histogram has a uniform probability distribution. The CDF acts as the transfer function. This CDF is obtained fronm the probability distribution function (PDF) and hence is image specific.

In contrast stretching, the transfer function is a straight line, a linear function. What you have to do is

1. Take the histogram.

2. Moving from left. find the pixel value (X axis) at which the no of pixels (Y axis) exceeds say 5% of the total no. of pixels.

3. Do the same traversing from right side of the histogram.

See in the attachment! I mean finding the range bars fromthe histogram. Then use the formula in the link given below. That will be linear contrast stretching.

http://homepages.inf.ed.ac.uk/rbf/HIPR2/stretch.htm

I think I had used Hough Transform for edge linking. There are ample amout of simple algorithms on the net... Search dude!

Hey! Could you please upload that image directly? I can't download zips and rars here! Sorry!

Hope this helps you!

Regards,

asymbian.

- 24th December 2004, 06:49 #9

- Join Date
- Sep 2004
- Posts
- 43
- Helped
- 1 / 1
- Points
- 3,078
- Level
- 13

## edge sharpening matlab codes

hi,

I got the idea. will try it out.

100.jpg is original image,

and 103.jpg is the image after smoothing, binarizing and thinning.

thanks for all the help..

dalaharp

- 24th December 2004, 06:49

- 24th December 2004, 07:47 #10

- Join Date
- Dec 2004
- Location
- Pune, INDIA.
- Posts
- 25
- Helped
- 2 / 2
- Points
- 1,929
- Level
- 10

## matlab code for contrast stretching

OK!!!

Noise is a problem in your case! Try to remove (exclude) the dark corners... Keep the background uniform. You only need the central core for accceptable accuracy so there is no point in wasting time and efforts in cleaning the dark corners of noise.

I also have a feeling that the median filter should work better. Try adaptive median filter and lowpass filter. LPF will smudge the image but will remove noise appreciably.

Regards,

asymbian.

- 24th December 2004, 11:08 #11

- Join Date
- Sep 2004
- Posts
- 43
- Helped
- 1 / 1
- Points
- 3,078
- Level
- 13

## what is edge crispening

thanks for the paper,

infact i already have it and got many ideas from it. nice one.

i guess i got it from edaboard only, some old post.

and now contrast strecthing seems to working, but the thing is that i had to specify

nearly 15 to 20% for c and d to see a considerable change in contrast.

or for 5%, if the contrast does not change, should one understand that its contrast is already good??

i am using median filter now, i will try adaptive median filter.

and what is mean and variance for a spatial image.

i cant relly understand these terms..

thanks,

dalaharp

- 26th December 2004, 12:50 #12

- Join Date
- Aug 2001
- Location
- israel
- Posts
- 130
- Helped
- 12 / 12
- Points
- 4,139
- Level
- 15

## c++ simple edge detection contrast

The Raymond Thai thesis on fingerprints can be downloded here:

http://www.csse.uwa.edu.au/~pk/stude...s/raymondthai/

- 28th December 2004, 14:26 #13

- Join Date
- Dec 2004
- Location
- Pune, INDIA.
- Posts
- 25
- Helped
- 2 / 2
- Points
- 1,929
- Level
- 10

## edge detection in fingerprint

good!

Try to "read" the histogram of the image. As I have said earlier, for a fingerprint image it should be two peaks, one on white side representing the background and one on dark side rep. the ridges. If that is the case, your stretching should bring the backgroung pixels to values as close as possible to 255 (white) and ridge pixels to values as close as possible to 0 (black). So the histogram of your contrast stretched image should have two peaks; one close to 0 and one close to 255. That would mean an image with very high contrast. Send me the images and histograms before and after contrast stretching, if possible. After that go for binarisation and it should be fine. Contrast stretching will only make binarisation more efficient ans satisfactory. As far as the percentage values are concerned, try to decide the values initially on the besis of the histogram and then generalise the cutoff.

Mean of an image is the average of all the pixel values in the image. Variation is a measure of the deviation from the mean (second order). Find the formula of mean and variance in any image processing book. Mean is the measure of the overall intensity of the image. Variance is a measure of the contrast.

Low mean = relatively dark image and vice versa.

Low variance = low contrast image and vice versa.

Hope you find it interesting!

asymbian.

- 29th December 2004, 11:01 #14

- Join Date
- Sep 2004
- Posts
- 43
- Helped
- 1 / 1
- Points
- 3,078
- Level
- 13

## matlab code for valley sharpening technique

HI,

really interesting..but not really coming out right..

the images below are after contrast stretching, if i give a cutoff of 5% theres no change, 10% little change..this images with 20%..

i also tried with the mean and variance method given in the paper..more or less the same result..

andNoise is a problem in your case! Try to remove (exclude) the dark corners...

and mayyan, i tried mcc to convert m files to c files, its too complicated for me to grasp. i am trying with simple C..

anyways thanks a lot..

- 29th December 2004, 13:13 #15

- Join Date
- Dec 2004
- Location
- Pune, INDIA.
- Posts
- 25
- Helped
- 2 / 2
- Points
- 1,929
- Level
- 10

## fingerprint image processing+pdf

Hey!

The images say that whatever you are doing is going wrong somewhere in the algorothm. After contrast stretching, the backgroung should become whiter but in your case, it is turning gray. That means there is some mistake with the way you are doing it. Please send the images of the histograms before and after, if possible.

Refer to the output images of contrast stretching in books. Send me the exact procedure of your contrast stretching. The code would be great! I hope I can solve the problem.

And you tried mean and variance method for what? Median filtering? The more the window size for median filtering, the better the result... but it starts taking a lot of time.

I hope I am of help to you!

asymbian.

- 30th December 2004, 06:11 #16

- Join Date
- Sep 2004
- Posts
- 43
- Helped
- 1 / 1
- Points
- 3,078
- Level
- 13

## edge detection images thesis report

hi,

i am doing contrast stretching with this code,

Code:/* histogram */ for(u=0;u<256;u++) //clear HIST array { HIST[u]=0; } for(x=0;x<R;x++) { for(y=0;y<C;y++) { v=image[x][y]; if(v>255) //boundary values 0 to 255 { image[x][y]=255; printf("255\n"); } if(v<0) { image[x][y]=0; printf("0\n"); } HIST[v]=HIST[v]+1; //extract histogram } } /*contrast strtetching*/ for(v=0;v<256;v++) //c { totpix=totpix+HIST[v]; if(totpix>9830) //9830 is 15% of image pixels { cmin=v; goto corpse; } } corpse: totpix=0; for(v=0;v<256;v++) //d { totpix=totpix+HIST[v]; if(totpix>55705) //85% of image pixels[256x256] { dmax=v; goto carrion; } } carrion: for(x=0;x<R;x++) { for(y=0;y<C;y++) { if((dmax-cmin) == 0) histo[x][y]=(image[x][y]-cmin)*((255-0)/(dmax-cmin))+0; } } for(x=0;x<R;x++) { for(y=0;y<C;y++) { image[x][y]=histo[x][y]; } }

and the mean and variance are for histogram processing as given in raymond thais paper.

and doing segmentation, i am not getting satisfactory results.

what should be the size of segmentation window.??

- 4th January 2005, 07:37 #17

- Join Date
- Sep 2004
- Posts
- 43
- Helped
- 1 / 1
- Points
- 3,078
- Level
- 13

## fingerprint-prewitt

Hi,

the excessive noise or artefacts i get in the thinned image is because of the holes in the binary image.

any idea how to fill these holes and make the ridges smooth and prominent.

i am trying erosion and dilation, they are not of much help.

thanks..

- 4th January 2005, 08:20 #18

- Join Date
- Aug 2004
- Posts
- 180
- Helped
- 64 / 64
- Points
- 6,660
- Level
- 19

## image sharpen c code

I have been reading the discussion for quite a while. You guys even mentioned Raymond Thai's report. You tried to used general methods to enhanced ridges.

Have you tried Gabor filter mentioned in the report?

There is a reason it is used, instead of general edge enhancement methods. It uses the information concerning the flow of the ridges( the direction of ridge line and the periodical structure in the normal direction). General edge enhancement methods are not aware of how the ridge line should be continually flow in which direction, how wide it should be.

If you have already applied it before this step, I would say it doesn't work very well. So you might want to go back and check the filter.

- 4th January 2005, 12:10 #19

- Join Date
- Sep 2004
- Posts
- 43
- Helped
- 1 / 1
- Points
- 3,078
- Level
- 13

## sharpen window size variance

hi, thanks for the interest in my query...

i was planning to take up gabor after i complete a simpler flow(with median filter), since i am coding in C, i thought Gabor was a little too hard to understand, let alone coding.

i am also looking at steerable wedge filters and hough transform as options.

- 5th January 2005, 03:47 #20

- Join Date
- Aug 2004
- Posts
- 180
- Helped
- 64 / 64
- Points
- 6,660
- Level
- 19

## image processing local contrast stretching

I don't think Hough can be applied.