finding longest length

2 visualizaciones (últimos 30 días)
Mohammad Golam Kibria
Mohammad Golam Kibria el 14 de En. de 2012
Hi ,I have a matrix as follows I =
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0
0 0 1 0 1 0 0 0 1 0
0 1 0 1 1 0 1 0 0 1
1 0 0 0 1 0 1 1 0 0
0 0 0 0 1 0 1 0 0 0
0 1 1 1 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
I need the output as follows:
I =
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 1 0
0 1 0 1 0 0 0 0 0 1
1 0 0 0 0 0 0 1 0 0
0 0 0 0 1 0 1 0 0 0
0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
i.e only the longest length of pixel that touches two opposite boundary.can any body help please?Thanks

Respuestas (0)

Categorías

Más información sobre Images en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by