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

Refactor classes #8

Merged
merged 15 commits into from
Jul 23, 2022
Merged

Refactor classes #8

merged 15 commits into from
Jul 23, 2022

Conversation

zerofivefiveseven
Copy link
Collaborator

wrote some methods to conversions.h
new structure
new conversions method
new base class
refactor calc methods

Add class interface
create calc func instead of getkeypoints&getdescriptors
delete most of private fields and now them scope is just culc function
create calc func instead of getkeypoints&getdescriptors
delete most of private fields and now them scope is just culc function
Copy link
Owner

@TimPushkin TimPushkin left a comment

Choose a reason for hiding this comment

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

Looks great overall, but descriptors should be represented by a vector<vector<uint8_t>> because each key point has an assiciated array of uint8_ts.

include/feature_lib.h Outdated Show resolved Hide resolved
include/feature_lib.h Outdated Show resolved Hide resolved
include/feature_lib.h Outdated Show resolved Hide resolved
include/feature_lib.h Outdated Show resolved Hide resolved
include/feature_lib.h Outdated Show resolved Hide resolved
examples/test.cpp Outdated Show resolved Hide resolved
examples/test.cpp Outdated Show resolved Hide resolved
examples/test.cpp Outdated Show resolved Hide resolved
examples/test.cpp Outdated Show resolved Hide resolved
examples/test.cpp Outdated Show resolved Hide resolved
@TimPushkin
Copy link
Owner

Also, from the architectural aspect every class and struct in feature_lib.h should've been placed into a separate file. But as far as I know, Scapix has problems with porting structs from different headers, so we have to place everything together.

codestyle fixes
add getters setters methods
refactor constructor method
refactor class variables storing now they store in baseclass
edit example
Copy link
Owner

@TimPushkin TimPushkin left a comment

Choose a reason for hiding this comment

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

  1. Use auto where possible if it doesn't make the code less clear. You can read more about when to use auto here.
  2. Let's rename test.cpp to detection_example.cpp.

include/feature_lib.h Outdated Show resolved Hide resolved
include/feature_lib.h Outdated Show resolved Hide resolved
include/feature_lib.h Outdated Show resolved Hide resolved
src/CMakeLists.txt Outdated Show resolved Hide resolved
src/conversions.h Show resolved Hide resolved
examples/test.cpp Outdated Show resolved Hide resolved
examples/test.cpp Outdated Show resolved Hide resolved
examples/test.cpp Outdated Show resolved Hide resolved
examples/test.cpp Outdated Show resolved Hide resolved
examples/test.cpp Outdated Show resolved Hide resolved
remove setters
refactor matto2dvec and renamed it
edit codestyle & docstrings
remove
refactor mask storing
Copy link
Owner

@TimPushkin TimPushkin left a comment

Choose a reason for hiding this comment

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

You can still add auto in a lot of places

examples/detection_example.cpp Outdated Show resolved Hide resolved
examples/detection_example.cpp Outdated Show resolved Hide resolved
include/feature_lib.h Outdated Show resolved Hide resolved
include/feature_lib.h Show resolved Hide resolved
include/feature_lib.h Outdated Show resolved Hide resolved
src/conversions.h Outdated Show resolved Hide resolved
src/conversions.h Outdated Show resolved Hide resolved
src/feature_lib.cpp Show resolved Hide resolved
Copy link
Owner

@TimPushkin TimPushkin left a comment

Choose a reason for hiding this comment

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

You got the setters wrong again :(

examples/detection_example.cpp Outdated Show resolved Hide resolved
include/feature_lib.h Outdated Show resolved Hide resolved
include/feature_lib.h Outdated Show resolved Hide resolved
include/feature_lib.h Outdated Show resolved Hide resolved
src/feature_lib.cpp Outdated Show resolved Hide resolved
edit setters again
edit docstring
initialize width and height in header
Copy link
Owner

@TimPushkin TimPushkin left a comment

Choose a reason for hiding this comment

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

Other than this small detail, looks good to me

src/feature_lib.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@achains achains left a comment

Choose a reason for hiding this comment

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

Nice work, but it'd be better to remove relative import in examples

examples/detection_example.cpp Outdated Show resolved Hide resolved
include/feature_lib.h Outdated Show resolved Hide resolved
include/feature_lib.h Show resolved Hide resolved
include/feature_lib.h Show resolved Hide resolved
include/feature_lib.h Outdated Show resolved Hide resolved
include/feature_lib.h Outdated Show resolved Hide resolved
src/conversions.h Outdated Show resolved Hide resolved
src/conversions.h Outdated Show resolved Hide resolved
src/feature_lib.cpp Outdated Show resolved Hide resolved
Copy link
Owner

@TimPushkin TimPushkin left a comment

Choose a reason for hiding this comment

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

Better move the opencv-contrib downloading and extracting into a separate block with the same check that the standard opencv has. Maybe even create a function for it because the same code is used twice.

BuildOpenCV.cmake Outdated Show resolved Hide resolved
BuildOpenCV.cmake Outdated Show resolved Hide resolved
BuildOpenCV.cmake Outdated Show resolved Hide resolved
BuildOpenCV.cmake Outdated Show resolved Hide resolved
BuildOpenCV.cmake Outdated Show resolved Hide resolved
BuildOpenCV.cmake Outdated Show resolved Hide resolved
BuildOpenCV.cmake Outdated Show resolved Hide resolved
include/feature_lib.h Outdated Show resolved Hide resolved
src/conversions.h Outdated Show resolved Hide resolved
@zerofivefiveseven
Copy link
Collaborator Author

I did something with commits, and somehow strangely rolled back the changes in BuildOpenCV.cmake

@TimPushkin
Copy link
Owner

You did something wrong: you pushed the same commits and two lines related to the opencv-contrib changes are still there

@zerofivefiveseven
Copy link
Collaborator Author

rolled back changes in BuildOpenCV.cmake

    change mat constructor in conversions.h
    edit constructor of base class now it use initializer list constructor
    remove default constructors
    now child class use initializer list constructor
    move definitions of base class to .cpp
@zerofivefiveseven
Copy link
Collaborator Author

rewrite history
add last requested correction

@zerofivefiveseven zerofivefiveseven merged commit d335d9d into cpp/main Jul 23, 2022
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.

None yet

4 participants