Tuesday, 18 September 2012

Pulp Fiction: In Chronological Order

Part of the research I'm doing for my dissertation involves looking at the structure of well-known narrative based films.  Here's one bit of data I processed today - Pulp Fiction in chronological order:


Acts from the Film

1. Prologue—The Diner (i)
2. Prelude to "Vincent Vega and Marsellus Wallace's Wife"
3. "Vincent Vega and Marsellus Wallace's Wife"
4a. Prelude to "The Gold Watch" flashback
4b. Prelude to "The Gold Watch" present
5. "The Gold Watch"
6. "The Bonnie Situation"
7. Epilogue—The Diner (ii)

(from wikipedia)

Chronological Event Order

-Act 4a-
1.Butch's great grandfather bought the gold watch and wore it in WWI
2.Butch's grandfather wore the watch in in WWII
3.Winocki delivered the watch to Butch's father
4.Butch's father hid the watch in Vietnam
5.Koons hid the watch in Vietnam
6.20-30 years before the start of the film: Koons delivered the watch to Butch

-Act 2-
[7.Recently before the start of the film: Vincent visits Europe]
8.Morning: Vincent tells Jules about Europe
9.Vincent tells Jules he will be escorting Marsellus Wallace's wife
10.Jules executes Brett
11.A man bursts out of the bathroom at Brett's house shooting at Vincent and Jules but misses
12.Jules and Vincent return fire surviving
13.Jules decides that not being killed was a miracle

-Act 6-
14.Vincent accidentally kills his informant Marvin
15.Jules calls Jimmie for help and heads to his house
16.Jimmie calls Winston Wolf who helps dispose of the car
17.Jules and Vincent head to breakfast

-Act 1/Act 7-
18.Jules and Vincent eat breakfast in a coffee shop as Pumpkin and Honey Bunny plot to rob the diner and its customers
19.Vincent goes to the bathroom
20.Pumpkin and Honey Bunny hold up the diner
21.Pumpkin and Honey Bunny demand Jules' briefcase
22.Jules points his gun at Pumpkin, Honey Bunny points hers at Jules
23.Vincent emerges and points his gun at Honey Bunny
24.Jules delivers his sermon and Honey Bunny and Pumpkin leave
25.Jules and Vincent leave

-Act 3-
26.Butch accepts money from Marsellus to lose a fight.  Later Butch bets his payoff on him winning
27.Vincent and Jules deliver the briefcase
28.Later: Vincent buys heroin
29.Vincent shoots up and travels to Mia's house
30.Vincent and Mia go to Jack Rabbit Slim's
31.Mia overdoses
32.Lance and Vincent revive Mia
33.Mia and Vincent agree not to tell Marsellus about the event

-Act 4b-
34.Butch begins the fight he has been paid to lose

-Act 5-
35.Butch flees the arena after winning
36.Esmarelda tells Butch that he killed his opponent
37.Butch and Fabienne lie low
38.The next day: Butch discovers he has forgotten his Gold Watch
39.Butch returns to retrieve his Gold Watch
40.Butch kills Vincent Vega (who is waiting to kill Butch) as he exits the bathroom
41.Butch drives away but encounters Marsellus Wallace
42.A foot chase ensues and both end up in a pawnshop and are held at gunpoint by Maynard
43.Maynard takes Marsellus to be raped, and the gimp watches Butch
44.Butch breaks free killing Maynard and shooting Zed in the groin freeing Marsellus
45.Marsellus informs Butch that they are even, given some conditions
46.Butch returns to pick up Fabienne


Monday, 17 September 2012

How to Get Data from LibreOffice Base to MySQL on Windows

This is a slightly off topic post but I spent most of yesterday wrestling with LibreOffice Base (like OpenOffice) trying to get my research data out of it into a format I could generate reports from.  The Report Builder for which comes with LibreOffice isn't really much good unless you fancy learning LibreOffice BASIC, and I needed to be able to customise how my data looked.  The database is a collection of shot by shot comments and analysis for a few films I'm studying for my dissertation - notably the two Wim Wenders classics, "Paris, Texas" and "Kings of the Road".


