Lagrange
image_utils.h
1/*
2 * Copyright 2023 Adobe. All rights reserved.
3 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License. You may obtain a copy
5 * of the License at http://www.apache.org/licenses/LICENSE-2.0
6 *
7 * Unless required by applicable law or agreed to in writing, software distributed under
8 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9 * OF ANY KIND, either express or implied. See the License for the specific language
10 * governing permissions and limitations under the License.
11 */
12#pragma once
13
14#include <lagrange/common.h>
15#include <lagrange/image/ImageView.h>
16
17namespace lagrange {
18namespace image {
19
20float image_standard_deviation(const image::ImageView<float>& image);
21
46 const image::ImageView<float>& image,
47 float vfov,
48 image::ImageView<float>& result);
49
50
58void normalize_max_image(const image::ImageView<float>& image, image::ImageView<float>& result);
59
68{
69 std::vector<int> counts;
70 std::vector<float> boundaries;
71 float min_value;
72 float max_value;
73};
74
75
91
121float compute_otsu_threshold(const ImageHistogram& histogram, float upper_limit);
122
123} // namespace image
124} // namespace lagrange
Definition: ImageView.h:56
void depth_to_disparity(const image::ImageView< float > &image, float vfov, image::ImageView< float > &result)
Converts a depth image to a disparity image.
Definition: image_utils.cpp:43
void normalize_max_image(const image::ImageView< float > &image, image::ImageView< float > &result)
Normalizes an image in a way that the maximum value is 1.0.
Definition: image_utils.cpp:69
float compute_otsu_threshold(const ImageHistogram &histogram, float upper_limit)
Computes the Otsu threshold value of a given histogram.
Definition: image_utils.cpp:136
ImageHistogram create_image_histogram(const image::ImageView< float > &image, int num_bins)
Function to create an image histogram.
Definition: image_utils.cpp:90
Main namespace for Lagrange.
Definition: AABBIGL.h:30
A struct for storing an image histogram.
Definition: image_utils.h:68
std::vector< float > boundaries
Boundaries of each bin.
Definition: image_utils.h:70
std::vector< int > counts
Counts of each histogram bin.
Definition: image_utils.h:69
float min_value
Minimum pixel value in the image.
Definition: image_utils.h:71
float max_value
Maximum pixel value in the image.
Definition: image_utils.h:72