Skip to content

Add read/write functions to xfeatures2d and normalize naming convention#2997

Closed
augustinmanecy wants to merge 2 commits intoopencv:masterfrom
augustinmanecy:xfeatures2d-rw
Closed

Add read/write functions to xfeatures2d and normalize naming convention#2997
augustinmanecy wants to merge 2 commits intoopencv:masterfrom
augustinmanecy:xfeatures2d-rw

Conversation

@augustinmanecy
Copy link
Copy Markdown

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake


void read( const FileNode& fn)
{
fn["extended"] >> extended;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about hessianThreshold ?

@berak
Copy link
Copy Markdown
Contributor

berak commented Jul 7, 2021

you'll have to fix the java tests which currently expect either empty files, or a different layout

and there's a small general problem.
loading an xml from a previous version (no params in it) will lead to resetting the algorithm's params to 0, example:

<?xml version="1.0"?>
<opencv_storage>
</opencv_storage>
FileStorage fs2("my.xml",0);
int nOctaves=4; 
fs2["nOctaves"] >> nOctaves;
// nOctaves is 0 now

@augustinmanecy
Copy link
Copy Markdown
Author

@berak I think I corrected the java tests which failed in your link (TestCase Features2dTest.TestPTOD, and tests for BRIEF and SURF)
However, as I never dealt with java before and I do not know how to run all of this tests before committing a validated fix ;p Can you give me some instructions to be able to execute the test on my side before committing again?

@alalek
Copy link
Copy Markdown
Member

alalek commented Jul 8, 2021

Build target: opencv_test_java
From build dir: python <opencv_src_path>/modules/ts/misc/run.py -v -a -t java --package=xfeatures2d
(package parameter is optional)

@augustinmanecy
Copy link
Copy Markdown
Author

Hi, I just pushed a new commit which fix Java tests. I also added additionnal check in read methods in order to avoid erasing current value of parameters which are not in the configuration file (if a paramater was missing in the configuration file, it was replaced by 0).
Normally tests should pass now.

@alalek
Copy link
Copy Markdown
Member

alalek commented Jul 12, 2021

replaced by #3003

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

Successfully merging this pull request may close these issues.

3 participants