Git Product home page Git Product logo

Comments (5)

kevinpl07 avatar kevinpl07 commented on July 19, 2024 1

Hi @tshino,

you're amazing. It works like a charm!
Thank you so much for your help!

from softcam.

tshino avatar tshino commented on July 19, 2024

Hi, thank you for your interest and effort!
Actually, I have some experience with pybind11 in other projects, I'm sure that you are going in the right direction.

Since in python we are likely using a Numpy array to hold an image, you can use py::array_t<uint8_t> to pass the image to C++.
Since the element order (like row/column major) of a Numpy array can be different from the softcam's expectation, py::array::c_style option would be useful to avoid costly memory copy and to ensure you can safely pass the pointer to softcam.

Maybe I can do the whole thing to create a python bind of softcam, by just taking half a day, and I'm happy to do that.
So, I don't want to take your work, but if you are okay, I will do that.

Anyway, thanks for the great idea!

from softcam.

kevinpl07 avatar kevinpl07 commented on July 19, 2024

Hi @tshino,

if you are really willing to do that, that'd be amazing! I'm not that experienced with Visual Studio and C++, hence my frustration.
Let me know if I could be of any assistance and thanks for your help!

Kind regards
Kev

from softcam.

tshino avatar tshino commented on July 19, 2024

Hi @kevinpl07,
I've just made it and it is already working!
The code is in the branch for #13, so you can try it now.

Steps to build:

  1. run DownloadPybind11.bat.
  2. activate your target Python environment in Command Prompt.
  3. run LaunchVisualStudio.bat in the environment.
  4. on Visual Studio, build solution with Release|x64 configuration.
  5. copy softcam.pyd and softcam.dll to an appropriate directory.
  6. in python, you can import softcam!

I will write a detailed instruction like above as well as sample python code to use it.

from softcam.

tshino avatar tshino commented on July 19, 2024

Thank you again for your post!
That made this library more valuable.

from softcam.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.