How to Calculate Gears

Hello,

As shown in the attached image, I am working with a gear and would like to automatically calculate:
The tooth-to-root distance (the distance from the tooth tip to the bottom of the groove, passing through the gear's geometric center)
My questions are:
Are there any existing algorithms or established methods to automatically measure these gear tooth dimensions?
Are there any tools or libraries that can easily implement this functionality through macros or image processing?
I should note that the macro I've currently written only works for this specific gear image, but what I need is a solution that can be applied to images of any gear.
Attached is the macro I generated and the IQO file used.
Thank you very much for your assistance!

Best Answers

  • howard
    edited September 22 Answer ✓

    Matt—

    I've revised the macro, and it can now calculate the required targets.
    However, the IQO file used in the process cannot be applied to every gear drawing.

    Thanks.

    —Howard

  • 2025-09-24-165922

    Howard --

    Here is an EXAMPLE IMAGE that has OBJECTS that are SIMILAR in AREA




    Here is a SCREEN CAPTURE of IMAGE-PRO finding the 7 OBJECTS based on a DARK THRESHOLD



    Using the MEASUREMENT TYPES to include ROUNDNESS as a MEASUREMENT, we can then use EDIT RANGE to set the acceptable ROUNDNESS as shown here.



    With a ROUNDNESS FILTER from 1 to 2, and the RANGE OPTION turned on, when the COUNT is run, 5 OBJECTS are found as shown here.


    I have attached the EXAMPLE IMAGE below.

    I hope this information is helpful.

    -- Matt



Answers

  • 2025-09-11-142940

    Howard --

    This is an interesting challenge.

    I have downloaded and reviewed the contents of the file named 

        GEAR.ZIP 

    that you posted here on the forum.

    I would like to run YOUR MACRO on a copy of YOUR IMAGE that does not include the IMAGE-PRO MEASUREMENT LINES.  Will you amend this POST to include an ORIGINAL FULL SIZED COPY of one or more ORIGINAL SAMPLE IMAGES please.

    Thank you.

    -- Matt

    Matthew M. Batchelor
    Alces Imaging and Automation, LLC
  • Matt--
    Here is the original image
    Thank you.

    --Howard
  • 2025-09-16-115310

    Howard --

    Thank you for the THREE IMAGE FILES.

    The IMAGE FILES that I received are shown here.


    I will try to work on this later TODAY (TUE).

    Thanks again.

    -- Matt
  • 2025-09-18-161432

    Howard --

    I attempted to use your GEARS PROJECT on the EXAMPLE IMAGE named

        llqwmgwbdylt.tif

    I received an error as shown in the IMAGE below.

    I have some ideas on how we might set up the automated analysis that you are looking for but I would like to understand the path that you have followed up to this point.

    How would you like to proceed?

    Thanks.

    -- Matt

    Matthew M. Batchelor
    President and Applications Engineer
    Alces Imaging and Automation, LLC
    2906 Blue Wind Court
    Houston, TX  77084




  • mbatchelor
    edited September 23
    2025-09-23-134825

    Howard --

    Thank you for your message.

    Do you still have a question on this project that we can help you with?

    -- Matt
  • Matt--

    I want to know if there is a way to segment based on shape rather than color.

    Thank you.

    Howard--
  • 2025-09-24-145130

    Howard --

    Thank you for your message.

    Using the TRADITIONAL COUNT TOOL within IMAGE-PRO, the OBJECTS or FEATURES are found via a THRESHOLD of PIXEL GRAY VALUE or PIXEL COLOR VALUE.  After those OBJECTS or FEATURES are outlined based on that THRESHOLD, then MEASUREMENT RANGES can be used to FILTER those OBJECTS or FEATURES.

    I will generate an example image and show you this feature in action ASAP.

    -- Matt
  • Matt--

    Thank you for your assistance.

    --Howard
  • 2025-09-26-140822

    Howard --

    ALCES and I are glad to assist IMAGE-PRO USERS.

    -- Matt