image-js
image-js copied to clipboard
Error : warpingFourPoints method
Hi !
I use image-js to compute a warping 4 points image transformation. When I used this method, I always receive the error "pts muste be an array of 4 elements".
How to fix it
I check in the sources and I see that the param pts
is an object like this :
pts: {
pts: [[0,0], [100,0], [0, 100], [100, 100]]
};
You'll need to unwrap pts in an object and method will work !
Seems to me the parameter pts is an array of 4 XY as in this testcase
https://github.com/image-js/image-js/blob/bb06fbe41fd5b9497720a926b69609e1d6e5b596/src/image/transform/tests/warping.js#L29-L34
Not sure I understand what is the problem.