Browse Source

增加实现OpenCV的功能,但是失败了

master
张献维 1 year ago
parent
commit
c7b3badf8e
  1. 26161
      golang_learn/data_func/go_to_opencv/haarcascade_frontalface_alt.xml
  2. 23550
      golang_learn/data_func/go_to_opencv/haarcascade_frontalface_alt2.xml
  3. 103493
      golang_learn/data_func/go_to_opencv/haarcascade_frontalface_alt_tree.xml
  4. 35712
      golang_learn/data_func/go_to_opencv/haarcascade_frontalface_default.xml
  5. 41
      golang_learn/data_func/go_to_opencv/main.go
  6. 1
      golang_learn/go.mod
  7. 2
      golang_learn/go.sum

26161
golang_learn/data_func/go_to_opencv/haarcascade_frontalface_alt.xml

File diff suppressed because it is too large

23550
golang_learn/data_func/go_to_opencv/haarcascade_frontalface_alt2.xml

File diff suppressed because it is too large

103493
golang_learn/data_func/go_to_opencv/haarcascade_frontalface_alt_tree.xml

File diff suppressed because it is too large

35712
golang_learn/data_func/go_to_opencv/haarcascade_frontalface_default.xml

File diff suppressed because it is too large

41
golang_learn/data_func/go_to_opencv/main.go

@ -0,0 +1,41 @@
package main
import (
"fmt"
"github.com/lazywei/go-opencv/opencv"
)
func main() {
fmt.Println(opencv.Version())
}
/*
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)
}
*/

1
golang_learn/go.mod

@ -27,6 +27,7 @@ require (
github.com/kbinani/screenshot v0.0.0-20210720154843-7d3a670d8329 github.com/kbinani/screenshot v0.0.0-20210720154843-7d3a670d8329
github.com/kennygrant/sanitize v1.2.4 // indirect github.com/kennygrant/sanitize v1.2.4 // indirect
github.com/kr/pretty v0.3.0 // indirect github.com/kr/pretty v0.3.0 // indirect
github.com/lazywei/go-opencv v0.0.0-20190115070742-a4fe8ec027cc
github.com/lxn/walk v0.0.0-20210112085537-c389da54e794 github.com/lxn/walk v0.0.0-20210112085537-c389da54e794
github.com/lxn/win v0.0.0-20210218163916-a377121e959e github.com/lxn/win v0.0.0-20210218163916-a377121e959e
github.com/mattn/go-adodb v0.0.1 github.com/mattn/go-adodb v0.0.1

2
golang_learn/go.sum

@ -305,6 +305,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/lazywei/go-opencv v0.0.0-20190115070742-a4fe8ec027cc h1:Eo/8ytR1c43l4AAoxT5A26wKUpS/hr8JTRCmPEUiu9Q=
github.com/lazywei/go-opencv v0.0.0-20190115070742-a4fe8ec027cc/go.mod h1:NzTIqhnXetOqnR7TfHJuIonF3nQ2y9yC51OvfXcKpn8=
github.com/ledisdb/ledisdb v0.0.0-20200510135210-d35789ec47e6/go.mod h1:n931TsDuKuq+uX4v1fulaMbA/7ZLLhjc85h7chZGBCQ= github.com/ledisdb/ledisdb v0.0.0-20200510135210-d35789ec47e6/go.mod h1:n931TsDuKuq+uX4v1fulaMbA/7ZLLhjc85h7chZGBCQ=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lucor/goinfo v0.0.0-20200401173949-526b5363a13a/go.mod h1:ORP3/rB5IsulLEBwQZCJyyV6niqmI7P4EWSmkug+1Ng= github.com/lucor/goinfo v0.0.0-20200401173949-526b5363a13a/go.mod h1:ORP3/rB5IsulLEBwQZCJyyV6niqmI7P4EWSmkug+1Ng=

Loading…
Cancel
Save