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

Least Squares Gaussian Fit + Gaussian Grid centroiding algos #89

Open
wants to merge 36 commits into
base: master
Choose a base branch
from

Conversation

zeddie888
Copy link
Collaborator

No description provided.

@zeddie888 zeddie888 requested a review from markasoftware March 4, 2023 19:57
src/centroiders.cpp Outdated Show resolved Hide resolved
src/centroiders.cpp Outdated Show resolved Hide resolved
@markasoftware
Copy link
Member

Tab width should be 4 spaces, as in the rest of the codebase

@markasoftware
Copy link
Member

./lost pipeline --generate 1 --centroid-algo lsgf1d the centroids don't seem to be centered and it's often creating multiple centroids for each star.

Screenshot_20230304_121215

@markasoftware
Copy link
Member

Screenshot_20230304_163100

for reference, this is how --centroid-algo cog looks like in the same area

@zeddie888 zeddie888 changed the title Least Squares Gaussian Fit 1D centroiding algo Least Squares Gaussian Fit centroiding algos Mar 24, 2023
@zeddie888 zeddie888 changed the title Least Squares Gaussian Fit centroiding algos Least Squares Gaussian Fit + Gaussian Grid centroiding algos Mar 26, 2023
test/scripts/pyramid-incorrect.sh Show resolved Hide resolved
test/kvector.off Show resolved Hide resolved
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
Copy link
Member

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 {
Copy link
Member

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);
Copy link
Member

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.

test/gaussian-centroid.cpp Outdated Show resolved Hide resolved
test/gaussian-centroid.cpp Outdated Show resolved Hide resolved
test/gaussian-centroid.cpp Outdated Show resolved Hide resolved
src/centroiders.cpp Outdated Show resolved Hide resolved
/// 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;
Copy link
Member

Choose a reason for hiding this comment

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

why not Vec2?

@markasoftware
Copy link
Member

The tests do not compile.

}

// Cool, our flood is done
res.push_back({x0, y0, floodSize, fp.xMax - fp.xMin, fp.yMax - fp.yMin});
Copy link
Member

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)

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.

2 participants