POV-Ray : Newsgroups : povray.general : Counting gear teeth : Re: Counting gear teeth Server Time
18 Apr 2024 04:41:38 EDT (-0400)
  Re: Counting gear teeth  
From: scott
Date: 14 Jun 2017 03:34:53
Message: <5940e71d$1@news.povray.org>
>> You can
>> then do a fourier transform along x, and the frequency peak in the
>> result will correspond to the number of teeth, and be far more immune to
>> any artefacts/noise in the image.
> 
> I worked a little bit more on this, and plotted out the radius vs arc-length to
> get a triangle wave graph (3600 samples).   Naturally, I thought that the
> Fourier transform would be a great way to pluck-out the frequency of the teeth,
> I just haven't gotten to that point yet.
> I'm glad to see that you actually do this, and know empirically that it's a
> reliable and robust method.  That validates spending the time to go that route.
>   Thanks!  :)
> 
> Based on my graph, there does seem to be some "cruft" at some point on the gear
> photo that distorts the data, but it's apparently still clean enough to give me
> the correct number of teeth with the way I'm currently doing it, provided I
> apply the correct frequency of sampling. (see binary thread)
> 
> I was also thinking that there ought to be way to determine a radial sampling
> frequency based on the resolution of the image - since any higher than that
> wouldn't gain me anything.
> 
> Until I work any of that out, I might just think about pre-scanning the
> perimeter, estimating the tooth number and average size of a tooth, and then
> filtering out any noise that disrupts my counting algorithm by ignoring any
> change that's less than a certain fraction of a tooth height.

Another thing I did, which allows you to get a much more accurate value 
of wavelength/frequency than Fourier allows, is to use some form of 
auto-correlation. It might work out quite well here... I do this step 
after Fourier has given me a rough idea of the spacing, but you might be 
able to just skip the Fourier step and do this...

You find the centre point of the gear. Then create a 2nd copy of the 
image rotated by some angle A about this centre point. You then do a 
difference of all the pixels in the original and rotated version and sum 
up the errors (maybe ignore the centre part of the gear).

As you increase angle A from zero you will get a different total error, 
the angle that gives the minimum error will be your tooth angle. You can 
use whatever algorithm you want to search for the A with the minimum error.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.