Calculation of length and width [closed]

-1
Hello, I'm developing an application in Octave, which is very similar to MathLab and with C, which calculates the height and width of an object, which in this case is a seed.

The program receives an input image and then binarizes it. I would like to know how to calculate this distance, as I researched a lot and could not understand it very well.

One of the questions is: How do you find the two points in the image to measure the distance between them? Because type, in my thinking I have to get in the "middle" of the object at the top and "down" a line to the end of the object, this way I would have a row of pixels, which after performing a rule of three with another object of known size, I would get this information.

Thank you in advance.

    
asked by anonymous 02.06.2018 / 16:07

1 answer

1

If it's a color image,

I = imread("minhaImagem.png");
img = I(1);
[width, height, colorDepth] = size(img);

disp(width); disp(height)

If it is a monochrome image,

I = imread("minhaImagem.bmp");
img = I(1);
[width, height] = size(img);

disp(width); disp(height)

If it's an animated image,

I = imread("minhaImagem.gif");
img = I(1);
[width, height, colorDepth, timing] = size(img);

disp(width); disp(height)
    
02.06.2018 / 17:06