2
\$\begingroup\$

I have developed Python code to take an image produced by a DJI drone (and several other GNSS Cameras) and georeference the images. Basically the code reads the EXIF data from the individual images. A number of data are extracted from the EXIF like location, elevation, drone direction etc. and are use to create a footprint on the land. The images is then warped (scaled, skewed, rotated, and rubbersheeted) to that footprint and given real-world coordinates. The resulting image can be used in GIS software to determine/measure the relationship between what is on the ground and what is seen in the image. This all works great with Phantom 3 Pro, Phantom 4 Pro (and V2), Mavics, Mini Mavics etc. One important part of the code is that I need to code-in the CMOS sensor size. These sizes have been available online. I can confirm the reasonable accuracy of my methods with the drones mentioned above.

I now have a mini 3 pro. After processing mini 3 pro images with my code I see that my resulting georeferenced image footprints are far larger that they should be. This is a fail! I found online that the CMOS sensor is(10 x 7.5mm). I also understand that the mini 3 pro is capable of taking a 48 megapixel image but the images in my test are 12 MP images because that is what the drone captures in intervalometer mode.

Assuming the problem is with the 12MP images I reprocessed my test images using the same CMOS size as the mini2 (6.4 x 4.7mm) which is also capturing a 12MP image. The resulting footprints are still too large. Again, I think I have the wrong sensor size.

Upon further investigation I see that this camera has a quad bayer array. I now understand that the issue with my code is that the inputs into my script are erroneous for this camera. As another experiment I tried dividing the 10x7.5 values by 4 and ran a test with 2.5 x 1.875. That produced an image too small for the landscape.

My question is which likely input parameter needs to change to get a 10x7.5 quad Bayer array to behave like a regular 6.4 x 4.7mm sensor? Do I need to alter the CMOS size - that didn't work with the tests mentioned above, the focal length (which comes from the EXIF), the image size (which comes from the EXIF), some combination, or something else? I am a geo-spatial analyst and not a optics guy so any help is appreciated.

Here is an EXIF dump from an image:

