how to remove hair , and find the center of finger knuckle

조회 수: 4 (최근 30일)
alqaed
alqaed 2014년 12월 29일
댓글: Imran Riaz 2022년 7월 22일
I used this code to remove the hairs, but the result were not good & affected the canny edge detection of the image ( I want to remove the hairs only from the images which have it , and the unhaired one must not be affected when the code applied to it ) , it is important to know that the code must not exceed 100 msec.
se = strel('disk',5);
hairs = imbothat(T,se);
replacedImage = roifill(T,hairs);
figure(4), imshow(replacedImage);
ll = edge (replacedImage,'canny')
figure(5),imshow (ll)
at the next step I want to find the knuckle location. (image is attached for clearness)
  댓글 수: 1
Imran Riaz
Imran Riaz 2022년 7월 22일
I am facing same issue. You resolved the problem if yes then help me please. Few images in my dataset have hairs on fingers.

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2015년 1월 14일
You can't find the center of the knuckle if you don't have the entire knuckle in the image. And if you did have it, it's not clear why you think you need to remove the hairs to find it. Do you think that you need to find vertical wrinkles to know where the knuckle is laterally, and that that hairs might interfere with that if the hair go vertically?
  댓글 수: 1
alqaed
alqaed 2015년 2월 5일
편집: alqaed 2015년 2월 5일
I have the entire knuckle in the image , finding the center is an important step to avoid affect of the movement of finger in matching process. so I wanna remove hair to have more accurate image , & knuckle center for making movement of finger without effect on recognition process

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Bruno Pop-Stefanov
Bruno Pop-Stefanov 2015년 1월 14일
This is not perfect, but slightly better than the results you got:
I = rgb2gray(imread('06.jpg'));
se = strel('disk',5);
hairs = imbothat(I,se);
BW = hairs > 15;
BW2 = imdilate(BW,strel('disk',2));
figure(1)
subplot(1,2,1)
imshow(BW)
subplot(1,2,2)
imshow(BW2)
replacedImage = roifill(I,BW2);
figure(2)
subplot(1,2,1)
imshow(I)
subplot(1,2,2)
imshow(replacedImage)
ll = edge (replacedImage,'canny');
figure(3)
imshow(ll)
The problem in the code you posted comes from the hairs image:
figure
imshow(hairs)
It is in fact a grayscale image with a majority of non-zero pixels:
figure
imshow(logical(hairs))
When passing hairs to roifill, non-zero pixels indicate the regions to fill in the image. In other words, you are filling the majority of the image, instead of filling only the pixels corresponding to the hairs.
In my code I am creating BW as a binary image: roifill will fill pixels whose intensity values in hairs is greater than 15. Take a look at the histogram of hairs:
figure
imhist(hairs)
Most pixels have intensity < 50.
Dilating the BW image ensures that we are smearing the hairs and a little more.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by