how to make top half image white in the frame ??

5 visualizaciones (últimos 30 días)
sai vallikat
sai vallikat el 24 de Ag. de 2016
Comentada: Image Analyst el 1 de Sept. de 2016
I am having an RGB image and I want to make top region of the image filled with white color.. The above is the RGB image with frame size 640 * 480
I want the upper half to make it white..
Any suggestions are greatly appreciated..! Thanks

Respuesta aceptada

Image Analyst
Image Analyst el 24 de Ag. de 2016
Just set the values to 255:
[rows, columns, numberOfColorChannels] = size(rgbImage);
midRow = floor(rows/2);
rgbImage(1:midRow, :, :) = 255;
imshow(rgbImage);
  5 comentarios
sai vallikat
sai vallikat el 1 de Sept. de 2016
Hello sir,
That actually worked for me but I want to segment out the frame like this
out of the entire frame that is visible in the above image..!
Precisely I want to shade all the regions and take only the region of the pallet as I shown below ... I want to make other entire region white..
Thanks, Regards. sai
Image Analyst
Image Analyst el 1 de Sept. de 2016
I hope you understand that I can't write the entire app for you. If I were you, I'd use a combination of a texture filter, like stdfilt(), and color segmentation, like the demos in my File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862

Iniciar sesión para comentar.

Más respuestas (1)

sai vallikat
sai vallikat el 1 de Sept. de 2016
I tried this way it is working but is there any easy approach to do ??
if true
% code
i = imread('2.png');
i(1:350, 1:640, :) = 255;
i(1:480, 1:220, :)=255;
i(1:480, 440:640, :) =255;
i(450:480, 220:440, :)= 255;
imshow(i)
end
  1 comentario
Image Analyst
Image Analyst el 1 de Sept. de 2016
No, that's pretty much the best way, assuming you know the rows and columns like you do.

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by