ssa
1package goroi2
3import (4"fmt"5"image/color"6"math"7"testing"8)
9
10func TestCoords(t *testing.T) {11// "cascade/facefinder"12p, ErrPig := NewPigs("../../cascade/facefinder")13if ErrPig != nil {14t.Error(ErrPig)15}16R, G, B, ErrCoords := p.Coords2("tests/0200.png")17if ErrCoords != nil {18t.Error(ErrCoords)19}20// 200 - 138.4217 111.4517 92.779821// 300 - 138.3724 111.1482 92.433022fmt.Println(R, G, B)23
24var r uint32 = 2672825var g uint32 = 2338726var b uint32 = 1747627fmt.Println(uint8(r>>8), uint8(g>>8), uint8(b>>8))28// _, cb, cr := ycbcr(r, g, b)29_, cb, cr := color.YCbCrToRGB(uint8(r>>8), uint8(g>>8), uint8(b>>8))30h, _, _ := RGBAToHSV(r, g, b, math.MaxUint32)31fmt.Println("cb,cr,h", cb, cr, h)32
33fmt.Println("math.MaxUint8 ", math.MaxUint8)34fmt.Println("math.MaxUint16", math.MaxUint16)35fmt.Println("math.MaxUint32", math.MaxUint32)36
37}
38