Friday, September 26, 2014

PCL: pointcloud transformation




// transform the model by the transformation value
  Eigen::Matrix4f txform;
 

 //get the txformation matrix (discussed below)
 
 pcl::transformPointCloud (*cloud_3dmodel, *txformed_model, txform );


ICP can be used to estimate the transform :

Eigen::Matrix4f txform;

 pcl::IterativeClosestPoint<pcl::PointXYZRGB, pcl::PointXYZRGB> icp;
 icp.setInputCloud(cloud_3dmodel);
 icp.setInputTarget(cloud_cluster);
 pcl::PointCloud<pcl::PointXYZRGB> Final;
 icp.align(Final);
 std::cout << "ICP has converged:" << icp.hasConverged() << " score: " <<    icp.getFitnessScore() << std::endl;

txform = icp.getFinalTransformation();

Refer:
http://stc0.wordpress.com/2013/03/22/equivalent-ways-to-register-two-point-clouds-with-pcl/
http://pointclouds.org/documentation/tutorials/iterative_closest_point.php

Eigen: block access to matrices

  
 Eigen library: matrix block operation: 

 http://eigen.tuxfamily.org/dox-devel/group__TutorialBlockOperations.html


 //Code snippet to define a 4x4 transformation matrix:


  Eigen::Matrix4f txform;

  .........

  // Get Rotation Matrix and translation vector: T = [R | t]
  Eigen::Matrix3f rotation = txform.block<3,3>(0, 0);
  Eigen::Vector3f translation = txform.block<3,1>(0, 3);
 

  //Print he individual values
    printf ("\n");
    printf ("            | %6.3f %6.3f %6.3f | \n", rotation (0,0), rotation (0,1), rotation (0,2));
    printf ("        R = | %6.3f %6.3f %6.3f | \n", rotation (1,0), rotation (1,1), rotation (1,2));
    printf ("            | %6.3f %6.3f %6.3f | \n", rotation (2,0), rotation (2,1), rotation (2,2));
    printf ("\n");
    printf ("        t = < %0.3f, %0.3f, %0.3f >\n", translation (0), translation (1), translation (2));


   


Saturday, September 20, 2014

A quick python tutorial

Here is the link to a quick python tutorial for beginners:

http://www.ccs.neu.edu/home/rplatt/cs5100_2014/pa0/hw_asst0.html

Hope it helps for people who want to begin with their work in python!

Sunday, May 4, 2014

How to write Unicode text using LaTeX

Here is a ppt I made with my lab-mate Praveen Krishnan, where I have compiled how to write in LaTeX documents using different languages. I have compiled it from various sources ... I hope it is useful to you all...

http://researchweb.iiit.ac.in/~swagatika.panda/Documents/UnicodeText_Latex_Tutorial.pdf
 
References:



  • Devanagari for TEXVersion 1.2, User Manual

Split a PDF to many PDFs

Here is the link to Linux Commando's blogpost on using pdftk  to split a pdf.

http://linuxcommando.blogspot.in/2013/02/splitting-up-is-easy-for-pdf-file.html

Monday, March 3, 2014

Take screencast and ogv to Avi conversion in Ubuntu

For recording your screen, where we can demonstrate some videos or some functions, RecordMydesktop is a nice option in Ubuntu. It can be downloaded using Ubuntu Software Center. It is pretty easy to use too.

Here is the link for RecordMyDesktop:

https://apps.ubuntu.com/cat/applications/gtk-recordmydesktop/

However, this tool generates the video in ".ogv" format. If we wish to convert it into a commonly used format such as ".avi", we can use following commad:

$ mencoder input.ogv -ovc lavc -oac mp3lame -o output.avi

Courtesy:

http://www.cyberciti.biz/faq/linux-unix-bsd-appleosx-convert-ogv-to-avi-video-audio/

Saturday, March 1, 2014

Show that A^2 = 0 is possible but A’A = 0 is not possible (unless A= zero matrix).

Found a solution in Stackexchage and quoting it here:

http://math.stackexchange.com/questions/435880/if-aat-is-the-zero-matrix-then-a-is-the-zero-matrix

if we put A=(aij)1i,jn , then At=(bij) , with bij=aji , so by definition:
AAt=(k=1naikbkj)=(k=1naikajk)

If you now look at the main diagonal's general entry of the above, you get
k=1naikaik=k=1na2ik

So if AAt=0 then the above diagonal's entries are zero, but a sum of squared real numbers is zero iff each number is zero, so...