how to calculate width and length of binary image?

12 views (last 30 days)
I need to calculate width and length of the binary image... PLZ SUGGEST A WAY

Accepted Answer

Image Analyst
Image Analyst on 18 Oct 2014
You can use the size() function:
[theLength, width] = size(binaryImage);
The first return argument, theLength, is the number of rows (the height), and the second output argument, width, is the number of columns.
As an aside, don't use length as the name of a variable since it's the name of a built-in function.
  8 Comments
sou
sou on 20 Oct 2014
sir but this gives wrong width for my image sir...
my image is in this link http://labs.fme.aegean.gr/decision/downloads in this link under martin2003 zip file New database pictures\normal superficiel cells are my images sir... plz try it

Sign in to comment.

More Answers (1)

Matt J
Matt J on 18 Oct 2014
Edited: Matt J on 18 Oct 2014
The size() command?
[Width,Length]=size(binaryImage);

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!