Created
May 7, 2014 20:04
-
-
Save aavogt/59da0e98bfeaac0c9f1b to your computer and use it in GitHub Desktop.
opencv createVideoWriter needs a more restrictive type?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DataKinds #-} | |
module Main where | |
import OpenCV.HighCV | |
import OpenCV.Core.Image | |
main = do | |
cap <- createFileCapture "in.avi" | |
Just img <- cap | |
w <- createVideoWriter "out.avi" ('M','J','P','G') 1 (width img, height img) | |
w ( convertRGBToGray (img :: Image Trichromatic Word8 NoROI) ) | |
-- fails (segfault, or fails to actually produce out.avi). Works just fine | |
-- when replacing the convertRGBToGray with id | |
-- | |
-- so should createVideoWriter produce a function of type: | |
-- | |
-- Image Trichromatic d r -> IO () |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment