0

i have the following picture and i want to calculate the periodicity of the light drafts in the picture, i was suggested to use fourier transform. I got as far as calculating the power spectrum but then I can't continue. i am working in halcon this is the image that I have to analyze

this is the code used

get_image_size (img, Width, Height)
median_rect (img, ImageMedian, 5, Height -1)
sub_image (img,ImageMedian,ImageSub, 1.0, 128)
fft_generic (ImageSub, ImageFFT, 'to_freq', -1, 'sqrt', 'dc_center', 'complex')
power_real(ImageFFT, ImageResult)

i need advice on how to continue not only code but also ideas are fine.

1 Answers1

1

I don't think there is need for FFT here. Just use gray projections and find the peaks. In the code, there is a mask that covers all the peaks. After that it should be easy:

read_image (Image, 'C:/Users/Perkovic/Desktop/JL9Wj.png')
gray_projections (Image, Image, 'simple', HorProjection, VertProjection)
create_funct_1d_array (HorProjection, Function)
smooth_funct_1d_mean (Function, 9, 3, SmoothedFunction)
funct_1d_to_pairs (SmoothedFunction, XValues, Signal)

tuple_median (Signal, Median)
tuple_deviation (Signal, Deviation)
Mask:=Signal[>]Median+Deviation

enter image description here

Vladimir Perković
  • 1,351
  • 3
  • 12
  • 30