image-js / image-js-typescript

Temporary repository to work on the migration of image-js to TypeScript
https://image-js.github.io/image-js-typescript/
MIT License
5 stars 5 forks source link

Implement methods to detect and eliminate outliers #196

Open opatiny opened 1 year ago

opatiny commented 1 year ago

They are at least these two possibilities to remove some of the outliers:

1) crosscheck: best match for a-> should be the same for b->a https://docs.opencv.org/4.x/dc/dc3/tutorial_py_matcher.html

2) Lowe's ratio test: the best match $p_1$ is at least two times better that the second match $p_2$ $\frac{d(q,p_1)}{d(q,p_2)} < \frac{1}{2}$

opatiny commented 1 year ago

Crosscheck was implemented in #199

opatiny commented 1 year ago

Lowe's ratio test will necessitate implementing a function that returns the N best matches for each keypoint.

opatiny commented 1 year ago

A basic function to eliminate outliers was implemented (filterEucledeanDistance), but it can only be used when the rough position of the destination is known. It only keeps the best match from source to a given destination keypoint, "the better" meaning the one which euclidean distance is the smallest.

Implemented in c590cdb27e1d13d56833f4dbb0e3bd05f38dbfab