Height and width of an image
조회 수: 1 (최근 30일)
이전 댓글 표시
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
채택된 답변
ANKUR KUMAR
2018년 10월 8일
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
ANKUR KUMAR
2018년 10월 8일
Please refer these links:
Guillaume
2018년 10월 8일
Note:
nnz(something)
is simpler and a lot faster to compute than:
length(find(something))
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!