Closed rstoye closed 2 months ago
I'm busy converting the project to N-API, I can not check that for now.
Alright, thank you for the response. I'll stick to the python script for now and check back later.
you have small bug cv.findHomography(srcPts, dstPts, cv.RANSAC);
should be cv.findHomography(dstPts, srcPts, cv.RANSAC);
you have small bug
cv.findHomography(srcPts, dstPts, cv.RANSAC);
should becv.findHomography(dstPts, srcPts, cv.RANSAC);
Well this is embarrassing, but you're absolutely right. I switched the two and now it's working as intended. Thank you very much, I appreciate the help.
I'm trying to recreate a python script in typescript and it seems everything works fine, except that the output image looks like nothing was actually done to it.
This is the python code that works flawlessly.
It takes the template image and the scanned image and warps the scanned image according to the template. It also scales the scanned image up to match the dimensions of the template image (1653 x 2338 -> 2480 x 3508).
template -> scanned -> aligned
Now here is my typescript code:
But instead of the expected aligned image like the one above I only get this one:
Which as you can see doesn't seem to have been warped at all.
I compared the srcPts and dstPts with the ones from the python code and they match. And the matches look like this.
I tried a few different approaches and searched online for similar problems, but I wasn't able to find anything. So I don't understand what I'm doing wrong.
Any help would be really appreciated. Thanks in advance.
OpenCV version: 4.9.0
OS: Manjaro Linux 24.0.2