Terence Eden. He has a beard and is smiling.

Terence Eden’s Blog

Theme Switcher:

How to detect 3D video?

· 1,550 words · Viewed ~1,184 times


Still from the moview Finding Nemo. The image is split side by side.

Here's an interesting conundrum. My TV can automatically detect when 3D video is being played and offers to switch into 3D mode - but how does the detection work? This post will give you a few strategies for detecting 3D images using Python. Firstly, some terminology. 3D videos are usually saved either as Side-By-Side images, or Over-Under images. Colloquially known as H-SBS and H-OU. Here's …

Reconstructing 3D Models from The Last Jedi

· 3 comments · 1,200 words · Viewed ~4,839 times


Different depth maps of various accuracy

A quick tutorial in how to recover 3D information from your favourite 3D movies. In this example, we'll be using Star Wars - The Last Jedi. tl;dr? Here's the end result (this video is silent): https://shkspr.mobi/blog/wp-content/uploads/2018/04/walker-text.mp4 Grab the code on GitHub. Let's go! Take a screenshot of your favourite scene. Something with a clearly defined foreground and…

Adjusting timestamps on images with Python

· 1 comment · 200 words · Viewed ~3,532 times


A cute penguin.

As ever, mostly notes to myself. I have a bunch of old images which don't have any timestamp associated with them. This quick Python script will add a DateTime EXIF metadata tag to an image. This uses piexif which can be installed using pip install piexif This simple script reads a photo, adds a timestamp, then saves a copy of the new photo. from PIL import Image from PIL.ExifTags import…

Long Exposures - Creating Average Frames From Movies

· 3 comments · 750 words · Viewed ~8,230 times


I read a Guardian article about an artist who set up an analogue camera in front of their TV, set it to long exposure, and set a movie playing. The result was a rather wonderful collection of images. You can see more of Jason Shulman's works Is there a way to automate this process? Yes! Here's my attempt at a "Long Exposure" of "Taxi Driver". It's not the same as Shulmans's process, but I …

Replacing IFTTT - Part 1: RSS & Tumblr

· 5 comments · 450 words · Viewed ~616 times


Screenshot from If This Then That.

I've grown to loath IFTTT. What started out as a cool way to plug internet things together has being an opaque an uncommunicative company with no real interest in customer service. That's not surprising, I suppose, its paying customers are the companies who can't be bothered to develop a proper API and so just shove some integrations up there. But it is annoying for those of us who want…

Which Twitter User Receives The Most Citations on Wikipedia?

· 5 comments · 650 words · Viewed ~1,058 times


The Twitter logo.

I few days ago, I was somewhat surprised to find that one of my Tweets had been used as a citation in Wikipedia! I began to wonder - how often are Tweets used in citations? It's possible to search for your own Tweets using this (somewhat obscure) link: https://en.wikipedia.org/w/index.php?title=Special%3ALinkSearch&target=twitter.com%2Fedent Just edit the end of it to see if you, or your…

Track deletions on Twitter - AKA build your own Politwoops

· 500 words · Viewed ~857 times


Twitter, as part of its never-ending quest to alienate users and appease the rich and powerful, have shut down Politwoops accounts. Politwoops monitored politicians' Twitter accounts and noted when they deleted a tweet. Most of the time deletions were done for the same reason we all deleted content - mispellings, broken links, etc - but occaisionally they caught politicians attempting to flush…

Idiot's Guide To Getting Started with Raspberry Pi's GPIO Pins

· 13 comments · 500 words · Viewed ~41,051 times


The idiot in question being... me! It's been ages since I did any real electronics. Most of my work involves software and pre-assembled bits of kit. I thought that it was time I reacquainted myself with the joys of electricity :-) Because I'm fundamentally lazy, I purchased the all-in-one Raspberry Pi 2 kit from Vilros. Lots of LEDs, some buttons, a nice case, all the cables, resistors,…

This is what a graph of 8,000 fake Twitter accounts looks like

· 13 comments · 600 words · Viewed ~51,520 times


Recently I've been plagued with Tweets saying that I'm "trending in London." As flattering as that is, it's not true. There appears to be a network of Twitter bots which are randomly repeating other people's tweets, ripping off avatars and bios, and generally causing a nuisance. Looking at the users' Twitter name, I don't think it's unreasonable to think that "ekip_uhokoqeq" and…

Which Painting Do You Look Like? Comparing Faces Using Python and OpenCV

· 22 comments · 1,250 words · Viewed ~24,817 times


Many years ago, as I was wandering around the Louvre, I came across a painting which bore an uncanny resemblance to me! Spooky, eh? Yeah, yeah, it's not the greatest likeness ever, but people who know me seem to think I look like the chap on the left. This got me thinking... Wouldn't it be great if when you entered an art gallery, a computer could tell you which painting you look most like? …

Pareidolia and Computer Vision

· 300 words · Viewed ~418 times


Humans are pretty spectacular at image recognition. We have a seemingly innate ability to look at an image and tell if it is that of a human face - even if it has been severely distorted. Occasionally though, the software in our brains is a little too eager to see a face. This phenomenon is called Pareidolia. It's what causes you to see dragons when you look at the clouds, and a smiling…

Putting UK Flooding Alerts Onto Twitter #UKBLC14

· 1 comment · 150 words


As part of BlueLightCamp '14, a group of civil servants, hackers, and emergency service workers got together for a weekend of furious creation. I decided to look at flooding data. The recent floods in the UK are a brutal remember of the realities of climate change and our poor stewardship of the nation's waterways. The UK Government has a large collection of Flooding Data online - including…