Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LinearCost ¶
Calculates the cost of merging two greyscale clusters, it represents the increase in MSE value caused by the merge
func QuantiseGreyscale ¶
Returns "m" greyscale colours to best recreate the colour palette of the original image
func VectorCost ¶
Calculates the cost of merging two colour clusters, it represents the increase in MSE value caused by the merge
Types ¶
type Histogram ¶
Histogram for PNN Nodes which are coloured
func CreatePNNHistogram ¶
Creates a PNN Histogram
type Node ¶
type Node struct { Prev *Node // Pointer to the previous Node Next *Node // Pointer to the Next Node D float64 // Merge cost value, indicating the increase in the MSE if the two classes are merged (this class and the one to the right) N float64 // Number of pixels in the class Index int // Index of the Node in the heap // Variables for greyscale quantisation C float64 // Mean grey level of the class T uint8 // Maximal grey value, also serves as threshold between the class and its neighbour class to the right // Variables for colour quantisation colours.RGB // RGB Values of the node A float64 // Alpha Value of the node (Used for non-LAB PNN) NN *Node // Pointers to the nearest neighbour MergeCount int // The iteration where the node was last merged with another UpdateCount int // The iteration where the MSE was last calculated for the node }
Node holding Colour data for PNN
Click to show internal directories.
Click to hide internal directories.