mirror of
https://github.com/esimov/pigo.git
synced 2025-10-08 01:20:07 +08:00
Change pointer array to uint8
This commit is contained in:
@@ -45,7 +45,7 @@ func FindFaces(pixels []uint8) uintptr {
|
|||||||
det = append([]int{len(result), 0, 0}, det...)
|
det = append([]int{len(result), 0, 0}, det...)
|
||||||
|
|
||||||
// Convert the slice into an array pointer.
|
// Convert the slice into an array pointer.
|
||||||
s := *(*[]int)(unsafe.Pointer(&det))
|
s := *(*[]uint8)(unsafe.Pointer(&det))
|
||||||
p := uintptr(unsafe.Pointer(&s[0]))
|
p := uintptr(unsafe.Pointer(&s[0]))
|
||||||
|
|
||||||
// Ensure `det` is not freed up by GC prematurely.
|
// Ensure `det` is not freed up by GC prematurely.
|
||||||
@@ -61,7 +61,7 @@ func FindFaces(pixels []uint8) uintptr {
|
|||||||
// and returns a cluster with the detected faces coordinates.
|
// and returns a cluster with the detected faces coordinates.
|
||||||
func clusterDetection(pixels []uint8, rows, cols int) []pigo.Detection {
|
func clusterDetection(pixels []uint8, rows, cols int) []pigo.Detection {
|
||||||
cParams := pigo.CascadeParams{
|
cParams := pigo.CascadeParams{
|
||||||
MinSize: 20,
|
MinSize: 100,
|
||||||
MaxSize: 1000,
|
MaxSize: 1000,
|
||||||
ShiftFactor: 0.15,
|
ShiftFactor: 0.15,
|
||||||
ScaleFactor: 1.1,
|
ScaleFactor: 1.1,
|
||||||
|
Reference in New Issue
Block a user