Issue 1:
System information (version)

OpenCV => 3.4.3

Operating System / Platform => macOS High Sierra (10.13.6)

Compiler => Apple LLVM version 10.0.0 (clang-1000.10.44.2)

Detailed description

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.

Note that this bug might be similar to #7485, but I wasn't certain of it.

Steps to reproduce

Below is the code I used.

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->x = x;
p->y = y;
p->button = 0;
} else if (event == cv::EVENT_RBUTTONDOWN) {
p->x = x;
p->y = y;
p->button = 1;
}
}

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

while (d.button == -1) {
cv::waitKey(10);
}
return d;
}

Issue 2:
System information (version)

OpenCV => 3.4.4

Operating System / Platform => Ubuntu 16.04

Compiler => gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609

Detailed description

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.

Steps to reproduce

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 ..

The entire output is attached as a text file:

op_log.txt

Of relevance:

-- Python 3:

-- Interpreter: /usr/bin/python3 (ver 3.5.2)

-- Libraries: NO

-- numpy: NO (Python3 wrappers can not be generated)

-- packages path: lib/python3.5/dist-packages

-- Python (for build): /home/sheshank/anaconda3/bin/python3.6

-- Install to: /usr/local

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