- Find all red pixels. This will give you a list of pixel coordinates.
- Convert all of the found red pixels to black pixels in the image.
- Add your desired constant to the x coordinates that you found in step 1.
- Convert the bleck pixels at the new set of coordinates into red pixels.
How can I convert red curve in an image into a line ?
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MMSAAH
el 11 de Jul. de 2019
Editada: John D'Errico
el 11 de Jul. de 2019
I have a skeletonized image (512*512*3) of type uint8. (See attached image)
I want to convert this image into a curve and translate it along the x axis without changing image dimensions.
Can anyone help me solving this task ?
Thanks in advance
0 comentarios
Respuesta aceptada
John D'Errico
el 11 de Jul. de 2019
Editada: John D'Errico
el 11 de Jul. de 2019
What does it mean to convert something into a "curve"? In fact, there is no need to do anything of the sort.
You have a picture of some red pixels, on a black background. You want to shift them by some amount in x. Easy, really.
Done. WTP? There was never any need to create some sort of unspecified thing as a curve, since all you wanted to do is shift a set of pixels in the image. In fact, creating a curve out of those pixels is a more complicated thing, since it must be some completely general curve as it is drawn. Then you would need to convert it back into pixel coordinates. So creating some sort of arbitrary curve is a waste of time and effort.
0 comentarios
Más respuestas (1)
dror yemini
el 11 de Jul. de 2019
ind=find(im2(:)>0);
[ii,jj]=ind2sub(size(im2),ind);
figure,imshow(im2);hold on;
plot(jj,ii,'wo')
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!