How to remove specific portions of a image?

조회 수: 1 (최근 30일)
arjun
arjun 2014년 7월 30일
댓글: Steve Eddins 2014년 7월 31일
Hey, I wish to remove circles from my image by specifying its center and the radius. Its a bw image and i wish to specifically remove few selected circles by specifying their centers and radii. I know strel can be used but i am not able to figure out how to use it for this purpose. Thanks.
  댓글 수: 1
Steve Eddins
Steve Eddins 2014년 7월 31일
See today's blog post for a little bit more on this question.

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

채택된 답변

Image Analyst
Image Analyst 2014년 7월 30일
Keeping in mind that an image must remain rectangular, what does "remove" mean to you? You can't really remove those pixels but you can replace them with something, such as another image, a texture, a uniform gray level, or smear the boundaries inwards with roifill(). What do you want to do?
  댓글 수: 3
Image Analyst
Image Analyst 2014년 7월 30일
See the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_create_a_circle.3F to create a circle mask. Then use that to replace the image
grayImage(mask) = 0;
Image Analyst
Image Analyst 2014년 7월 30일
If you just want to replace all pixels above some value, like 250, with 0, then do this
binaryImage = grayImage > 250; % or whatever.
grayImage(binaryImage) = 0; % Set to 0.

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

추가 답변 (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