Thursday, March 29, 2018

Open-CV migrating from Windows(Visual Studio) to Ubuntu

Depends on the scenario, it may be required you to change the development environment. After the change, the system never is expected to execute the code smoothly. for this errors, sometimes no errors in the compilation and when you run its simply exit no output will be visible.  I faced this issue and this is my findings of this problem. 


  • Case sensitiveness, if your images have .jpg and in your code, you mentioned as .JPG this may throw and assertation error. In some cases, it's not. Check carefully the case of your code. Linux is case sensitive. 
  • Never called executable code (method calling) outside the main method or any other method. 
This code segment is in outside the main method and not belong to any other method. This is more like a global declaration so I don't need to pass parameters to methods. This is going to fail in Linux environment. this should be inside a method.

This is Linux, and I insert that code segment inside the main method and worked fine. 
I don't know to explain why it's not working but I believe visual studio going to handle lots of things for us. But g++ compiler cant.

  • Always use pass by reference for parameter passing because then we can update the same variable.  
This is it for now and I will update this article with other problems I faced in future. 

Thursday, March 22, 2018

Install drivers in ubuntu using command line

First, you need to get superuser permission.
sudo passwd root
this will prompt you to enter your normal login password

then the system will ask for new set of the password to assign as the sudo password.
Done...

In order to install wifi drivers type, this commands.

this will prompt all the required drivers' list.

sudo ubuntu-drivers list
Will show all the driver packages which apply to your current system. You can then
sudo ubuntu-drivers autoinstall 
to install all the packages you need, or you can do:
sudo ubuntu-drivers devices
to show you which devices need drivers and their corresponding package names.
after identifying the required drivers you can issue the 
sudo apt-get install <driver name>
This will do the trick. Enjoy.