#include <iostream>
#include <vector>
#include "simple_tools.h"
#include "cimg_dependent.h"
#include "errormacros.h"
#include "Image.h"
Go to the source code of this file.
Namespaces | |
namespace | lsseg |
Functions | |
bool | in_zero_one_interval (double d) |
void | uniformNoise (double *res, double lval, double uval, int num_samples) |
void | lsseg::negate (Image< double > &img, double min=0, double max=255) |
make an Image<double> a negative of itself. | |
void | lsseg::rescale (Image< double > &img, double cur_min, double cur_max, double to_min=0, double to_max=255) |
rescale the pixel range of an Image<double> so that its pixels spans a different range than before rescaling | |
void | lsseg::rescale_channels (Image< double > &img, double to_min=0, double to_max=255) |
rescale the pixel ranges of each of an image's channels to a user-specified interval | |
void | lsseg::clip (Image< double > &img, double min, double max) |
clip the pixel range of a image to a certain interval | |
void | lsseg::transpose (Image< double > &img) |
transpose the x and y dimensions of an Image<double> | |
void | lsseg::transpose (const Image< double > &img, Image< double > &target) |
Generate an Image<double> that is the transpose of another Image<double>. | |
void | lsseg::horizontal_sinusoidal_bands (LevelSetFunction &img, int num_bands, double phase=0) |
Initializes a LevelSetFunction with horizontal bands created by a sine function. | |
void | lsseg::rectangle (LevelSetFunction &img, double xmin_ratio, double xmax_ratio, double ymin_ratio, double ymax_ratio, double zmin_ratio=0, double zmax_ratio=1) |
Initializes a LevelSetFunction to become 1 everywhere, except for an interior rectangular domain where the LevelSetFunction has the value -1. | |
void | lsseg::init_voronoi_regions (LevelSetFunction *regs, const double *center_coords,int num_regions, bool three_d=false) |
Initializes a set of LevelSetFunctions defined on a common domain so that their closed regions together constitute a voronoi subdivision of the domain. The points defining the voronoi subdivision is given by the user. | |
void | lsseg::multiregion_bands (LevelSetFunction *regs, int num_regs, int pixel_bandwidth) |
Initializes a set of LevelSetFunctions defined on a common domain so that their closed regions together constitute a subdivision on the domain, and where each such region consists of a set of horizontal bands of a certain width along the y-direction. | |
void | lsseg::random_scattered_voronoi (LevelSetFunction *regs, int num_regs, int num_fragments) |
Initializes a set of LevelSetFunctions defined on a common domain so that their closed regions together constitute a voronoi subdivision of the domain. The points defining the voronoi subdivision are randomly generated. | |
void | lsseg::set_from_parzen (LevelSetFunction &img, const ParzenDistributionForce pf, const Mask *m=0) |
Initializes a LevelSetFunction to become a function with two values, 1 and -1, corresponding to the domains in which the force defined by the pf argument is positive or negative. | |
void | lsseg::sphere (LevelSetFunction &img, double relrad,double xrelpos,double yrelpos,double zrelpos=0) |
Initializes a LevelSetFunction to become the signed distance function from a point in its domain minus some fixed value, thus its zero-set becomes a circle around . | |
void | lsseg::make_border_mask (const LevelSetFunction &phi, Mask &target, int width=2, const Mask *geom_mask=0) |
Generate a Mask over a domain, where the active region of the Mask is specified as the region of a certain width (in pixels) around the zero-set of a LevelSetFunction defined on the same domain. | |
void | lsseg::mask_from_segmentation (const LevelSetFunction &phi, Mask &target, SEG_REGION reg) |
Generate a Mask over a domain, where the active region of the Mask is specified as the region defined by the negative (or positive) region of a LevelSetFunction over the same domain. | |
void | lsseg::read_image_sequence (istream &image_list, Image< double > &result, bool convert_to_grayscale) |
unsigned long int | lsseg::nonzeroes (const Image< int > &img) |
Count the number of nonzero pixels of an Image<int>. | |
double | lsseg::nonzero_ratio (const Image< int > &img) |
Calculate the ratio of the number pixels with a nonzero value to the total number of pixels in an Image<int>. | |
unsigned long int | lsseg::positives (const Image< double > &img) |
Count the number of pixels with a nonnegative value in an Image<int>. | |
unsigned long int | lsseg::negatives (const Image< double > &img) |
Count the number of pixels with a negative value in an Image<int>. | |
double | lsseg::positive_ratio (const Image< double > &img) |
Calculate the ratio of the number of pixels with a nonnegative value to the total number of pixels in an Image<double>. | |
double | lsseg::negative_ratio (const Image< double > &img) |
Calculate the ratio of the number of pixels with a negative value to the total number of pixels in an Image<double>. |
Definition in file simple_tools.C.
bool @13::in_zero_one_interval | ( | double | d | ) | [inline, static] |
Definition at line 67 of file simple_tools.C.
void @13::uniformNoise | ( | double * | res, | |
double | lval, | |||
double | uval, | |||
int | num_samples | |||
) | [inline, static] |
Definition at line 70 of file simple_tools.C.