got gocv working

This commit is contained in:
BroodjeAap 2020-06-30 20:30:41 +00:00
parent 9ac295230d
commit e966ef3669

View file

@ -3,12 +3,15 @@ package main
import ( import (
"crypto/sha256" "crypto/sha256"
"encoding/base64" "encoding/base64"
"fmt"
"io/ioutil" "io/ioutil"
"log" "log"
"net/http" "net/http"
"os" "os"
"path/filepath" "path/filepath"
"text/template" "text/template"
"gocv.io/x/gocv"
) )
// StreamURL Unexported // StreamURL Unexported
@ -54,6 +57,9 @@ func stream(w http.ResponseWriter, r *http.Request) {
saveStreamInstant(URL, img) saveStreamInstant(URL, img)
w.Write([]byte(img)) w.Write([]byte(img))
gocvImg := gocv.IMRead(filepath.Join(".", "streams", "vERFlpF_5Y-AgJ06PjD8-LtylFJXEjbqJp0g3he5Ngs=", "current.jpg"), gocv.IMReadColor)
fmt.Println(gocvImg.Empty())
} }
func saveStreamInstant(URL string, img []byte) { func saveStreamInstant(URL string, img []byte) {