tnc-ca-geo / animl-email-relay

Lambda service for extracting camera trap images from email attachments
Other
0 stars 0 forks source link

Find compatible cellular camera #2

Closed nathanielrindlaub closed 2 years ago

nathanielrindlaub commented 2 years ago

Evidently, the only cellular camera that sends images to an email address is this one (according to Trail Cam Pro): https://www.trailcampro.com/products/ridgetec-lookout-4g-lte

nathanielrindlaub commented 2 years ago

I purchased an Ridgetec lookout, set it up, and it does send images to an email address, but the embedded images are just thumbnails with very limited EXIF data:

ExifTool Version Number         : 11.86
File Name                       : PICT0003.JPG
Directory                       : .
File Size                       : 32 kB
File Modification Date/Time     : 2022:08:31 11:25:26-07:00
File Access Date/Time           : 2022:08:31 11:25:58-07:00
File Inode Change Date/Time     : 2022:08:31 11:25:57-07:00
File Permissions                : rw-r--r--
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
JFIF Version                    : 1.02
Resolution Unit                 : None
X Resolution                    : 0
Y Resolution                    : 0
Image Width                     : 800
Image Height                    : 450
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Image Size                      : 800x450
Megapixels                      : 0.360

Like other cellular cameras, you can requests the original image manually from the RidgeTec web app, and the EXIF data on the original is more complete, but exiftool doesn't recognize RidgeTec's MakerNotes, and there doesn't appear to be a serial number field present:

ExifTool Version Number         : 11.86
File Name                       : ridgtech-original.JPG
Directory                       : .
File Size                       : 1151 kB
File Modification Date/Time     : 2022:08:31 11:34:24-07:00
File Access Date/Time           : 2022:08:31 11:34:25-07:00
File Inode Change Date/Time     : 2022:08:31 11:34:24-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)
Make                            : RidgeTec Technology
Camera Model Name               : Lookout
Orientation                     : Horizontal (normal)
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Software                        : BSP-05.00.02
Modify Date                     : 2022:08:31 13:35:26
Y Cb Cr Positioning             : Co-sited
Exposure Time                   : 1/112
F Number                        : 2.8
Exposure Program                : Program AE
ISO                             : 100
Exif Version                    : 0220
Date/Time Original              : 2022:08:31 13:35:26
Create Date                     : 2022:08:31 13:35:26
Components Configuration        : Y, Cb, Cr, -
Compressed Bits Per Pixel       : undef
Shutter Speed Value             : 1/112
Aperture Value                  : 2.8
Exposure Compensation           : 0
Max Aperture Value              : 2.8
Metering Mode                   : Center-weighted average
Light Source                    : Unknown
Flash                           : Off, Did not fire
Focal Length                    : 0.0 mm
Warning                         : [minor] Unrecognized MakerNotes
User Comment                    :
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 3200
Exif Image Height               : 1800
Interoperability Index          : R98 - DCF basic file (sRGB)
Interoperability Version        : 0100
File Source                     : Digital Camera
Scene Type                      : Directly photographed
Exposure Mode                   : Unknown (8212)
White Balance                   : Auto
Digital Zoom Ratio              : 1000
Focal Length In 35mm Format     : 8212 mm
Scene Capture Type              : Portrait
Sharpness                       : Unknown (8212)
Compression                     : JPEG (old-style)
Thumbnail Offset                : 42582
Thumbnail Length                : 6720
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                 : 90084
MP Image Start                  : 1088402
Dependent Image 1 Entry Number  : 0
Dependent Image 2 Entry Number  : 0
Image Width                     : 3200
Image Height                    : 1800
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:2 (2 1)
Aperture                        : 2.8
Image Size                      : 3200x1800
Megapixels                      : 5.8
Shutter Speed                   : 1/112
Thumbnail Image                 : (Binary data 6720 bytes, use -b option to extract)
Preview Image                   : (Binary data 90084 bytes, use -b option to extract)
Focal Length                    : 0.0 mm
Light Value                     : 9.8

So out of the box this camera won't meet the basic requirements we need cameras to meet in order to integrate them: (1) the ability to send images in emails, (2) EXIF data with at a bare minimum a camera serial number and a Date/Time Created field.

Possible next steps are:

nathanielrindlaub commented 2 years ago

After reaching out to RidgeTec, it looks like we have a path forward. I explained our need, and their extremely accommodating and responsive support staff added the data we'd need as data attribute tags in the embedded <img/> in the email, and because you can request decent-sized thumbnails (> 960px wide), I think we have what we need to build out an integration. The only catch is that we'll have to scrape the data-attributes out of the <img/> tag and write them into the thumbnail's EXIF data before dumping it in the animl-images-ingestion bucket.

Also, I would love to stick with node for this service, but b/c we'll need to write to the images' EXIF, we'll need exiftool, and sadly this very promising node wrapper for it exiftool-vendored doesn't work in Lambda environments (go to the closed issues section of its repo and search for "Lambda" to learn why). So I think that means we need to refactor to Python.