Height and width of an image
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
ANKUR KUMAR
le 8 Oct 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 commentaires
ANKUR KUMAR
le 8 Oct 2018
Please refer these links:
Guillaume
le 8 Oct 2018
Note:
nnz(something)
is simpler and a lot faster to compute than:
length(find(something))
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!