gobot.io/x/gobot@v1.16.0/platforms/opencv/utils_test.go (about)

     1  package opencv
     2  
     3  import (
     4  	"path"
     5  	"runtime"
     6  	"testing"
     7  
     8  	"gobot.io/x/gobot/gobottest"
     9  	"gocv.io/x/gocv"
    10  )
    11  
    12  func TestUtils(t *testing.T) {
    13  	_, currentfile, _, _ := runtime.Caller(0)
    14  	image := gocv.IMRead(path.Join(path.Dir(currentfile), "lena-256x256.jpg"), gocv.IMReadColor)
    15  	rect := DetectObjects("haarcascade_frontalface_alt.xml", image)
    16  	gobottest.Refute(t, len(rect), 0)
    17  	DrawRectangles(image, rect, 0, 0, 0, 0)
    18  }