필터 지우기
필터 지우기

how can i set a croped squares values in an image to zero?

조회 수: 1 (최근 30일)
sara
sara 2015년 6월 26일
댓글: sara 2015년 6월 28일
i want to remove a cropped square out of my image,?(the image without that cropped region),when i use imsubtract,it says they should be in same size,is it possible to give the value 0 to the cropped square instead?

채택된 답변

Image Analyst
Image Analyst 2015년 6월 26일
"remove a cropped square out of my image" - what does that mean? You can't remove it. Images must remain rectangular. You can't just remove them and have nothing/emptiness there. There has to be something there, even if it's just NaN values.
If you want to set some rectangular region to zero in a gray scale image, you can do this:
grayImage(row1:row2, col1:col2) = 0;
You can also set a non-rectangular region(s) to zero if you have a binary image where pixels are "true" if you want them to be set to zero, and false if you want them to remain untouched:
grayImage(mask) = 0;
  댓글 수: 1
sara
sara 2015년 6월 28일
thank you very much,it worked so greate,it was part of the image which had bad effect on my segmentation.thank you,.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Geometric Transformation and Image Registration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by