Colorize the input using Dave Green's 'cubehelix' algorithm. More...
#include <rcv.hpp>
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. | |
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);
| 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
| nlev | The number of color levels in the color map. |
| start | The starting position in the color space. 0=blue, 1=red, 2=green. Defaults to 0.5. |
| rot | The number of rotations through the rainbow. Can be positive or negative, indicating direction of rainbow. Negative values correspond to Blue->Red direction. |
| gamma | The gamma correction for intensity. |
| hue | The hue intensity factor. |
| reverse | Set to True to reverse the color map. Will go from black to white. Good for density plots where shade~density. |
1.7.6.1