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. 

No comments:

Post a Comment