Set image roi to zero

8 次查看(过去 30 天)
RuiQi
RuiQi 2016-2-10
评论: conor paxton 2018-10-19
Hi,
I have an image 800 x 800. I want to set a 10 x 10 region at center 200,200 to ZERO. How do i do that ? Help thanks
Managed to do it. Thanks
  1 个评论
conor paxton
conor paxton 2018-10-19
Hello, Could I ask, how you managed to do it please?

请先登录,再进行评论。

回答(2 个)

Guillaume
Guillaume 2016-2-10
A 10x10 region can't be centered on a pixel. It needs to have an odd size.
Anyway:
yourimage(196:205, 196:205, :) = 0

David Sanchez
David Sanchez 2016-2-10
If I is your image
I(201:210,201:210) = 0;
  1 个评论
Guillaume
Guillaume 2016-2-10
That's hardly centered on 200,200 !
And that only works with grayscale images

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by