pyRANSAC-3D icon indicating copy to clipboard operation
pyRANSAC-3D copied to clipboard

Adding new cpp wrappers

Open GuiiFerrari opened this issue 3 years ago • 7 comments

Few changes to add the new line_cpp.py which contains the bind to the cpp line ransac. Still needs to change the class to return the B coefficient from equation: y = A*t + B.

GuiiFerrari avatar Jan 19 '21 21:01 GuiiFerrari

I'm working on how to make this work for a python library. Basically we need to make the build of the C files when installing using pip. I don't have much experience using C extensions.

https://stackoverflow.com/questions/32528560/using-setuptools-to-create-a-cython-package-calling-an-external-c-library

@GuiiFerrari do you have the setup.py you used to generate the .so file? This would help me a lot.

leomariga avatar Jan 21 '21 22:01 leomariga

I generate the .so file using the following:

g++ -c -fPIC line.cpp -o line.o
g++ line.o -shared -o line.so

I don't know to make a functional dll on windows. I always end up with some error.

GuiiFerrari avatar Jan 21 '21 22:01 GuiiFerrari

Today I worked on making the instalation available for different architectures using extension from the setup.py file during the pip install. I created a repository to test how can we build the cpp files during the instalation. I manage to make it work on linux, but no success on windows yet.

Right now the only way of building the cpp on different architectures is to build during the instalation, so every system will generate its shared library type (.so, .dll etc..). However, not every user has the compiling tools needed for such task and I already saw many problems using this approach.

I believe the best way to distribute the cpp package will be using the build wheels for every possible architecture using CI. I'll work on this problem this week to see what I can do.

leomariga avatar Feb 09 '21 03:02 leomariga

Unfortunately I don't know how to help you. I will work on a plane implementation soon. I've made the complete optimization for line ransac.

GuiiFerrari avatar Feb 09 '21 06:02 GuiiFerrari

I created the wrapper and I think It's working. Try to install this version and use the class Line_cpp. There's a test file. Test the new file and tell me if it's working.

GuiiFerrari avatar Jun 08 '22 00:06 GuiiFerrari

Thank you Guii, I will soon give it a try

leomariga avatar Jun 12 '22 19:06 leomariga

Hi, have you tried?

GuiiFerrari avatar Oct 17 '22 12:10 GuiiFerrari