检测拍摄图像的相机

时间:2015-11-12 04:20:41

标签: image-processing machine-learning computer-vision

考虑一下我们所拥有的一个问题 - 一组5个摄像头和10个从每个摄像头拍摄的照片(在不同的照明条件下)。

我的问题是,它是否可能有一张随机图片(取自该套装中的一台相机)并确定拍摄哪张相机?

图像处理,计算机视觉,机器学习......不是我的专业领域(正如你所建议的那样)但我知道一些机器学习概念/算法的基础知识以及如何处理数据集等。

我知道这是一个非常广泛的问题,可能没有黑色或白色的答案,但任何有关我如何处理问题或应该是什么起点的指导都将受到高度赞赏,因为我无法做到这一点。在网上找到关于这个特定问题的大量帮助。

2 个答案:

答案 0 :(得分:5)

最简单的可能是查看图像名称,因为大多数摄像机都会分配单调增加的帧数,并且摄像机不太可能都拍摄相同数量的照片 - 如果有,则可以在拍摄之前拍摄100张额外照片从第一台摄像机开始,在第二台摄像机上增加200张图片,在第三台摄像机上增加300张,依此类推,以便偏移帧数。

另一种选择是使用jheadexiftool等工具查看图片标题中的EXIF数据,例如

exiftool IMG_3913.JPG

<强>输出

ExifTool Version Number         : 10.01
File Name                       : IMG_3913.JPG
Directory                       : .
File Size                       : 1979 kB
File Modification Date/Time     : 2015:05:28 17:16:43+01:00
File Access Date/Time           : 2015:11:12 08:05:21+00:00
File Inode Change Date/Time     : 2015:11:12 07:59:13+00:00
File Permissions                : rw-------
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
Exif Byte Order                 : Big-endian (Motorola, MM)
Make                            : Apple
Camera Model Name               : iPhone 5
Orientation                     : Rotate 90 CW
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Software                        : 8.3
Modify Date                     : 2015:05:28 17:16:43
Y Cb Cr Positioning             : Centered
Exposure Time                   : 1/120
F Number                        : 2.4
Exposure Program                : Program AE
ISO                             : 80
Exif Version                    : 0221
Date/Time Original              : 2015:05:28 17:16:43
Create Date                     : 2015:05:28 17:16:43
Components Configuration        : Y, Cb, Cr, -
Shutter Speed Value             : 1/120
Aperture Value                  : 2.4
Brightness Value                : 5.308204915
Exposure Compensation           : 0
Metering Mode                   : Multi-segment
Flash                           : Auto, Did not fire
Focal Length                    : 4.1 mm
Subject Area                    : 1373 1230 998 998
Run Time Scale                  : 1000000000
Run Time Value                  : 27313980762583
Run Time Epoch                  : 0
Run Time Flags                  : Valid
Sub Sec Time Original           : 037
Sub Sec Time Digitized          : 037
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 3264
Exif Image Height               : 2448
Sensing Method                  : One-chip color area
Scene Type                      : Directly photographed
Exposure Mode                   : Auto
White Balance                   : Auto
Focal Length In 35mm Format     : 33 mm
Scene Capture Type              : Standard
Lens Info                       : 4.12mm f/2.4
Lens Make                       : Apple
Lens Model                      : iPhone 5 back camera 4.12mm f/2.4
GPS Latitude Ref                : North
GPS Longitude Ref               : West
GPS Altitude Ref                : Above Sea Level
GPS Time Stamp                  : 16:16:35.6
GPS Speed Ref                   : km/h
GPS Speed                       : 0
GPS Date Stamp                  : 2015:05:28
Compression                     : JPEG (old-style)
Thumbnail Offset                : 1328
Thumbnail Length                : 10991
XMP Toolkit                     : XMP Core 5.4.0
Region Applied To Dimensions H  : 2448
Region Applied To Dimensions W  : 3264
Region Applied To Dimensions Unit: pixel
Region Extensions Time Stamp    : -1596906250
Region Extensions Face ID       : 2
Region Extensions Confidence Level: 352
Region Extensions Angle Info Yaw: 0
Region Extensions Angle Info Roll: 270
Region Area Y                   : 0.503881
Region Area W                   : 0.306066
Region Area Unit                : normalized
Region Area X                   : 0.418658
Region Area H                   : 0.408088
Region Type                     : Face
Image Width                     : 3264
Image Height                    : 2448
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Aperture                        : 2.4
GPS Altitude                    : 20 m Above Sea Level
GPS Date/Time                   : 2015:05:28 16:16:35.6Z
GPS Latitude                    : 51 deg 51' 3.11" N
GPS Longitude                   : 2 deg 12' 18.89" W
GPS Position                    : 51 deg 51' 3.11" N, 2 deg 12' 18.89" W
Image Size                      : 3264x2448
Megapixels                      : 8.0
Run Time Since Power Up         : 7:35:13
Scale Factor To 35 mm Equivalent: 8.0
Shutter Speed                   : 1/120
Create Date                     : 2015:05:28 17:16:43.037
Date/Time Original              : 2015:05:28 17:16:43.037
Thumbnail Image                 : (Binary data 10991 bytes, use -b option to extract)
Circle Of Confusion             : 0.004 mm
Field Of View                   : 57.2 deg
Focal Length                    : 4.1 mm (35 mm equivalent: 33.0 mm)
Hyperfocal Distance             : 1.89 m
Light Value                     : 9.8

