opencv-extra-0.2.0.1: Haskell binding to OpenCV-3.x extra modules

Safe HaskellNone
LanguageHaskell2010

OpenCV.Extra.XPhoto

Synopsis

Documentation

dctDenoising Source #

Arguments

:: Double

expected noise standard deviation

-> Maybe Int32

size of block side where dct is computed use default 16

-> Mat (S [h, w]) (S 3) (S Word8)

Input image 8-bit 3-channel image.

-> CvExcept (Mat (S [h, w]) (S 3) (S Word8))

Output image same size and type as input.

Perform dctDenoising function for colored images.

Example:

dctDenoisingImg
    :: forall h w w2 c d
     . ( Mat (ShapeT [h, w]) ('S c) ('S d) ~ Lenna_512x512
       , w2 ~ ((*) w 2)
       )
    => Mat ('S ['S h, 'S w2]) ('S c) ('S d)
dctDenoisingImg = exceptError $ do
    denoised <- dctDenoising 10 Nothing lenna_512x512
    withMatM
      (Proxy :: Proxy [h, w2])
      (Proxy :: Proxy c)
      (Proxy :: Proxy d)
      black $ \imgM -> do
        matCopyToM imgM (V2 0 0) lenna_512x512 Nothing
        matCopyToM imgM (V2 w 0) denoised Nothing
  where
    w = fromInteger $ natVal (Proxy :: Proxy w)