Command Conversion_Color
Using of command
This command is use for color conversion of source image
Commands parameters
Function has 3 parameters:
- Source picture:You can select one of used picture which is use as source picture for color conversion.You can select Picture_0 to Picture_19.
- Destination picture:You can select one of used picture which is use as destination picture for color conversion.You can select Picture_0 to Picture_19.
- Conversion code:You can select which type of conversion will be use. You can select:
- RGB2GRAY: This option convert source colour image 3 channel RGB to 1 channel grayscale image. RGB[A]->Gray: Y<-0.299*R + 0.587*G + 0.114*B
- GRAY2RGB:This option conver source grayscale 1 channel image to 3 channel image. All channel in destination image has same value as in grayscale image. Gray->RGB[A]: R<-Y G<-Y B<-Y A<-0
- RGB2XYZ:Option covert source 3 channel RBG image to CIE XYZ format
- XYZ2RGB: Option convert CIE XYZ format to 3 channel RGB image
- RGB2YCrCb: Option convert 3 channel RGB format to YCrCb JPEG format.
Y <- 0.299*R + 0.587*G + 0.114*B
Cr <- (R-Y)*0.713 + delta
Cb <- (B-Y)*0.564 + delta
- YCrCb2RGB: Option convert YCrCb JPEG format to 3 channel RGB format
R <- Y + 1.403*(Cr - delta)
G <- Y - 0.344*(Cr - delta) - 0.714*(Cb - delta)
B <- Y + 1.773*(Cb - delta),
- RGB2HSV:Option convert source RGB format to HSV format:
V <- max(R,G,B)
S <- (V-min(R,G,B))/V if V≠0, 0 otherwise
(G - B)*60/S, if V=R
H <- 180+(B - R)*60/S, if V=G
240+(R - G)*60/S, if V=B
- HSV2RGB: Option convert source HSV format to destination RGB format
- RGB2HLS: Option convert source 3 channel RGB image to HLS format:
Vmax <- max(R,G,B)
Vmin <- min(R,G,B)
L <- (Vmax + Vmin)/2
S <- (Vmax - Vmin)/(Vmax + Vmin) if L < 0.5
(Vmax - Vmin)/(2 - (Vmax + Vmin)) if L >= 0.5
(G - B)*60/S, if Vmax=R
H <- 180+(B - R)*60/S, if Vmax=G
240+(R - G)*60/S, if Vmax=B
- HLS2RGB: Option convert HLS format to RGB format
- RGB2Lab:Option convert source RGB format to Lab format
- Lab2RGB: Option convert Lab format to RGB format
- RGB2Luv:Option conver RGB format to Luv format
- Luv2RGB:Option convert Luv format to RGB format
- There is also conversion from BGR format to other. Function is same as in RGB format
Error codes
- Error code -11:Bad source picture position. This error means error in first parameter. Picture is not in range Picture_0 to Picture_19.
- Error code -12:Bad destination picture position. This error means error in second parameter. Picture is not in range Picture_0 to Picture_19.
- Error code -100: OpenCV error. Excplanation of this error is in result window