ImageFeaturesAndMatching icon indicating copy to clipboard operation
ImageFeaturesAndMatching copied to clipboard

SuperGlue can't be used

Open Jay230223 opened this issue 2 years ago • 8 comments

hello oym1994 There's some question about the SuperGlue! First, the ".engine" of SuperGlue can't be generated; Second, the matcher of SuplerGlue isn‘’t defined; so, is there any code to be added, thank you!

Jay230223 avatar Feb 17 '23 07:02 Jay230223

same problem

song-GAO-1992 avatar Mar 16 '23 07:03 song-GAO-1992

hello oym1994 There's some question about the SuperGlue! First, the ".engine" of SuperGlue can't be generated; Second, the matcher of SuplerGlue isn‘’t defined; so, is there any code to be added, thank you!

Hi, the engine will be automaticly generated if there exists no such file. But you need TensorRT with version 8.2.3 or above, or the generation process may fail.

So what is your GPU platform and tensortRT version? Can you show more error message?

oym1994 avatar Mar 22 '23 14:03 oym1994

same problem

Hi, what is your GPU platform and tensortRT version? Can you show more error message?

oym1994 avatar Mar 22 '23 14:03 oym1994

hello oym1994 There's some question about the SuperGlue! First, the ".engine" of SuperGlue can't be generated; Second, the matcher of SuplerGlue isn‘’t defined; so, is there any code to be added, thank you!

Hi, the engine will be automaticly generated if there exists no such file. But you need TensorRT with version 8.2.3 or above, or the generation process may fail.

So what is your GPU platform and tensortRT version? Can you show more error message?

As for the match function, sorry I forget the upload the newest commit, now I am not convenient for this. you can try adding code with the same logic in the function below:

void matchFeatures(const cv::Mat &desc_source, const cv::Mat &desc_ref, std::vectorcv::DMatch &matches, std::string selectorType) {

// perform matching task
if (selectorType.compare("SEL_NN") == 0)
{ // nearest neighbor (best match)
  keypoints_matcher_->match(
      desc_source, desc_ref,
      matches); // Finds the best match for each descriptor in desc_source
}
else if (selectorType.compare("SEL_KNN") ==
         0)
{ // k nearest neighbors (k=2)

  std::vector<std::vector<cv::DMatch>> knn_matches;
  keypoints_matcher_->knnMatch(desc_source, desc_ref, knn_matches, 2);
  double minDescDistRatio = 0.8;
  for (auto it = knn_matches.begin(); it != knn_matches.end(); ++it)
  {
    if ((*it)[0].distance < minDescDistRatio * (*it)[1].distance)
    {
      matches.push_back((*it)[0]);
    }
  }
}

}

If succeeded, please pull a request. Warmly welcome!

oym1994 avatar Mar 22 '23 14:03 oym1994

Hi @oym1994

Thanks for sharing.

I'm trying to run your code, but I got some problem to do.

In my case, I got superglue.engine, but It cause some error, I couldn't parse the reason, could you please help me to solve it?

Here is the part about error. Screenshot from 2023-04-10 15-23-48

When the code reach matcher's match function, it shows segmentation fault(KNN as well, but other kinds of matchers(e.g., FLANN) don't show segmentation fault).

Thanks.

PigBroA avatar Apr 10 '23 06:04 PigBroA

Hi @oym1994

Thanks for sharing.

I'm trying to run your code, but I got some problem to do.

In my case, I got superglue.engine, but It cause some error, I couldn't parse the reason, could you please help me to solve it?

Here is the part about error. Screenshot from 2023-04-10 15-23-48

When the code reach matcher's match function, it shows segmentation fault(KNN as well, but other kinds of matchers(e.g., FLANN) don't show segmentation fault).

Thanks.

Hi, what kind of keypoints and descriptors are used? Currently, superglue has only been tested with superpoint. And you may need to get fixed number of keypoints (depend on the infer number during onnx creation procedure).

oym1994 avatar Oct 25 '23 08:10 oym1994

Hi @oym1994

Thanks for sharing.

I'm trying to run your code, but I got some problem to do.

In my case, I got superglue.engine, but It cause some error, I couldn't parse the reason, could you please help me to solve it?

Here is the part about error. Screenshot from 2023-04-10 15-23-48

When the code reach matcher's match function, it shows segmentation fault(KNN as well, but other kinds of matchers(e.g., FLANN) don't show segmentation fault).

Thanks.

Hi, what kind of keypoints and descriptors are used? Currently, superglue has only been tested with superpoint. And you may need to get fixed number of keypoints (depend on the infer number during onnx creation procedure).

oym1994 avatar Oct 25 '23 08:10 oym1994

Hi @oym1994 Thanks for sharing. I'm trying to run your code, but I got some problem to do. In my case, I got superglue.engine, but It cause some error, I couldn't parse the reason, could you please help me to solve it? Here is the part about error. Screenshot from 2023-04-10 15-23-48 When the code reach matcher's match function, it shows segmentation fault(KNN as well, but other kinds of matchers(e.g., FLANN) don't show segmentation fault). Thanks.

Hi, what kind of keypoints and descriptors are used? Currently, superglue has only been tested with superpoint. And you may need to get fixed number of keypoints (depend on the infer number during onnx creation procedure).

Hi, I got same issue when running with superpoint and superglue.

DayBeha avatar Dec 27 '23 12:12 DayBeha