How I create a image mask?

조회 수: 25 (최근 30일)
Samyak Raj Mehta
Samyak Raj Mehta 2015년 11월 29일
댓글: Image Analyst 2017년 10월 20일
I want to cut a complete face image in fixed face, without ears. Like we doing in photoshop. I have to create a mask from that i'll cut existing face images.
  댓글 수: 2
Jan
Jan 2015년 11월 29일
You forgot to explain any details. Do you want to determine the shape automatically or does the user define it with the mouse? Do you need a hard edge or some smoothing? Do you have the image processing toolbox?
In addition "provide me matlab code" is a command, not a polite question. This reduces the motivation to post an answer or provide a solution. So take the chance to edit the question, provide enough details to give us a chance to post a matching answer, and be polite.
Samyak Raj Mehta
Samyak Raj Mehta 2015년 12월 2일
편집: Samyak Raj Mehta 2015년 12월 2일
Thank's for your suggestion. I want to make mask, from this mask i'll cut different kind of face which are from faceGen Modeller. I need Edge of image are smooth.
I attached a sample face cut image.
Thank's...

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

답변 (2개)

Image Analyst
Image Analyst 2015년 11월 29일
See my attached demo of imfreehand.
  댓글 수: 3
W.Khan
W.Khan 2017년 10월 20일
Hello Image Analyst, I have two questions: for the selecting tool we can select only one object. What if I want to select more than one area. How to amend it?
Another question is: When I select the masked region, the mask is white (Masked white inside region). What if I want to fill this white area with some color, say blue, yellow etc? Please comment.
Thanks
Image Analyst
Image Analyst 2017년 10월 20일
Put imfreehand in a loop.
Do the mask replacement on each color channel individually.

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


Image Analyst
Image Analyst 2015년 12월 2일
For the face image, in your comment....
This image is already masked, so you must already have a mask, so I'm not sure what additional you need. If you don't have the mask, just take the max of the image and find zeros.
maxImage = max(rgbIMage, [], 3);
mask = maxImage ~= 0; % Inside of face, OR
mask = maxImage == 0; % Outside face - whichever you want.
  댓글 수: 2
Samyak Raj Mehta
Samyak Raj Mehta 2015년 12월 2일
I have used photoshop to cut this face and 24 images are still there to shape up. So can you please provide me solution from that my work will reduce. Or other wise any way to make outline of this face., from that I use outline of that face as a mask and cut rest of images.
Image Analyst
Image Analyst 2015년 12월 2일
편집: Image Analyst 2015년 12월 2일
How can I know how to do that when you have not given the original, pre-mask image and only supplied the post-mask image? What is outside the part you masked that made you decide not to include that in the mask?
Anyway, if you have only 24 images to mask, you might get it done faster in Photoshop than if you have to write and debug a MATLAB program.

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by