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

Web support #77

Open
abdelaziz-mahdy opened this issue Jun 5, 2024 · 10 comments
Open

Web support #77

abdelaziz-mahdy opened this issue Jun 5, 2024 · 10 comments
Labels
enhancement New feature or request

Comments

@abdelaziz-mahdy
Copy link
Contributor

Do you think this package can run opencv web assembly? Or it will be alot of work?

@abdelaziz-mahdy abdelaziz-mahdy added the enhancement New feature or request label Jun 5, 2024
@rainyl
Copy link
Owner

rainyl commented Jun 5, 2024

I haven't investigated but the most important problem is that web is not supported by dart::ffi and package:ffi, which is the basement of calling native codes. But I do think it's possible to call native libs via WASM, I used to search dart ffi for web or something else and found some developers were working on ffi for web , but it's immatrue and haven't update for a long time.

If you have any ideas, maybe we can try to work more on it.

@abdelaziz-mahdy
Copy link
Contributor Author

abdelaziz-mahdy commented Jul 23, 2024

i think this will be possible when this is available dart-lang/sdk#46690

@rainyl
Copy link
Owner

rainyl commented Jul 24, 2024

@abdelaziz-mahdy Yes you are right, will keep tracking.

@rainyl
Copy link
Owner

rainyl commented Oct 23, 2024

I noticed wasm_ffi project:

looks like possible to use a .wasm library similar to dart:ffi

@abdelaziz-mahdy
Copy link
Contributor Author

If opencv can be compiled to wasm, it will lead to this package being cross platform, which will most probably replace the image lib for the performance sensitive apps

Since the image lib is not as fast as opencv

@rainyl
Copy link
Owner

rainyl commented Oct 23, 2024

Yes, will try to build opencv for wasm

@eramirez3
Copy link

Hi, any update about openCV for wasm?

@rainyl
Copy link
Owner

rainyl commented Dec 4, 2024

Hi, any update about openCV for wasm?

I havn't managed to build it successfully so it's stuck.

And I have no much time recently, so it seems to be a long way to go.

@abdelaziz-mahdy
Copy link
Contributor Author

abdelaziz-mahdy commented Dec 4, 2024

Hi, any update about openCV for wasm?

I havn't managed to build it successfully so it's stuck.

And I have no much time recently, so it seems to be a long way to go.

does a repo exist for your tries? i may try to work on it too (we may make it work step by step)

@rainyl
Copy link
Owner

rainyl commented Dec 4, 2024

Hi, any update about openCV for wasm?

I havn't managed to build it successfully so it's stuck.
And I have no much time recently, so it seems to be a long way to go.

does a repo exist for your tries? i may try to work on it too (we may make it work step by step)

WASM for OpenCV itself is okay, you can find the static library at https://github.com/rainyl/opencv.full/actions/runs/11481954041, but I didn't managed to build the dynamic libraries for C wrappers because emsdk doesn't support shared library when using cmake (not sure about the supporting status now).

So you can download the static libopencv-webassembly from the artifacts and try to built the dynamic library for the wrappers locally, and then call it from dart.

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

No branches or pull requests

3 participants