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 次查看(过去 30 天)
the image is an RGB object image

回答(1 个)

Fei Deng
Fei Deng 2016-9-21
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)

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by