Ask Your Question

MrDaniel1234's profile - activity

2017-07-06 05:42:19 -0600 asked a question Homography Decomposition Results

Hello,

Please see the answer to the stackoverflow question linked below.

https://stackoverflow.com/questions/3...

It's pretty straight forward with a homography decomposition.

https://hal.inria.fr/inria-00174036v3...

We already know that there exist 4 solutions, in the general case, for the homography decomposition problem, two of them being the ”opposites” of the other two.

Rtna = {Ra, ta, na} ; Rtna− = {Ra, −ta, −na} (131) Rtnb = {Rb, tb, nb} ; Rtnb− = {Rb, −tb, −nb} (132)

These can be reduced to only two solutions applying the constraint that all the reference points must be visible from the camera (visibility constraint). We will assume along the development that the two solutions verifying this constraint are Rtna and Rtnb and that, among them, Rtna is the ”true” solution. These solutions are related according to (102)- (104). In practice, in order to determine which one is the good solution, we can use an approximation of the normal n∗. Thus, having an approximated parameter vector μ we build a non-linear state observer:

There must be code somewhere for an OpenCV implementation for the refinement of the homographies.

  // decompose using identity as internal parameters matrix
  std::vector<cv::Mat> Rs, Ts;
  cv::decomposeHomographyMat(H,
                             K,
                             Rs, Ts,
                             cv::noArray());

Rs and Ts have multiple solutions. How do i determine which one?

1) Visibility Test - Project points to 3D space using R and t, and check it is in front of the camera. (+ve z value?) 2) How to reduce the final two solutions?

Regards,

Daniel

2016-10-05 08:30:10 -0600 commented question One to Many Images by ID

@berak - Given a list of images. I wish to identify the name of a new sample image which matches only one from the list of images.

2016-10-05 00:11:41 -0600 asked a question One to Many Images by ID

Hello,

I am seeking to use 2D features to match a large amount of images.

The opencv example of one to many images

https://github.com/opencv/opencv/blob...

So all this does is find that all query features were matched to the training set. How to get the id? DMatch does not contain information about the particular image it is from.

    descriptorMatcher->match( queryDescriptors, matches );
    tm.stop();
    double matchTime = tm.getTimeMilli();

    CV_Assert( queryDescriptors.rows == (int)matches.size() || matches.empty() );

I have also looked at FLANN index, but i do not understand it well enough. First create a BOW vocabulary from the features in all training images.

While looping
    Mat bowFeature = getBow2(inImg, detector, bow, featureMask2);
    trainData.push_back(bowFeature.reshape(1,1));


Ptr<cv::flann::Index> index = train_index(trainData);

int K = 2;
cv::Mat dists, indices;
index->knnSearch(bowTest, indices, dists, K);
float response = indices.at<int>(0, 0)

This should give me the image id right?

I am unsure about how the index is generated.

Are there any samples of one to many image matching by id?