Imaging The Past With Time-Travel Rephotography

Have you ever noticed that people in old photographs looks a bit weird? Deep wrinkles, sunken cheeks, and exaggerated blemishes are commonplace in photos taken up to the early 20th century. Surely not everybody looked like this, right? Maybe it was an odd makeup trend — was it just a fashionable look back then?

Not quite — it turns out that the culprit here is the film itself. The earliest glass-plate emulsions used in photography were only sensitive to the highest-frequency light, that which fell in the blue to ultraviolet range. Perhaps unsurprisingly, when combined with the fact that humans have red blood, this posed a real problem. While some of the historical figures we see in old photos may have benefited from an improved skincare regimen, the primary source of their haunting visage was that the photographic techniques available at the time were simply incapable of capturing skin properly. This lead to the sharp creases and dark lips we’re so used to seeing.

Of course, primitive film isn’t the only thing separating antique photos from the 42 megapixel behemoths that your camera can take nowadays. Film processing steps had the potential to introduce dust and other blemishes to the image, and over time the prints can fade and age in a variety of ways that depend upon the chemicals they were processed in. When rolled together, all of these factors make it difficult to paint an accurate portrait of some of history’s famous faces. Before you start to worry that you’ll never know just what Abraham Lincoln looked like, you might consider taking a stab at Time-Travel Rephotography.

Amazingly, Time-Travel Rephotography is a technique that actually lives up to how cool its name is. It uses a neural network (specifically, the StyleGAN2 framework) to take an old photo and project it into the space of high-res modern photos the network was trained on. This allows it to perform colorization, skin correction, upscaling, and various noise reduction and filtering operations in a single step which outputs remarkable results. Make sure you check out the project’s website to see some of the outputs at full-resolution.

We’ve seen AI upscaling before, but this project takes it to the next level by completely restoring antique photographs. We’re left wondering what techniques will be available 100 years from now to restore JPEGs stored way back in 2021, bringing them up to “modern” viewing standards.

Thanks to [Gus] for the tip!

Continue reading “Imaging The Past With Time-Travel Rephotography”

Python Will Soon Support Switch Statements

Rejoice! Gone are the long chains of ifelse statements, because switch statements will soon be here — sort of. What the Python gods are actually giving us are match statements. match statements are awfully similar to switch statements, but have a few really cool and unique features, which I’ll attempt to illustrate below.

Continue reading “Python Will Soon Support Switch Statements”

Bringing Some Coulter To The Bench: Measuring Tiny Particles With Nanopore Sensing

We’ve all been there: you’re sitting at your bench, with a beaker full of some conductive fluid with a bunch of tiny particles suspended in it, and you want to measure the sizes of each particle.

Okay, maybe this isn’t a shared experience we’ve all had, but It’s at least an ordeal Hackaday alum [Nava Whiteford] has been through, and he was able to carry out the measurements in question using a neat apparatus known as a Coulter counter.

Imagine a container full of a conductive fluid. If you place an electrode at each end, the fluid will carry a current. Now, drop an insulating divider in the middle of the container, and the current will stop flowing. Finally, poke a small hole (or nanopore) in the divider. Huzzah! The current is flowing again… but how does this let us measure particle sizes? Well, now think about a tiny particle moving through the hole in the divider. As the particle passes through, the hole will be partially blocked, and the current flow will be partially interrupted. It turns out, the resulting dip in current is proportional to the volume of the particle — a fun property known as the Coulter principle.

[Nava] built a great demo of the system with a macropore in place of the nanopore. The pore in question was a hole melted into a bottle cap, which was suspended in a beaker by two toothpicks. [Nava] used small chips of Acrylic as the particles to be measured, which they pipetted into the solution of KCl. They then passed a current through the solution and used an oscilloscope to sense the interruptions. Be sure to check out their write up for a video of the system in action!

Of course, this technique has a much wider range of applications than measuring little bits of plastic — obtaining blood cell counts, for one. We’ve seen particle counters for use in the air before, but it’s great to see that there’s a way to measure particles in an aqueous solution —  you know, in case we ever find ourselves in such a situation.

Sea Level: How Do We Measure Global Ocean Levels And Do Rising Oceans Change That Benchmark?

Every summer you go down the shore, but lately you’ve begun to notice that the beach seems narrower each time you visit. Is that the sea level rising, or is the sand just being swept away? Speaking of sea levels, you keep hearing that they rise higher every year — but how exactly is that measured? After all, you can’t exactly use a ruler. As it turns out, there are a number of clever systems in place that can accurately measure the global sea level down to less than an inch and a half.

Not only are waves always rippling across the ocean’s surface, but tides periodically roll in and out, making any single instantaneous measurement of sea level hopelessly inaccurate. Even if you plan to take hundreds or thousands of measurements over the course of weeks or months, taking the individual measurements is still difficult. Pick a nice, stable rock in the surf, mark a line on it, and return every hour for two weeks to hold a tape measure up to it. At best you’ll get within six inches on each reading, no matter what you’ll get wet, and at worst the rock will move and you’ll get a damp notebook full of useless numbers. So let’s take a look at how the pros do it.

Continue reading “Sea Level: How Do We Measure Global Ocean Levels And Do Rising Oceans Change That Benchmark?”

Continuous Excitation Piano Machine Looks Nervous, Sounds Grand

It’s not every day we see a grand piano with a Raspberry Pi inside, let alone one with 96 motors, but sometimes we get lucky. The contraption in question is one developed by [Konstantin Leonenko], as part of a collaboration with composer [Patricia Alessandrini] for a piece she created inspired by Ada Lovelace. Specifically, [Patricia] was inspired by Ada’s idea that an “analytical machine” would, someday, be able to create music on its own. [Konstantin] and [Patricia] worked together to make a machine that would learn from it’s human co-performers and create music with them.

Their creation, rather than just one tricked-out keyboard, is actually a portable attachment that can be easily fitted to any grand piano. Each of the device’s 96 motors drives a plastic “finger” that excites the piano’s strings. The result is a sound unlike any other — and you really need to experience it so click through that link at the top for the demo video.

Rather cleverly, the fingers are designed such that their dynamics help to mask the sound of the motor (a must for performances) while simultaneously enhancing the string’s timbre. Like any project, this one went through a number of iterations over the two-year design process, and even spun off into an entirely new, glove-based version.

We’ve seen some awesome music tech hacks, and this one fits right in with the rest. It’s always exciting to see an instrument as ubiquitous as the piano be used in new and refreshing ways. Be sure to check out the link at the top for a video of this incredible instrument in action!

Hacking Hardware Bitcoin Wallets: Extracting The Cryptographic Seed From A Trezor

It’s long been common wisdom that one of the safest places to keep your cryptocurrency holdings is in a hardware wallet. These are small, portable devices that encrypt your keys and offer a bit more peace of mind than holding your coins in a soft or web wallet.

But of course, as we know, nothing is totally secure.

And we were reminded of this fact by Kraken Security Labs, when they showed us how they bypassed all of the safeguards in a popular wallet, the Trezor, to dump and decrypt it’s seed.

It’s worth noting that the hack does require physical access to the wallet — albeit only about fifteen minutes worth. And by “physical access” we mean that the hack leaves the device thoroughly mutilated. The Kraken team started by desoldering the heart of the wallet, a STM32 processor. They then dropped it into a socket on an interface board, and got to glitching.

The hack relies on an attack known as voltage glitching. Essentially, at a precisely-timed moment during the device’s boot sequence, the supply voltage is fluctuated. This enables the chip’s factory bootloader, which can read out the contents of it’s onboard flash memory. The memory is read-protected, but can be accessed 256 bytes at a time through a second voltage glitch. Neither of these attacks work 100% of the time, so if the device fails to boot or the memory remains locked, the FPGA performing the attacks simply tries again. After enough iterations, the Kraken team was able to fully dump the chip’s flash memory.

Continue reading “Hacking Hardware Bitcoin Wallets: Extracting The Cryptographic Seed From A Trezor”

Bringing Modern Control To An Old Radio

The modern ham radio shack can take many forms. Some are shrines the “boat anchor” radios of old, named for their considerable weight. Others are simply a small, unassuming software-defined radio (SDR) hooked up to a laptop. Nowadays, many shacks fall somewhere in the middle. It’s not uncommon to find a sleek Icom IC-7300 sitting atop an ancient Hallicrafters SX-115 (which sounds suspiciously like the author’s setup). When a ham wants to work a digital mode such as FT-8, they will undoubtedly reach for a newer radio complete with USB (Universal Serial Bus in this case, not Upper Sideband) rig control — but what if the newest piece of equipment they have is a thirty-year-old Kenwood?

If that sounds like you, then fear not because [Steve Bossert] has you covered. He took his trusty Kenwood TS-50, a classic radio from 1993 whose most advanced feature is fuzzy logic, and upgraded it with USB (again, the serial bus) control.

When Kenwood designed the TS-50, they had computer control in mind. There’s a hidden port on the bottom of the unit which reveals a connector that mates with Kenwood’s proprietary (and expensive) set of serial control cables. Thankfully, the engineers over at Kenwood decided to use UART for PC communication, so slapping a USB port in the radio’s case isn’t as daunting as it may sound. [Steve] picked up a CP2104 USB-TTL UART Serial Adapter and wired it up to the radio’s control port. After a bit of drilling, screwing, and gluing, the radio had an upgraded (and non-proprietary!) interface compatible with the ever-popular hamlib. While this doesn’t cover all radio control functions, it gets you tuning, which is pretty important. For a fully modern radio experience, [Steve] suggests using the 8-pin mic connector along with an interface such as Rigblaster or Signalink. This adds PTT and audio signal routing.

If you want to try this for yourself, be sure to check out [Steve]’s extremely well-documented writeup. You could even take this a step further and control your TS-50 from your smartphone with this HTML5 interface we saw a few months back.