tfedor / dzo-arap Goto Github PK
View Code? Open in Web Editor NEWAs-rigid-as-possible image deformation in Python and C
As-rigid-as-possible image deformation in Python and 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.
i try to run python main.py but i got this problem
OSError: [WinError 1114] A dynamic link library (DLL) initialization routine failed
Hi, do you know how to increase the speed of transformation. It look like a little bit slow.
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!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.