在FFT直方图中查找尖峰
我想找出图像是否具有震撼力。如图所示,在这里。所以这就是我在做的。我进行傅立叶变换,检查是否有钉子。我必须从答案这里尝试此方法。
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论