-
Notifications
You must be signed in to change notification settings - Fork 8
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
Least Squares Gaussian Fit + Gaussian Grid centroiding algos #89
base: master
Are you sure you want to change the base?
Conversation
Tab width should be 4 spaces, as in the rest of the codebase |
Makefile
Outdated
# bash ./test/scripts/pyramid-incorrect.sh | ||
bash ./test/scripts/readme-examples-test.sh | ||
bash ./test/scripts/pyramid-incorrect.sh | ||
# bash ./test/scripts/readme-examples-test.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this stuff shouldn't be changed
Stars Go(unsigned char *image, int imageWidth, int imageHeight) const override; | ||
}; | ||
|
||
class GaussianGrid : public CentroidAlgorithm { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doxygen comment?
}; | ||
|
||
} | ||
/// Get value of pixel at (x, y) in image with width=w | ||
int Get(int x, int y, const unsigned char *image, int w); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
functions with such short undescriptive names sholudn't be in hpp file, they could conflict with other names. Really we shouldn't have any functions anywhere named Get
.
If there are some functions you only need to access for testing purposes, you can create a centroiders-private.hpp
file that contains declarations for these. That's what I did with star-id-private.hpp
recently in some pyramid branch.
src/centroiders.cpp
Outdated
/// Prediction of 2D Gaussian model for 2D LSGF method | ||
static float FitModel2D(float x, float y, float a, float xb, float yb, float sigmaX, float sigmaY); | ||
|
||
typedef std::vector<int> Point; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not Vec2?
The tests do not compile. |
} | ||
|
||
// Cool, our flood is done | ||
res.push_back({x0, y0, floodSize, fp.xMax - fp.xMin, fp.yMax - fp.yMin}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
res
is a std::vector<std::vector<int>>
. However, every element has the same structure, so there's no reason to use a vector -- it should be a vector of structs. It's okay to make single-use structs. (And while I like to use structs instead of tuples, a tuple is still better than a vector here).
(I'm going to fix this myself because I'm rewriting a whole bunch of centroid stuff right now, just thought you should know)
No description provided.