MATLAB Answers

how can i assign different intensity to an object present in an image with dimension (N,N,3) (for example: assigning different intensity(like 10,20,100,etc) to a circle present in an image)

1 view (last 30 days)
HT
HT on 19 Sep 2016
Answered: Fei Deng on 21 Sep 2016
the image is an RGB object image

  0 Comments

Sign in to comment.

Answers (1)

Fei Deng
Fei Deng on 21 Sep 2016
Hi Hemang,
To assign a different intensity to an object present in an RGB image, basically there are two steps:
(1) To identify the object and positions of the pixels that this object sits on;
(2) Assign intensity to these pixels.
You can use Computer Vision System toolbox or Image Processing toolbox to do the first step, for example, function ‘imfindcircles’ can be used for finding circles. Now I assume you already have those target positions in hand. To change intensity of certain positions, here is a simple example:
I= imread('peppers.png'); % read an image (stored in MATLAB default path)
I2 = I;
I2(:,200:220,:)=255; % Change the intensity to 255 for the object, here the object is a vertical line with width 20;
image(I2)

  0 Comments

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!