Meanshift
1.0
|
Image helper functions. More...
#include "image.h"
Functions | |
uchar * | AllocateUcharImage (int width, int height, int nchannel) |
Allocate space for the uchar image,. More... | |
int ** | GenerateLabels (int width, int height) |
Generate labels for clustering. More... | |
vector< int > | GenerateRandomNumbers (int count) |
Function generate random numbers. More... | |
void | LabelImage (uchar *image, int width, int height, int **labels, int regCount) |
Function LabelImage in RGB colors. More... | |
void | RGB2LUV (float r, float g, float b, uchar *l, uchar *u, uchar *v) |
Function RGB2LUV converts RGB pixel value to LUV pixel value. More... | |
void | LUV2RGB (float L, float u, float v, uchar *R, uchar *G, uchar *B) |
Function LUV2RGB converts LUV pixel value to RGB pixel value. More... | |
uchar * | ConvertRGB2LUV (uchar *rgb, int width, int height, int nchannel) |
Function ConvertRGB2LUV convert RGB image to LUV. More... | |
uchar * | ConvertLUV2RGB (uchar *luv, int width, int height, int nchannel) |
Function ConvertLUV2RGB converts input image image from LUV to RGB color space. More... | |
void | SetPixel (uchar *im, int width, int height, int x, int y, const uchar val, int nchannel) |
Set Pixel at channel component of image at postition given with x and y. More... | |
uchar | GetPixel (uchar *im, int width, int height, int x, int y, int nchannel) |
Get Pixel at channel component of image at postition given with x and y. More... | |
int | range_distance (uchar *image, int width, int height, int x1, int y1, int x2, int y2) |
Function range_distance calculate range distance between two pixels. More... | |
float | color_distance (const float *a, const float *b) |
Function color_distance calculate color distance between the two pixels. More... | |
Image helper functions.
uchar* AllocateUcharImage | ( | int | width, |
int | height, | ||
int | nchannel | ||
) |
Allocate space for the uchar image,.
width,height | and nchannel |
float color_distance | ( | const float * | a, |
const float * | b | ||
) |
Function color_distance calculate color distance between the two pixels.
a,b | input images |
uchar* ConvertLUV2RGB | ( | uchar * | luv, |
int | width, | ||
int | height, | ||
int | nchannel | ||
) |
Function ConvertLUV2RGB converts input image image from LUV to RGB color space.
luv | LUV image to convert |
width | width of the image |
height | gheight of the image |
nchannel | number of image channels |
uchar* ConvertRGB2LUV | ( | uchar * | rgb, |
int | width, | ||
int | height, | ||
int | nchannel | ||
) |
Function ConvertRGB2LUV convert RGB image to LUV.
rgb | RGB image to convert |
width | width of the image |
height | gheight of the image |
nchannel | number of image channels |
int** GenerateLabels | ( | int | width, |
int | height | ||
) |
Generate labels for clustering.
Function generate labels.
width,height |
vector<int> GenerateRandomNumbers | ( | int | count | ) |
Function generate random numbers.
count | - Count of numbers to be generated |
uchar GetPixel | ( | uchar * | im, |
int | width, | ||
int | height, | ||
int | x, | ||
int | y, | ||
int | nchannel | ||
) |
Get Pixel at channel component of image at postition given with x and y.
im | image to convert |
width | width of the image |
height | gheight of the image |
x | x position in the image 0 < x < width |
y | y position in the image 0 < y < height |
nchannel | number of image channels |
void LabelImage | ( | uchar * | image, |
int | width, | ||
int | height, | ||
int ** | labels, | ||
int | regCount | ||
) |
Function LabelImage in RGB colors.
image | image to be labeled |
width | width of the image |
height | heighto of the image |
labels | color labels |
regCount | regions to be labeled |
|
inline |
Function LUV2RGB converts LUV pixel value to RGB pixel value.
L | component of input image |
u | component of input image |
v | component of input image |
r | component of output image |
g | component of output image |
b | component of output image |
int range_distance | ( | uchar * | image, |
int | width, | ||
int | height, | ||
int | x1, | ||
int | y1, | ||
int | x2, | ||
int | y2 | ||
) |
Function range_distance calculate range distance between two pixels.
image | image to calculate |
width | width of the image |
height | height of the image |
x1 | first x position in the image |
y1 | first y position in the image |
x2 | second x position in the image |
y2 | second y position in the image |
|
inline |
Function RGB2LUV converts RGB pixel value to LUV pixel value.
r | component of input image |
g | component of input image |
b | component of input image |
l | component of output image |
u | component of output image |
v | component of output image 0<=l<=100, −134<=u<=220, −140<=v<=122 |
void SetPixel | ( | uchar * | im, |
int | width, | ||
int | height, | ||
int | x, | ||
int | y, | ||
const uchar | val, | ||
int | nchannel | ||
) |
Set Pixel at channel component of image at postition given with x and y.
im | image to convert |
width | width of the image |
height | gheight of the image |
x | x position in the image |
y | y position in the image |
val | value to set at pixel location |
nchannel | number of image channels |