Opencv.js repeated alignment image results are inconsistent

I learned image alignment through this article, but I found that after repeated alignment operations, the result is not the same as the first time, but after refreshing the web page, the alignment is consistent every time

helo, citing someone else’s blog isnt all too useful here,
we need to see, what YOU are trying to do (code, images) and a more clear report, of what you expect to happen, vs YOUR results, thank you.

Re-examined the code today and found a bug,

new cv.Mat(src_point_ns.length, 1, cv.CV_32FC2);

change into

new cv.Mat(src_point_ns.length * 0.5, 1, cv.CV_32FC2);

so, you found an error in some 3rd party tutorial.

please go and bug the author, so others dont fall into the same trap !

I have done this, I still have a question, how to use noArray in js?

unfortunately, there is no equivalent to noArray() here, so you cannot use it from js

next best replacement would be an empty Mat like:

new cv.Mat()
1 Like