The Smell of Molten Projects in the Morning

Ed Nisley's Blog: Shop notes, electronics, firmware, machinery, 3D printing, laser cuttery, and curiosities. Contents: 100% human thinking, 0% AI slop.

Category: Photography & Images

Taking & making images.

  • Verifying a 64 GB MicroSD Card

    Having just acquired a pair of 64 GB MicroSD cards for the HDR-AS30V camera, I found that I don’t have enough free disk space for 64 GB of white noise and, thus, can’t use the same technique as for the 32 GB card. I now, however, have a stockpile of helmet camera video files that are close enough to white noise for my purposes and come in convenient chunks.

    Start by copying enough big video files to nearly fill the card:

    sudo mount /dev/sdb1 /mnt/backup
    sudo mount -o uid=ed /dev/sdc1 /mnt/part
    FUSE exfat 1.0.1
    cd /mnt/backup/Video
    find -iname MAH*MP4 -size +3G | head -16 | xargs -I{} rsync -vrt --progress {} /mnt/part
    sending incremental file list
    MAH00122.MP4
      4,275,755,727 100%   11.94MB/s    0:05:41 (xfr#1, to-chk=0/1)
    
    sent 4,276,799,695 bytes  received 35 bytes  12,487,006.51 bytes/sec
    total size is 4,275,755,727  speedup is 1.00
    ... snippage ...
    

    The head -16 ensures that you won’t waste a lot of time copying too many files. The card has about 59 GB free, so 16 x 4 GB is about right.

    The -vrt adds verbosity and omits permission settings that ExFAT doesn’t understand; otherwise, you’d just use -va and be done with it.

    Then tuck some smaller files into the remaining nooks and crannies:

    find -iname MAH*MP4 -size -400M | head -16 | xargs -I{} rsync -vrt --progress {} /mnt/part
    ... snippage ...
    

    Some fiddling with the -size -400M and head -16 values may be in order, depending on how many snippets of video data you may have.

    Compare the copies with the original files:

    cd /mnt/part
    for f in * ; do find /mnt/backup/Video/ -name $f | xargs diff $f ; done
    

    If you don’t see anything, then they’re all good!

    There’s probably an algorithmic solution that would eliminate the guesstimation, but very nearly all of the time goes to copying and comparing, so it can’t make much difference.

  • Image File Recovery Redux

    Took a picture of the sewing machine setup with the Sony DSC-F717, transferred it into DigiKam, got the “done transferring, you can disconnect the camera” message, believed it, disconnected the camera, deleted the image file, and then discovered that DigiKam mislaid the image file.

    Rather than re-set-up and re-take the shot, I followed my own directions and recovered the image from the Memory Stick:

    dmesg | tail
    [43176.079853] usb 2-1.6.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [43176.079855] usb 2-1.6.3: Product: Sony PTP
    [43176.079856] usb 2-1.6.3: Manufacturer: Sony
    [43198.073652] usb 2-1.6.3: USB disconnect, device number 22
    [43333.788533] sd 9:0:0:0: [sdc] 1947648 512-byte logical blocks: (997 MB/951 MiB)
    [43333.803292] sd 9:0:0:0: [sdc] No Caching mode page found
    [43333.803299] sd 9:0:0:0: [sdc] Assuming drive cache: write through
    [43333.824681] sd 9:0:0:0: [sdc] No Caching mode page found
    [43333.824688] sd 9:0:0:0: [sdc] Assuming drive cache: write through
    [43333.825491]  sdc: sdc1
    sudo dd if=/dev/sdc of=/tmp/pix.bin bs=1M
    ^C615+0 records in
    614+0 records out
    643825664 bytes (644 MB) copied, 38.5841 s, 16.7 MB/s
    strings -t x pix.bin | grep Exif | head
      68006 Exif
     208006 Exif
     3f8005 _Exif
     7b8006 Exif
    13d8006 Exif
    15b0005 wExif
    1798005 CExif
    19c0006 Exif
    1b90006 Exif
    1f98005 %Exif
    dd if=pix.bin of=image03.jpg bs=$((16#1000)) count=1K skip=$((16#3f8))
    1024+0 records in
    1024+0 records out
    4194304 bytes (4.2 MB) copied, 0.0121431 s, 345 MB/s
    display image03.jpg
    convert image03.jpg dsc00656.jpg
    

    Obviously, there was a bit more flailing around than you see here, but that’s the gist of the adventure. For what it’s worth, image01 was a random blurred shot and image02 is the ID picture I keep on all my cameras.

    The convert step discards all the junk after the end of the image, so the dsc00656.jpg file doesn’t include anything unexpected.

    The picture isn’t all that much to look at, even after cropping out the background, but …

    Kenmore 158 - stepper drive test
    Kenmore 158 – stepper drive test

    The advantage of the manual method: renewing one’s acquaintance with tools that come in handy for other tasks.

  • Turtle Tragedy: Raymond Avenue

    Verily, ’tis the season for turtles on the move. This one clunked over the curb on Raymond Avenue at Vassar Lake, couldn’t find an escape route, and got smashed:

    Smashed turtle - Raymond Ave at Vassar Lake - 2014-07-06
    Smashed turtle – Raymond Ave at Vassar Lake – 2014-07-06

    Turtle armor works pretty well against their usual predators, but can’t handle automobile tire impacts.

    That’s a tight crop from the helmet camera, with terrible compression artifacts smearing the spalled concrete sidewalk.

    For whatever reason, NYSDOT can’t do concrete sidewalks; the entire length of Raymond Avenue has lousy concrete. The fact that Vassar College B&G uses the sidewalks as their private golf-cart highway may have something to do with it, but that’s not the primary problem, because the concrete on DOT’s showcase Rt 55 between Burnett Blvd and Titusville Rd looks the same way.

  • Generating Button Images With ImageMagick

    Starting with the hints and commands at ImageMagick Advanced Techniques for Gel Effects, I came up with a script that spits out colorful gel-flavored buttons:

    convert -size 120x64 xc:none -fill red -draw "roundrectangle 10,10 110,54 8,8" \
      gel_shape.png
    #display gel_shape.png
    convert gel_shape.png \
      \( +clone -alpha extract -blur 0x12 -shade 110x0 \
      -normalize -sigmoidal-contrast 16,60% -evaluate multiply .5\
      -roll +4+8 +clone -compose Screen -composite \) \
      -compose In  -composite \
      gel_highlight.png
    #display gel_highlight.png
    convert gel_highlight.png \
      \( +clone -alpha extract  -blur 0x2 -shade 0x90 -normalize \
      -blur 0x2  +level 60,100%  -alpha On \) \
      -compose Multiply -composite \
       gel_border.png
    #display gel_border.png
    convert gel_border.png \
      -font Verdana-Bold  -pointsize 20  -fill white  -stroke black \
      -gravity Center  -annotate 0 "Jelly"  -trim -repage 0x0+7+7 \
      \( +clone -background navy -shadow 80x4+4+4 \) +swap \
      -background snow4  -flatten \
      gel_button.png
    convert gel_button.png -type truecolor Gelly24.bmp
    display -resize 300% Gelly24.bmp
    

    I could not ever figure that stuff out on my own.

    For some reason, WordPress chokes when uploading the starting shape as a PNG file, so here it is as a JPG with a black border replacing the original transparency:

     

    gel_shape
    gel_shape

    With the gel highlight:

    gel_highlight
    gel_highlight

    Adding a border:

    gel_border
    gel_border

    Adding text, shadow, and background:

    gel_button
    gel_button

    Adding the drop shadow may increase the image size ever so slightly, so the -repage 0x0+7+7 operation may require resetting the exact image size.

    The final step converts the PNG image into the 24-bit uncompressed BMP format required by the Adafruit routine that slaps it into the TFT display:

    Adafruit TFT display - timing demo
    Adafruit TFT display – timing demo

    The smaller buttons came directly from The GIMP, with full-frontal manual control over everything. Obviously, that doesn’t scale well for many buttons that should all look pretty much the same, because you want to get your fingers out of the loop.

    But, obviously, when you do this on a mass scale, you want better control over the colors and text and suchlike; that’s in the nature of fine tuning when it’s needed.

    I’m not entirely convinced I want gel-flavored buttons, but it was a fun exercise.

  • Turtle Teleportation: Love Road

    We spotted another turtle while on a grocery ride:

    Turtle on Love Rd - as spotted - 2014-07-02
    Turtle on Love Rd – as spotted – 2014-07-02

    Although this is certainly meddling in the turtle’s affairs, it seemed reasonable on a torrid day with plenty of hot asphalt to cross:

    Turtle on Love Rd - pickup - 2014-07-02
    Turtle on Love Rd – pickup – 2014-07-02

    I made the (possibly unwarranted) assumption that the turtle wanted to cross the road; I’ve been wrong before.

    In any event, this must be what teleportation feels like:

    Turtle on Love Rd - delivery - 2014-07-02
    Turtle on Love Rd – delivery – 2014-07-02

    There’s not really much on that side of the road, other than an inactive oil spill site left over from when Love Oil ran a tank farm. That’s why it’s called Love Rd, of course.

    Perhaps someone else will help the turtle cross the road in the other direction…

     

     

  • Sony HDR-AS30V Camera: Protecting The Lens

    The 170° fisheye lens on the HDR-AS30V action camera protrudes from the front of the case, the better to view the passing scenery:

    Sony HDR-AS30V Action Camera
    Sony HDR-AS30V Action Camera

    Unfortunately, that means there’s nothing to protect it when the scenery gets a bit too close.

    Mounting it upside-down in the skeleton frame provides a bit of protection, by putting it inside the straight line connecting the helmet brim with the top of the frame:

    Sony HDR-AS30V camera on bike helmet - inverted
    Sony HDR-AS30V camera on bike helmet – inverted

    That won’t protect it from severe impacts, but perhaps a casual drop won’t scar the lens. You can tell from the scuffs that the helmet does get dropped every now and then.

    Most of the camera mounts on Thingiverse don’t take that into account, alas.

    When you remove the skeleton mount from the helmet, grip the camera between finger and thumb while releasing the latch with your other hand. The mount will dangle from your fingers and the camera won’t slide out; if you don’t have both hands free, don’t mess with the camera.

    Even though it doesn’t look at all like a GoPro Hero, everybody recognizes the “camera on helmet” meme and, in general, behaves a bit more circumspectly. I didn’t see that coming, not at all.

     

  • Monthly Image: Hudson River Boating

    Much of the boat traffic on the Hudson consists of barges shuttling bulk commodities between the Atlantic and the Port of Albany. I think this is a crude oil barge, based on the Christmas Tree plumbing that was more visible when it passed under the Mid Hudson Bridge:

    Walkway and Barge - from Mid Hudson Bridge
    Walkway and Barge – from Mid Hudson Bridge

    We crossed the Walkway Over the Hudson westbound, where a work crew was tending a crane. That’s how they do repair and inspection:

    Walkway Inspection Crane - from Mid Hudson Bridge
    Walkway Inspection Crane – from Mid Hudson Bridge

    The Hudson River has far fewer power boats than in years gone by, probably due to their gallon-per-minute fuel consumption:

    Power boat on Hudson River - from Mid Hudson Bridge
    Power boat on Hudson River – from Mid Hudson Bridge

    It was a fine day for a ride:

    KE4ZNU - APRS track 2014-06-30
    KE4ZNU – APRS track 2014-06-30