forked from go/golangs_learn
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
954 B
41 lines
954 B
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/lazywei/go-opencv/opencv"
|
|
)
|
|
|
|
func main() {
|
|
fmt.Println(opencv.Size{})
|
|
}
|
|
|
|
/*
|
|
func main() {
|
|
// 加载图像
|
|
imagePath := "E:\\VivimanZhang\\OneDrive\\归档\\图片\\正式头像.jpg"
|
|
image := opencv.LoadImage(imagePath)
|
|
if image == nil {
|
|
fmt.Printf("Error loading image: %s\n", imagePath)
|
|
return
|
|
}
|
|
defer image.Release()
|
|
|
|
// 加载Haar级联分类器XML文件(用于人脸检测)
|
|
classifier := opencv.LoadHaarClassifierCascade("E:\\Code-Go\\Golang学习项目\\golang_learn\\data_func\\go_to_opencv\\haarcascade_frontalface_default.xml")
|
|
if classifier == nil {
|
|
fmt.Println("Error loading Haar classifier")
|
|
return
|
|
}
|
|
defer classifier.Release()
|
|
|
|
// 进行人脸检测
|
|
faces := classifier.DetectObjects(image)
|
|
fmt.Printf("Found %d faces\n", len(faces))
|
|
|
|
// 显示图像
|
|
window := opencv.NewWindow("Face Detection")
|
|
defer window.Destroy()
|
|
window.ShowImage(image)
|
|
opencv.WaitKey(0)
|
|
}
|
|
*/
|
|
|