How can I erase the pqtient's name,age,date,time,etc from the following image using matlab code
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Prakash Sharma
le 26 Mar 2015
Commenté : Image Analyst
le 29 Mar 2015
Please Sir send me the code. It will be very helpful if you send me the complete code
2 commentaires
Réponse acceptée
Image Analyst
le 28 Mar 2015
The code was not built with all images in mind - only one image was supplied so it might only work with images of that type. For your image it looks like you might just be able to find pure white pixels and set them to zero
grayImage(grayImage==255) = 0;
Of course it will need to be a little more robust since you will have to account for white pixels that might occur within the brain. So first you'll have to find the brain by thresholding, then fill it. Then mask that out so it's not touched when using the line above. Something like (untested)
brainPixels = grayImage > someThreshold;
%---------------------------------------------------------------------------
% Extract the largest area using our custom function ExtractNLargestBlobs().
biggestBlob = ExtractNLargestBlobs(brainPixels , 1);
biggestBlob = imfill(biggestBlob, 'holes');
%---------------------------------------------------------------------------
letters = grayImage == 255;
% Mask out brain.
letters(biggestBlob) = false;
% Erase letters
grayImage(letters) = 0;
See attached demo for the ExtractNLargestBlobs() function. Come back with any difficulties, otherwise, eventually mark the Answer as accepted if it works.
4 commentaires
Image Analyst
le 29 Mar 2015
That image has white gridlines around it, like it's a portion of a contact sheet. You should get rid of those, like use imcrop() to extract only the part of the image within the grid tile. There are several other ways to do it but the key is to start with a good image. If you have to make it "good" to start with, then that will add several steps.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Read, Write, and Modify Image 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!