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

fix param name to fit prototype #375

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions clic/include/tier4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ remove_labels_with_map_values_within_range_func(const Device::Pointer & device,
* associated with the labels.
*
* @param device Device to perform the operation on. [const Device::Pointer &]
* @param src Input image where labels will be filtered. [const Array::Pointer &]
* @param values Vector of values associated with the labels. [const Array::Pointer &]
* @param values_map Vector of values associated with the labels. [const Array::Pointer &]
* @param label_map_input Input image where labels will be filtered. [const Array::Pointer &]
* @param dst Output image where labels will be written to. [Array::Pointer ( = None )]
* @param min_value_range Minimum value to keep. [float ( = 0 )]
* @param max_value_range Maximum value to keep. [float ( = 100 )]
Expand All @@ -223,8 +223,8 @@ remove_labels_with_map_values_within_range_func(const Device::Pointer & device,
*/
auto
exclude_labels_with_map_values_out_of_range_func(const Device::Pointer & device,
const Array::Pointer & src,
const Array::Pointer & values,
const Array::Pointer & values_map,
const Array::Pointer & label_map_input,
Array::Pointer dst,
float min_value_range,
float max_value_range) -> Array::Pointer;
Expand All @@ -235,8 +235,8 @@ exclude_labels_with_map_values_out_of_range_func(const Device::Pointer & device,
* associated with the labels.
*
* @param device Device to perform the operation on. [const Device::Pointer &]
* @param src Input image where labels will be filtered. [const Array::Pointer &]
* @param values Vector of values associated with the labels. [const Array::Pointer &]
* @param values_map Vector of values associated with the labels. [const Array::Pointer &]
* @param label_map_input Input image where labels will be filtered. [const Array::Pointer &]
* @param dst Output image where labels will be written to. [Array::Pointer ( = None )]
* @param min_value_range Minimum value to keep. [float ( = 0 )]
* @param max_value_range Maximum value to keep. [float ( = 100 )]
Expand All @@ -248,8 +248,8 @@ exclude_labels_with_map_values_out_of_range_func(const Device::Pointer & device,
*/
auto
exclude_labels_with_map_values_within_range_func(const Device::Pointer & device,
const Array::Pointer & src,
const Array::Pointer & values,
const Array::Pointer & values_map,
const Array::Pointer & label_map_input,
Array::Pointer dst,
float min_value_range,
float max_value_range) -> Array::Pointer;
Expand Down
14 changes: 8 additions & 6 deletions clic/src/tier4/filter_label_by_values.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,27 @@ remove_labels_with_map_values_within_range_func(const Device::Pointer & device,

auto
exclude_labels_with_map_values_out_of_range_func(const Device::Pointer & device,
const Array::Pointer & src,
const Array::Pointer & values,
const Array::Pointer & values_map,
const Array::Pointer & label_map_input,
Array::Pointer dst,
float min_value_range,
float max_value_range) -> Array::Pointer
{
return remove_labels_with_map_values_out_of_range_func(device, src, values, dst, min_value_range, max_value_range);
return remove_labels_with_map_values_out_of_range_func(
device, label_map_input, values_map, dst, min_value_range, max_value_range);
}


auto
exclude_labels_with_map_values_within_range_func(const Device::Pointer & device,
const Array::Pointer & src,
const Array::Pointer & values,
const Array::Pointer & values_map,
const Array::Pointer & label_map_input,
Array::Pointer dst,
float min_value_range,
float max_value_range) -> Array::Pointer
{
return remove_labels_with_map_values_within_range_func(device, src, values, dst, min_value_range, max_value_range);
return remove_labels_with_map_values_within_range_func(
device, label_map_input, values_map, dst, min_value_range, max_value_range);
}

} // namespace cle::tier4
8 changes: 4 additions & 4 deletions clic/src/tier4/threshold_otsu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ threshold_otsu_func(const Device::Pointer & device, const Array::Pointer & src,
constexpr int bin = 256;
const float min_intensity = tier2::minimum_of_all_pixels_func(device, src);
const float max_intensity = tier2::maximum_of_all_pixels_func(device, src);
double range = max_intensity - min_intensity;
double range = max_intensity - min_intensity;

// Compute histogram
auto hist_array = Array::create(bin, 1, 1, 1, dType::FLOAT, mType::BUFFER, src->device());
tier3::histogram_func(device, src, hist_array, bin, min_intensity, max_intensity);
Expand All @@ -41,7 +41,7 @@ threshold_otsu_func(const Device::Pointer & device, const Array::Pointer & src,
// Compute weight2
std::vector<double> reversed_counts(counts.rbegin(), counts.rend());
std::partial_sum(reversed_counts.begin(), reversed_counts.end(), weight2.rbegin());

// Compute mean1
std::vector<double> counts_bin_centers(bin);
std::transform(counts.begin(), counts.end(), bin_centers.begin(), counts_bin_centers.begin(), std::multiplies<>());
Expand All @@ -62,7 +62,7 @@ threshold_otsu_func(const Device::Pointer & device, const Array::Pointer & src,
auto max_it = std::max_element(variance12.begin(), variance12.end());
size_t idx = std::distance(variance12.begin(), max_it);
double threshold = bin_centers[idx];

// Create binary image with threshold
tier0::create_like(src, dst, dType::BINARY);
return tier1::greater_constant_func(device, src, dst, static_cast<float>(threshold));
Expand Down
Loading