Operations on the RGB color cube (filtering, display density, ...). More...
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "rgbprocess_lib.h"
#include "cppcode/rgbcubeIPOL.h"
Go to the source code of this file.
Functions | |
void | input2RGB (unsigned char *input, unsigned char **RR, unsigned char **GG, unsigned char **BB, int size) |
Convert color data from 1 array with format RR...RRGG...GGBB...BB to 3 arrays with formats RRR..., GGG..., BBB... | |
void | RGB2output (unsigned char *R, unsigned char *G, unsigned char *B, unsigned char *output, int size) |
Convert color data from 3 arrays with formats RRR..., GGG..., BBB... to 1 array with format RR...RRGG...GGBB...BB. | |
void | rgbprocess (unsigned char *input1, unsigned char *input2, unsigned char *input3, int w, int h, unsigned char *output1, unsigned char *output2, unsigned char *output3, int wOut, int hOut, const char *option) |
Main function: calls functions that perform different operations on the color cube. | |
void | RGBviewsparams (const char *nameparams) |
Computes parameters (position and coordinates vectors) of a set of projection planes for displaying different views of the RGB color cube. Stores results in a text file. | |
void | getRGBview (unsigned char *input, int w, int h, unsigned char *I, unsigned char *output, int wview, int hview, float P[3], float u[3], float v[3]) |
Creates an image displaying the orthonormal projection of the RGB cube of a color image onto a plane defined by its position P in RGB space and by two coordinates vectors u, v. | |
float | computeRMSE (unsigned char *input1, unsigned char *input2, int w, int h, float &dmean) |
Compute Root Mean Squared Error (RMSE) and Average Distance (dmean) between two sets of colors in RGB space. | |
int | countcolors (unsigned char *input, int w, int h) |
Count the number of different colors in an image. | |
void | RGB2VRML2 (unsigned char *input, int w, int h, unsigned char *Idsty, const char *nameout) |
Creates a file in VRML 2.0 format containing the list of color points of an input image. Each point is either displayed with its original RGB color or with a gray level value proportional to the density of the color. |
Operations on the RGB color cube (filtering, display density, ...).
Definition in file rgbprocess_lib.cpp.
float computeRMSE | ( | unsigned char * | input1, | |
unsigned char * | input2, | |||
int | w, | |||
int | h, | |||
float & | dmean | |||
) |
Compute Root Mean Squared Error (RMSE) and Average Distance (dmean) between two sets of colors in RGB space.
[in] | input1,input2 | input images whose colors are to be compared |
[in] | w,h | input image dimensions |
[out] | dmean | average distance between corresponding colors |
Definition at line 445 of file rgbprocess_lib.cpp.
int countcolors | ( | unsigned char * | input, | |
int | w, | |||
int | h | |||
) |
Count the number of different colors in an image.
[in] | input | input image |
[in] | w,h | input image dimensions |
Definition at line 480 of file rgbprocess_lib.cpp.
void getRGBview | ( | unsigned char * | input, | |
int | w, | |||
int | h, | |||
unsigned char * | I, | |||
unsigned char * | output, | |||
int | wview, | |||
int | hview, | |||
float | P[3], | |||
float | u[3], | |||
float | v[3] | |||
) |
Creates an image displaying the orthonormal projection of the RGB cube of a color image onto a plane defined by its position P in RGB space and by two coordinates vectors u, v.
[in] | input | input image |
[in] | w,h | input image dimensions |
[out] | output | output image |
[in] | wview,hview | output image dimensions |
[in] | P | position of projection plane in RGB space (center of the plane) |
[in] | u,v | vectors defining a coordinates system on the plane |
Definition at line 407 of file rgbprocess_lib.cpp.
void input2RGB | ( | unsigned char * | input, | |
unsigned char ** | RR, | |||
unsigned char ** | GG, | |||
unsigned char ** | BB, | |||
int | size | |||
) |
Convert color data from 1 array with format RR...RRGG...GGBB...BB to 3 arrays with formats RRR..., GGG..., BBB...
[in] | input | input array |
[out] | RR,GG,BB | output arrays [in] size number of colors |
Definition at line 59 of file rgbprocess_lib.cpp.
void RGB2output | ( | unsigned char * | R, | |
unsigned char * | G, | |||
unsigned char * | B, | |||
unsigned char * | output, | |||
int | size | |||
) |
Convert color data from 3 arrays with formats RRR..., GGG..., BBB... to 1 array with format RR...RRGG...GGBB...BB.
[in] | R,G,B | input arrays |
[out] | output | input array [in] size number of colors |
Definition at line 90 of file rgbprocess_lib.cpp.
void RGB2VRML2 | ( | unsigned char * | input, | |
int | w, | |||
int | h, | |||
unsigned char * | Idsty, | |||
const char * | nameout | |||
) |
Creates a file in VRML 2.0 format containing the list of color points of an input image. Each point is either displayed with its original RGB color or with a gray level value proportional to the density of the color.
[in] | input | input image |
[in] | Idsty | density image |
[out] | nameout | output file name |
Definition at line 511 of file rgbprocess_lib.cpp.
void rgbprocess | ( | unsigned char * | input1, | |
unsigned char * | input2, | |||
unsigned char * | input3, | |||
int | w, | |||
int | h, | |||
unsigned char * | output1, | |||
unsigned char * | output2, | |||
unsigned char * | output3, | |||
int | wOut, | |||
int | hOut, | |||
const char * | option | |||
) |
Main function: calls functions that perform different operations on the color cube.
[in] | input1,input2,input3 | input images |
[in] | w,h | dimensions of the input images |
[in] | output1,output2,output3 | output images |
[in] | wOut,hOut | dimensions of the output images |
[in] | option | processing option |
Processing options:
filter: applies LLP2 algorithm to input1, saves result to output1 (calls filtercolor function in rgbcubeIPOL.cpp)
rmisolated: removes isolated color points from input1, saves result to output1 (calls removeisolatedRGB function in colorfiltering.cpp)
pcaviews: creates 3 images (output1, output2, output3) displaying the principal views of the RGB cube of image input1 (calls function PCAviews in rgbcubeIPOL.cpp)
pcaviewsB: creates 1 image (output1) displaying the 3 principal views of the RGB cube of image input1 (calls function PCAviewsB in rgbcubeIPOL.cpp)
densityviews: creates 1 image (output1) displaying the 3 principal views of the RGB cube of image input1, each color point is displayed with a grey level proportional to its density in the color cube (lighter for higher densities) (calls PCAviews_densityB in rgbcubeIPOL.cpp)
densityImage: creates a gray-scale image (output1) with values proportional to the density of the colors of image input1 (calls densityImage function in rgbcubeIPOL.cpp)
mergeimages: creates one output image (output1) from two inputs (input1, input2) such that output1=input1 except at pixels with (0, 0, 0) RGB value, which are replaced by pixels of input2
combineimages: creates one output image (output1) from three inputs (input1, input2, input3), arranged in horizontal direction
combineimagesB: creates one output image (output1) from three inputs (input1, input2, input3), arranged in two rows: first row displays input1 and input2 and second row input3 (centered)
Definition at line 155 of file rgbprocess_lib.cpp.
void RGBviewsparams | ( | const char * | nameparams | ) |
Computes parameters (position and coordinates vectors) of a set of projection planes for displaying different views of the RGB color cube. Stores results in a text file.
[out] | nameparams | name of output file |
Definition at line 384 of file rgbprocess_lib.cpp.