package main import ( "io/ioutil" "testing" "gocv.io/x/gocv" ) func TestMain(t *testing.T) { //ts := new(turbidityProbe) const ( rows = 2464 cols = 3280 ) // Read frame frame, err := ioutil.ReadFile("AusOcean_logo_1080p.h264") if err != nil { t.Fatal(err) } // Decode //mat, err := gocv.NewMatFromBytes(rows, cols, gocv.MatTypeCV8UC3, frame) mat, err := gocv.IMDecode(frame, gocv.IMReadUnchanged) if err != nil { t.Fatal(err) } if mat.Empty() { t.Fatal("Empty gocv.Mat") } gocv.IMWrite("logo.jpg", mat) }