在FFT直方图中查找尖峰

发布于 2025-02-05 09:00:56 字数 601 浏览 3 评论 0原文

我想找出图像是否具有震撼力。如图所示,在这里。所以这就是我在做的。我进行傅立叶变换,检查是否有钉子。我必须从答案这里尝试此方法。

im = cv2.imread('image1.jpg') 
gray= cv2.cvtColor(im, cv2.COLOR_BGR2GRAY)
 
fft = np.fft.fft2(gray) fftShift = np.fft.fftshift(fft)

答案说“沿x和y轴进行计算直方图,并查找是否存在尖峰。如果尖峰高于定义阈值,则具有像素化图像。”我知道scipy.signal模块中有find_peaks。但是我不知道如何确切地将其用于此目的,或者是否有更好的方法。有人可以帮忙吗?

我只有像素化图像,没有原始图像。

I want to find if an image has blockiness. Like in the image here. So this is what I am doing. I take the fourier transform and check if there are spikes. I got to try this method from the answer here.

im = cv2.imread('image1.jpg') 
gray= cv2.cvtColor(im, cv2.COLOR_BGR2GRAY)
 
fft = np.fft.fft2(gray) fftShift = np.fft.fftshift(fft)

The answer says to "compute histograms along X and Y axis, and find if there are spikes. If spikes are higher than defined threshold, you have pixelated image." I know there is find_peaks in scipy.signal module. But I do not know how exactly to use it for this purpose or if there is a better way of doing it. Can someone please help?

I only have the pixelated image, I do not have the original image.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文