Borrar filtros
Borrar filtros

How to change color some parts of RGB image directly in matlab?

1 visualización (últimos 30 días)
Vortana
Vortana el 23 de En. de 2014
Comentada: Image Analyst el 10 de Mzo. de 2014
Well, I struggle several days to find solutions for this issue since i am a new in matlab.
Let's say for example I have big images contains coins, I did pre-processing, and I crop each coins from the original image using boundingbox from regoinprops. I got
In the image above, there is a coin, and black line here refers to some texts or line.
What I want to do is I want to extract only the coin from this cropped image.
I came up an ideas that if I can do an operations that detect for instance 10px from left-top, right-top, left-bottom, and right bottom in this rgb image directly than change those pixel to white color than I can get something like this, only coins with white background.
What do you think about this idea? can I implement it in matlab? Do you have any other ideas that can solve this problem?
Thank

Respuestas (1)

Image Analyst
Image Analyst el 23 de En. de 2014
Since the shadows could possibly cause a problem, I'd probably see what imfindcircle() can do for you.
  2 comentarios
Vortana
Vortana el 23 de En. de 2014
Thank, but i use Matlab2011R, so I don't think they have this function.
Image Analyst
Image Analyst el 10 de Mzo. de 2014
If it's still a problem, let me know. Otherwise let's find a way that works. for example since the coin is colored you can probably convert to hsv with rgb2hsv() and then use thresholding to find pixels with a high "s" value.
hsv = rgb2hsv(rgbImage);
s = hsv(:,:,2);
coinMask = s > 0.2; % or whatever value works.

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by