ExifTool Version Number         : 11.88
File Name                       : DJI_0187.JPG
Directory                       : .
File Size                       : 5.6 MB
File Modification Date/Time     : 2023:05:11 07:35:50-07:00
File Access Date/Time           : 2023:05:11 15:26:49-07:00
File Inode Change Date/Time     : 2023:05:11 15:25:06-07:00
File Permissions                : rw-r--r--
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
Exif Byte Order                 : Little-endian (Intel, II)
Image Description               : default
Make                            : DJI
Camera Model Name               : FC3582
Orientation                     : Horizontal (normal)
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Software                        : 10.02.22.06
Modify Date                     : 2023:05:11 14:35:49
Y Cb Cr Positioning             : Co-sited
Exposure Time                   : 1/2000
F Number                        : 1.7
Exposure Program                : Program AE
ISO                             : 100
Sensitivity Type                : Recommended Exposure Index
Recommended Exposure Index      : 100
Exif Version                    : 0230
Date/Time Original              : 2023:05:11 14:35:49
Create Date                     : 2023:05:11 14:35:49
Components Configuration        : Y, Cb, Cr, -
Shutter Speed Value             : 1/2000
Aperture Value                  : 1.7
Exposure Compensation           : 0
Max Aperture Value              : 1.7
Metering Mode                   : Average
Light Source                    : Daylight
Flash                           : No Flash
Focal Length                    : 6.7 mm
Warning                         : [minor] Bad MakerNotes directory
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 4032
Exif Image Height               : 3024
Interoperability Index          : R98 - DCF basic file (sRGB)
Interoperability Version        : 0100
File Source                     : Digital Camera
Scene Type                      : Directly photographed
Exposure Mode                   : Auto
White Balance                   : Auto
Digital Zoom Ratio              : 1
Focal Length In 35mm Format     : 24 mm
Scene Capture Type              : Standard
Gain Control                    : None
Contrast                        : Normal
Saturation                      : Normal
Sharpness                       : Normal
Device Setting Description      : (Binary data 4 bytes, use -b option to extract)
Serial Number                   : 53HQK7J0M103AX
Lens Info                       : 6.72mm f/1.7
GPS Version ID                  : 2.3.0.0
GPS Latitude Ref                : North
GPS Longitude Ref               : West
GPS Altitude Ref                : Below Sea Level
GPS Status                      : Measurement Void
GPS Map Datum                   : WGS-84
XP Comment                      : 0.9.142
XP Keywords                     : hdr
Compression                     : JPEG
Thumbnail Offset                : 25034
Thumbnail Length                : 9059
About                           : DJI Meta Data
Format                          : image/jpg
Image Source                    : DefaultCamera
Gps Status                      : Invalid
Altitude Type                   : RtkAlt
Absolute Altitude               : -19.028
Relative Altitude               : +27.900
Gimbal Roll Degree              : +0.00
Gimbal Yaw Degree               : -11.50
Gimbal Pitch Degree             : -89.90
Flight Roll Degree              : -4.00
Flight Yaw Degree               : -9.20
Flight Pitch Degree             : +2.50
Flight X Speed                  : 0.0
Flight Y Speed                  : 0.0
Flight Z Speed                  : 0.0
Cam Reverse                     : 0
Gimbal Reverse                  : 0
Self Data                       : 
Surveying Mode                  : 0
UTC At Exposure                 : 
Shutter Type                    : Electronic
Camera Serial Number            : 53HQK7J0M103AX
Lens Serial Number              : 
Drone Model                     : Mini 3 Pro
Drone Serial Number             : 1581F4XFA2322M
Version                         : 7.0
Has Settings                    : False
Has Crop                        : False
Already Applied                 : False
MPF Version                     : 0100
Number Of Images                : 2
MP Image Flags                  : Dependent child image
MP Image Format                 : JPEG
MP Image Type                   : Large Thumbnail (VGA equivalent)
MP Image Length                 : 263119
MP Image Start                  : 5659074
Dependent Image 1 Entry Number  : 0
Dependent Image 2 Entry Number  : 0
Image UID List                  : (Binary data 66 bytes, use -b option to extract)
Total Frames                    : 1
Image Width                     : 4032
Image Height                    : 3024
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Aperture                        : 1.7
Image Size                      : 4032x3024
Megapixels                      : 12.2
Scale Factor To 35 mm Equivalent: 3.6
Shutter Speed                   : 1/2000
Thumbnail Image                 : (Binary data 9059 bytes, use -b option to extract)
GPS Altitude                    : 19 m Below Sea Level
GPS Latitude                    : 48 deg 47' 26.85" N
GPS Longitude                   : 122 deg 37' 31.47" W
Preview Image                   : (Binary data 263119 bytes, use -b option to extract)
Circle Of Confusion             : 0.008 mm
Field Of View                   : 73.7 deg
Focal Length                    : 6.7 mm (35 mm equivalent: 24.0 mm)
GPS Position                    : 48 deg 47' 26.85" N, 122 deg 37' 31.47" W
Hyperfocal Distance             : 3.16 m
Light Value                     : 12.5
\$\endgroup\$
2
  • \$\begingroup\$ The bayer array is square 2x2 so you should divide each dimension by 2, not 4 \$\endgroup\$ May 12, 2023 at 21:01
  • \$\begingroup\$ Ugh, math error on my part. Thanks, that worked. If you post that as an answer I will mark that answered. \$\endgroup\$
    – GBG
    May 12, 2023 at 22:12

1 Answer 1

2
\$\begingroup\$

There is small mistake with the size of the Bayer matrix. It is 2x2 cells so you should divide each dimension by 2, not by 4.

P.S. for information Fujifilm X-Trans matrix is different, it is 3x3 so if you have/use such sensor you should change the calculations.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.