| | |
| | | package gosdk |
| | | |
| | | /* |
| | | #cgo CFLAGS: -I. -I./sdk/face/include -I./sdk/darknet/include -I/usr/local/cuda/include -w -g |
| | | #cgo CXXFLAGS: -I. -I./sdk/face/include -I./sdk/darknet/include -I/usr/local/cuda/include -w -g -std=c++11 |
| | | #cgo LDFLAGS: -L/usr/local/cuda/lib64 -L${SRCDIR}/sdk/face/lib/gpu -L${SRCDIR}/sdk/darknet/lib |
| | | #cgo CFLAGS: -I. -I./sdk/face/include -I./sdk/darknet/include -I/usr/local/cuda/include -I./sdk/plate/include -w -g |
| | | #cgo CXXFLAGS: -I. -I./sdk/face/include -I./sdk/darknet/include -I/usr/local/cuda/include -I./sdk/plate/include -w -g -std=c++11 |
| | | #cgo LDFLAGS: -L/usr/local/cuda/lib64 -L${SRCDIR}/sdk/face/lib/gpu -L${SRCDIR}/sdk/darknet/lib -L${SRCDIR}/sdk/plate/lib |
| | | #cgo LDFLAGS: -Wl,-rpath,${SRCDIR}/sdk/face/lib/gpu:${SRCDIR}/sdk/darknet/lib |
| | | #cgo LDFLAGS: -ldarknet -lTHFaceImage -lTHFeature -lTHFaceProperty -lTHFaceTracking -lcudart -lcublas -lcurand -lrt -ldl -lpthread |
| | | #cgo LDFLAGS: -ldarknet -lTHFaceImage -lTHFeature -lTHFaceProperty -lTHFaceTracking -lcudart -lcublas -lcurand -lrt -ldl -lpthread -lthplateid |
| | | #include <stdlib.h> |
| | | #include "csdk.h" |
| | | */ |
| | |
| | | *LastTrackID = id |
| | | return allObjs, newObjs |
| | | } |
| | | |
| | | // InitPlateIDDetector init plateid detector |
| | | func InitPlateIDDetector(width, height int, soPath []byte) { |
| | | C.c_api_plate_id_init(C.int(width), C.int(height), (*C.char)(unsafe.Pointer(&soPath[0]))) |
| | | } |
| | | |
| | | // PlateIDDetect plateid detect |
| | | func PlateIDDetect(img SDKImage) []CPlateIDResult { |
| | | data := img.Data |
| | | w := img.Width |
| | | h := img.Height |
| | | |
| | | var count C.int |
| | | cppos := C.c_api_plate_id_detect(&count, (*C.uchar)(unsafe.Pointer(&data[0])), C.int(w), C.int(h)) |
| | | if cppos != nil { |
| | | defer C.free(unsafe.Pointer(cppos)) |
| | | return CPlateIDPosArrayToGoArray(unsafe.Pointer(cppos), int(count)) |
| | | } |
| | | return nil |
| | | } |
| | | |
| | | func FreePlateIdDetector() int{ |
| | | return int(C.c_api_plate_id_free()) |
| | | } |