Search code examples
pythonopencvcomputer-visionhalcon

Migrate Halcon code to OpenCV


I am developing a solution using a comercial computer vision software called Halcon. I am thinking on migrating or convert my solution to OpenCV in Python. I will like to start developing my other computer vision solution in Halcon because the IDE is incredible, and them generate a script to migrate them to OpenCV.

Does anyone know any library for this task?

I will like to start developing an open source SDK to convert Halcon to OpenCV. I and thinking to start developing all internal function from Halcon to Python. Any advice?


Solution

  • I wouldn't invest time in such an effort. These are some reasons:

    • For simple functions (blur, erode, dilate) Halcon and OpenCV have different implementations of the same function and probably you will have slightly different outputs (one may round up and the other round down, for example). A complex program that runs properly in Halcon may fail in OpenCV for these small differences (a butterfly effect).

    • Probably there are complex functions (pattern matching algorithms, deep learning), that exist in one environment and don't exist in the other.

    • OpenCV users typically don't have Halcon IDE. I like OpenCV because it is open source and free, I won't consider using Halcon IDE because it is not. Moreover OpenCV has many functions and it improves very fast (I don't know Halcon). If Halcon was much better than OpenCV (more popular, faster, cross platform, with all OpenCV functions implemented in Halcon) and my project had the money, I would use Halcon IDE for development and I would use it in production as well (and completely ignore OpenCV). In either case, I wouldn't use a tool that converts one to the other. It is like writing the Linux kernel with Visual Studio, maybe someone does it, but I guess it is not the majority.

    If I had to spend time in an open source project, I would write a better OpenCV interface (as Vladimir Perković suggests). There are some efforts in that direction (probably there is something else if you search):