Created
February 20, 2017 16:50
-
-
Save paulocoutinhox/cc216198f49b7c5aa5268eb736a0d7e4 to your computer and use it in GitHub Desktop.
Sample Go program showing integration with image-detect library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
/* | |
#cgo pkg-config: opencv | |
#cgo CFLAGS: -I/Users/paulo/Developer/workspaces/cpp/image-detect/lib/include -I/usr/include | |
#cgo LDFLAGS: -L/Users/paulo/Developer/workspaces/cpp/image-detect/build -limage-detect | |
#include "image-detect.h" | |
*/ | |
import "C" | |
import ( | |
"log" | |
"os" | |
) | |
func main() { | |
imageDetectHome := os.Getenv("IMAGE_DETECT_HOME") | |
screenImagePath := imageDetectHome + "/extras/images/screen.png" | |
detectImagePath := imageDetectHome + "/extras/images/detect.png" | |
outputImagePath := imageDetectHome + "/extras/images/diff.png" | |
result := C.process(C.String(screenImagePath), C.String(detectImagePath), C.String(outputImagePath)) | |
log.Print(result) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Error that i get: