Jun 11 2012

Star Trek Analysis

Published by jfrank at 9:26 pm under python

After a recent sleep study I asked the doctor if I could take the data with me. He laughed and agreed after admitting that he had to have his data too when he first took a study. I realized after I came home that I potentially had an interesting set of data because before I drifted off in the laboratory I finished up an episode of Star Trek the Next Generation, Season 1 episode 18. The doctor immediately noticed that I was watching something by glancing at the EEG and eye tracking chart the next morning. I decided that I would try to correlate that data with my EEG data. This post is a precursor to that mini-project.

In order to do that I needed something about the video to use as my triggering events, something to correlate against. I decided to analyze the episode frame by frame and compare each frame with the next one to detect the ‘amount of differentness’. I used a simple metric, taking the RGB values of each pixel in frame at time T, and then the absolute value of the difference between the positions in frame T and the corresponding positions in frame T+1. As you may guess the super sharp spikes are scene cuts where nearly all the pixels have a large difference between T and T+1.

What you see below is a clip from that episode at about 32:25, 10 frames turned into an animated GIF which is trough to trough of the ‘double mountain’ shape in the center of line plot below. This caught my eye as a repetitious and mechanically generated shape so I pulled up the video at that moment and indeed it was Dr. Crusher doing computer analysis of medical data from the doomed denizens of Aldea. By comparison the smooth line to the left of the first cut-spike is her face toward the camera head slowly turning toward the computer.

Next is a two-frame loop from my most memorable scene in this episode. The planet demonstrates its power by hurling the Enterprise through space like a toy.

This is two frames animating, and you can see the ship is moving slightly but the rest of the scene doesn’t change. These two frames are the bottom of the trough most of the way down the slope of the jagged mountain center of the plot. This seemed bizzare, and I found it also through looking at the plot below and noticing the jagged edges. After looking at several special effect scenes that have this same characteristic I realized the jagged spikes in the chart indicate 12 fps (or some other partial frame rate) with interpolation.  Some of this effect could be due to the poor quality compressed digital copy that I have, but the visual analysis (some things moving, while everything should be moving) indicates there is a real difference in the broadcast. In this repetition, the star field would freeze every fourth frame while the ship continued to move.

All ~60000 frames (at 24 fps)  are available here.

Full Episode Frame Change Data

No responses yet

Trackback URI | Comments RSS

Leave a Reply