Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help compiling and running on mac os x #15

Open
vshesh opened this issue Feb 17, 2021 · 7 comments
Open

Help compiling and running on mac os x #15

vshesh opened this issue Feb 17, 2021 · 7 comments

Comments

@vshesh
Copy link

vshesh commented Feb 17, 2021

Hello,

Trying to run your detector on Mac OS X and so far I have managed to download the code, change some flags for new opencv and build the library by using CMake.
I want to build the library as a shared library so I can call it from python and use it to detect tags.
The Stag parts compile okay, but when the compilation gets to the ED/ED.cpp file it fails in the directory generally due to dependency on old opencv code (such as IplImage). Any ideas on how I can update the library to compile against new opencv?

Scanning dependencies of target STag
[  4%] Building CXX object CMakeFiles/STag.dir/src/ED/ED.cpp.o
In file included from /Users/Vishesh/repos/tui-table/tags/stag/src/ED/ED.cpp:18:
/Users/Vishesh/repos/tui-table/tags/stag/src/ED/Utilities.h:22:14: error: unknown type name
      'IplImage'
void RGB2Lab(IplImage *rgbImg, IplImage *labImg);
             ^
/Users/Vishesh/repos/tui-table/tags/stag/src/ED/Utilities.h:22:32: error: unknown type name
      'IplImage'
void RGB2Lab(IplImage *rgbImg, IplImage *labImg);
                               ^

There is also a dependency on windows.h in the Timer.h module. How do I convert this to mac?

Another question is whether this whole library can be wrapped for python or similar so that I can ignore main.cpp and write my own loop function there (and just use the library to run the detection algorithm).

@Sologala
Copy link

hi! i just pull request a branch to build in macos , please refer to this link

@vshesh
Copy link
Author

vshesh commented Mar 15, 2021

^ took a look. seems like you have made changes for windows.h and Timer.h modules, which is helpful.
how did you resolve the old opencv version issue? I don't see anything in your pull request for that.

Also, once you did get it to build, how are you using this package as a detector? Have you wrapped it, or are you writing your own c++ code and linking it against this library yourself? It would be somewhat difficult for me to maintain my own c++ code using the cv::Mat and associated functions ... i'd much rather use python or similar with this library as glue.

@Sologala
Copy link

Sologala commented Mar 15, 2021

I just also got this repositary, so that do not know more details about it.
But you can check this:

 stag.detectMarkers(image);
 stag.logResults("");

logResults() will give you some inspiration.

In most of my time, i use it as a library within my own c++ code. You can use pybind11 to warp it for python.

@Sologala
Copy link

@vshesh Or you can check this demo

@vshesh
Copy link
Author

vshesh commented Mar 15, 2021

Thanks for the response.
I think this is all helpful, except I cannot build your package against opencv version 4.
The package uses the old C struct IplImage instead of the newer cv::Mat class.

Have you found a way around this?

@Sologala
Copy link

I have not met this problem. It �seems like that Sloving this problem well cost a bunch of time. the version of my opencv is 3.4.13, and My environment won't be later version for the time being. Nevertheless, I will publish it If I met it and successfully tackle it.

@vshesh
Copy link
Author

vshesh commented Mar 16, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants