Height and width of an image

1 回表示 (過去 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 Center および File ExchangeRed についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by