从FFT图像中找到频率。

huangapple go评论110阅读模式
英文:

Find frequency from FFT Image

问题

我有以下的图片,想要计算图片中光线草图的周期性,有人建议我使用傅立叶变换。我已经成功计算出功率谱,但之后就不知道该怎么继续了。我正在使用Halcon。

以下是使用的代码:

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 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

得分: 1

我认为这里不需要使用FFT。只需使用灰度投影并找到峰值。在代码中,有一个覆盖所有峰值的掩码。之后应该很容易:

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

从FFT图像中找到频率。

英文:

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

从FFT图像中找到频率。

huangapple
  • 本文由 发表于 2023年7月10日 23:50:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/76655388.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定