How can I erase the pqtient's name,age,date,time,etc from the following image using matlab code

3 次查看(过去 30 天)
Please Sir send me the code. It will be very helpful if you send me the complete code

采纳的回答

Image Analyst
Image Analyst 2015-3-28
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 个评论
Image Analyst
Image Analyst 2015-3-29
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.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Read, Write, and Modify Image 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by