MATLAB Answers

RuiQi
0

Set image roi to zero

Asked by RuiQi
on 10 Feb 2016
Latest activity Commented on by conor paxton on 19 Oct 2018
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 Comment

conor paxton on 19 Oct 2018
Hello, Could I ask, how you managed to do it please?

Sign in to comment.

2 Answers

Guillaume
Answer by Guillaume
on 10 Feb 2016

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

  0 Comments

Sign in to comment.


David Sanchez
Answer by David Sanchez
on 10 Feb 2016

If I is your image
I(201:210,201:210) = 0;

  1 Comment

Guillaume
on 10 Feb 2016
That's hardly centered on 200,200 !
And that only works with grayscale images

Sign in to comment.