rcv
Rand's OpenCV Utilities
 All Classes Functions
Classes | Public Member Functions
rcv::cubehelix Class Reference

Colorize the input using Dave Green's 'cubehelix' algorithm. More...

#include <rcv.hpp>

List of all members.

Classes

struct  create
 A helper struct to create cubehelix instances using named parameters. More...

Public Member Functions

 cubehelix (size_t nlev=256, float start=0.5, float rot=-1.5, float gamma=1.0, float hue=1.2, bool reverse=false)
 Construct a cubehelix object and initialize it's mapping tables.
cv::Mat operator() (cv::Mat const &input)
 Map the values of an input image to cubehelix colors.

Detailed Description

Colorize the input using Dave Green's 'cubehelix' algorithm.

This implementation based on Jim Davenport's python implementation found here: https://github.com/jradavenport/cubehelix/

cubehelix contains a handy named parameter creation helper,

    cubehelix colorizer = cubehelix::create().start(.6).rot(1.5).nlev(128).reverse();

    cv::Mat grayscale;
    cv::Mat colorized = colorizer(grayscale);

Constructor & Destructor Documentation

rcv::cubehelix::cubehelix ( size_t  nlev = 256,
float  start = 0.5,
float  rot = -1.5,
float  gamma = 1.0,
float  hue = 1.2,
bool  reverse = false 
) [inline]

Construct a cubehelix object and initialize it's mapping tables.

There are a lot of parameters here, so you can use the cubehelix::create class if you want named parameters

Parameters:
nlevThe number of color levels in the color map.
startThe starting position in the color space. 0=blue, 1=red, 2=green. Defaults to 0.5.
rotThe number of rotations through the rainbow. Can be positive or negative, indicating direction of rainbow. Negative values correspond to Blue->Red direction.
gammaThe gamma correction for intensity.
hueThe hue intensity factor.
reverseSet to True to reverse the color map. Will go from black to white. Good for density plots where shade~density.

The documentation for this class was generated from the following file:
 All Classes Functions