<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; 3.4.3</li>
<li>Operating System / Platform =&gt; macOS High Sierra (10.13.6)</li>
<li>Compiler =&gt; Apple LLVM version 10.0.0 (clang-1000.10.44.2)</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">I'm using a mouse callback on a window created with HighGUI in order to retrieve the X/Y coordinates of the mouse pointer when the user click inside the image. The returned coordinates are correct along the X axis, but off along the Y axis. In particular, if I click at the top of the image (where the Y coordinates should be 0), nothing happens. I have to click several pixels below the top of the image (maybe 15-20 pixels) to get a response (0 instead of 15-20). If I click at the very bottom of the image (where the Y coordinates should be the height of the image), I get the correct response. It is like the active part of the image (that is the one in which a click generates a response) is compressed along the Y axis relative to the actual height occupied by the image.</p>
<p dir="auto">Note that this bug might be similar to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="182837879" data-permission-text="Title is private" data-url="https://github.com/opencv/opencv/issues/7485" data-hovercard-type="issue" data-hovercard-url="/opencv/opencv/issues/7485/hovercard" href="https://github.com/opencv/opencv/issues/7485">#7485</a>, but I wasn't certain of it.</p>
<h5 dir="auto">Steps to reproduce</h5>
<p dir="auto">Below is the code I used.</p>
<div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="struct ClickData {
  int x;
  int y;
  int button;
};

void onMouse(int event, int x, int y, int flags, void* data) {
  ClickData* p = (ClickData*) data;

  if  (event == cv::EVENT_LBUTTONDOWN) {
    p-&gt;x = x;
    p-&gt;y = y;
    p-&gt;button = 0;
  } else if (event == cv::EVENT_RBUTTONDOWN) {
    p-&gt;x = x;
    p-&gt;y = y;
    p-&gt;button = 1;
  }
}

ClickData _click(std::string window_name) {
  ClickData d;
  d.button = -1;
  cv::setMouseCallback(window_name, onMouse, &amp;d);

  while (d.button == -1) {
    cv::waitKey(10);
  }
  return d;
}"><pre class="notranslate"><span class="pl-k">struct</span> <span class="pl-en">ClickData</span> {
  <span class="pl-k">int</span> x;
  <span class="pl-k">int</span> y;
  <span class="pl-k">int</span> button;
};

<span class="pl-k">void</span> <span class="pl-en">onMouse</span>(<span class="pl-k">int</span> event, <span class="pl-k">int</span> x, <span class="pl-k">int</span> y, <span class="pl-k">int</span> flags, <span class="pl-k">void</span>* data) {
  ClickData* p = (ClickData*) data;

  <span class="pl-k">if</span>  (event == cv::EVENT_LBUTTONDOWN) {
    p-&gt;<span class="pl-smi">x</span> = x;
    p-&gt;<span class="pl-smi">y</span> = y;
    p-&gt;<span class="pl-smi">button</span> = <span class="pl-c1">0</span>;
  } <span class="pl-k">else</span> <span class="pl-k">if</span> (event == cv::EVENT_RBUTTONDOWN) {
    p-&gt;<span class="pl-smi">x</span> = x;
    p-&gt;<span class="pl-smi">y</span> = y;
    p-&gt;<span class="pl-smi">button</span> = <span class="pl-c1">1</span>;
  }
}

ClickData <span class="pl-en">_click</span>(std::string window_name) {
  ClickData d;
  d.<span class="pl-smi">button</span> = -<span class="pl-c1">1</span>;
  <span class="pl-c1">cv::setMouseCallback</span>(window_name, onMouse, &amp;d);

  <span class="pl-k">while</span> (d.<span class="pl-smi">button</span> == -<span class="pl-c1">1</span>) {
    <span class="pl-c1">cv::waitKey</span>(<span class="pl-c1">10</span>);
  }
  <span class="pl-k">return</span> d;
}</pre></div>
<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; 3.4.4</li>
<li>Operating System / Platform =&gt; Ubuntu 16.04</li>
<li>Compiler =&gt; gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">I am trying to install OpenCV3.4.4 with contrib modules. The issue is I have several python versions in my system and I'm unable to to get it to install in the required place even after correctly setting up all cmake flags.</p>
<h5 dir="auto">Steps to reproduce</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="mkdir build
cd build
sudo cmake -D CMAKE_BUILD_TYPE=RELEASE \
                    -D CMAKE_INSTALL_PREFIX=/usr/local \ 
                    -D INSTALL_PYTHON_EXAMPLES=ON \ 
                    -D INSTALL_C_EXAMPLES=OFF \
                    -D OPENCV_ENABLE_NONFREE=ON \
                    -D OPENCV_EXTRA_MODULES_PATH=~/OpenCV/opencv_contrib/modules \
                    -D PYTHON_DEFAULT_EXECUTABLE=~/anaconda3/bin/python3.6 \ 
                    -D PYTHON_PACKAGES_PATH=~/anaconda3/lib/python3.6/site-packages/ \
                    -D PYTHON_LIBRARY=~/anaconda3/lib/libpython3.6m.so \
                    -D PYTHON_INCLUDE=~/anaconda3/include/python3.6m \
                    -D PYTHON_NUMPY_INCLUDE_DIRS=~/anaconda3/lib/python3.6/site -packages/numpy/core/include \ 
                    -D BUILD_NEW_PYTHON_SUPPORT=ON \ 
                    -D BUILD_opencv_python3=ON \
                    -D HAVE_opencv_python3=ON .."><pre class="notranslate"><code class="notranslate">mkdir build
cd build
sudo cmake -D CMAKE_BUILD_TYPE=RELEASE \
                    -D CMAKE_INSTALL_PREFIX=/usr/local \ 
                    -D INSTALL_PYTHON_EXAMPLES=ON \ 
                    -D INSTALL_C_EXAMPLES=OFF \
                    -D OPENCV_ENABLE_NONFREE=ON \
                    -D OPENCV_EXTRA_MODULES_PATH=~/OpenCV/opencv_contrib/modules \
                    -D PYTHON_DEFAULT_EXECUTABLE=~/anaconda3/bin/python3.6 \ 
                    -D PYTHON_PACKAGES_PATH=~/anaconda3/lib/python3.6/site-packages/ \
                    -D PYTHON_LIBRARY=~/anaconda3/lib/libpython3.6m.so \
                    -D PYTHON_INCLUDE=~/anaconda3/include/python3.6m \
                    -D PYTHON_NUMPY_INCLUDE_DIRS=~/anaconda3/lib/python3.6/site -packages/numpy/core/include \ 
                    -D BUILD_NEW_PYTHON_SUPPORT=ON \ 
                    -D BUILD_opencv_python3=ON \
                    -D HAVE_opencv_python3=ON ..
</code></pre></div>
<p dir="auto">The entire output is attached as a text file:</p>
<p dir="auto"><a href="https://github.com/opencv/opencv/files/2777273/op_log.txt">op_log.txt</a></p>
<p dir="auto">Of relevance:</p>
<p dir="auto">--   Python 3:<br>
--     Interpreter:                 /usr/bin/python3 (ver 3.5.2)<br>
--     Libraries:                   NO<br>
--     numpy:                       NO (Python3 wrappers can not be generated)<br>
--     packages path:               lib/python3.5/dist-packages</p>
<p dir="auto">--   Python (for build):            /home/sheshank/anaconda3/bin/python3.6</p>
<p dir="auto">--   Install to:                    /usr/local</p>
<p dir="auto">As you can see it is somehow installing in the default python3 instead of the ananconda3 python which I had specified. Please explain how I can install it in the anaconda python. Thanks in advance</p>