Skip to content

Commit

Permalink
Simplify the the filter interface by hidding internals
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelJ committed Jan 11, 2015
1 parent 7e3a4d4 commit c6ada8b
Show file tree
Hide file tree
Showing 21 changed files with 1,013 additions and 739 deletions.
4 changes: 3 additions & 1 deletion changelog
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
v0.2 December 2014
BREAKING CHANGES:
* Origin is on the upper left corner of the image (was bottom left).
* New Filter interface.
* New simplified filters interface. The old interface is still used
internally to create filters and is available in
Vision.Image.Filter.Internal.
* DevIL bindings (Vision.Image.Storage) are now in a separate package
(friday-devil) and with an improved interface.
* Benchmarks are now in a separate package (friday-bench).
Expand Down
1 change: 1 addition & 0 deletions friday.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ library
Vision.Image.Grey.Specialize
Vision.Image.Grey.Type
Vision.Image.Filter
Vision.Image.Filter.Internal
Vision.Image.HSV
Vision.Image.HSV.Conversion
Vision.Image.HSV.Specialize
Expand Down
10 changes: 6 additions & 4 deletions src/Vision/Detector/Edge.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{-# LANGUAGE BangPatterns, FlexibleContexts, MultiWayIf #-}
{-# LANGUAGE BangPatterns
, FlexibleContexts
, MultiWayIf #-}

module Vision.Detector.Edge (canny) where

Expand All @@ -12,7 +14,7 @@ import Vision.Image (
Image, ImagePixel, Manifest, MutableManifest, Grey, DerivativeType (..)
, (!), shape, linearIndex, fromFunction
, create, new', linearRead, linearWrite
, apply, sobel
, sobel
)
import Vision.Primitive (Z (..), (:.) (..), inShape, ix2)

Expand Down Expand Up @@ -64,8 +66,8 @@ canny !derivSize !lowThres !highThres !img =
(!lowThres', !highThres') = (square lowThres, square highThres)

dx, dy :: Manifest Int16
!dx = sobel derivSize DerivativeX `apply` img
!dy = sobel derivSize DerivativeY `apply` img
!dx = sobel derivSize DerivativeX img
!dy = sobel derivSize DerivativeY img

-- Gradient magnitude, squared.
dxy :: Manifest Int32
Expand Down
8 changes: 6 additions & 2 deletions src/Vision/Histogram.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{-# LANGUAGE BangPatterns, FlexibleContexts, FlexibleInstances
, ParallelListComp, TypeFamilies, TypeOperators #-}
{-# LANGUAGE BangPatterns
, FlexibleContexts
, FlexibleInstances
, ParallelListComp
, TypeFamilies
, TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}

-- | Contains functions to compute and manipulate histograms as well as some
Expand Down
Loading

0 comments on commit c6ada8b

Please sign in to comment.