You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to limit the keypoints to the best n keypoints?
A 1000px max long side image produces 29823 keypoints. Then going into the RobustAffineTransformEstimator to check for geometric an exception is thrown:
Exception in thread "main" java.lang.IllegalArgumentException: Matrix of 59646 x 59646 = 3557645316 elements is too large to be allocated using a single Java array.
at no.uib.cipr.matrix.AbstractDenseMatrix.(AbstractDenseMatrix.java:53)
at no.uib.cipr.matrix.DenseMatrix.(DenseMatrix.java:167)
at no.uib.cipr.matrix.SVD.(SVD.java:97)
at no.uib.cipr.matrix.SVD.(SVD.java:75)
at no.uib.cipr.matrix.SVD.factorize(SVD.java:149)
at org.openimaj.math.matrix.MatrixUtils.solveHomogeneousSystem(MatrixUtils.java:1549)
at org.openimaj.math.matrix.MatrixUtils.solveHomogeneousSystem(MatrixUtils.java:1522)
at org.openimaj.math.geometry.transforms.TransformUtilities.affineMatrix(TransformUtilities.java:478)
at org.openimaj.math.geometry.transforms.AffineTransformModel.estimate(AffineTransformModel.java:104)
at org.openimaj.math.model.fit.RANSAC.fitData(RANSAC.java:529)
at org.openimaj.math.geometry.transforms.estimation.RobustAffineTransformEstimator.fitData(RobustAffineTransformEstimator.java:134)
at org.openimaj.feature.local.matcher.consistent.ConsistentLocalFeatureMatcher2d.findMatches(ConsistentLocalFeatureMatcher2d.java:138)
at imgtest.ImgTest.featureMatch(ImgTest.java:111)
at imgtest.ImgTest.main(ImgTest.java:54)
I am trying to re-produce SIFT searches originally written using OpenCV (in java) but I would like to use OpenIMAJ instead for better portability. OpenCV allows a limit on keypoint detectors so that only the best n are returned. Typically for my purposes I have found that around 2000 of the best keypoints are all that is needed to produce highly accurate matches with low numbers of false negatives, and exceedingly low false positives. Being able to limit this also increases performance as subsequent matching doesn't need to be based on such a large set - and of course the exception is avoided.
Is there a way to control keypoint selection?
The text was updated successfully, but these errors were encountered:
I'm sort of surprised that your finding so many keypoints on a 1000px image - the default settings follow Lowe's original paper & should normally just give you a few thousand points.... That being said, you have full control over the keypoints being detected by passing in a DoGSIFTEngineOptions object to the DoGSIFTEngine constructor (or call getOptions() on the instance you already have). Try playing with setEigenvalueRatio() and setMagnitudeThreshold() to reduce the number of keypoints found (in both cases raising it will reduce the number I think). Potentially options.setDoubleInitialImage(false) might also give you a quick fix and also make everything faster, but it might affect matching performance too much --- really depends on the types of images for your problem.
Is it possible to limit the keypoints to the best n keypoints?
A 1000px max long side image produces 29823 keypoints. Then going into the RobustAffineTransformEstimator to check for geometric an exception is thrown:
Exception in thread "main" java.lang.IllegalArgumentException: Matrix of 59646 x 59646 = 3557645316 elements is too large to be allocated using a single Java array.
at no.uib.cipr.matrix.AbstractDenseMatrix.(AbstractDenseMatrix.java:53)
at no.uib.cipr.matrix.DenseMatrix.(DenseMatrix.java:167)
at no.uib.cipr.matrix.SVD.(SVD.java:97)
at no.uib.cipr.matrix.SVD.(SVD.java:75)
at no.uib.cipr.matrix.SVD.factorize(SVD.java:149)
at org.openimaj.math.matrix.MatrixUtils.solveHomogeneousSystem(MatrixUtils.java:1549)
at org.openimaj.math.matrix.MatrixUtils.solveHomogeneousSystem(MatrixUtils.java:1522)
at org.openimaj.math.geometry.transforms.TransformUtilities.affineMatrix(TransformUtilities.java:478)
at org.openimaj.math.geometry.transforms.AffineTransformModel.estimate(AffineTransformModel.java:104)
at org.openimaj.math.model.fit.RANSAC.fitData(RANSAC.java:529)
at org.openimaj.math.geometry.transforms.estimation.RobustAffineTransformEstimator.fitData(RobustAffineTransformEstimator.java:134)
at org.openimaj.feature.local.matcher.consistent.ConsistentLocalFeatureMatcher2d.findMatches(ConsistentLocalFeatureMatcher2d.java:138)
at imgtest.ImgTest.featureMatch(ImgTest.java:111)
at imgtest.ImgTest.main(ImgTest.java:54)
I am trying to re-produce SIFT searches originally written using OpenCV (in java) but I would like to use OpenIMAJ instead for better portability. OpenCV allows a limit on keypoint detectors so that only the best n are returned. Typically for my purposes I have found that around 2000 of the best keypoints are all that is needed to produce highly accurate matches with low numbers of false negatives, and exceedingly low false positives. Being able to limit this also increases performance as subsequent matching doesn't need to be based on such a large set - and of course the exception is avoided.
Is there a way to control keypoint selection?
The text was updated successfully, but these errors were encountered: