<div dir="ltr"><p style="box-sizing:border-box;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px;margin-top:0px">Hi folks!</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">I'm trying to build<span class="inbox-inbox-Apple-converted-space"> </span><a href="http://lumiguide.github.io/haskell-opencv/doc/index.html" style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration-line:none"><code style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:11.9px;padding:0.2em 0px;margin:0px;background-color:rgba(27,31,35,0.05);border-radius:3px">opencv</code></a><span class="inbox-inbox-Apple-converted-space"> </span>as dependency on my macOS Sierra. I stuck with missing<span class="inbox-inbox-Apple-converted-space"> </span><code style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:11.9px;padding:0.2em 0px;margin:0px;background-color:rgba(27,31,35,0.05);border-radius:3px">_contrib</code><span class="inbox-inbox-Apple-converted-space"> </span>and<span class="inbox-inbox-Apple-converted-space"> </span><code style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:11.9px;padding:0.2em 0px;margin:0px;background-color:rgba(27,31,35,0.05);border-radius:3px">_legacy</code><span class="inbox-inbox-Apple-converted-space"> </span>C libraries. I've installed OpenCV with contrib packages via brew. Here are the steps I've done.</p><h2 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom:1px solid rgb(234,236,239);color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">Installation</h2><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">I have installed<span class="inbox-inbox-Apple-converted-space"> </span><code style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:11.9px;padding:0.2em 0px;margin:0px;background-color:rgba(27,31,35,0.05);border-radius:3px">opencv</code><span class="inbox-inbox-Apple-converted-space"> </span>via brew (with some<span class="inbox-inbox-Apple-converted-space"> </span><a href="http://www.pyimagesearch.com/2017/05/15/resolving-macos-opencv-homebrew-install-errors/" style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration-line:none">patches</a><span class="inbox-inbox-Apple-converted-space"> </span>of brew formula):</p><div class="inbox-inbox-highlight inbox-inbox-highlight-source-shell" style="box-sizing:border-box;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px;overflow:visible"><pre style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:11.9px;margin-top:0px;margin-bottom:0px;font-stretch:normal;line-height:1.45;word-wrap:normal;padding:16px;overflow:auto;background-color:rgb(246,248,250);border-radius:3px;word-break:normal">brew install opencv3 --with-contrib --with-python3

python
Python 3.6.1 (default, Apr  4 2017, 09:40:21) 
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.38)] on darwin
Type <span class="inbox-inbox-pl-s" style="box-sizing:border-box;color:rgb(3,47,98)"><span class="inbox-inbox-pl-pds" style="box-sizing:border-box">"</span>help<span class="inbox-inbox-pl-pds" style="box-sizing:border-box">"</span></span>, <span class="inbox-inbox-pl-s" style="box-sizing:border-box;color:rgb(3,47,98)"><span class="inbox-inbox-pl-pds" style="box-sizing:border-box">"</span>copyright<span class="inbox-inbox-pl-pds" style="box-sizing:border-box">"</span></span>, <span class="inbox-inbox-pl-s" style="box-sizing:border-box;color:rgb(3,47,98)"><span class="inbox-inbox-pl-pds" style="box-sizing:border-box">"</span>credits<span class="inbox-inbox-pl-pds" style="box-sizing:border-box">"</span></span> or <span class="inbox-inbox-pl-s" style="box-sizing:border-box;color:rgb(3,47,98)"><span class="inbox-inbox-pl-pds" style="box-sizing:border-box">"</span>license<span class="inbox-inbox-pl-pds" style="box-sizing:border-box">"</span></span> <span class="inbox-inbox-pl-k" style="box-sizing:border-box;color:rgb(215,58,73)">for</span> more information.
<span class="inbox-inbox-pl-k" style="box-sizing:border-box;color:rgb(215,58,73)">>>></span> import cv2
<span class="inbox-inbox-pl-k" style="box-sizing:border-box;color:rgb(215,58,73)">>>></span> cv2.__version__
<span class="inbox-inbox-pl-s" style="box-sizing:border-box;color:rgb(3,47,98)"><span class="inbox-inbox-pl-pds" style="box-sizing:border-box">'</span>3.2.0<span class="inbox-inbox-pl-pds" style="box-sizing:border-box">'</span></span></pre></div><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">I have not installed Python 2.7 bindings. Python 3.6 only.</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">Now<span class="inbox-inbox-Apple-converted-space"> </span><code style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:11.9px;padding:0.2em 0px;margin:0px;background-color:rgba(27,31,35,0.05);border-radius:3px">stack build</code><span class="inbox-inbox-Apple-converted-space"> </span>need some attention too:</p><div class="inbox-inbox-highlight inbox-inbox-highlight-source-shell" style="box-sizing:border-box;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px;overflow:visible"><pre style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:11.9px;margin-top:0px;margin-bottom:0px;font-stretch:normal;line-height:1.45;word-wrap:normal;padding:16px;overflow:auto;background-color:rgb(246,248,250);border-radius:3px;word-break:normal">stack build
opencv-0.0.1.0: configure
Progress: 1/2
--  While building package opencv-0.0.1.0 using:
    Configuring opencv-0.0.1.0...
    setup: Missing dependencies on foreign libraries:
    <span class="inbox-inbox-pl-k" style="box-sizing:border-box;color:rgb(215,58,73)">*</span> Missing C libraries: opencv_calib3d, opencv_imgproc, opencv_contrib,
    opencv_legacy,
    This problem can usually be solved by installing the system packages that
    provide these libraries (you may need the <span class="inbox-inbox-pl-s" style="box-sizing:border-box;color:rgb(3,47,98)"><span class="inbox-inbox-pl-pds" style="box-sizing:border-box">"</span>-dev<span class="inbox-inbox-pl-pds" style="box-sizing:border-box">"</span></span> versions). If the libraries
    are already installed but <span class="inbox-inbox-pl-k" style="box-sizing:border-box;color:rgb(215,58,73)">in</span> a non-standard location <span class="inbox-inbox-pl-k" style="box-sizing:border-box;color:rgb(215,58,73)">then</span> you can use the
    flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are.</pre></div><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">Following suggestion I've tried specify include and lib dirs:</p><div class="inbox-inbox-highlight inbox-inbox-highlight-source-shell" style="box-sizing:border-box;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px;overflow:visible"><pre style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:11.9px;margin-top:0px;margin-bottom:0px;font-stretch:normal;line-height:1.45;word-wrap:normal;padding:16px;overflow:auto;background-color:rgb(246,248,250);border-radius:3px;word-break:normal">stack build --extra-lib-dirs=/usr/local/opt/opencv3/lib --extra-include-dirs=/usr/local/opt/opencv3/include
opencv-0.0.1.0: configure
Progress: 1/2
--  While building package opencv-0.0.1.0 using:
    Configuring opencv-0.0.1.0...
    setup: Missing dependencies on foreign libraries:
    <span class="inbox-inbox-pl-k" style="box-sizing:border-box;color:rgb(215,58,73)">*</span> Missing C libraries: opencv_contrib, opencv_legacy,
    This problem can usually be solved by installing the system packages that
    provide these libraries (you may need the <span class="inbox-inbox-pl-s" style="box-sizing:border-box;color:rgb(3,47,98)"><span class="inbox-inbox-pl-pds" style="box-sizing:border-box">"</span>-dev<span class="inbox-inbox-pl-pds" style="box-sizing:border-box">"</span></span> versions). If the libraries
    are already installed but <span class="inbox-inbox-pl-k" style="box-sizing:border-box;color:rgb(215,58,73)">in</span> a non-standard location <span class="inbox-inbox-pl-k" style="box-sizing:border-box;color:rgb(215,58,73)">then</span> you can use the
    flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are.</pre></div><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">I have no idea how to find where missing libraries are located.</p><p style="box-sizing:border-box;margin-top:0px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px;margin-bottom:0px">Would appreciate any help! Arthur!</p></div>