英文:
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
英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论