Speeding up complex Numpy Matrix multiplications (Point cloud) -


i have around 200 3d points need multiply rather complex 2d projection matrix. using numpy , loop, iterating through 3d point cloud, applying matrix transformations , getting data.

this seems rather slow. there way might able vectorize this, or use kind of speed techniques (maps, pools etc.)

    f = matrix([         [735.4809,  0.,         388.9476,   0.],         [0.,        733.6047,   292.0895,   0.],         [0.,        0.,         1.0000,     0.]     ])     vehiclerpy = self.getrt(roll=roll, pitch=pitch, yaw=0., x=imux, y=imuy, z=imuz);     sonartocamera = self.getrt(roll=rtroll, pitch=rtpitch, yaw=rtyaw, x=rtx, y=rty, z=rtz);     spacematrix = matrix([         [(sqrt(r**2 - (y/(cosd(roll)*cosd(pitch)))**2)*sind(theta))],         [(y/(cosd(roll)*cosd(pitch)))],         [(sqrt(r**2 - (y/(cosd(roll)*cosd(pitch)))**2)*cosd(theta))],         [1]     ])     finalmatrix = f*vehiclerpy*sonartocamera*spacematrix;     uvmatrix = matrix([         [finalmatrix.item(0)/finalmatrix.item(2)],         [finalmatrix.item(1)/finalmatrix.item(2)],     ]) 

something above. need repeat 3*3/4*4 multiplication across 200 points per frame


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

jdbc - Not able to establish database connection in eclipse -