Documentation ¶
Overview ¶
Package histogram provides methods to compute approximate color histograms in the HSV color space.
Index ¶
Constants ¶
const ( // RoundClosest will round to the closest value using math.Round RoundClosest = iota // RoundUp will round to the closest bigger value using math.Ceil RoundUp // RoundDown will round to the closest lower value using math.Trunc RoundDown )
Variables ¶
This section is empty.
Functions ¶
func With32Bins ¶
With32Bins returns a color histogram with 32 bins for the input image. The values in the bins will represent the percentage of pixels mapped to a certain Hue and Saturation level. It is VERY IMPORTANT TO NOTICE that the percentages are rounded, so the sum of all percentages may not be equal to 100. The Hue will be mapped to 8 levels, indexes {0,4,8,12,16,20,24,28}. The Saturation will be mapped to 4 levels, indexes hue_level + {0,1,2,3}. The Value channel is not taken into consideration, as to give invariance to light intensity.
func With32BinsConcurrent ¶
With32BinsConcurrent returns a color histogram with 32 bins for the input image. This concurrent version will check whether the image is taller or wider and iterate over the biggest dimension of the two, using use one goroutine per column/row. The values in the bins will represent the percentage of pixels mapped to a certain Hue and Saturation level. It is VERY IMPORTANT TO NOTICE that the percentages are rounded, so the sum of all percentages may not be equal to 100. The Hue will be mapped to 8 levels, indexes {0,4,8,12,16,20,24,28}. The Saturation will be mapped to 4 levels, indexes hue_level + {0,1,2,3}. The Value channel is not taken into consideration, as to give invariance to light intensity.
func With64Bins ¶
With64Bins returns a color histogram with 64 bins for the input image. The values in the bins will represent the percentage of pixels mapped to a certain Hue, Saturation and Value level. The output can be considered as two 32 bin histograms, where the second batch of 32 bins represents colors with Value above 50. It is VERY IMPORTANT TO NOTICE that the percentages are rounded, so the sum of all percentages may not be equal to 100. The Hue will be mapped to 8 levels, indexes {0,4,8,12,16,20,24,28}. The Saturation will be mapped to 4 levels, indexes H_level + {0,1,2,3}. The Value will be mapped to 2 levels, indexes H_level + S_level + {0,32}.
func With64BinsConcurrent ¶
With64BinsConcurrent returns a color histogram with 64 bins for the input image. This concurrent version will check whether the image is taller or wider and iterate over the biggest dimension of the two, using use one goroutine per column/row. The values in the bins will represent the percentage of pixels mapped to a certain Hue, Saturation and Value level. The output can be considered as two 32 bin histograms, where the second batch of 32 bins represents colors with Value above 50. It is VERY IMPORTANT TO NOTICE that the percentages are rounded, so the sum of all percentages may not be equal to 100. The Hue will be mapped to 8 levels, indexes {0,4,8,12,16,20,24,28}. The Saturation will be mapped to 4 levels, indexes H_level + {0,1,2,3}. The Value will be mapped to 2 levels, indexes H_level + S_level + {0,32}.
Types ¶
This section is empty.