got decoding/encoding in/out gocv working
This commit is contained in:
parent
90a0fef1c4
commit
90a8832ab9
1 changed files with 4 additions and 4 deletions
8
main.go
8
main.go
|
@ -3,7 +3,6 @@ package main
|
||||||
import (
|
import (
|
||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"fmt"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
@ -56,10 +55,11 @@ func stream(w http.ResponseWriter, r *http.Request) {
|
||||||
// TODO async for this?
|
// TODO async for this?
|
||||||
saveStreamInstant(URL, img)
|
saveStreamInstant(URL, img)
|
||||||
|
|
||||||
w.Write([]byte(img))
|
mat, err := gocv.IMDecode(img, gocv.IMReadColor)
|
||||||
|
|
||||||
gocvImg := gocv.IMRead(filepath.Join(".", "streams", "vERFlpF_5Y-AgJ06PjD8-LtylFJXEjbqJp0g3he5Ngs=", "current.jpg"), gocv.IMReadColor)
|
gocvIMG, err := gocv.IMEncode(".jpg", mat)
|
||||||
fmt.Println(gocvImg.Empty())
|
|
||||||
|
w.Write(gocvIMG)
|
||||||
}
|
}
|
||||||
|
|
||||||
func saveStreamInstant(URL string, img []byte) {
|
func saveStreamInstant(URL string, img []byte) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue