    cb <- mk'CvErrorCallback catch
    c'cvRedirectError cb nullPtr nullPtr
    c'cvSetErrMode c'CV_ErrModeSilent
-


setCOI :: (Enum a) => a -> MutableImage (ChannelOf a) d -> IO ()
setCOI chnl image = withMutableImage image $ \i ->
                            {#call cvSetImageCOI#} i (fromIntegral . (+1) . fromEnum $ chnl) 
                            -- CV numbers channels starting from 1. 0 means all channels

resetCOI :: MutableImage a d -> IO ()

-- | Convert an image to from arbitrary bit depth into 64 bit, floating point, image.
--   This conversion does preserve the color space.
-- Note: this function is named unsafe because it will lose information
-- from the image.
unsafeImageTo64F :: Image c d -> Image c D64
unsafeImageTo64F img = unsafePerformIO $ withGenImage img $ \image ->
                creatingImage
