Reference

Table of Contents  ▸  List of Commands  ▸  User KaRo's CLI functions  ▸  kr_mean_lch◀  example_descriptive_feature    |    karo_shape_moments  ▶

kr_mean_lch

Arguments:

Description:

Calculate LCH color features from selected RGB image after application of rgb2lch [ mean l(uminance), c(hromaticity), h(hue), sd l, c, h ] returned in status and global variable _kr_mean_lch. Mean and sd of h is the circular mean and sd of hue (angles)! There is no test of image mode RGB!

mode==0 return original (default)
mode==1 return original and image generated from original l(uminance) and mean c, mean h
mode==2 return original and const. image generated from mean l(uminance), mean c, mean h
mode==3 return original and image generated from l(uminance), c, mean h
mode==4 return original and image generated from l(uminance), mean c, h

Default values:

mode=0

Examples of use:

• Example #1

$ gmic sp wall kr_mean_lch. 1 (${}) s. x,2 rm.

Command: sp wall kr_mean_lch. 1 (${}) s. x,2 rm.
Command: sp wall kr_mean_lch. 1 (${}) s. x,2 rm.
Command: sp wall kr_mean_lch. 1 (${}) s. x,2 rm.

• Example #2

$ gmic sp +luminance threshold. 50% karo_close. 15,1 +extract_region.. .,0,1 kr_mean_lch. 0 (${}) rm.. +rgb2lch... s. c f.. {-4,@1} f. {-4,@2} a[-1--3] c lch2rgb. rm.. f. I=i#-2?I:I#-3 # Replace region with mean chromaticity amd mean hue

Command: sp +luminance threshold. 50% karo_close. 15,1 +extract_region.. .,0,1 kr_mean_lch. 0 (${}) rm.. +rgb2lch... s. c f.. {-4,@1} f. {-4,@2} a[-1--3] c lch2rgb. rm.. f. I=i#-2?I:I#-3 # Replace region with mean chromaticity amd mean hue
Command: sp +luminance threshold. 50% karo_close. 15,1 +extract_region.. .,0,1 kr_mean_lch. 0 (${}) rm.. +rgb2lch... s. c f.. {-4,@1} f. {-4,@2} a[-1--3] c lch2rgb. rm.. f. I=i#-2?I:I#-3 # Replace region with mean chromaticity amd mean hue
Command: sp +luminance threshold. 50% karo_close. 15,1 +extract_region.. .,0,1 kr_mean_lch. 0 (${}) rm.. +rgb2lch... s. c f.. {-4,@1} f. {-4,@2} a[-1--3] c lch2rgb. rm.. f. I=i#-2?I:I#-3 # Replace region with mean chromaticity amd mean hue