MVE - Multi-View Environment mve-devel
|
#include <iostream>
#include <limits>
#include <complex>
#include <type_traits>
#include "util/exception.h"
#include "math/accum.h"
#include "math/functions.h"
#include "mve/defines.h"
#include "mve/image.h"
#include <cmath>
#include <stdexcept>
Go to the source code of this file.
Namespaces | |
namespace | mve |
Multi-View Environment library. | |
namespace | mve::image |
Image tools, loading and processing functions. | |
Enumerations | |
enum | mve::image::DesaturateType { mve::image::DESATURATE_MAXIMUM , mve::image::DESATURATE_LIGHTNESS , mve::image::DESATURATE_LUMINOSITY , mve::image::DESATURATE_LUMINANCE , mve::image::DESATURATE_AVERAGE } |
Desaturaturation type. More... | |
enum | mve::image::FlipType { mve::image::FLIP_NONE = 0 , mve::image::FLIP_HORIZONTAL = 1 << 0 , mve::image::FLIP_VERTICAL = 1 << 1 , mve::image::FLIP_BOTH = FLIP_HORIZONTAL | FLIP_VERTICAL } |
Image flipping type. More... | |
enum | mve::image::RescaleInterpolation { mve::image::RESCALE_NEAREST , mve::image::RESCALE_LINEAR , mve::image::RESCALE_GAUSSIAN } |
Rescale interpolation type. More... | |
enum | mve::image::RotateType { mve::image::ROTATE_CCW , mve::image::ROTATE_CW , mve::image::ROTATE_180 , mve::image::ROTATE_SWAP } |
Image rotation type. More... | |
Functions | |
template<typename T > | |
Image< T >::Ptr | mve::image::blur_boxfilter (typename Image< T >::ConstPtr in, int ks) |
Blurs the image using a box filter of integer size 'ks'. | |
template<typename T > | |
Image< T >::Ptr | mve::image::blur_gaussian (typename Image< T >::ConstPtr in, float sigma) |
Blurs the image using a gaussian convolution kernel. | |
DoubleImage::Ptr | mve::image::byte_to_double_image (ByteImage::ConstPtr image) |
Converts a given byte image to a double image. | |
FloatImage::Ptr | mve::image::byte_to_float_image (ByteImage::ConstPtr image) |
Converts a given byte image to a float image. | |
template<typename T > | |
Image< T >::Ptr | mve::image::create_thumbnail (typename Image< T >::ConstPtr image, int64_t thumb_width, int64_t thumb_height) |
Creates a thumbnail of the given size by first rescaling the image and then cropping to fill the thumbnail. | |
template<typename T > | |
Image< T >::Ptr | mve::image::crop (typename Image< T >::ConstPtr image, int64_t width, int64_t height, int64_t left, int64_t top, T const *fill_color) |
Returns a sub-image by cropping against a rectangular region. | |
template<typename T > | |
Image< T >::Ptr | mve::image::desaturate (typename Image< T >::ConstPtr image, DesaturateType type) |
Desaturates an RGB or RGBA image to G or GA respectively. | |
template<typename T > | |
T | mve::image::desaturate_average (T const *v) |
template<typename T > | |
T | mve::image::desaturate_lightness (T const *v) |
template<typename T > | |
T | mve::image::desaturate_luminance (T const *v) |
template<typename T > | |
T | mve::image::desaturate_luminosity (T const *v) |
template<typename T > | |
T | mve::image::desaturate_maximum (T const *v) |
template<typename T > | |
Image< T >::Ptr | mve::image::difference (typename Image< T >::ConstPtr i1, typename Image< T >::ConstPtr i2) |
Creates a difference image by computing the absolute difference per value. | |
ByteImage::Ptr | mve::image::double_to_byte_image (DoubleImage::ConstPtr image, double vmin=0.0, double vmax=1.0) |
Converts a given double image to a byte image. | |
template<typename T > | |
Image< T >::Ptr | mve::image::expand_grayscale (typename Image< T >::ConstPtr image) |
Expands a gray image (one or two channels) to an RGB or RGBA image. | |
template<typename T > | |
void | mve::image::find_min_max_value (typename mve::Image< T >::ConstPtr image, T *vmin, T *vmax) |
Finds the smallest and largest value in the given image. | |
template<typename T > | |
void | mve::image::flip (typename Image< T >::Ptr image, FlipType type) |
Flips the given image either horizontally, vertically or both IN-PLACE. | |
void | mve::image::float_image_normalize (FloatImage::Ptr image) |
Normalizes a float image IN-PLACE such that all values are [0, 1]. | |
ByteImage::Ptr | mve::image::float_to_byte_image (FloatImage::ConstPtr image, float vmin=0.0f, float vmax=1.0f) |
Converts a given float image to a byte image. | |
void | mve::image::gamma_correct (ByteImage::Ptr image, float power) |
Applies fast gamma correction to byte image using a lookup table. | |
template<typename T > | |
void | mve::image::gamma_correct (typename Image< T >::Ptr image, T const &power) |
Applies gamma correction to float/double images (in-place). | |
template<typename T > | |
void | mve::image::gamma_correct_inv_srgb (typename Image< T >::Ptr image) |
Applies inverse gamma correction to float/double (in-place) images with nonlinear R'G'B' values in the range [0, 1] to linear sRGB values according to http://www.brucelindbloom.com/index.html?Eqn_RGB_to_XYZ.html: | |
template<typename T > | |
void | mve::image::gamma_correct_srgb (typename Image< T >::Ptr image) |
Applies gamma correction to float/double images (in-place) with linear RGB values in range [0, 1] to nonlinear R'G'B' values according to http://www.brucelindbloom.com/index.html?Eqn_XYZ_to_RGB.html: | |
template<typename T > | |
T | mve::image::gaussian_kernel (typename Image< T >::ConstPtr img, float x, float y, int64_t c, float sigma) |
template<typename T > | |
Image< T >::Ptr | mve::image::image_undistort_k2k4 (typename Image< T >::ConstPtr img, double focal_length, double k2, double k4) |
Undistorts the input image given the focal length of the image and two undistortion parameters. | |
template<typename T > | |
Image< T >::Ptr | mve::image::image_undistort_msps (typename Image< T >::ConstPtr img, double k0, double k1) |
Undistorts the input image given the two undistortion parameters. | |
template<typename T > | |
Image< T >::Ptr | mve::image::image_undistort_vsfm (typename Image< T >::ConstPtr img, double focal_length, double k1) |
Undistorts the input image given the focal length of the image and a single distortion parameter. | |
ByteImage::Ptr | mve::image::int_to_byte_image (IntImage::ConstPtr image) |
Convertes a given int image to a byte image. | |
template<typename T_IN , typename T_OUT > | |
Image< T_OUT >::Ptr | mve::image::integral_image (typename Image< T_IN >::ConstPtr image) |
Calculates the integral image (or summed area table) for the input image. | |
template<typename T > | |
T | mve::image::integral_image_area (typename Image< T >::ConstPtr sat, int64_t x1, int64_t y1, int64_t x2, int64_t y2, int64_t cc=0) |
Sums over the rectangle defined by A=(x1,y1) and B=(x2,y2) on the given SAT for channel cc. | |
ByteImage::Ptr | mve::image::raw_to_byte_image (RawImage::ConstPtr image, uint16_t vmin=0, uint16_t vmax=65535) |
Converts a given raw image to a byte image. | |
FloatImage::Ptr | mve::image::raw_to_float_image (RawImage::ConstPtr image) |
Converts a given raw image to a float image. | |
template<typename T > | |
void | mve::image::reduce_alpha (typename mve::Image< T >::Ptr img) |
Reduce alpha: Reduces RGBA or GA images to RGB or G images. | |
template<typename T > | |
Image< T >::Ptr | mve::image::rescale (typename Image< T >::ConstPtr image, RescaleInterpolation interp, int64_t width, int64_t height) |
Returns a rescaled version of 'image' with dimensions 'width' times 'height' using 'interp' for value interpolation. | |
template<typename T > | |
Image< T >::Ptr | mve::image::rescale_double_size (typename Image< T >::ConstPtr img) |
Returns a rescaled version of the image, upscaled with linear interpolation by factor 2. | |
template<typename T > | |
Image< T >::Ptr | mve::image::rescale_double_size_supersample (typename Image< T >::ConstPtr img) |
Returns a rescaled version of the image, upscaled with linear interpolation. | |
template<typename T > | |
void | mve::image::rescale_gaussian (typename Image< T >::ConstPtr in, typename Image< T >::Ptr out, float sigma_factor=1.0f) |
Rescales image 'in' using a gaussian kernel mask. | |
template<typename T > | |
Image< T >::Ptr | mve::image::rescale_half_size (typename Image< T >::ConstPtr image) |
Returns a rescaled version of image, scaled by factor 1/2, by grouping blocks of 2x2 pixel into one pixel in the new image. | |
template<typename T > | |
Image< T >::Ptr | mve::image::rescale_half_size_gaussian (typename Image< T >::ConstPtr image, float sigma=0.866025403784439f) |
Returns a rescaled version of the image, scaled with a gaussian approximation by factor 1/2. | |
template<typename T > | |
Image< T >::Ptr | mve::image::rescale_half_size_subsample (typename Image< T >::ConstPtr image) |
Returns a rescaled version of the image by subsampling every second column and row. | |
template<typename T > | |
void | mve::image::rescale_linear (typename Image< T >::ConstPtr in, typename Image< T >::Ptr out) |
Rescales image 'in' using linear interpolation. | |
template<typename T > | |
void | mve::image::rescale_nearest (typename Image< T >::ConstPtr in, typename Image< T >::Ptr out) |
Rescales image 'in' using nearest neighbor. | |
template<typename T > | |
Image< T >::Ptr | mve::image::rotate (typename Image< T >::ConstPtr image, float angle, T const *fill_color) |
Returns an image created by rotating the input image by the given amount of degrees (in radian) in clock-wise direction. | |
template<typename T > | |
Image< T >::Ptr | mve::image::rotate (typename Image< T >::ConstPtr image, RotateType type) |
Returns a rotated copy of the given image either rotated clock wise, counter-clock wise, with 180 degree or with swapped x- and y-axis. | |
template<typename T > | |
mve::Image< T >::Ptr | mve::image::sobel_edge (typename mve::Image< T >::ConstPtr img) |
Implementation of the Sobel operator. | |
template<typename T > | |
Image< T >::Ptr | mve::image::subtract (typename Image< T >::ConstPtr i1, typename Image< T >::ConstPtr i2) |
Subtracts two images to create the signed difference between the values. | |
template<typename SRC , typename DST > | |
Image< DST >::Ptr | mve::image::type_to_type_image (typename Image< SRC >::ConstPtr image) |
Generic conversion between image types without scaling or clamping. | |