How Can I Find Size, Angle and Vector(line) Length Automatically or using single button click or macro :)

Tags: #<Tag:0x00007fb87a1ac7e8> #<Tag:0x00007fb87a1ac658> #<Tag:0x00007fb87a1ac518> #<Tag:0x00007fb87a1ac3d8>


Hello community :slight_smile:

I want to measure size of the object from image like 1.2mm x 1.6 mm automatically draw lines around the object

Finding angle like below

Finding angle and length of the vector

Please understand this I was able to do all that using manual mode. I already read through user guide also I went through forum but most of the time I was doing it manually :walking:, Is there any way I can do it in Auto mode :bullettrain_side:. My images are not complex. Is there any possibility that I can measure all that during live cam real time like I put object under microscope and it instantly shows the size of the object, angle and length of vector. With single push of the button.:sweat:

Example Image

cylinder width is 6.89 in mm for scale


Hi @dimsum

This depends heavily on the objects you try to measure. Your example image with the cylinder is relatively simple, You could threshold it and then project it down to one dimension and measure the length of the projection.

Other shapes are more complex. You have to start with a segmentation and then get the polygon out of it. I know that you can convert a ROI to and Polygon with ops().convert().contour(ROI), but this will result in a “dense” polygon (a vertex for each border pixel). To get angles and lengths it would be good to get a “sparse” (only corner vertices) polygon.


@tibuch thanks for helping me out can you please make a macro of it and post it here I am bit confuse because every time I try to automate task it just don’t work I also banging my head with opencv and python for live object dimension something like this can we do that something similar in imagej :tired_face:


I don’t have a macro at hand which will perform live object measuring. I just tried to give you some starting points.

I would personally start with basic object segmentation either with ImageJ or KNIME Image Processing and then extract features/measurements from the segmentation.