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.

  • Bulk-renaming Video Snapshots

    For reasons that should be obvious by now, I review the helmet camera video from (some of) our bike rides and extract snapshots of interesting events. VLC auto-names the snapshots along these lines:

    -rw-rw-r-- 1 ed ed  4.0M 2016-09-16 16:15 vlcsnap-2016-09-16-16h15m43s49.png
    -rw-rw-r-- 1 ed ed  3.2M 2016-09-16 16:15 vlcsnap-2016-09-16-16h15m59s181.png
    -rw-rw-r-- 1 ed ed  2.7M 2016-09-16 16:18 vlcsnap-2016-09-16-16h18m58s125.png
    -rw-rw-r-- 1 ed ed  3.7M 2016-09-16 18:40 vlcsnap-2016-09-16-18h40m22s7.png
    -rw-rw-r-- 1 ed ed  3.5M 2016-09-16 18:40 vlcsnap-2016-09-16-18h40m58s132.png
    -rw-rw-r-- 1 ed ed  3.5M 2016-09-16 18:41 vlcsnap-2016-09-16-18h41m29s181.png
    -rw-rw-r-- 1 ed ed  3.9M 2016-09-16 18:41 vlcsnap-2016-09-16-18h41m42s60.png
    -rw-rw-r-- 1 ed ed  3.8M 2016-09-16 18:41 vlcsnap-2016-09-16-18h41m54s146.png
    -rw-rw-r-- 1 ed ed  3.8M 2016-09-16 18:42 vlcsnap-2016-09-16-18h42m22s206.png
    -rw-rw-r-- 1 ed ed  3.7M 2016-09-16 18:42 vlcsnap-2016-09-16-18h42m38s58.png
    

    The gap in the timestamp after the first three files reveals a random errand.

    First, convert to JPG format, place the results in another directory and, en passant, mash them to a reasonable size:

    mkdir /some-useful-directory/Road\ Repair/"Rt 82 and CR 29"
    for f in  vlcsnap-2016-09-16* ; do convert $f -density 300 -define jpeg:extent=200KB /some-useful-directory/Road\ Repair/"Rt 82 and CR 29"/${f%%.*}.jpg ; done
    cd /some-useful-directory/Road\ Repair/"Rt 82 and CR 29"
    

    Replace the first part of the VLC-generated names with relevant identification:

    rename 's/vlcsnap-/Rt 82 - /' vlcsnap-2016-09-16-16*
    rename 's/vlcsnap-/CR 29 - /' vlcsnap*
    

    The directory now contains these files:

    -rw-rw-r-- 1 ed ed 193K 2016-09-19 11:36 CR 29 - 2016-09-16-18h40m22s7.jpg
    -rw-rw-r-- 1 ed ed 192K 2016-09-19 11:36 CR 29 - 2016-09-16-18h40m58s132.jpg
    -rw-rw-r-- 1 ed ed 193K 2016-09-19 11:36 CR 29 - 2016-09-16-18h41m29s181.jpg
    -rw-rw-r-- 1 ed ed 193K 2016-09-19 11:36 CR 29 - 2016-09-16-18h41m42s60.jpg
    -rw-rw-r-- 1 ed ed 194K 2016-09-19 11:36 CR 29 - 2016-09-16-18h41m54s146.jpg
    -rw-rw-r-- 1 ed ed 196K 2016-09-19 11:36 CR 29 - 2016-09-16-18h42m22s206.jpg
    -rw-rw-r-- 1 ed ed 196K 2016-09-19 11:36 CR 29 - 2016-09-16-18h42m38s58.jpg
    -rw-rw-r-- 1 ed ed 195K 2016-09-19 11:36 Rt 82 - 2016-09-16-16h15m43s49.jpg
    -rw-rw-r-- 1 ed ed 194K 2016-09-19 11:36 Rt 82 - 2016-09-16-16h15m59s181.jpg
    -rw-rw-r-- 1 ed ed 194K 2016-09-19 11:36 Rt 82 - 2016-09-16-16h18m58s125.jpg
    
    

    These bursts of Perl regex line noise replace the snapshot timestamp on those files with an ascending sequence number, with separate sequences for each group:

    i=1 ; for f in CR* ; do rename -v "s/-1[68]h..m..s\d{1,3}/ - $(( i++ ))/" "$f" ; done
    i=1 ; for f in Rt* ; do rename -v "s/-1[68]h..m..s\d{1,3}/ - $(( i++ ))/" "$f" ; done
    

    And then the files make sense:

    -rw-rw-r-- 1 ed ed 193K 2016-09-19 13:51 CR 29 - 2016-09-16 - 1.jpg
    -rw-rw-r-- 1 ed ed 192K 2016-09-19 13:51 CR 29 - 2016-09-16 - 2.jpg
    -rw-rw-r-- 1 ed ed 193K 2016-09-19 13:51 CR 29 - 2016-09-16 - 3.jpg
    -rw-rw-r-- 1 ed ed 193K 2016-09-19 13:51 CR 29 - 2016-09-16 - 4.jpg
    -rw-rw-r-- 1 ed ed 194K 2016-09-19 13:51 CR 29 - 2016-09-16 - 5.jpg
    -rw-rw-r-- 1 ed ed 196K 2016-09-19 13:51 CR 29 - 2016-09-16 - 6.jpg
    -rw-rw-r-- 1 ed ed 196K 2016-09-19 13:51 CR 29 - 2016-09-16 - 7.jpg
    -rw-rw-r-- 1 ed ed 195K 2016-09-19 13:51 Rt 82 - 2016-09-16 - 1.jpg
    -rw-rw-r-- 1 ed ed 194K 2016-09-19 13:51 Rt 82 - 2016-09-16 - 2.jpg
    -rw-rw-r-- 1 ed ed 194K 2016-09-19 13:51 Rt 82 - 2016-09-16 - 3.jpg
    

    The hard part, this time around, involved figuring a regex for the timestamp. The trick was to specify a single digit for the milliseconds part, with a repetition count allowing for one-to-three digits.

    The Perl regex cheat sheet helped.

    The double quotes around the rename search parameter allows the shell to expand the $(( i++ )) gibberish. The double quotes around the file name keep the blank-separated parts together.

    At some point I must figure out how to produce leading-zero-filled sequence numbers, which will probably involve a printf.

    The ride covered some roads with “2 to 4 foot” shoulders, which seems overly optimistic:

    Rt 82 - 2016-09-16 - 3
    Rt 82 – 2016-09-16 – 3

    NYSDOT and DCDPW both believe a homeopathic strip of asphalt will cover faults in the travel lane and don’t care that the right side of the strip puts an abrupt ledge along the middle of the minimal and fissured shoulder:

    Rt 82 - 2016-09-16 - 1
    Rt 82 – 2016-09-16 – 1

    Ah, well, it was a lovely day for a ride …

  • Poughkeepsie Waterfront at Night

    Another Walkway Over the Hudson Moonwalk provided a good view of the Poughkeepsie waterfront:

    City of Poughkeepsie Waterfront - night view
    City of Poughkeepsie Waterfront – night view

    The railroad station’s parking garage produces the big mass of sodium light in the middle and (I think) the bleached church on the far left has mercury vapor floodlights.

    The smaller spots of cold-white LED lighting scattered here-and-there will gradually expand and, in five years or so, take over the entire vista …

  • A Curiosity of Sparrows

    There’s obviously something going on inside the long-abandoned nesting box:

    Sparrow investigating bird box
    Sparrow investigating bird box

    You’ve seen this happen to people, too:

    More sparrows on the bird box
    More sparrows on the bird box

    How many sparrows can fit on the roof of a bird box?

    Four sparrows investigating bird box
    Four sparrows investigating bird box

    There’s always room for one more:

    Late season sparrows on bird box
    Late season sparrows on bird box

    Perhaps they were having a family reunion?

    Taken with the Canon SX230-HS from the patio, zoomed all the way, and ruthlessly cropped.

  • Monthly Image: New Coopers Hawks

    “Our” Cooper’s Hawks have long since flown off, although one occasionally swoops through the yard on an urgent mission. I took this picture on an early July morning, when they were still being companionable:

    New Coopers Hawks - Watching the Area
    New Coopers Hawks – Watching the Area

    Taken with the DSC-H5 and 1.7x teleadapter, zoomed in all the way, and dot-for-dot cropped. The birds look fine and the image looks awful…

  • No Turning Back, Vehicular Division

    We were in the Arlington Square exit, waiting to cross Rt 44 into Adams:

    Rt 44 Plaza Exit - 2016-08-02 - 0
    Rt 44 Plaza Exit – 2016-08-02 – 0

    If we both line up on the traffic signal sensor loop, it seems to detect us; Mary’s on the right side of the loop, I’m rolling along the left side. This seems to be an old-school dipole loop, not a quadrupole.

    Despite the fact that the mall entrance lane is to our left, across that substantial median strip and exactly where you’d expect it, a driver turned left from Rt 44 into the mall exit:

    Rt 44 Plaza Exit - 2016-08-02 - 1
    Rt 44 Plaza Exit – 2016-08-02 – 1

    He obviously intended to use the lane we were occupying, because it’s the right-hand lane from his direction (where we were obviously not supposed to be), but veered away at the last moment:

    Rt 44 Plaza Exit - 2016-08-02 - 2
    Rt 44 Plaza Exit – 2016-08-02 – 2

    Which was a good thing for all parties concerned, including the car approaching us in the proper lane:

    Rt 44 Plaza Exit - 2016-08-02 - 3
    Rt 44 Plaza Exit – 2016-08-02 – 3

    Elapsed time: five seconds.

    The driver then turned right, head-on against cars exiting from the parking lot and parallel-broadside with a pickup entering in the proper lane, and somehow didn’t collide with anybody or anything.

    From where we sat, there was absolutely nothing we could do but watch death roll toward us.

  • Wasp Flyby

    I didn’t notice this at the time:

    This slideshow requires JavaScript.

    The camera runs at 60 frame/s, so the entire show spans a bit more than half a second: zzzzzip!

    I think it’s a member of the Yellow Jacket wasp family, noted for their in-your-face attitude and repeat-fire stinger. They’re highly capable flying machines, that’s for sure…

    We were pulling out of the local “health food” store with fresh-ground nut butters in the packs, nearing the end of a 17 mile loop on a fine Sunday morning.

     

  • Monthly Science: Sony NP-BX1 Battery Status

    Having had the weaker of the two surviving STK batteries die 36 minutes into a ride, I tested them all:

    Sony NP-BX1 - 1 A test - 2016-08-17
    Sony NP-BX1 – 1 A test – 2016-08-17

    The X axis shows W·h, rather than the usual A·h, because that seems more useful in a world of constant-power supplies.

    The test current is now 1 A, rather than the previous 500 mA, to more closely match the camera’s actual load. The CBA tester doesn’t have a constant-power mode; I think that doesn’t make much practical difference.

    The orange curve (STK D) is the failed battery, ending after 1.4 W·h. At an average 3.2-ish V, that’s 26 minutes, which is close enough to the actual run time, given the different current.

    The red curve (STK C) is the sole STK battery of the original four from last November that actually worked.

    The upper two curves come from the mostly unused Wasabi batteries (F and G), also from November. They have lost a bit of their capacity, but show the highest voltage out toward the end, so that’s good.

    The black curve is the lightly used Sony OEM battery that came with the camera. Although it has about the same ultimate capacity as the other three “good” batteries, the voltage depression suggests it’ll trip out early.

    The others are pretty much debris by now. I suppose they might be good for LED blinkies or some other low-voltage and low-current application, but …

    So I’ll start using all four of the better batteries and see how the run times work out in actual use.