What is the filter I can use to get clearer image on hand vein?

8 vues (au cours des 30 derniers jours)
Atifah Samuri
Atifah Samuri le 20 Déc 2021
I use this code below but when I see the result i did'nt see any differences between original image and median filtering image. Is any suggestion to change to another filter so that I can see the difference obviously also I don't know why I use the salt & pepper. I want my image is showing the vein without we look where is the vein because we can see it obviously.
hand = imread('fara.jpg');
handgray = rgb2gray (hand);
% figure
% imshow (handgray)
%median filtering
handmf = imread ('fara.jpg');
handmedfilt = imnoise (handmf,'salt & pepper', 0.02);
handdahmf = medfilt3 (handmedfilt);
% figure, imshow (handmedfilt), figure, imshow (handdahmf)
handclah = imread('fara.jpg');
[rows, columns, numberOfColorChannels] = size(handclah);
if numberOfColorChannels == 3
% If it's color, convert it to gray scale.
handclah = rgb2gray(handclah);
handclahe = adapthisteq(handclah, 'clipLimit', 0.02, 'Distribution', 'rayleigh');
% subplot(3, 2, 1);
figure, imshow (hand);
title('Original image');
% subplot(3, 2, 2);
figure, imshow (handclah);
title('Grayscale image');
% subplot(3, 2, 3);
figure, imshow (handmedfilt);
title('Salt&pepper filter');
% subplot(3, 2, 4);
figure, imshow (handdahmf);
title('median filter');
% subplot(3, 2, 5.5);
figure, imshow (handclahe);
title('Clahe image');
  1 commentaire
Walter Roberson
Walter Roberson le 20 Déc 2021
Please note that questions about "the most suitable" or "the best" are research questions. To answer the question, we would not only need to know of a mostly-successful filter: we would have to be able to prove that that filter is the best possible, that a few thousand years from now when Dark Energy Computers are given away in cereal boxes, that the filter we tell you know will still be the "most suitable" filter.

Connectez-vous pour commenter.

Réponses (2)

Sanchari le 15 Fév 2024
Hi Atifah,
I understand that you are trying to find a suitable filter that accentuates hand-veins in the given image. A similar question regarding image filters was answered here: https://in.mathworks.com/matlabcentral/answers/376805-matlab-code-for-vein-detection-using-ir-camera. Here, the asker wanted to perform vein detection in MATLAB using IR camera. Assuming that you are targeting similar behaviour and goal in spirit, I recommend using Otsu’s segmentation method.
The following image processing provides satisfiable outcome for the mentioned problem: Raw image > CLAHE filtering > Otsu segmentation > Median filtering.
Accordingly, the mended code is given as under:
%Conversion from rgb to grayscale
hand = imread('hand raw.png');
handgray = rgb2gray (hand);
%CLAHE filtering
handclahe = adapthisteq(handgray, 'clipLimit', 0.02, 'Distribution', 'uniform');
figure, imshow (hand);
title('Original image');
figure, imshow (handclahe);
title('Clahe image');
%Otsu's segmentation
level = graythresh(handclahe); % Find the Otsu threshold
handotsu = imbinarize(handclahe, level); % Segment the image
figure, imshow(handotsu);
title('Otsu image');
%Median filtering
handmedfilt = medfilt2(handotsu, [15 12]); %Cleaning up segmented image with median filtering of kernel size [9 9]
figure, imshow (handmedfilt);
title('Median filtered and cleaned image');
In this code, I have used the Otsu’s segmentation method to get the vein lines from the image. I have processed the provided raw image in the code snippet above. Note that if the input image has more noticeable veins than the provided image, the code snippet is expected to yield better results.
You may refer to the following link in the event you desire a different combination of filters: https://in.mathworks.com/help/images/linear-filtering.html?s_tid=CRUX_lftnav
Please refer the following links for further information on:
  1. Recognize and detect vein pattern (ML Answer): https://in.mathworks.com/matlabcentral/answers/381718-how-to-recognize-and-detect-the-vein-pattern-in-the-image
  2. Image Segmentation Tutorial (File Exchange): https://in.mathworks.com/matlabcentral/fileexchange/25157-image-segmentation-tutorial?s_tid=srchtitle_support_results_9_image%2520filter
  3. Preprocessing steps in palm vein image (ML Answer): https://in.mathworks.com/support/search.html/answers/53105-pre-processing-steps-in-palm-vein-image.html?fq%5B%5D=asset_type_name:answer&fq%5B%5D=category:deeplearning/image-data-workflows&page=1
  4. Process images in real time (ML Answer): https://in.mathworks.com/support/search.html/answers/484295-how-can-i-use-matlab-to-process-images-in-real-time.html?fq%5B%5D=asset_type_name:answer&fq%5B%5D=category:support/image-acq6831&page=1
I hope this resolves your query!

Image Analyst
Image Analyst le 15 Fév 2024


En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange




Community Treasure Hunt

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

Start Hunting!

Translated by