Open drull95 opened 7 years ago
It look likes you found a bug in the JuicyPixels conversion function OpenCV.Juicy.fromImage
!
Until we can fix that bug I suggest you use OpenCV.ImgCodecs.imdecode
.
Your program with imdecode
(untested):
{-# language DataKinds #-}
import Codec.Picture
import qualified Data.ByteString as B
import OpenCV.HighGui
import qualified OpenCV as CV
import System.FilePath
workingDir = "/home/cmo/src/fps-bot/data"
thumbnail = workingDir </> "level-thumbnail.png"
startScreen = workingDir </> "screen-0169.png"
loadImage :: FilePath -> IO (CV.Mat ('S ['D, 'D]) 'D 'D)
loadImage path = CV.imdecode CV.ImreadColor <$> B.readFile path
main = do
w <- makeWindow "hello"
thum<- loadImage thumbnail
start<- loadImage startScreen
-- imshow w thum
imshow w start
waitKey 5000
Thank you for reporting the bug!
this program:
results in this error:
I've put the png files online at github.com/drull95/fps-bot. Any help is greatly appreciated.