got gocv working
This commit is contained in:
parent
9ac295230d
commit
e966ef3669
1 changed files with 6 additions and 0 deletions
6
main.go
6
main.go
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue