Height and width of an image

1 visualización (últimos 30 días)
Wong Wei Weng
Wong Wei Weng el 8 de Oct. de 2018
Comentada: Guillaume el 8 de Oct. de 2018
Hi, is it possible to find the height and width of the object inside an image? I had attached an image with white and black line to find width and height value
  2 comentarios
KSSV
KSSV el 8 de Oct. de 2018
Editada: KSSV el 8 de Oct. de 2018
Read about imdistline, regionprops.
Wong Wei Weng
Wong Wei Weng el 8 de Oct. de 2018
can it be 2 value? one horizontally and one is vertically?

Iniciar sesión para comentar.

Respuesta aceptada

ANKUR KUMAR
ANKUR KUMAR el 8 de Oct. de 2018
Try this,
A=imread('testing.jpg');
AA=rgb2gray(A);
len=max(arrayfun(@(x) length(find(AA(:,x)~=255)),1:800))
bred=max(arrayfun(@(x) length(find(AA(x,:)~=255)),1:800))
  9 comentarios
Guillaume
Guillaume el 8 de Oct. de 2018
Note:
nnz(something)
is simpler and a lot faster to compute than:
length(find(something))

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by