2

I'm working on a fingerprint recognition project but I need to pre-process the image. I go through the following process.

1) Binarization

2) Filtering to removing the "stair-step" effect; i.e smoothing

3) Thin the lines

I'm adding in a step that I'm trying to develop that will fill in any holes that are left after thinning. I'm trying to accomplish this as follows.

4a) Use bwlabel to find regions (I might consider using bwmorp(...,'shrink') to just leave the "blobs" but doing this reduces the size of the blob a little).

4b) Find all regions that do not have the maximum area

4c) Use the location of these regions to shrink these "blobs" to points.

But how can I apply shrink at specified locations?

Binarization

Binarization

Filtering

Filtered

Thinning

Thinning

Hole filling

Fill holes

roldy
  • 95
  • 5
  • 13

2 Answers2

0

I am Not sure if I understood the question correctly. But can you take complement of the thinned image and then use bwlabel. After that, count the number of pixels belonging to each label. Apply your criteria to select labels and get their locations. After that, you can use imfill(bw,locations) command.

Autonomous
  • 8,935
  • 1
  • 38
  • 77
  • Well what I would actually like to do is not just fill in the holes but shrink the holes to a point. As you can see in the hole filling image above I have a bunch of these small holes filled in. I want to be able to apply a shrink to these regions and shrink them to a point. Then replace the filled in holes with this newly created point. The problem that I am having is trimming off the ridges to just leave the filled areas while avoiding erosion of the filled areas (if I were to use erode the ridges would disappear but also reduce the size of the area). – roldy Apr 26 '13 at 21:49
  • Try this. After doing `bwlabel`, fill each hole separately and then use `bwmorph(image,'remove')` or `bwmorph(image,'skeleton')`, whatever suits your needs. Repeat this procedure for each hole (i.e. label). Extremely inefficient, but as of now, I can't think of anything else. – Autonomous Apr 26 '13 at 22:19
0

If you have a region you want to shrink to a point then calculate the center of mass for the region. Do this by just averaging the x and y coordinates of each point in the blob. Set the region pixels to black and the center of mass to white.

The problem that I am having is trimming off the ridges to just leave the filled areas while avoiding erosion of the filled areas (if I were to use erode the ridges would disappear but also reduce the size of the area).

You don't really have to worry about erosion of the small regions as it will have little impact on the center of mass, and you point will still end up going to an appropriate location.

denver
  • 2,863
  • 2
  • 31
  • 45
  • The issue that I have with erosion is that I need to be able to "subtract" those pixels out of the original image and replace with the them with a point. If I erode the image, I'm loosing some of those pixels in the blobs. – roldy Apr 28 '13 at 01:22