How to apply thinning algorithm to color image
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi, is there any possible way to apply thinning algorithm to a color image. Exactly like the one I attached. I want to get single line drawing from the color image
Thank you
0 comentarios
Respuestas (1)
Image Analyst
el 16 de Abr. de 2014
Try this for starters:
redChannel = rgbImage(:,:,1);
% Threshold (binarize) the red channel.
binaryImage = redChannel < 227; % Use triangle method to get the # automatically.
% Take largest blob. See attached demo. Then...
thinnedImage = bwmorph(binaryImage, 'skel', inf);
Adapt as necessary.
3 comentarios
Image Analyst
el 16 de Abr. de 2014
You can't. It needs to be binary if you're going to skeletonize. After skeletonization you can convert to color if you want:
black = zeros(size(binaryImage), 'uint8');
rgbImage = cat(2, black, black, uint8(binaryImage));
Weight the components if you want a different color.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!