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
  댓글 수: 2

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

채택된 답변

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