hybridgroup.gobot/platforms/opencv/utils_test.go

19 lines
418 B
Go
Raw Permalink Normal View History

2014-07-24 07:38:46 +08:00
package opencv
import (
"path"
"runtime"
"testing"
"gobot.io/x/gobot/gobottest"
"gocv.io/x/gocv"
2014-07-24 07:38:46 +08:00
)
func TestUtils(t *testing.T) {
_, currentfile, _, _ := runtime.Caller(0)
image := gocv.IMRead(path.Join(path.Dir(currentfile), "lena-256x256.jpg"), gocv.IMReadColor)
rect := DetectObjects("haarcascade_frontalface_alt.xml", image)
gobottest.Refute(t, len(rect), 0)
DrawRectangles(image, rect, 0, 0, 0, 0)
2014-07-24 07:38:46 +08:00
}