Categories
3d Augmented Reality graphics vision

Augmenting Images with Blender 3D 2.9x

augmenting KITTI image with a 3D car

Trying to demonstrate how to do data augmentation on the KITTI stereo dataset, I found myself diving (too deeply) into Blender 3D.

What I set out to do is add a 3D object to an unsuspecting image from the KITTI dataset, to show that one way to get more training data is by synthesizing. I just put a 3D object in front of an image (say a 3D plane with the image as the texture) and done ✅ – I’ve augmented the image. Turns out it needs a bit more of Blender trickery. This is the real reason for this post.

Categories
3d Augmented Reality code graphics opencv python video vision

Projector-Camera Calibration – the "easy" way

First let me open by saying projector-camera calibration is NOT EASY. But it’s technically not complicated too.
It is however, an amalgamation of optimizations that accrue and accumulate error with each step, so that the end product is not far from a random guess.
So 3D reconstructions I was able to get from my calibrated pro-cam were just a distorted mess of points.
Nevertheless, here come the deets.

Categories
3d Mobile phones

My first Thing on Thingiverse!

2017-02-17 09.18.33
Just wanted to share the first Thing I uploaded to Thingiverse (which is a huge open-source collection of 3D-printable or otherwise fabricateable objects).
It’s a 1/4-20 (standard camera mount) holder for a smartphone using a rubber band.
I saw many designs that use screws to hold the phone in place, but I didn’t have such screws and I had many loose rubber bands. Also a rubber band allows the phone to snap in and out more easily.
It’s a very basic 3D design I did with FreeCAD, then made it on my FlashForge Creator Pro.
Enjoy
Roy

Categories
3d graphics

Model and render a folded paper with FreeCAD, Blender

Hello,
I created a little video tutorial to model and render a folded piece of paper for a project I’m working on…
Here it is, enjoy!

Categories
3d code opencv programming vision

Structure-from-Motion Toy Lib Upgrades to OpenCV 3

sfm toy lib
Hello again!
After a long hiatus I’m back with an update. Recently I’ve been upgrading the Structure-from-Motion Toy Library (https://github.com/royshil/SfM-Toy-Library/) to OpenCV 3.x from OpenCV 2.4.x.

Categories
3d code graphics gui opengl qt

WTH OpenGL 4? Rendering elements arrays with VAOs and VBOs in a QGLWidget

I spent an entire day getting OpenGL 4 to display data from a VAO with VBOs so I thought I’d share the results with you guys, save you some pain.
I’m using the excellent GL wrappers from Qt, and in particular QGLShaderProgram.
This is pretty straightforward, but the thing to remember is that OpenGL is looking for the vertices/other elements (color? tex coords?) to come from some bound GL buffer or from the host. So if your app is not working and nothing appears on screen, just make sure GL has a bound buffer and the shader locations match up and consistent (see the const int I have on the class here).

Categories
3d Augmented Reality code graphics Mapping opengl programming Tracking video vision

Bootstrapping planar AR and tracking without markers [w/code]

Years ago I wanted to implement PTAM. I was young and naïve 🙂
Well I got a few moments to spare on a recent sleepless night, and I set out to implement the basic bootstrapping step of initializing a map with a planar object – no known markers needed, and then tracking it for augmented reality purposes.

Categories
3d Augmented Reality code graphics opencv opengl programming qt Tracking video vision

Augmented Reality on libQGLViewer and OpenCV-OpenGL tips [w/code]

You already know I love libQGLViewer. So here a snippet on how to do AR in a QGLViewer widget. It only requires a couple of tweaks/overloads to the plain vanilla widget setup (using the matrices properly, disable the mouse binding) and it works.

The major problems I recognize with getting a working AR from OpenCV’s intrinsic and extrinsic camera parameters are their translation to OpenGL. I saw a whole lot of solutions online, and I contributed from my own experience a while back, so I want to reiterate here again in the context of libQGLViewer, with a couple extra tips.

Categories
3d code graphics opengl programming

Vertex array objects with shaders on OpenGL 2.1 & GLSL 1.2 [w/code]

rect3826Phew. Finally this is working!
I’ve been confined to OpenGL 2.1 and GLSL 1.2 on the Mac since the Qt OpenGL context will not pick up the core OpenGL profile (a big problem on it’s own) and get an OpenGL 3.x and GLSL 1.5… So it’s back to old school GL’ing, but anyway some things are working, albeit they have their quirks.
So for all of you battling the OpenGL 2.1 war, here’s how I made VAOs work with a very simple shader.

Categories
3d code graphics gui opencv programming qt vision

Moving to Qt on the SfM-Toy-Library project

Qt GUI for SfMToyLibFor those of you still interested, I’ve made the move to using Qt and QGLViewer in the SfM-Toy-Lib project. Getting rid of PCL dependency (I think it’s a bloated library), and burying FLTK long in the past, I feel much better about it now.
Get it on github: https://github.com/royshil/SfM-Toy-Library