Height and width of an image

5 次查看(过去 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 个评论
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 个)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by