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

5 ビュー (過去 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.
  1 件のコメント
alqaed
alqaed 2015 年 2 月 5 日
thanks for your help , i'm gonna try it

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by