GRACE UNDER PRESSURE
  • Blog
  • About
  • Act Now
  • Updates
  • THESIS
  • Contact




BLOG BY GRACE C. YOUNG
                                                             
                                                      

FFMPEG ON UBUNTU (?)

11/4/2015

Comments

 
I'm trying to save a video as a sequence of images on a Linux - Ubuntu desktop. At first I tried to use ffmpeg, but ffmpeg wouldn't install. It turns out Ubuntu has it's own version of ffmpeg called avconv that you can use exactly the same way; e.g., ​the command below will save filename.mov as a set of images filename_img1.jpg, filename_img2.jpg, etc. at 25 frames per second. ​
$ avconv –i filename.mov –r 25 filename_img%d.jpg
I'm using Ubuntu 14.04.3.
Comments

"HELLO WORLD" PYTHON SCRIPT FOR AGISOFT PHOTOSCAN 

10/14/2015

Comments

 
I'm starting to use Python scripting in Agisoft PhotoScan Pro to batch process the many sets of images of that I want to render into 3D models. There are a few ways to do this, although I had to settle on Agisoft Python Scripting (Option 3) for reasons described below.
Option 1) Batch process via drop-down menus. Agisoft PhotoScan, both pro and standard editions, let you create and run batch processes via a set of easy-to-use drop-down menus. No programming required! ​You can access these by clicking Workflow > Batch Process... There are more tasks you can add to your batch process in the Pro version (details in images below). But here's where batch processing falls short, even in the pro edition... I have a set of 60 or so folders, each with at least a dozen images, that I want to create into 60 different 3D models. I don't have the time or patience to manually upload each set of images and save the renderings in organized folders. I'd rather let my computer run overnight, automatically working through my folders of images, and wake up to a .stl file saved in each folder :) Unfortunately, the batch processing options available via the drop-down menus don't seem to let you add images automatically from folders. I've tried the "Import Cameras" feature and it just fails, without ever asking you to select or input a set of images. After some trial-and-error and searching thru the manual to no avail, I looked into other options.  

Option 2) Open Source Tools, Python Photogrammetry Toolbox. This is a free tool that would let me do all my rendering in a Python script. I've heard good things, however, apparently the toolbox only runs on Linux and Windows. I'd really like all my processing to  run on my Mac for a number of reasons (I travel to remove places with just a tiny MacBook Air that can't run BootCamp). Apparently the Bundler package by Noah Snavely works on Mac and it will render a sparse point cloud from images, and then you can generate a mesh by running Yasutaka Furukawa's Patch-Based Multi-View Stereo program. I spent an hour or so attempting to get this working but it got too complicated so, once again, I looked into other options. That's how I stumbled into Option 3, Python Scripting in Agisoft PhotoScan Pro.
​
Option 3) Python Scripting in Agisoft PhotoScan Pro. Make sure you're reading most up-to-date user manual for this, version 1.1.0 as far as I can tell. For whatever reason, the older version 1.0.0 comes up first on Google searches and it's actually harder to find the most up-to-date version, linked above. (Maybe my referencing this will boost it in search algorithm?! Hello Google!) If you try running the example script in version 1.0.0 of the manual it won't work; yes, I tried that. If you run the example script in version 1.1.0 it will work; yay. Here's a hello world program:
import PhotoScan

doc = PhotoScan.app.document
doc.save("/Users/Grace/Dropbox/My DPhil/Tests/test2.psz")

PhotoScan.app.messageBox("hello world")
Note:  Photoscan.app.messageBox("hello world") will not work, and PhotoScan.Application.messageBox("hello world") will not work either. PhotoScan.app.quit() will work; PhotoScan.Application.quit() won't work. Also, the folder you're saving into (here, /Users/Grace/Dropbox/My DPhil/Tests/) must already exist. If it doesn't, the file test2.psz will not be created and it will not clearly tell you that it wasn't created; it will just tell you "exit code 0" instead of "exit code 1" in the console, as shown below. Finally, beware that test2.psz will overwrite another test2.psz in that location without telling you.
Picture
You see the pattern...

Picture
Batch processing menu Agisoft PhotoScan Standard
Picture
Batch processing menu Agisoft PhotoScan Pro

Picture
Success.
I hope this helps somebody! 
Comments

OCEAN PAVILION

7/18/2015

Comments

 
About a year ago I worked with a team at the MIT Media Lab on a science/art piece called the "Coral Pavilion." Since I left, the project has really taken off! It's now the "Ocean Pavilion." Read more in 
"Water-based Robotic Fabrication:  Large-Scale Additive Manufacturing of Functionally-Graded Hydrogel Composites via Multi-Chamber Extrusion" in the journal of 3D Printing and Additive Manufacturing or on Professor Neri Oxman's website "Mechanic Biomaterials Deposition," "Pneumatic Biomaterials Deposition," and "Water-Based Robotic Fabrication." 
Comments

BLENDER 3D MODELING SOFTWARE

6/9/2015

Comments

 
Picture
Right now I'm learning Blender for 3D modeling work. Previously I used Rhino, SolidWorks, and Autodesk Inventor. Switching to Blender because a) people here use it, b) it's free, c) it works across platforms and d) it seems to be just as powerful as the non-free, Windows-only modeling software. 

Major shoutout to the awesome Wikibook that's making the transition easier:  Blender 3D: Noob to Pro. Highly recommend. 
Blender is not the kind of software you can launch into and grope about until you find your way. It's not like exploring an unfamiliar city. It's more like flying a spaceship. If you hop into the pilot's seat without knowing the fundamentals, you'll be lucky to ever get off the ground, and it'd take a miracle for you to reach your destination. 
Comments

