8000 nixpkgs-version.nix: bump nixpkgs to release-18.03 · LumiGuide/haskell-opencv@67fa3f1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 67fa3f1

Browse files
committed
nixpkgs-version.nix: bump nixpkgs to release-18.03
This brings in opencv-3.4.1. The `line` function from opencv now throws an exception when using a 0 width thickness or drawing a line from and to the same coordinate. The `filter2DImg` example crashed because of this. This is now fixed.
1 parent 435f448 commit 67fa3f1

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

nixpkgs-version.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
rev = "dffe1e569cd7901dbaddcd691f476860d71e78b2";
3-
sha256 = "1zrpabi3qv7r4yx8rv4ir8fz4dpwh4ix8yd31rcz88pgbws8v53g";
2+
rev = "69a03de0384d767a155a459c5385e2b316578bc0";
3+
sha256 = "15p1z8k338d9rvis9wzk8mdjvk6925g9ks0zhwa18905k19zvr1v";
44
}

opencv/src/OpenCV/ImgProc/ImgFiltering.hsc

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -523,11 +523,16 @@ filter2DImg = exceptError $
523523
(Proxy :: Proxy 1)
524524
(Proxy :: Proxy Double)
525525
black $ \\imgM -> do
526-
lift $ line imgM (V2 0 0 :: V2 Int32) (V2 0 0 :: V2 Int32) (V4 (-2) (-2) (-2) 1 :: V4 Double) 0 LineType_8 0
527-
lift $ line imgM (V2 1 0 :: V2 Int32) (V2 0 1 :: V2 Int32) (V4 (-1) (-1) (-1) 1 :: V4 Double) 0 LineType_8 0
528-
lift $ line imgM (V2 1 1 :: V2 Int32) (V2 1 1 :: V2 Int32) (V4 1 1 1 1 :: V4 Double) 0 LineType_8 0
529-
lift $ line imgM (V2 1 2 :: V2 Int32) (V2 2 1 :: V2 Int32) (V4 1 1 1 1 :: V4 Double) 0 LineType_8 0
530-
lift $ line imgM (V2 2 2 :: V2 Int32) (V2 2 2 :: V2 Int32) (V4 2 2 2 1 :: V4 Double) 0 LineType_8 0
526+
527+
let pixels :: [[Double]]
528+
pixels = [ [-2, -1, 0]
529+
, [-1, 1, 1]
530+
, [ 0, 1, 2]
531+
]
532+
533+
for_ (zip [0..] pixels) $ \\(y, row) ->
534+
for_ (zip [0..] row) $ \\(x, elem) ->
535+
unsafeWrite imgM [y,x] 0 elem
531536
@
532537
533538
<<doc/generated/examples/filter2DImg.png filter2DImg>>

0 commit comments

Comments
 (0)
0