Issue 1:
I'm trying to move a very simple OpenCV application to android. The code tries to access the camera from a qt for android . My qt code simply tries to access the camera using cv::VideoCapture like so:

cv::VideoCapture cap(0); // /dev/video0

Camera cannot be opened,Permissions are open,chmod 777 /dev/video0,The camera still doesn't open.

What did I add less? Or is my method wrong, Android can't open the camera in this way at all?

Opencv version:　4.1.1

qt version:　5.12.3

android ndk: android-ndk-r19c

Issue 2:
System information (version)

OpenCV => 4.1.0

Operating System / Platform => Ubuntu 18.04 64 Bit

Compiler => Visual Studio Code

Detailed description

I am using the SSD face detector from the dnn module, and testing it on the Helen dataset http://www.ifp.illinois.edu/~vuongle2/helen/

I have a strange behavior using the default settings, that is using the default 300x300 size:

cv::Mat inputBlob = cv::dnn::blobFromImage(image, 1.0, cv::Size(300,300), meanVal, mixchannels, false);

It works ok on most of the files except on some where the bounding box is always shifted to the right

51 images out of 2330 are concerned by this strange behavior. I cannot see any relationships between these (different sizes...) most of them are tightly cropped though.

Now the strange thing is that if I use

cv::Mat inputBlob = cv::dnn::blobFromImage(image, 1.0, cv::Size(128,128), meanVal, mixchannels, false);

Everything works perfectly, and the 51 images above are detected as expected.

I tried to resize the image before, but It did not change anything.

256x256 or 300x300 result in the same bug

128x96 is ok

I tried to use version 4.1.2, but I have a crash if I use the new prototxt and .caffemodel

Steps to reproduce

const std::string caffeConfigFile = "deploy.prototxt";
const std::string caffeWeightFile = "res10_300x300_ssd_iter_140000_fp16.caffemodel";
net = cv::dnn::readNetFromCaffe(caffeConfigFile, caffeWeightFile);
cv::Mat image = cv::imread(imageFile);
cv::Mat inputBlob = cv::dnn::blobFromImage(image, 1.0, cv::Size(300,300), cv::Scalar(104.0, 177.0, 123.0), false, false);
net.setInput(inputBlob, "data");
cv::Mat detection = net.forward();
cv::Mat detectionMat(detection.size[2], detection.size[3], CV_32F, detection.ptr<float>());
int x1 = static_cast<int>(detectionMat.at<float>(0, 3) * image.cols);
int y1 = static_cast<int>(detectionMat.at<float>(0, 4) * image.rows);
int x2 = static_cast<int>(detectionMat.at<float>(0, 5) * image.cols);
int y2 = static_cast<int>(detectionMat.at<float>(0, 6) * image.rows);

cv::Rect faceBox = cv::Rect(x1, y1, x2 - x1 + 1, y2 - y1 + 1);

This problem occurs on these 51 files from the Helen dataset:

1021890651_1.jpg 164403300_1.jpg 2330954824_1.jpg 2584224650_1.jpg

1037255513_1.jpg 1657180938_1.jpg 2346354291_1.jpg 2584536815_1.jpg

103770709_1.jpg 167671232_1.jpg 2352345861_1.jpg 2607971564_1.jpg

10407038_1.jpg 168907806_1.jpg 2365877276_1.jpg 266036271_1.jpg

111714273_1.jpg 1908146310_1.jpg 240001815_1.jpg 2664748719_1.jpg

1224500832_1.jpg 1961032923_1.jpg 2402251921_1.jpg 2705102720_1.jpg

1242475639_1.jpg 1962410129_1.jpg 2407771006_1.jpg 2721024227_1.jpg

131437823_1.jpg 2138681738_1.jpg 2419189561_1.jpg 2738187790_1.jpg

1408008592_1.jpg 2193639644_1.jpg 2449764454_1.jpg 2837076619_1.jpg

1418178512_1.jpg 2216370944_1.jpg 245801293_1.jpg 3006823882_1.jpg

145548320_1.jpg 2223862191_1.jpg 245871800_1.jpg 30542618_1.jpg

155271502_1.jpg 2264901367_1.jpg 2512750679_1.jpg 3247810519_1.jpg

161868885_1.jpg 228950047_1.jpg 2546411220_1.jpg