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

use sol2 to bind the opencv library #1651

Open
libaineu2004 opened this issue Nov 23, 2024 · 1 comment
Open

use sol2 to bind the opencv library #1651

libaineu2004 opened this issue Nov 23, 2024 · 1 comment

Comments

@libaineu2004
Copy link

https://opencv.org/

I want to use sol2 to bind the opencv library.
But I don't know how to implement it?
For example, reading and binarizing images.

cv::Mat src = cv::imread("demo.png", IMREAD_GRAYSCALE);
cv::Mat dst;
cv::threshold(src, dst, 128, 255, THRESH_BINARY);
cv::imshow("binary", dst);

Could you please write an example? How to bind opencv? I want to use lua to implement this C++ source code.
Thank you!

@trexxet
Copy link

trexxet commented Jan 7, 2025

You take all the types, classes, functions and methods, and bind them one by one. That's how it's done for literally anything, not for OpenCV only.

Sol repo contains enough examples to help you do it, but if you dare, then good luck.

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