Last modified: November 22, 2010
Contents
Image [Float] blue ()
Operates on: | Image [RGB] |
---|---|
Returns: | Image [Float] |
Category: | Color |
Defined in: | color.py |
Author: | Michael Droettboom and Karl MacMillan |
Returns a GREYSCALE image where each pixel is the blue component of the RGB original.
Example 1: blue()
Image [Float] cie_Lab_L ()
Operates on: | Image [RGB] |
---|---|
Returns: | Image [Float] |
Category: | Color |
Defined in: | color.py |
Author: | Michael Droettboom and Karl MacMillan |
Returns a FLOAT image where each pixel is an L value in the CIE L*a*b* color space. For an introduction to the different color spaces, see A. Ford and A. Roberts: Color Space Concersions (1998).
The present conversion uses the RGB to Lab conversion routine from VIGRA.
Example 1: cie_Lab_L()
Image [Float] cie_Lab_a ()
Operates on: | Image [RGB] |
---|---|
Returns: | Image [Float] |
Category: | Color |
Defined in: | color.py |
Author: | Michael Droettboom and Karl MacMillan |
Returns a FLOAT image where each pixel is an a value in the CIE L*a*b* color space. For an introduction to the different color spaces, see A. Ford and A. Roberts: Color Space Concersions (1998).
The present conversion uses the RGB to Lab conversion routine from VIGRA.
Example 1: cie_Lab_a()
Image [Float] cie_Lab_b ()
Operates on: | Image [RGB] |
---|---|
Returns: | Image [Float] |
Category: | Color |
Defined in: | color.py |
Author: | Michael Droettboom and Karl MacMillan |
Returns a FLOAT image where each pixel is a b value in the CIE L*a*b* color space. For an introduction to the different color spaces, see A. Ford and A. Roberts: Color Space Concersions (1998).
The present conversion uses the RGB to Lab conversion routine from VIGRA.
Example 1: cie_Lab_b()
Image [Float] cie_x ()
Operates on: | Image [RGB] |
---|---|
Returns: | Image [Float] |
Category: | Color |
Defined in: | color.py |
Author: | Michael Droettboom and Karl MacMillan |
Returns a FLOAT image where each pixel is a x value in the CIE 1964 Colorimetric system in range [0, 1).
Example 1: cie_x()
Image [Float] cie_y ()
Operates on: | Image [RGB] |
---|---|
Returns: | Image [Float] |
Category: | Color |
Defined in: | color.py |
Author: | Michael Droettboom and Karl MacMillan |
Returns a FLOAT image where each pixel is a y value in the CIE 1964 Colorimetric system in range [0, 1).
Example 1: cie_y()
Image [Float] cie_z ()
Operates on: | Image [RGB] |
---|---|
Returns: | Image [Float] |
Category: | Color |
Defined in: | color.py |
Author: | Michael Droettboom and Karl MacMillan |
Returns a FLOAT image where each pixel is a z value in the CIE 1964 Colorimetric system in range [0, 1).
Example 1: cie_z()
Image [RGB] color_ccs (bool ignore_unlabeled = True)
Operates on: | Image [OneBit] |
---|---|
Returns: | Image [RGB] |
Category: | Color |
Defined in: | gui_support.py |
Author: | Michael Droettboom, Karl MacMillan, and Robert Butz |
Returns an RGB image where each connected component of the image is colored one of eight different colors. This function can be used to verify that cc_analysis is working correctly for your image.
It should be noted that this coloring does not take care of component adjacency. It may therefore happen that adjacent components obtain the same color. If this is not acceptable in your use case, have a look at graph_color_ccs instead.
Note
Connected component analysis must already be performed on the image (using cc_analysis, for example) in order for this to work.
Example 1:
Image [OneBit] colors_to_labels (dict rgb_to_label)
Operates on: | Image [RGB] |
---|---|
Returns: | Image [OneBit] |
Category: | Color |
Defined in: | color.py |
Author: | Christoph Dalitz and Hasan Yildiz |
Converts an RGB image to a labeled onebit image.
Each RGB color is replaced by the label specified in the mapping rgb_to_label. RGB values not listed in rgb_to_label are white in the returned onebit image. When no mapping rgb_to_label is provided, each different RGB color is replaced by a unique label.
This is mostly useful for reading manually labeled groundtruth data from color PNG files. Example:
# map red to label 3, and green to label 5
labeled = rgb.colors_to_labels( {RGBPixel(255,0,0): 3, RGBPixel(0,255,0): 5} )
A typical use case of this plugin is in combination with ccs_from_labeled_image.
Image [Float] cyan ()
Operates on: | Image [RGB] |
---|---|
Returns: | Image [Float] |
Category: | Color |
Defined in: | color.py |
Author: | Michael Droettboom and Karl MacMillan |
Returns a GREYSCALE image where each pixel is the cyan component of the RGB original.
Example 1: cyan()
Image [RGB] false_color ()
Operates on: | Image [Float|GreyScale] |
---|---|
Returns: | Image [RGB] |
Category: | Color |
Defined in: | color.py |
Author: | Michael Droettboom and Karl MacMillan |
Returns a false color representation of the given image. Low values are red, mid values are green and high values are blue. This can help visualize greyscale images that are not real images but are representations of other kinds of data.
Example 1: false_color()
Image [RGB] graph_color_ccs ([object ccs], [RGBPixel colors] = None, Choice [CC center|20% contour points|voronoi diagram] method = 20% contour points)
Operates on: | Image [OneBit] |
---|---|
Returns: | Image [RGB] |
Category: | Color |
Defined in: | geometry.py |
Author: | Oliver Christen and Tobias Bolten |
Returns an RGB Image where each segment is colored with one of the colors from colors with the constraint that segments adjacent in the neighborship graph have different colors.
This function can be used to verify that the pagesegmentation e.g. cc_analysis is working correctly for your image.
The graph coloring algorithm is based on the "6-COLOR" alorithm for planar graphs, as described in:
D. Matula, Y. Shiloach, R. Tarjan: Two linear-time algorithms for five-coloring a planar graph. Tech Rep STAN-CS-80-830, Computer Science Dep., Stanford Univ., Stanford, Calif., 1980
We have modified the algorithm in such way that the color distribution is balanced, i.e. that each color is assigned approximately to the same number of nodes (also known as "equitable coloring").
Controls the calculation of the neighborhood graph:
0 = from the CC center points (fastest, but can be inaccurate for large CC's)
1 = from a 20 percent sample of the contour points (reasonable compromise between speed and accuracy)
2 = from the exact area Voronoi diagram (can be slow on large images)
ccs = imgage.cc_analysis()
colors = [ RGBPixel(150, 0, 0),
RGBPixel(0, 250, 0),
RGBPixel(0, 0, 255),
RGBPixel(250, 0, 255),
RGBPixel(50, 150, 50),
RGBPixel(0, 190, 255),
RGBPixel(230, 190, 20) ]
rgb = imgage.mycolor_ccs(ccs, colors, 1)
Note
colors may not contain less than six colors.
Image [Float] green ()
Operates on: | Image [RGB] |
---|---|
Returns: | Image [Float] |
Category: | Color |
Defined in: | color.py |
Author: | Michael Droettboom and Karl MacMillan |
Returns a GREYSCALE image where each pixel is the green component of the original.
Example 1: green()
Image [Float] hue ()
Operates on: | Image [RGB] |
---|---|
Returns: | Image [Float] |
Category: | Color |
Defined in: | color.py |
Author: | Michael Droettboom and Karl MacMillan |
Returns a FLOAT image where each pixel is a hue value in HSV space in range [0, 1). Since the hue space is continuous, the shortest distance between 1 and 0 is 0.
Example 1: hue()
Image [Float] magenta ()
Operates on: | Image [RGB] |
---|---|
Returns: | Image [Float] |
Category: | Color |
Defined in: | color.py |
Author: | Michael Droettboom and Karl MacMillan |
Returns a GREYSCALE image where each pixel is the magenta component of the RGB original.
Example 1: magenta()
Image [Float] red ()
Operates on: | Image [RGB] |
---|---|
Returns: | Image [Float] |
Category: | Color |
Defined in: | color.py |
Author: | Michael Droettboom and Karl MacMillan |
Returns a GREYSCALE image where each pixel is the red component of the RGB original.
Example 1: red()
Image [Float] saturation ()
Operates on: | Image [RGB] |
---|---|
Returns: | Image [Float] |
Category: | Color |
Defined in: | color.py |
Author: | Michael Droettboom and Karl MacMillan |
Returns a FLOAT image where each pixel is a saturation value in HSV space in range [0, 1).
Example 1: saturation()
Image [Float] value ()
Operates on: | Image [RGB] |
---|---|
Returns: | Image [Float] |
Category: | Color |
Defined in: | color.py |
Author: | Michael Droettboom and Karl MacMillan |
Returns a FLOAT image where each pixel is the value in HSV space in range [0, 1). For more information, Google for HSV color space.
Example 1: value()
Image [Float] yellow ()
Operates on: | Image [RGB] |
---|---|
Returns: | Image [Float] |
Category: | Color |
Defined in: | color.py |
Author: | Michael Droettboom and Karl MacMillan |
Returns a GREYSCALE image where each pixel is the yellow component of the RGB original.
Example 1: yellow()