I used Base because I could easily design a simple form and flick between records.  In retrospect I should have used MySQL and PHP from the start and coded all my forms in PHP.  After several failed attempt the way which I found which worked was.


  1. Download WAMP server.  Make sure you get a version which has MySQL 5.1, not the latest 5.5.  You can simply download the latest WAMP if you wish, then click the icon in the system tray, choose 'MySQL' then 'Version', then get more.
  2. Check the WAMP is fired up and running the right version:  click the icon in the system tray, choose 'MySQL' then 'Version', then 5.1.xx.
  3. Install a MySQL to ODBC connector which speaks to version 5.1 (here).
  4. Add a database to MySQL (however you wish, but the easy way is with phpMyAdmin from the WAMP system tray icon.  Make sure you set up the access permissions for a user name.
  5. Add a connection to the database in the Data Sources list in the Windows Control Panel > Administrative Tools (more instructions here).  The port number is probably 3306 if you haven't touched anything.
  6. Create a new database in LibreOffice Base which connects to the ODBC source by clicking File > New > Connect to an Existing Database > choose MySQL from the dropdown, then click Next.  Choose 'Connect using ODBC' click Next, then browse for the data source you just added in Data Sources in step 5.
  7. Finally you can copy your table from your original LibreOffice Base file and paste it into the new file which is linked to MySQL via ODBC.  You'll probably have to convert some data types along the way and rename some fields if the names are too long or use forbidden characters.  LibreOffice will ask you about this if you need to do it.
That took me a good few hours to work out yesterday, so I hope that it helps anyone else who has entered a huge amount of data into LibreOffice Base only to discover they need to get it out again.  I couldn't export to text, or do the copy and paste into a LibreOffice Calc sheet as I had binary data which made the text file too large to be uploaded again into MySQL.

Now on with the research!

Monday, 2 July 2012

Drawings and Paintings

Three very fast drawings from yesterday, in the Hurtwood near Peaslake...


...and three fast oil paintings from easter (on the back of cereal packets)....




Sunday, 3 June 2012

Lip Sync Project from the First Term

This has been sitting on my hard drive for months waiting for me to finish the sound effects.  I didn't really enjoy this project at all concept wise, but it was nice to work with plasticine and stop-motion for the first time.  It was my first project at the RCA and I guess I was still finding my feet...

Tuesday, 15 May 2012

Drawing in Space and Her Favourite Positions



'Drawing in Space' is an experiment I've wanted to try for a while: using OpenCV and a webcam to draw in 3D.  Essentially you wave a coloured square of card around in front of the webcam and my code converts the path your hand takes into a 3D Drawing.  First it filters the image based on a colour you have chosen, selecting all pixels within a colour range determined by the mean and standard deviation of the patch chosen in the calibration phase.  It then finds contours in the filtered image, simplifies these reducing the number of edges, checks if any contours are square (concave, under a certain contained area, and with all internal angles within a given tolerance).  From all the squares found it then chooses which is the most likely square to follow on from the last based on the sum of the square of the magnitude of the delta in each point's position between frames (trying different permutations of the order of corners to account for rotations and mirroring).  If it can't find the square it motion tracks the corners from the last frame.  If any of these are missing it interpolates the data, and if all of them are missing it tracks strong features in the last image (in full colour, unfiltered) and uses a simple nearest neighbour algorithm to associate each corner of the last square with a nearby tracking point (if it was clever it would use some kind of error detection here to eliminate anomalies and then a delaunay triangularisation to interpolate points, but it needs to be lean to run at all).  If all of this fails, the script uses a third order differential on the last few points to extrapolate the next position, filling in the gaps for a few frames until data resumes.   The script also adjusts the colour it is searching for frame by frame to account for changes in light conditions.  Optionally you can also use the chessboard tracking instead of a coloured square.

The drawings are displayed in anaglyph as you draw, and can be exported as OBJ files.  I need some options to adjust the convergence point and so on, but its mostly there now.  A beta version of the code is online here (right click, save target as).  You need matching python 2.7, numpy 1.6.1, and opencv-python 2.4.0 compiled against each other.  If you're running Windows you can get numpy and opencv packages here.




'Her Favourite Positions' is an animation of 186 Portraits and 37 Full Body Poses from my Life Drawing classes at the RCA.  I matched them up frame by frame in AfterFX, and did a little warp correction here and there to get the proportions generally accurate.  I'm quite amazed that this even worked at all and that you can see a ghostly generic photofit face through the mess of lines.


Tuesday, 17 April 2012

'Tube' Lauches its Kickstarter

The summer before last I moved to Northampton, MA for three months to work on Bassam Kurdali's next open movie, 'Tube'.  I think its fair to say that in those three months I learnt more about CG animation, coding, model making and film making than I have in such a short space of time before or since, as well as having an amazing time living with the other interns Henri and Becky, cooking, cycling, swimming in the river, running up mountains etc.  I managed to do some work remotely for the project last year, but this year my own work has completely taken over.  'Tube' has recently launched its kickstarter project.  I really hope they manage to collect enough funding to finish the film and release the tremendous mountains of assets to the crowd: models, rigs, textures, scripts.  If you've got a spare dime, nickel, quarter or dollar, I'm sure they'd appreciate it...


Sunday, 4 March 2012

Drawings



I spent yesterday photographing some of the several hundred or so drawings from my half a year at the RCA (not including the first 500 frames I drew last week for the film I'm currently working on).  Here's a very quick look at them, and below is, my updated drawing portfolio.



Or view it full size on scribd.