Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Compute_Descriptors on an existing vector<KeyPoint>? #33

Closed
antithing opened this issue Jun 29, 2017 · 4 comments
Closed

Use Compute_Descriptors on an existing vector<KeyPoint>? #33

antithing opened this issue Jun 29, 2017 · 4 comments

Comments

@antithing
Copy link

antithing commented Jun 29, 2017

Hi, and thank you for making this code available. I am trying to split out the Compute_Descriptors function from the rest, so that i can use it on existing Keys, found in another function. (using this code also).
I get keypoints and descriptors. Then I filter out some of the keypoints, and now i want to find descriptors of the remaining Keypoints. I have this function:

void Akaze::DetectDesciptorsOnly( cv::Mat &returnDesc, vector<cv::KeyPoint> Keys)
{
	//set up 
	if (bFirstLoopDescrip == false)
	{
		evolutionDescrip = new AKAZE(optionsDescrip);
		bFirstLoopDescrip = true;
	}
	cv::Mat desc;
	evolutionDescrip->Compute_Descriptors(Keys, desc);
	std::cout << "des " << desc.rows << std::endl;
	desc.copyTo(returnDesc);
}

But it always returns zero. The keypoint array has around 900 points going in. Where am i going wrong here? thanks!

@pablofdezalc
Copy link
Owner

Hi,

In A-KAZE the descriptor is really attached to the detector. For being able to compute the descriptor you need to compute (or re-use the computations from the detector) the scale space. If you want to use a different detector and the descriptors from A-KAZE, you need to provide a way so that A-KAZE descriptors can be extracted from the scale space defined in the other detectors.

Regards,
Pablo

@antithing
Copy link
Author

Ah I see. So if I was to:

AKAZE* evolutionDescrip;

//detect with evolutionDescrip in one function

evolutionDescrip->Compute_Descriptors(Keys, desc);

in another function, that would work?

Same instance of AKAZE, but in a different function.

thank you for your time.

@pablofdezalc
Copy link
Owner

It will work as long as you call Create_Nonlinear_Scale_Space(). However, keep in mind that when you use another detector in combination with A-KAZE descriptors you need to adapt the scale of the detected keypoints to an appropriate value for the descriptor computation.

@antithing
Copy link
Author

Thank you. I have it working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants