v1.0.0-rc.81
This commit is contained in:
@@ -9,36 +9,6 @@
|
||||
|
||||
#include "StrongPixelSet.h"
|
||||
|
||||
struct intensity_id {
|
||||
float I;
|
||||
uint32_t id;
|
||||
};
|
||||
|
||||
struct res_id {
|
||||
float res;
|
||||
uint32_t id;
|
||||
};
|
||||
|
||||
void FilterSpotsByCount(int64_t count,
|
||||
const std::vector<SpotToSave> &input,
|
||||
std::vector<SpotToSave> &output) {
|
||||
|
||||
size_t output_size = std::min<size_t>(input.size(), count);
|
||||
std::vector<intensity_id> intensity_id_vector(input.size());
|
||||
|
||||
for (int i = 0; i < input.size(); i++) {
|
||||
intensity_id_vector[i].I = input[i].intensity;
|
||||
intensity_id_vector[i].id = i;
|
||||
}
|
||||
|
||||
std::partial_sort(intensity_id_vector.begin(), intensity_id_vector.begin() + output_size, intensity_id_vector.end(),
|
||||
[](const intensity_id& a,const intensity_id& b ) { return a.I > b.I;});
|
||||
|
||||
output.reserve(output_size);
|
||||
for (int i = 0; i < output_size; i++)
|
||||
output.push_back(input[intensity_id_vector[i].id]);
|
||||
}
|
||||
|
||||
StrongPixelSet::StrongPixelSet() : strong_pixel_count(0) {
|
||||
pixels.reserve(max_strong_pixel_per_module);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user