First steps towards bundle adjustment


The white points are triangulated from the correspondences in the first two video frames. The red shows the two camera positions. Green are from adding data from the third image. The third camera position is farther ahead because 3 frames are skipped in the video sequence.

This was done with three rectified jpeg images. When added to the Ladybug program, it will find correspondences from the raw images (higher resolution) and then project those points to the rectified position. This uses the camera intrinsics produced through the Ladybug API.

Branching river model

This model extends the semi-implicit scheme to include a branching river. It would be easy to extend it to multiple tributaries but I haven’t tried it yet.

In the animation above, the ocean tide enters at the left. The main river is blue and the branching river is cyan. The model is 50km long with a long wave tide (M2) and a smaller oscillation.

River modeling progress

I think I’ve worked out a lot of the planning errors. The code worked before but the result was not very accurate because I didn’t segment the river properly. The current version places height calculations at the center of the cell and the flow at the cell edges. This is using a semi-implicit method.

This video shows a run that includes a slope with inflow from upstream. There is also a tidal and faster oscillation from the ocean side (left boundary).

Sliding plates implicit

The next assignment was to rewrite the sliding plates using an implicit scheme. Here is a video of the animation produced using Visual Python arrows.

Colored according to speed. The initial velocity of the fluid is zero and the upper plate moves at a constant speed.
The visualization setup using Visual Python looks like this:

#SET UP VISUALIZATION SCENE
scene = display(title='Velocity profile', width=800, height=800, center=(u/2,y_divs/2,0), 
                autoscale=True, fullscreen=False)
base = box(pos=(u/2,-0.5,-2), length=u, height=0.4, width=4)
plate = box(pos=(u/2,y_divs+1.5,-2), length=u, height=0.4, width=4)
quiver = [] #TO HOLD ALL THE VELOCITY VECTOR ARROWS
quiver.append( arrow(pos=(0,0,0), axis=(BOUNDS[0,0],0,0),
                         shaftwidth=0.5, color=color.blue) )
for each in xrange(y_divs):
    quiver.append( arrow(pos=(0,each+1,0), axis=(UM[each,0],0,0),
                         shaftwidth=0.5, color=color.blue) )
quiver.append( arrow(pos=(0,y_divs+1,0), axis=(BOUNDS[-1,0],0,0),
                         shaftwidth=0.5, color=color.red) )
scene.autoscale = False

The main loop with the visualization update looks like this:

    for t in arange(t_divs-1): #START FROM 1, SKIP ZERO
        B = zeros(y_divs)
        B[:] = -1 * UM[:,t]
        B[ 0] -= BOUNDS[ 0,t+1] * alpha
        B[-1] -= BOUNDS[-1,t+1] * alpha
        
        UMnext = linalg.solve( A, B )
        UM[:,t+1] = UMnext[:]
        
        for y in arange(y_divs):
            #UPDATE VECTOR LENGTH BASED ON SPEED
            quiver[y+1].axis = (UM[y,t+1],0,0)
            #CHANGE ARROW COLOR BASED ON SPEED: Blue is slow, Red is fast
            quiver[y+1].color = (UM[y,t+1]/u,0.3,1.-UM[y,t+1]/u)

Sliding Plates

Completed the sliding plates assignment.
Assignment: Simulate the vertical velocity profile of a liquid between two infinitely long plates separated by 40mm. The bottom plate remains fixed, but the top plates begins moving at a constant 40m/s in the +x direction. Using the explicit finite difference method.

Image

Visual python makes it so easy to make a nice graphical simulation. I use arrows along the profile that change from blue to red as they increase in length to show the velocity.

Image