Git Product home page Git Product logo

dzo-arap's People

Contributors

tfedor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dzo-arap's Issues

Parameter conversion python to C.

Hi, I had "int too long to convert" error. However I solved it by using np.int64()
-> self._lib.compute_mask(np.int64(mask.data), np.int64(orig.data), width, height, tolerance)
then I got this error "ctypes.ArgumentError: argument 1: <class 'TypeError'>: Don't know how to convert parameter 1"

In Cpp file, compute_mask function expects bool and char arrays as the first two parameters.
But in python code mask.data and orig.data are integer types. How do you expect it to be converted automatically from int to bool* and char* ?

I mean how does it work for you and not for me?

I changed the function in CWRAPPER.dll

def mask(self, mask, orig, width, height, tolerance):
                print(type(mask.data))
                print(type(orig.data))
                print(width)
                print(height)
                print(tolerance)
                self._lib.compute_mask(np.int64(mask.data), np.int64(orig.data), width, height, tolerance) #line16


Full of the error I get:

C:\Users\Faruk\Downloads\dzo-arap-master\dzo-arap-master>python main.py
<class 'int'>
<class 'int'>
600
500
10
Traceback (most recent call last):
File "main.py", line 3, in
app = Application("assets/taz.jpg")
File "C:\Users\Faruk\Downloads\dzo-arap-master\dzo-arap-master\classes\Application.py", line 18, in init
self.load_image(path)
File "C:\Users\Faruk\Downloads\dzo-arap-master\dzo-arap-master\classes\Application.py", line 30, in load_image
self._image = ImageHelper(self._cw, path)
File "C:\Users\Faruk\Downloads\dzo-arap-master\dzo-arap-master\classes\ImageHelper.py", line 28, in init
self._compute_mask()
File "C:\Users\Faruk\Downloads\dzo-arap-master\dzo-arap-master\classes\ImageHelper.py", line 76, in _compute_mask
self.cw.mask(self.cmask, self.corig, self.width, self.height, 10)
File "C:\Users\Faruk\Downloads\dzo-arap-master\dzo-arap-master\classes\CWrapper.py", line 16, in mask
self._lib.compute_mask(np.int64(mask.data), np.int64(orig.data), width, height, tolerance)
ctypes.ArgumentError: argument 1: <class 'TypeError'>: Don't know how to convert parameter 1


Can you explain that how you expect it to be converted from int to bool* and char* automatically?
Do I miss something? I didn't examine the project fully.

how to run the project

i try to run python main.py but i got this problem
OSError: [WinError 1114] A dynamic link library (DLL) initialization routine failed

int too long to convert

Hi! When I run it on Win10 64bit with Anaconda 64bit, error occurs:

ctypes.ArgumentError: argument 1: <class 'OverflowError'>: int too long to convert

It seems like the integer in Python is too big to be converted to int in C++. I tried to replace "int" with "int64_t" but it still does not work. Do you know how to solve this problem?

Thank you very much!

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.