jhead这样:

jhead -v IMGxyz.jpg

<强>输出

Exif header 12317 bytes long
Exif section in Motorola order
(dir has 11 entries)
    Make = "Apple"
    Model = "iPhone 5"
    Orientation = 6
    XResolution = 72/1
    YResolution = 72/1
    ResolutionUnit = 2
    Software = "8.3"
    DateTime = "2015:05:28 17:16:43"
    YCbCrPositioning = 1
    ExifOffset = 198
    Exif Dir:(dir has 32 entries)
        ExposureTime = 1/120
        FNumber = 12/5
        ExposureProgram = 2
        ISOSpeedRatings = 80
        ExifVersion = "0221"
        DateTimeOriginal = "2015:05:28 17:16:43"
        DateTimeDigitized = "2015:05:28 17:16:43"
        ComponentsConfiguration = "?"
        ShutterSpeedValue = 5567/806
        ApertureValue = 4845/1918
        BrightnessValue = 12745/2401
        ExposureBiasValue = 0/1
        MeteringMode = 5
        Flash = 24
        FocalLength = 103/25
        SubjectArea = 1373, 1230, 998, 998
        Maker note:  41 70 70 6c 65 20 69 4f 53 00 00... (232 bytes)
        SubSecTimeOriginal = "037"
        SubSecTimeDigitized = "037"
        FlashPixVersion = "0100"
        ColorSpace = 1
        ExifImageWidth = 3264
        ExifImageLength = 2448
        SensingMethod = 2
        SceneType = ""
        ExposureMode = 0
        WhiteBalance = 0
        FocalLengthIn35mmFilm = 33
        SceneCaptureType = 0
        Unknown Tag a432 Value = 103/25, 103/25, 12/5, 12/5
        Unknown Tag a433 Value = "Apple"
        Unknown Tag a434 Value = "iPhone 5 back camera 4.12mm f/2.4"
    GPS Dir offset = 996
    GPS info dir:(dir has 10 entries)
        GPSLatitudeRef      ="N"
        GPSLatitude         =51/1, 51/1, 311/100, 51/1, 311/100, 2/1, 311/100, 2/1, 12/1
        GPSLongitudeRef     ="W"
        GPSLongitude        =2/1, 12/1, 1889/100, 12/1, 1889/100, 17151/857, 1889/100, 17151/857, 16/1
        GPSAltitudeRef      =00
        GPSAltitude         =17151/857
        GPSTimeStamp        =16/1, 16/1, 3560/100, 16/1, 3560/100, 0/1, 3560/100, 0/1, 842019125/976237882
        GPSSpeedRef         ="K"
        GPSSpeed            =0/1
        GPSDateStamp        ="2015:05:28"
    Continued directory (dir has 6 entries)
        Compression = 6
        XResolution = 72/1
        YResolution = 72/1
        ResolutionUnit = 2
        ThumbnailOffset = 1316
        ThumbnailLength = 10991
