Height and width of an image

조회 수: 2 (최근 30일)
Wong Wei Weng
Wong Wei Weng 2018년 10월 8일
댓글: Guillaume 2018년 10월 8일
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
KSSV
KSSV 2018년 10월 8일
편집: KSSV 2018년 10월 8일
Read about imdistline, regionprops.
Wong Wei Weng
Wong Wei Weng 2018년 10월 8일
can it be 2 value? one horizontally and one is vertically?

댓글을 달려면 로그인하십시오.

채택된 답변

ANKUR KUMAR
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
Guillaume
Guillaume 2018년 10월 8일
Note:
nnz(something)
is simpler and a lot faster to compute than:
length(find(something))

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Build Interactive Tools에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by