如何检测图片是否被修改?

发布于 2024-11-28 02:20:21 字数 254 浏览 4 评论 0原文

假设某人有一张白皮书图像(.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 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

戏舞 2024-12-05 02:20:21

事实上,这方面的研究已有悠久的历史。例如,在像素级别,修改的部分可能与相邻像素不一致(当然,在某些假设下,边缘永远不会与相邻像素一致,但用户强加的模糊区域与图片的其余部分不一致,如果您复制图像中的区域,两个区域将具有令人难以置信的高相似度分数)。

当然,有很多对策(技术/逻辑)可以击败现有的伪造检测方法。

我建议您在谷歌上搜索“数字图像伪造

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"

洋洋洒洒 2024-12-05 02:20:21

只是一个想法,虽然我从未尝试过。

  1. 以预定义的比例获取图像直方图并将直方图箱存储到 EXIF
  2. 为了检查图像,将图像缩放到预定义的比例并获取其直方图
  3. 从 EXIF 直方图箱与 (2) 中获得的直方图箱进行比较

有点简单,我猜;-)

Just a thought, though I have never tried it.

  1. Obtain the Image Histogram at a predefined scale and store the histogram bin into the EXIF
  2. For checking the Image, scale the Image to the predefined scale and obtain its histogram
  3. From the EXIF histogram bins compare with histogram bins obtained in (2)

Kind of simple, I guess ;-)

沐歌 2024-12-05 02:20:21

不,这是不可能的。你也许能想出一些在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文