[OpenCV] Chapter01-04 Show image into window
Show image into window
Source Code
package main
import (
"log"
"gocv.io/x/gocv"
)
func main() {
imageFilePath := "../../data/Lena.png"
mat := gocv.IMRead(imageFilePath, gocv.IMReadAnyColor)
if mat.Empty() {
log.Panic("Can not read Image file : ", imageFilePath)
return
}
window := gocv.NewWindow("Original Image")
defer window.Close()
window.IMShow(mat)
gocv.WaitKey(5000) // if you want to show continually, 5000 -> -1
}

Comments
Post a Comment