I am working on a project part of which requires removal of certain part of the image can anyone please help me with that ???? The input image is a front view of a face(does not contain any disguise)I want to delete its eyes. Is that possible??

 채택된 답변

Image Analyst
Image Analyst 2014년 9월 15일

0 개 추천

You can't have "holes" in the image - it must remain rectangular. Like David says, you can replace with zeros or some value but you can't have just null/nothing. imcrop() will produce a separate smaller image with the original left intact, unless the output of imcrop is also the original image.

댓글 수: 6

imcrop() is working but does not help my need sir.. replacing with zero might do.. how do i select specific region of the face(Eg:eyes) to make this replacement and what function/code do i use, i mean whats better functions like reshape() or going the histogram way??
This is how i want it to be in a rough way..
I can select the features using cascade object detector... is there some way i can replace selected portion with zero??
Assume you have a binary mask image that specified the region you want to make some uniform color (R, G, B):
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
redChannel(binaryMask) = R;
greenChannel(binaryMask) = G;
blueChannel(binaryMask) = B;
% Recombine separate color channels into a single, true color RGB image.
newRGBImage = cat(3, redChannel, greenChannel, blueChannel);
Ali Gouhar
Ali Gouhar 2020년 11월 13일
How to remove a single horizontal line and diagonal lines that is imposed on a image
Image Analyst
Image Analyst 2020년 11월 13일
You asked this before somewhere and I told you to use a modified median filter.
Please post this as a new question (not here) and if you can't figure it out, I'll give you a complete demo.

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

추가 답변 (1개)

Rushikesh Tade
Rushikesh Tade 2014년 9월 15일

0 개 추천

By removing if you mean crop then,
Image(row_start:row_end,col_start:col_end)=[];

댓글 수: 5

David Young
David Young 2014년 9월 15일
It's a good idea to test answers before posting them. Unless you are deleting complete columns or complete rows, this will just produce a "Subscripted assignment dimension mismatch" error.
Replacing [] with 0 might sometimes be a useful thing to do. The nub of the question is more likely to be how to detect the eyes in the first place.
Thanks but this is cropping the image... I want to remove eyes and let the remaining face be intact
David Young
David Young 2014년 9월 15일
No, it's not cropping the image. It's throwing an error, in general.
Its a syntax David you'll have to go through the help column to know how to make it work.
Image Analyst
Image Analyst 2014년 9월 16일
Let's make it crystal clear: You flat out cannot do what Rushikesh said in general. Just try it and see. The only way to get it to work is like David said and if those indexes indicate an entire row or column, meaning the start has to be 1 and the ends have to be "end".
What you can do is what I said, and that is to create new, smaller images where you've identified the rectangles in the image and used imcrop() to crop those out, thus forming the new images but leaving the original image intact.

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

질문:

2014년 9월 15일

댓글:

2020년 11월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by