Most of my day-to-day activities when I’m not on an exciting expedition are related to developing and testing software and mechanical devices. I think of the process as:
Like so many others, when I know a task should be fairly standard (e.g., yesterday I wanted to convert ten thousand .pgm files into .tiff files.), but I don’t know how to do it, I Google it and hopefully an Internet user or blogger-from-heaven has written about it (THANK YOU “Matt “; I installed ImageMagick and used it’s ‘convert’ function).
When Google doesn’t have the answer, however, I take extra time to figure out the solution, usually by asking people around the lab or using the trial-and-error-plus-reading-bits-of-the-manual method.
I’m going to try to give back more by recording oddball technical things that might save others time and frustration. It’s like take-a-penny leave-a-penny with the Internet. I realize this changes the audience of my blog; so I’m posting these under the new page “#OxfordThesis.”
The solution isn’t necessarily intuitive.
You’ve to go back into PhotoScan and render the Texture of the model (after rendering the point cloud and mesh, even though the point cloud will have associated colours). There are some different options for texture rendering (generic, spheric, orthophoto); make sure you use generic. In PhotoScan, when you then export the model (File – Export Model) the .obj it creates will have associated .mtl and .jpeg files for the texture mapping. The .obj. mtl, and .jpeg (or whatever image type you choose) files must remain in the same folder and have the same names. Also, your file name cannot have spaces.
To view the texture in Rhino, you’ll need to be viewing the model as “Rendered.” To do this, right click in the view panel and select “Rendered,” or use shortcut ^ ⌘ R.
Another thing: This might seem obvious, but on the Rhino Import make sure “Ignore textures” isn’t checked.
If it’s still not working (e.g., this can happen after you’ve moved files around on your desktop), you may need to do this: Right-click the object, select “Object Properties,” under “Material” click “edit”, and then under the “Textures” menu, make sure “colour” is checked. For the “Map file,” un-load the file already there (if there is one; and even if it’s the correct one) by selecting the option “Choose. ” Then, re-load the correct image file. This should add the correct colours to your object.
Get to this menu by right-clicking the object, selecting “Object Properties,” then under “Material” clicking “edit.
Ideally I’d have posted this on this forum where someone asked same question — but I couldn’t make an account without paying.
Still not working? Post comment below.
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:
doc = PhotoScan.app.document
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 t est2.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.
You see the pattern.
Batch processing menu Agisoft PhotoScan Standard
Batch processing menu Agisoft PhotoScan Pro
I hope this helps somebody!
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.