2014-07-23 16:38:46 -07:00
|
|
|
package opencv
|
|
|
|
|
|
|
|
import (
|
|
|
|
"path"
|
|
|
|
"runtime"
|
|
|
|
"testing"
|
|
|
|
|
2017-03-27 14:10:37 -04:00
|
|
|
"gobot.io/x/gobot/gobottest"
|
2017-10-18 18:13:40 +02:00
|
|
|
"gocv.io/x/gocv"
|
2014-07-23 16:38:46 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestUtils(t *testing.T) {
|
|
|
|
_, currentfile, _, _ := runtime.Caller(0)
|
2017-10-05 17:05:10 +02:00
|
|
|
image := gocv.IMRead(path.Join(path.Dir(currentfile), "lena-256x256.jpg"), gocv.IMReadColor)
|
2017-10-23 11:45:36 +02:00
|
|
|
rect := DetectObjects("haarcascade_frontalface_alt.xml", image)
|
2016-02-22 00:21:24 -05:00
|
|
|
gobottest.Refute(t, len(rect), 0)
|
2017-10-05 17:05:10 +02:00
|
|
|
DrawRectangles(image, rect, 0, 0, 0, 0)
|
2014-07-23 16:38:46 -07:00
|
|
|
}
|