Thumbnail size: 10991 bytes
Image cotains XMP section, 1939 bytes long
??http://ns.adobe.com/xap/1.0/?<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.4.0">
   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      <rdf:Description rdf:about=""
            xmlns:mwg-rs="http://www.metadataworkinggroup.com/schemas/regions/"
            xmlns:stDim="http://ns.adobe.com/xap/1.0/sType/Dimensions#"
            xmlns:apple-fi="http://ns.apple.com/faceinfo/1.0/"
            xmlns:stArea="http://ns.adobe.com/xmp/sType/Area#">
         <mwg-rs:Regions rdf:parseType="Resource">
            <mwg-rs:AppliedToDimensions rdf:parseType="Resource">
               <stDim:h>2448</stDim:h>
               <stDim:w>3264</stDim:w>
               <stDim:unit>pixel</stDim:unit>
            </mwg-rs:AppliedToDimensions>
            <mwg-rs:RegionList>
               <rdf:Seq>
                  <rdf:li rdf:parseType="Resource">
                     <mwg-rs:Extensions rdf:parseType="Resource">
                        <apple-fi:Timestamp>-1596906250</apple-fi:Timestamp>
                        <apple-fi:FaceID>2</apple-fi:FaceID>
                        <apple-fi:ConfidenceLevel>352</apple-fi:ConfidenceLevel>
                        <apple-fi:AngleInfoYaw>0</apple-fi:AngleInfoYaw>
                        <apple-fi:AngleInfoRoll>270</apple-fi:AngleInfoRoll>
                     </mwg-rs:Extensions>
                     <mwg-rs:Area rdf:parseType="Resource">
                        <stArea:y>0.503881</stArea:y>
                        <stArea:w>0.306066</stArea:w>
                        <stArea:unit>normalized</stArea:unit>
                        <stArea:x>0.418658</stArea:x>
                        <stArea:h>0.408088</stArea:h>
                     </mwg-rs:Area>
                     <mwg-rs:Type>Face</mwg-rs:Type>
                  </rdf:li>
               </rdf:Seq>
            </mwg-rs:RegionList>
         </mwg-rs:Regions>
      </rdf:Description>
   </rdf:RDF>
</x:xmpmeta>
Jpeg section marker 0xdb size 132
Jpeg section marker 0xdd size 4
JPEG image is 3264w * 2448h, 3 color components, 8 bits per sample
Jpeg section marker 0xc4 size 418
File name    : IMG_3913.JPG
File size    : 2026129 bytes
File date    : 2015:05:28 17:16:43
Camera make  : Apple
Camera model : iPhone 5
Date/Time    : 2015:05:28 17:16:43
Resolution   : 3264 x 2448
Orientation  : rotate 90
Flash used   : No (auto)
Focal length :  4.1mm  (35mm equivalent: 33mm)
Exposure time: 0.0083 s  (1/120)
Aperture     : f/2.4
ISO equiv.   : 80
Whitebalance : Auto
Metering Mode: pattern
Exposure     : program (auto)
GPS Latitude : N 51d 51m  3.11s
GPS Longitude: W  2d 12m 18.89s
GPS Altitude :  20.01m

您可以在图像文件名(佳能专业相机那样做)或EXIF数据中找到序列号 - 这是理想的。

如果做不到这一点,最简单的方法可能是在每台相机上设置不同的日期,例如正确设置日期和时间,但在相机1到2001上设置年份,在相机2到2002上设置年份,在相机3上设置2003年。

答案 1 :(得分:5)

你正踩到巫师领域

我会尽量使我的答案简短,易于理解,但你指的是一个完整的研究领域,涉及深刻的数学魔法。现在没有回头......

请阅读令人惊叹的论文“Digital Image Forensics : a booklet for beginner”。 这个答案将涵盖论文(而且不多,我不是专家)。

Digital Image Forensics 101

图像采集管道

enter image description here

上述每个步骤都会留下标记,例如:

  • 镜头人工制品可用于识别同一相机两次
  • 滤色镜阵列(CFA)图案取决于相机制造商
  • 传感器噪音统计数据因图像而异。
  • 图像压缩(JPEG)使用不同制造商的“压缩表”

还有更多(再次阅读论文!)

相机内部变化?

上述技术依赖于可以分组的人工制品:

  • 与相机型号的所有实例相同的属性
  • 属于同一型号的2个不同相机的属性
  • 同一相机制造商的相同属性

它提出了你想要识别的问题:

  • 鉴于一台摄像机“这张照片是由这个特定设备拍摄的”吗?
  • 这张照片是否被相同的相机型号拍摄了?

反取证,反柜台取证......

关注单个统计属性(比如CFA模式),我们计算参考相机和给定图像的相关统计数据,并测量相关性。

这些属性适用于任何未被遮挡的图像,但我们必须假设有不良意图的人会试图篡改图像,使其看起来像是正确的相机一样!

如果我们事先知道将要计算什么度量标准,我们可以通过篡改图像并优化我们的图像统计信息来与系统目标值相似来轻易欺骗系统(记住优化是不应该被忽视的黑暗魔法;)

例如可以在后处理中通过重新采样给定表来调整JPEG压缩表,以使我的假图像作为另一个相机传递。

法医,柜台取证,反柜台取证之间的这种猫捉老鼠游戏可以走得很远。

相关问题