PRESENTING AT CONFERENCE

1/25/2015

Comments

 
At Underwater Interventions in New Orleans next month, I'll present two projects: 
  • Development of a modular, autonomous stereo-camera system for monitoring fish assemblages 
  • Viewing the underwater world at up to 18,000 frames/second
The links go to the abstracts. 
Comments

ALIGNING MANY PHOTOS

1/20/2015

Comments

 
For the exhibit I did recently, I wanted to cover a narrow wall with 1600 images the Edgertronic camera took in one second. Each image would be just a little larger than a postage stamp. I couldn't think of an "obvious" way to do this without going insane, and I couldn't find advice on the Internet about how to either.  So I'm posting what I ended up doing in case it helps anyone. 

1.  I wrote a Python script (.py file here) that wrote the text for a LaTeX file (.tex file here). LaTeX layout the images in a 64x25 grid on a PDF and added a nice header. It took about 20min.  I'm sure this isn't the most efficient way, but it worked. The result is below. 
Picture
The PDF was 36x80."
Picture
2.  I also heard you can use Photoshop to do this (go to -> automate -> contact sheet), although I didn't try it; I don't have Photoshop on my laptop anymore :(
Comments

Transition

12/26/2014

Comments

 
I'm now transitioning to the Ocean Research & Conservation Group, led by Professor Alex Rogers at Oxford. We'll be designing tools for deep sea exploration. I'm incredibly excited and grateful to be part of such a fantastic team. More updates to come.
Comments

WEEK 8

12/4/2014

Comments

 
Time is flying by. I'm in the midst of my literature review on helical screw piles. I keep my notes in LaTeX and organize the hundreds of papers I'm looking at using reference management software Mendeley combined with BibTeX. Mendeley syncs papers to my phone (via the PaperShip application), so woohoo I can read whenever I've a few spare moments, like waiting in line for lunch, sitting on a bus/plane/boat, or standing at the bus stop. All those little chunks of time really do add up. There's a slight learning curve with all software, but now I'm saving hours of time, energy, and frustration. Honestly, doing so much heavy reading is new to me. I prefer to design, build, and test things or solve problems, either equations or hands-on ones. 
Comments

Week 4 

11/12/2014

Comments

 
Time has flown by (ahem, no log updates recently) and I've been busy, busy. I finally finished the set of problem sets in soil mechanics and am proud to have read about three dozen offshore geotechnical engineering scientific papers, mostly relating to wind turbine foundations. Sometimes a 2,000 word paper takes more than an hour to read because it's technically very dense. After learning the lingo and becoming more accustom to the topics, however, I can read them faster, or just skim them to get a pretty good gist of what's going on. 

Much of what I'm reading is my supervisor's previous work. A top tier academic, he has a long (somewhat daunting) list of publications. It's awesome to have the co-authors of papers sitting right next to me in the office, so we can discuss the work and ask questions. I remember hearing about Google, DropBox and other technology companies debating the pros and cons of various office layouts. It really does have an effect on the office culture. Our office has a bit of a start-up feel. We're in a big room with high ceilings and the desks can roll around. No walls. 

In addition to delving into my thesis topic (which will most likely be helical screw piles for offshore wind turbines, more on that later), I've been exploring broadly the intersections of ocean management and technology. The 2nd International Ocean Research Conference is coming up in Barcelona (beach!), and there will be special talks on underwater vehicles for exploration and on how technology can be used to better manage the ocean. This is a topic I'm especially interested in from an engineer's perspective. I hope to either attend in person, or watch the online broadcast. This week I also had the good fortune to attend Capital Link's Forum on Corporate Social Responsibility in the maritime shipping industry in London. In addition to getting to enjoy the afternoon in the beautiful One Moorgate Place, I met some incredible people. One of the delegates at the International Maritime Organization (IMO) invited me to be a guest delegate at the IMO the next day. What an experience!  

I also attended a meeting of the Oxford Animal Ethics Society on the topic of plastics in the ocean. It inspired me to write something about the topic again, because there is much misconception about the issue, and there really is too much plastic and trash in the ocean. We can all do something about it. 
Comments

WEEK 2 DAY 2 (2.2) OF DPHIL

10/22/2014

Comments

 
The Marine Archeology talk yesterday was fascinating. I was most interested in the technical elements of their field work. As expected, their site work is in shallow water (8m depth), so SCUBA dive time is almost unlimited. They've been working over winters on the same site on the Nile for 15 years (when it's safe to work there!), and continue to discover new artifacts buried in the clay. Their discoveries are detailed in the BBC documentary Swallowed by the Sea. Imagine what they could discover if they could dive deeper, in colder water (e.g., off the UK, where there are 30,000+ shipwrecks), and for longer amounts of time. 

They are thinking to use cameras and laser scanners to 3D model artifacts. I was excited to hear this because it's the same technology I worked with at Woods Hole Oceanographic Institution this summer to make 3D maps of sea ice and seabeds. 

While at my desk today I'm listening to Planet Money podcast When Women Stopped Coding and the BBC documentary Swallowed by the Sea as I work through water content, porosity, and compression indices in various soil mechanics problems. 
Comments
<<Previous
Forward>>

    Author

    Same author, Grace. This is where I make technical notes, usually related to my PhD. My slightly more exciting blog, Grace Under Pressure, is here. 

Grace under pressure

 MORE BLOG (ALL)        WHAT'S M31 ABOUT?        UNDERSEA GRADUATION