Go to the source code of this file.
Functions | |
int | count_RGBcolors (unsigned char *imR, unsigned char *imG, unsigned char *imB, int w, int h) |
Count the number of different colors in an image. | |
void | PCAviews (unsigned char *imR, unsigned char *imG, unsigned char *imB, int w, int h, unsigned char *refR, unsigned char *refG, unsigned char *refB, int wref, int href, unsigned char *im12R, unsigned char *im12G, unsigned char *im12B, unsigned char *im13R, unsigned char *im13G, unsigned char *im13B, unsigned char *im23R, unsigned char *im23G, unsigned char *im23B, int wout, int hout) |
Create 3 images displaying the projections of the color cube of an image onto the 3 planes defined by the principal components of the color distribution in RGB space. | |
void | PCAviewsB (unsigned char *imR, unsigned char *imG, unsigned char *imB, int w, int h, unsigned char *refR, unsigned char *refG, unsigned char *refB, int wref, int href, unsigned char *im123R, unsigned char *im123G, unsigned char *im123B, int wout, int hout) |
Concatenates into one single output image the 3 projections of the RGB color distribution of an input image onto the 3 planes defined by the principal components of the color distribution of a reference image (eventually, reference and input images may be the same). | |
void | PCAviews_density (unsigned char *imR, unsigned char *imG, unsigned char *imB, int w, int h, unsigned char *refR, unsigned char *refG, unsigned char *refB, unsigned char *im12R, unsigned char *im12G, unsigned char *im12B, unsigned char *im13R, unsigned char *im13G, unsigned char *im13B, unsigned char *im23R, unsigned char *im23G, unsigned char *im23B, int wout, int hout, int rdst, unsigned char cumdsty, unsigned char *Idsty) |
Create 3 images displaying the densities of the colors in the color cube of an image, projected onto the 3 planes defined by the principal components of the color distribution in RGB space. | |
void | PCAviews_densityB (unsigned char *imR, unsigned char *imG, unsigned char *imB, int w, int h, unsigned char *refR, unsigned char *refG, unsigned char *refB, unsigned char *im123R, unsigned char *im123G, unsigned char *im123B, int wout, int hout, int rdst, unsigned char cumdsty, unsigned char *Idsty) |
Concatenates into one single output image the 3 projections of the density of the RGB color distribution of an input image onto the 3 planes defined by the principal components of the color distribution of a reference image (eventually, reference and input images may be the same). | |
void | rmHighGradHue (unsigned char *imR, unsigned char *imG, unsigned char *imB, unsigned char *lowR, unsigned char *lowG, unsigned char *lowB, unsigned char *highR, unsigned char *highG, unsigned char *highB, int w, int h, float thgrad, float thsat) |
int | filtercolor (unsigned char *inR, unsigned char *inG, unsigned char *inB, unsigned char *outR, unsigned char *outG, unsigned char *outB, int w, int h, int type, float eitmax, int r, int rsim) |
Filter the cloud of RGB points associated to a color image by iteratively projecting the points to a line (1D projection) or a plane (2D projection) computed using Principal Components Analysis of a local neighborhood of the point in RGB space. | |
void | mergeimages (unsigned char *in1R, unsigned char *in1G, unsigned char *in1B, unsigned char *in2R, unsigned char *in2G, unsigned char *in2B, unsigned char *outR, unsigned char *outG, unsigned char *outB, int w, int h) |
Create a new image identical to the first input image except for pixels with (0, 0, 0) RGB value which are replaced by the pixels of the second input image. | |
void | densityImage (unsigned char *R, unsigned char *G, unsigned char *B, int w, int h, unsigned char *I, int rdst, unsigned char logscale) |
Create an output image where the color of each pixel has been replaced by a brightness value proportional to the density of the color (white: high density, black: low density). | |
int | RGBviews_sequence (unsigned char *imR, unsigned char *imG, unsigned char *imB, int w, int h, unsigned char ***viewsR, unsigned char ***viewsG, unsigned char ***viewsB, int wview, int hview, unsigned char displayDensity) |
Generate a rotating sequence of views of the RGB cube. | |
int | RGBviews_sequence_params (const char *paramsfile) |
Generate the parameters of the projection planes for a rotating sequence of views of the RGB cube. | |
void | delete_views_sequence (unsigned char **viewR, unsigned char **viewG, unsigned char **viewB, int nviews) |
Delete data structure storing 3D views of the RGB cube. | |
void | compute_RGB_PCA (unsigned char *R, unsigned char *G, unsigned char *B, int npoints, float &Rcm, float &Gcm, float &Bcm, float &vp1, float &vp2, float &vp3, float vc1[3], float vc2[3], float vc3[3]) |
Principal Components Analysis (PCA) of the cloud of RGB points associated to a color image. | |
void | projectRGBcube (unsigned char *R, unsigned char *G, unsigned char *B, int npoints, unsigned char *I, unsigned char *Rout, unsigned char *Gout, unsigned char *Bout, int wout, int hout, float M[3], float u[3], float v[3]) |
Create image displaying the projection of the color cube of a color image onto a plane (rescale projected points to fit the output image size). | |
void | projectRGBcubeB (unsigned char *R, unsigned char *G, unsigned char *B, int npoints, unsigned char *I, unsigned char *Rout, unsigned char *Gout, unsigned char *Bout, int wout, int hout, float M[3], float u[3], float v[3]) |
Create image displaying the projection of the color cube of a color image onto a plane (in this case the center of projection is located at the center of the output image, which was not necessarily the case in 'projectRGBcube'). | |
void | projectRGBdensities (unsigned char *R, unsigned char *G, unsigned char *B, int npoints, unsigned char *Rout, unsigned char *Gout, unsigned char *Bout, int wout, int hout, float M[3], float u[3], float v[3], float ***dsty, float &maxdsty, unsigned char logscale) |
Create image displaying the projection of the color cube of a color image onto a plane. Each output image pixel is displayed with a grey level proportional to the cumulated color density of the points projected onto that pixel (X-rays projection). | |
float | diffRMSE (unsigned char *R1, unsigned char *G1, unsigned char *B1, unsigned char *R2, unsigned char *G2, unsigned char *B2, int w, int h, unsigned char use_voxel, float &dmean) |
Compute Root Mean Square Error between two images. | |
void | RGBcube2PLY (unsigned char *R, unsigned char *G, unsigned char *B, int npoints, unsigned char *I, const char *nameout) |
Create a PLY file storing the RGB color cube (including its edges) (optionally displaying density information). | |
void | RGBcube2VRML2 (unsigned char *R, unsigned char *G, unsigned char *B, int npoints, unsigned char *I, const char *nameout) |
Create a VRML2.0 file storing the RGB color cube (including its edges) (optionally displaying density information). |
void compute_RGB_PCA | ( | unsigned char * | R, | |
unsigned char * | G, | |||
unsigned char * | B, | |||
int | npoints, | |||
float & | Rcm, | |||
float & | Gcm, | |||
float & | Bcm, | |||
float & | vp1, | |||
float & | vp2, | |||
float & | vp3, | |||
float | vc1[3], | |||
float | vc2[3], | |||
float | vc3[3] | |||
) |
Principal Components Analysis (PCA) of the cloud of RGB points associated to a color image.
[in] | R,G,B | color channels of the image |
[in] | npoints | number of image pixels=number of color points |
[out] | Rcm,Gcm,Bcm | center of mass of the color distribution in RGB space |
[out] | vp1,vp2,vp3 | eigenvalues associated to the principal components |
[out] | vc1,vc2,vc3 | eigenvectors (unitary) associated to the principal components |
Definition at line 1025 of file rgbcubeIPOL.cpp.
int count_RGBcolors | ( | unsigned char * | imR, | |
unsigned char * | imG, | |||
unsigned char * | imB, | |||
int | w, | |||
int | h | |||
) |
Count the number of different colors in an image.
[in] | imR,imG,imB | color channels of the imput image |
[in] | w,h | image dimensions |
Definition at line 47 of file rgbcubeIPOL.cpp.
void delete_views_sequence | ( | unsigned char ** | viewR, | |
unsigned char ** | viewG, | |||
unsigned char ** | viewB, | |||
int | nviews | |||
) |
Delete data structure storing 3D views of the RGB cube.
[in] | viewR,viewG,viewB | arrays of data for R, G and B channels |
[in] | nviews | number of views |
Definition at line 998 of file rgbcubeIPOL.cpp.
void densityImage | ( | unsigned char * | R, | |
unsigned char * | G, | |||
unsigned char * | B, | |||
int | w, | |||
int | h, | |||
unsigned char * | I, | |||
int | rdst, | |||
unsigned char | logscale | |||
) |
Create an output image where the color of each pixel has been replaced by a brightness value proportional to the density of the color (white: high density, black: low density).
The density of a color C (in RGB space) is defined as
where is the set of neighbors of C is the Euclidean distance between colors C and C' in RGB space and is a weighting parameter
The set of neighbors of a color C is composed of all the colors at L1-distance below some threshold . Each color appears in the set of neighbors as many times as it is present in the image (i.e. the frequency of the color is taken into account in the computations). Tipically the weighting parameter is so the weight of the furthest neighbors is
[in] | R,G,B | color channels of the first input image |
[in] | w,h | image size |
[out] | I | output gray level image |
[in] | rdst | radius of neighborhood around each color point needed to compute its density |
[in] | logscale | if logscale=1 display values using logarithmic scale, otherwise use linear scale |
Definition at line 568 of file rgbcubeIPOL.cpp.
float diffRMSE | ( | unsigned char * | R1, | |
unsigned char * | G1, | |||
unsigned char * | B1, | |||
unsigned char * | R2, | |||
unsigned char * | G2, | |||
unsigned char * | B2, | |||
int | w, | |||
int | h, | |||
unsigned char | use_voxel, | |||
float & | dmean | |||
) |
Compute Root Mean Square Error between two images.
[in] | R1,G1,B1 | color channels of the first image |
[in] | R2,G2,B2 | color channels of the first image |
[in] | w,h | size of the images |
[in] | use_voxel | if use_voxel=1 compute differences between color clouds, without taking into account the number of pixels associated to each color |
[out] | dmean | average distance between the colors of both images |
Definition at line 1676 of file rgbcubeIPOL.cpp.
int filtercolor | ( | unsigned char * | inR, | |
unsigned char * | inG, | |||
unsigned char * | inB, | |||
unsigned char * | outR, | |||
unsigned char * | outG, | |||
unsigned char * | outB, | |||
int | w, | |||
int | h, | |||
int | type, | |||
float | eitmax, | |||
int | r, | |||
int | rsim | |||
) |
Filter the cloud of RGB points associated to a color image by iteratively projecting the points to a line (1D projection) or a plane (2D projection) computed using Principal Components Analysis of a local neighborhood of the point in RGB space.
[in] | inR,inG,inB | color channels of the input image |
[out] | outR,outG,outB | color channels of the output image |
[in] | w,h | image dimensions |
[in] | type | type=1 for 1D projection, type=2 for 2D projection |
[in] | eitmax | stop criterion of the algorithm. The algorithm is iterated until the average difference of corresponding colors in two consecutive iterations is below eitmax |
[in] | r | distance that defines the neighborhood of a color point (neighbors are RGB points at L1-distance below r) |
[in] | rsim | distance defining a small neighborhood around each color point, it is used to speed up the algorithm. It must be much smaller than r, typically rsim=r/3 |
Definition at line 487 of file rgbcubeIPOL.cpp.
void mergeimages | ( | unsigned char * | in1R, | |
unsigned char * | in1G, | |||
unsigned char * | in1B, | |||
unsigned char * | in2R, | |||
unsigned char * | in2G, | |||
unsigned char * | in2B, | |||
unsigned char * | outR, | |||
unsigned char * | outG, | |||
unsigned char * | outB, | |||
int | w, | |||
int | h | |||
) |
Create a new image identical to the first input image except for pixels with (0, 0, 0) RGB value which are replaced by the pixels of the second input image.
[in] | in1R,in1G,in1B | color channels of the first input image |
[in] | in2R,in2G,in2B | color channels of the second input image |
[out] | outR,outG,outB | color channels of the output image |
[in] | w,h | images size |
Definition at line 517 of file rgbcubeIPOL.cpp.
void PCAviews | ( | unsigned char * | imR, | |
unsigned char * | imG, | |||
unsigned char * | imB, | |||
int | w, | |||
int | h, | |||
unsigned char * | refR, | |||
unsigned char * | refG, | |||
unsigned char * | refB, | |||
int | wref, | |||
int | href, | |||
unsigned char * | im12R, | |||
unsigned char * | im12G, | |||
unsigned char * | im12B, | |||
unsigned char * | im13R, | |||
unsigned char * | im13G, | |||
unsigned char * | im13B, | |||
unsigned char * | im23R, | |||
unsigned char * | im23G, | |||
unsigned char * | im23B, | |||
int | wout, | |||
int | hout | |||
) |
Create 3 images displaying the projections of the color cube of an image onto the 3 planes defined by the principal components of the color distribution in RGB space.
[in] | imR,imG,imB | color channels of the image whose color cube is to be projected |
[in] | w,h | image dimensions |
[in] | refR,refG,refB | color channels of the image whose color distribution is used to compute Principal Components (reference image) |
[in] | wref,href | reference image dimensions |
[out] | im12R,im12G,im12B | color channels of the image displaying the projection onto the plane defined by the first and second principal components |
[out] | im13R,im13G,im13B | color channels of the image displaying the projection onto the plane defined by the first and third principal components |
[out] | im23R,im23G,im23B | color channels of the image displaying the projection onto the plane defined by the second and third principal components |
[in] | wout,hout | dimensions of the output images |
Definition at line 110 of file rgbcubeIPOL.cpp.
void PCAviews_density | ( | unsigned char * | imR, | |
unsigned char * | imG, | |||
unsigned char * | imB, | |||
int | w, | |||
int | h, | |||
unsigned char * | refR, | |||
unsigned char * | refG, | |||
unsigned char * | refB, | |||
unsigned char * | im12R, | |||
unsigned char * | im12G, | |||
unsigned char * | im12B, | |||
unsigned char * | im13R, | |||
unsigned char * | im13G, | |||
unsigned char * | im13B, | |||
unsigned char * | im23R, | |||
unsigned char * | im23G, | |||
unsigned char * | im23B, | |||
int | wout, | |||
int | hout, | |||
int | rdst, | |||
unsigned char | cumdsty, | |||
unsigned char * | Idsty | |||
) |
Create 3 images displaying the densities of the colors in the color cube of an image, projected onto the 3 planes defined by the principal components of the color distribution in RGB space.
[in] | imR,imG,imB | color channels of the image whose densities are to be displayed |
[in] | refR,refG,refB | color channels of the image whose color distribution is used to compute Principal Components (reference image) |
[in] | w,h | input image dimensions (= reference image dimensions) |
[out] | im12R,im12G,im12B | color channels of the image displaying the projection onto the plane defined by the first and second principal components |
[out] | im13R,im13G,im13B | color channels of the image displaying the projection onto the plane defined by the first and third principal components |
[out] | im23R,im23G,im23B | color channels of the image displaying the projection onto the plane defined by the second and third principal components |
[in] | wout,hout | dimensions of the output images |
[in] | rdst | radius of neighborhood around each color point needed to compute its density |
[in] | cumdsty | if cumdsty=1 display cumulated densities (X-rays projection), else display densities of color points |
[in] | Idsty | grey scale image where each pixel is displayed with a grey level proportional to the density of its color in the original image |
Definition at line 355 of file rgbcubeIPOL.cpp.
void PCAviews_densityB | ( | unsigned char * | imR, | |
unsigned char * | imG, | |||
unsigned char * | imB, | |||
int | w, | |||
int | h, | |||
unsigned char * | refR, | |||
unsigned char * | refG, | |||
unsigned char * | refB, | |||
unsigned char * | im123R, | |||
unsigned char * | im123G, | |||
unsigned char * | im123B, | |||
int | wout, | |||
int | hout, | |||
int | rdst, | |||
unsigned char | cumdsty, | |||
unsigned char * | Idsty | |||
) |
Concatenates into one single output image the 3 projections of the density of the RGB color distribution of an input image onto the 3 planes defined by the principal components of the color distribution of a reference image (eventually, reference and input images may be the same).
[in] | imR,imG,imB | color channels of the image whose densities are to be displayed |
[in] | refR,refG,refB | color channels of the image whose color distribution is used to compute Principal Components(reference image) |
[in] | w,h | input image dimensions (= reference image dimensions) |
[out] | im123R,im123G,im123B | color channels of the image displaying the projections |
[in] | wout,hout | dimensions of the image projections (output image size= (3 x wout) x hout ) |
[in] | rdst | radius of neighborhood around each color point needed to compute its density |
[in] | cumdsty | if cumdsty=1 display cumulated densities (X-rays projection), else display densities of color points |
[in] | Idsty | grey scale image where each pixel is displayed with a grey level proportional to the density of its color in the original image |
Definition at line 409 of file rgbcubeIPOL.cpp.
void PCAviewsB | ( | unsigned char * | imR, | |
unsigned char * | imG, | |||
unsigned char * | imB, | |||
int | w, | |||
int | h, | |||
unsigned char * | refR, | |||
unsigned char * | refG, | |||
unsigned char * | refB, | |||
int | wref, | |||
int | href, | |||
unsigned char * | im123R, | |||
unsigned char * | im123G, | |||
unsigned char * | im123B, | |||
int | wout, | |||
int | hout | |||
) |
Concatenates into one single output image the 3 projections of the RGB color distribution of an input image onto the 3 planes defined by the principal components of the color distribution of a reference image (eventually, reference and input images may be the same).
[in] | imR,imG,imB | color channels of the image whose color cube is to be projected (input image) |
[in] | w,h | image dimensions |
[in] | refR,refG,refB | color channels of the image whose color distribution is used to compute Principal Components(reference image) |
[in] | wref,href | reference image dimensions |
[out] | im123R,im123G,im123B | color channels of the output image |
[in] | wout,hout | dimensions of the image projections (output image size= (3 x wout) x hout ) |
Definition at line 163 of file rgbcubeIPOL.cpp.
void projectRGBcube | ( | unsigned char * | R, | |
unsigned char * | G, | |||
unsigned char * | B, | |||
int | npoints, | |||
unsigned char * | I, | |||
unsigned char * | Rout, | |||
unsigned char * | Gout, | |||
unsigned char * | Bout, | |||
int | wout, | |||
int | hout, | |||
float | M[3], | |||
float | u[3], | |||
float | v[3] | |||
) |
Create image displaying the projection of the color cube of a color image onto a plane (rescale projected points to fit the output image size).
[in] | R,G,B | color channels of the input image |
[in] | npoints | image size |
[in] | I | if not NULL, draw pixel n with grey level I[n], else use color (R[n], G[n], B[n]) |
[out] | Rout,Gout,Bout | color channels of the output image |
[in] | wout,hout | dimensions of the output image |
[in] | M | origin of the plane |
[in] | u,v | unitary vectors defining the coordinates system of the projection plane |
Definition at line 1192 of file rgbcubeIPOL.cpp.
void projectRGBcubeB | ( | unsigned char * | R, | |
unsigned char * | G, | |||
unsigned char * | B, | |||
int | npoints, | |||
unsigned char * | I, | |||
unsigned char * | Rout, | |||
unsigned char * | Gout, | |||
unsigned char * | Bout, | |||
int | wout, | |||
int | hout, | |||
float | M[3], | |||
float | u[3], | |||
float | v[3] | |||
) |
Create image displaying the projection of the color cube of a color image onto a plane (in this case the center of projection is located at the center of the output image, which was not necessarily the case in 'projectRGBcube').
[in] | R,G,B | color channels of the input image |
[in] | npoints | image size |
[in] | I | if not NULL, draw pixel n with grey level I[n], else use color (R[n], G[n], B[n]) |
[out] | Rout,Gout,Bout | color channels of the output image |
[in] | wout,hout | dimensions of the output image |
[in] | M | origin of the plane |
[in] | u,v | unitary vectors defining the coordinates system of the projection plane |
Definition at line 1355 of file rgbcubeIPOL.cpp.
void projectRGBdensities | ( | unsigned char * | R, | |
unsigned char * | G, | |||
unsigned char * | B, | |||
int | npoints, | |||
unsigned char * | Rout, | |||
unsigned char * | Gout, | |||
unsigned char * | Bout, | |||
int | wout, | |||
int | hout, | |||
float | M[3], | |||
float | u[3], | |||
float | v[3], | |||
float *** | dsty, | |||
float & | maxdsty, | |||
unsigned char | logscale | |||
) |
Create image displaying the projection of the color cube of a color image onto a plane. Each output image pixel is displayed with a grey level proportional to the cumulated color density of the points projected onto that pixel (X-rays projection).
[in] | R,G,B | color channels of the input image |
[in] | npoints | number of image pixels=number of color points |
[out] | Rout,Gout,Bout | color channels of the output image |
[in] | wout,hout | dimensions of the output image |
[in] | M | origin of the plane |
[in] | u,v | unitary vectors defining the coordinates system of the projection plane |
[in] | dsty | densities of the color points |
[in] | maxdsty | maximum density value (if unknown maxdsty=0) |
[in] | logscale | if logscale=1 display values using logarithmic scale, otherwise use linear scale |
Definition at line 1515 of file rgbcubeIPOL.cpp.
void RGBcube2PLY | ( | unsigned char * | R, | |
unsigned char * | G, | |||
unsigned char * | B, | |||
int | npoints, | |||
unsigned char * | I, | |||
const char * | nameout | |||
) |
Create a PLY file storing the RGB color cube (including its edges) (optionally displaying density information).
[in] | R,G,B | color channels of the input image |
[in] | npoints | image size |
[in] | I | if <> NULL, draw pixel n with grey level I[n], else use color (R[n], G[n], B[n]) |
[out] | nameout | output file name (PLY file format) |
Definition at line 1739 of file rgbcubeIPOL.cpp.
void RGBcube2VRML2 | ( | unsigned char * | R, | |
unsigned char * | G, | |||
unsigned char * | B, | |||
int | npoints, | |||
unsigned char * | I, | |||
const char * | nameout | |||
) |
Create a VRML2.0 file storing the RGB color cube (including its edges) (optionally displaying density information).
[in] | R,G,B | color channels of the input image |
[in] | npoints | image size |
[in] | I | if <> NULL, draw pixel n with grey level I[n], else use color (R[n], G[n], B[n]) |
[out] | nameout | output file name (VRML2.0 file format) |
Definition at line 1806 of file rgbcubeIPOL.cpp.
int RGBviews_sequence | ( | unsigned char * | imR, | |
unsigned char * | imG, | |||
unsigned char * | imB, | |||
int | win, | |||
int | hin, | |||
unsigned char *** | viewsR, | |||
unsigned char *** | viewsG, | |||
unsigned char *** | viewsB, | |||
int | wview, | |||
int | hview, | |||
unsigned char | displayDensity | |||
) |
Generate a rotating sequence of views of the RGB cube.
[in] | imR,imG,imB | color channels of the input image |
[in] | win,hin | dimensions of the input image |
[out] | viewR,viewG,viewB | color channels of the views |
[in] | wview,hview | dimensions of the views |
[in] | displayDensity | if active display grey levels proportional (logaritmic scale) to the density of the color points, else display actual RGB values |
Definition at line 604 of file rgbcubeIPOL.cpp.
int RGBviews_sequence_params | ( | const char * | paramsfile | ) |
Generate the parameters of the projection planes for a rotating sequence of views of the RGB cube.
[out] | paramsfile | output file name (text file) |
Definition at line 819 of file rgbcubeIPOL.cpp.
void rmHighGradHue | ( | unsigned char * | imR, | |
unsigned char * | imG, | |||
unsigned char * | imB, | |||
unsigned char * | lowR, | |||
unsigned char * | lowG, | |||
unsigned char * | lowB, | |||
unsigned char * | highR, | |||
unsigned char * | highG, | |||
unsigned char * | highB, | |||
int | w, | |||
int | h, | |||
float | thgrad, | |||
float | thsat | |||
) |