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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -