Skip to content

Instantly share code, notes, and snippets.

@aavogt
Created May 7, 2014 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aavogt/59da0e98bfeaac0c9f1b to your computer and use it in GitHub Desktop.
Save aavogt/59da0e98bfeaac0c9f1b to your computer and use it in GitHub Desktop.
opencv createVideoWriter needs a more restrictive type?
{-# 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