I need to draw 8 lines in a binary image according to the attached image.
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Marlon Damaceno
el 28 de Nov. de 2017
Editada: shivu shetty
el 5 de Abr. de 2018

How can I do this?
2 comentarios
Walter Roberson
el 28 de Nov. de 2017
Why 8? I only see 4 lines needed: one circle, and three blue lines that cross the circle.
Respuesta aceptada
KSSV
el 29 de Nov. de 2017
This can be done.....I will suggest you a method with functions available..rest you have to follow.
- Load the image using imread
- Crop the white margins i.e pick only from balck to black using imcrop
- Convert rgb image to gray using rgb2gray. This makes black to 0 and white to 255.
- Using find function find the white pixels. This gives all points of the white region
- Using boundary function get the boundary. This gives irregular curve coordinates which separates white and black. Now you have to play with this curve.
- Using pdist or Eucledian distance formula get the length of successive segments..summing this gives length of whole curve.
- Now split this length into eight equal parts..and pick those coordinates..joining these gives the lines you want.
Good luck.
2 comentarios
shivu shetty
el 5 de Abr. de 2018
Editada: shivu shetty
el 5 de Abr. de 2018
plz help me to count these rings....help me
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
