Skip to content

Commit

Permalink
Update nontrivial FocusScore
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseMckinzie committed Jun 4, 2024
1 parent 9624032 commit 2841b4d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/nyx/features/focus_score.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,16 @@ void FocusScoreFeature::reduce (size_t start, size_t end, std::vector<int>* ptrL
}
}

void osized_calculate(LR& r, ImageLoader& imloader) {
void FocusScoreFeature::osized_calculate(LR& r, ImageLoader& imloader) {

// Skip calculation in case of noninformative data
if (r.aux_max == r.aux_min) return;

WriteImageMatrix_nontriv Im0 ("FocusScoreFeature-osized_calculate-Im0", r.label);
Im0.allocate_from_cloud (r.raw_pixels_NT, r.aabb, false);

focus_score_ = get_focus_score_NT(Im0, 1);

}

void FocusScoreFeature::save_value(std::vector<std::vector<double>>& feature_vals) {
Expand All @@ -91,7 +93,7 @@ void FocusScoreFeature::save_value(std::vector<std::vector<double>>& feature_val

}

double FocusScoreFeature::get_local_focus_score_NT(WriteImageMatrix_nontriv& Im, int ksize) {
double FocusScoreFeature::get_focus_score_NT(WriteImageMatrix_nontriv& Im, int ksize) {

int n = 3; // size of kernel nxn

Expand Down
2 changes: 1 addition & 1 deletion src/nyx/features/focus_score.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class FocusScoreFeature: public FeatureMethod
//=== Non-trivial ROIs ===
void osized_add_online_pixel(size_t x, size_t y, uint32_t intensity) {}
void osized_calculate(LR& r, ImageLoader& imloader);
double get_local_focus_score_NT(WriteImageMatrix_nontriv& Im, int ksize);
double get_focus_score_NT(WriteImageMatrix_nontriv& Im, int ksize);

// Result saver
void save_value(std::vector<std::vector<double>>& feature_vals);
Expand Down

0 comments on commit 2841b4d

Please sign in to comment.