如何检测图片是否被修改?
假设某人有一张白皮书图像(.JPG 或 .PNG),其中有黑色文本。有人使用高级照片编辑器(Photoshop、GIMP 等)修改了此图像(通过画笔更改字母/数字)并将其发送给我们。
有什么办法可以通过代码来检测我们最终的这种类型的修改吗?
我读到相机上使用了一些算法,并且输出图像是通过一系列操作/模式渲染的。当有人通过图像编辑器触摸图像时,原始相机创建的图案肯定存在一些不正确的地方。这是真的吗?
任何链接、代码或想法将不胜感激。 卡斯萨卡尔
Assume that someone have an image(.JPG or .PNG) of a white paper which has black text in it. Someone modified this image(changed letters/numbers by brush) with an advanced photo editor(Photoshop, GIMP, etc.) and send it to us.
Is there any way to detect this type of modification in our end by code?
I read that there are some algorithms used on cameras and output images are rendered with a series of operations/patterns. When someone touch the image by a image editor, there needs to be some incorrectness on the patterns which are created by the original camera. Is this true?
Any link, code or idea will be appreciative.
cas sakal
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
事实上,这方面的研究已有悠久的历史。例如,在像素级别,修改的部分可能与相邻像素不一致(当然,在某些假设下,边缘永远不会与相邻像素一致,但用户强加的模糊区域与图片的其余部分不一致,如果您复制图像中的区域,两个区域将具有令人难以置信的高相似度分数)。
当然,有很多对策(技术/逻辑)可以击败现有的伪造检测方法。
我建议您在谷歌上搜索“数字图像伪造”
There is in fact a long history of research in that aspect. For example, at pixel level, the part that one modifies might not agree with the neighboring pixels (under some assumptions of course, edges never agree with neighboring pixels, but a user-imposed blurring region does not agree with the rest of the picture, if you duplicate regions in an image, two regions would have unbelievably high similarity scores).
Of course, there are a lot of countermeasures(technical/logical) that would defeat existing forgery detection methods.
I'll advice you to google "digital image forgery"
只是一个想法,虽然我从未尝试过。
有点简单,我猜;-)
Just a thought, though I have never tried it.
Kind of simple, I guess ;-)
不,这是不可能的。你也许能想出一些在 99% 的情况下都有效的方法,但我保证如果它足够重要,就会有人找到对策。
例如,他们可以在 Photoshop 中更改图片,将其打印出来并拍摄一张新照片,然后将其发送给您。祝你好运,检测到数字更改。
No, this is not possible. You may be able to come up with something that will work 99% of the time, but I guarantee if it is important enough, someone will find a countermeasure.
For example, they could alter the picture in photoshop, print it out and take a new photo, then send that to you. Good luck detecting that digital alteration.