This post attempts to explain how NesVideoAgent's automatic screenshot feature works. It should answer all questions, though it is a little technically oriented.

Architecture

Outer layer: A php program

It is run manually by me, though it could be run automatically too. This commandline program searches the database for submissions that match these rules:
For each matching submission, it does the following:

Inner layer: Modified emulator

The emulator is slightly patched version of the normal emulator used to run the movies.

The beauty analysis module

The beauty analysis module is a component in the emulator that works like this:

Description of operation

First, it plays the movie normally.
When the movie ends (actually, 2 frames before but that's a detail):

Analysis of beauty

The algorithm used by the emulator for determining the beauty of a particular screenshot is written hoping to meet the following guidelines. A good screenshot contains:
The algorithm works by dividing the screen into 12 sections (4 horizontally, 3 vertically), and for each section, determining:
The score is determined by the sum of sprite jitter in all sections, and matching each diagonal pair of sections and calculating how much the tint differs in them.
The tint is calculated by sampling the pixels in that section (actually, about a third of them in a random gridlike pattern for speed but that's again an implementation detail), converting them to the YIQ colorspace and calculating average of the complex number comprised by the I and Q components, weighted using the Y value, and the final number weighted using a logarithmic transformation.

NesVideoAgent/AutomaticScreenshots last edited by Bisqwit on 6/23/2009 7:58 AM
Page History Latest diff List referrers View Source