Merge remote-tracking branch 'upstream/3.4' into merge-3.4

pull/16698/head
Alexander Alekhin 5 years ago
commit 333a767be4
  1. 4
      cmake/OpenCVCompilerOptions.cmake
  2. 20
      modules/core/include/opencv2/core/mat.inl.hpp
  3. 11
      modules/dnn/src/ie_ngraph.cpp
  4. 35
      modules/highgui/src/window_QT.cpp
  5. 3
      modules/highgui/src/window_QT.h
  6. 1
      modules/highgui/src/window_QT.qrc
  7. 3
      modules/imgcodecs/src/exif.hpp
  8. 1041
      modules/imgproc/src/sumpixels.simd.hpp
  9. 13
      modules/videoio/src/cap_v4l.cpp

@ -153,6 +153,10 @@ if(CV_GCC OR CV_CLANG)
if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
add_extra_compiler_option(-Wno-missing-field-initializers) # GCC 4.x emits warnings about {}, fixed in GCC 5+
endif()
if(CV_CLANG AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0)
add_extra_compiler_option(-Wno-deprecated-enum-enum-conversion)
add_extra_compiler_option(-Wno-deprecated-anon-enum-enum-conversion)
endif()
endif()
add_extra_compiler_option(-fdiagnostics-show-option)

@ -54,6 +54,21 @@
#pragma warning( disable: 4127 )
#endif
#if defined(CV_SKIP_DISABLE_CLANG_ENUM_WARNINGS)
// nothing
#elif defined(CV_FORCE_DISABLE_CLANG_ENUM_WARNINGS)
#define CV_DISABLE_CLANG_ENUM_WARNINGS
#elif defined(__clang__) && defined(__has_warning)
#if __has_warning("-Wdeprecated-enum-enum-conversion") && __has_warning("-Wdeprecated-anon-enum-enum-conversion")
#define CV_DISABLE_CLANG_ENUM_WARNINGS
#endif
#endif
#ifdef CV_DISABLE_CLANG_ENUM_WARNINGS
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-enum-enum-conversion"
#pragma clang diagnostic ignored "-Wdeprecated-anon-enum-enum-conversion"
#endif
namespace cv
{
CV__DEBUG_NS_BEGIN
@ -3980,4 +3995,9 @@ inline void UMatData::markDeviceCopyObsolete(bool flag)
#pragma warning( pop )
#endif
#ifdef CV_DISABLE_CLANG_ENUM_WARNINGS
#undef CV_DISABLE_CLANG_ENUM_WARNINGS
#pragma clang diagnostic pop
#endif
#endif

@ -442,13 +442,14 @@ void InfEngineNgraphNet::initPlugin(InferenceEngine::CNNNetwork& net)
config.emplace("VPU_DETECT_NETWORK_BATCH", CONFIG_VALUE(NO));
}
bool isHetero = false;
if (device_name != "CPU")
bool isHetero = device_name == "FPGA";
// It is actual only for non-CPU targets and networks built in runtime using nGraph.
// We do not check IR models because they can be with version less than IRv10
if (!isHetero && device_name != "CPU" && !hasNetOwner)
{
isHetero = device_name == "FPGA";
for (auto& layer : net)
for (auto& node : net.getFunction()->get_ops())
{
if (layer->type == kOpenCVLayersType)
if (node->description() == kOpenCVLayersType)
{
isHetero = true;
break;

@ -1856,7 +1856,7 @@ void CvWindow::displayStatusBar(QString text, int delayms)
void CvWindow::enablePropertiesButton()
{
if (!vect_QActions.empty())
vect_QActions[9]->setDisabled(false);
vect_QActions[10]->setDisabled(false);
}
@ -1991,7 +1991,7 @@ void CvWindow::createView()
void CvWindow::createActions()
{
vect_QActions.resize(10);
vect_QActions.resize(11);
QWidget* view = myView->getWidget();
@ -2032,18 +2032,22 @@ void CvWindow::createActions()
vect_QActions[8]->setIconVisibleInMenu(true);
QObject::connect(vect_QActions[8], SIGNAL(triggered()), view, SLOT(saveView()));
vect_QActions[9] = new QAction(QIcon(":/properties-icon"), "Display properties window (CTRL+P)", this);
vect_QActions[9] = new QAction(QIcon(":/copy_clipbrd-icon"), "Copy image to clipboard (CTRL+C)", this);
vect_QActions[9]->setIconVisibleInMenu(true);
QObject::connect(vect_QActions[9], SIGNAL(triggered()), this, SLOT(displayPropertiesWin()));
QObject::connect(vect_QActions[9], SIGNAL(triggered()), view, SLOT(copy2Clipbrd()));
vect_QActions[10] = new QAction(QIcon(":/properties-icon"), "Display properties window (CTRL+P)", this);
vect_QActions[10]->setIconVisibleInMenu(true);
QObject::connect(vect_QActions[10], SIGNAL(triggered()), this, SLOT(displayPropertiesWin()));
if (global_control_panel->myLayout->count() == 0)
vect_QActions[9]->setDisabled(true);
vect_QActions[10]->setDisabled(true);
}
void CvWindow::createShortcuts()
{
vect_QShortcuts.resize(10);
vect_QShortcuts.resize(11);
QWidget* view = myView->getWidget();
@ -2074,8 +2078,11 @@ void CvWindow::createShortcuts()
vect_QShortcuts[8] = new QShortcut(shortcut_save_img, this);
QObject::connect(vect_QShortcuts[8], SIGNAL(activated()), view, SLOT(saveView()));
vect_QShortcuts[9] = new QShortcut(shortcut_properties_win, this);
QObject::connect(vect_QShortcuts[9], SIGNAL(activated()), this, SLOT(displayPropertiesWin()));
vect_QShortcuts[9] = new QShortcut(shortcut_copy_clipbrd, this);
QObject::connect(vect_QShortcuts[9], SIGNAL(activated()), view, SLOT(copy2Clipbrd()));
vect_QShortcuts[10] = new QShortcut(shortcut_properties_win, this);
QObject::connect(vect_QShortcuts[10], SIGNAL(activated()), this, SLOT(displayPropertiesWin()));
}
@ -2697,6 +2704,18 @@ void DefaultViewPort::saveView()
}
//copy image to clipboard
void DefaultViewPort::copy2Clipbrd()
{
// Create a new pixmap to render the viewport into
QPixmap viewportPixmap(viewport()->size());
viewport()->render(&viewportPixmap);
QClipboard *pClipboard = QApplication::clipboard();
pClipboard->setPixmap(viewportPixmap);
}
void DefaultViewPort::contextMenuEvent(QContextMenuEvent* evnt)
{
if (centralWidget->vect_QActions.size() > 0)

@ -76,6 +76,7 @@
#include <QDate>
#include <QFileDialog>
#include <QToolBar>
#include <QClipboard>
#include <QAction>
#include <QCheckBox>
@ -91,6 +92,7 @@ enum { CV_MODE_NORMAL = 0, CV_MODE_OPENGL = 1 };
enum { shortcut_zoom_normal = Qt::CTRL + Qt::Key_Z,
shortcut_zoom_imgRegion = Qt::CTRL + Qt::Key_X,
shortcut_save_img = Qt::CTRL + Qt::Key_S,
shortcut_copy_clipbrd = Qt::CTRL + Qt::Key_C,
shortcut_properties_win = Qt::CTRL + Qt::Key_P,
shortcut_zoom_in = Qt::CTRL + Qt::Key_Plus,//QKeySequence(QKeySequence::ZoomIn),
shortcut_zoom_out = Qt::CTRL + Qt::Key_Minus,//QKeySequence(QKeySequence::ZoomOut),
@ -518,6 +520,7 @@ public slots:
void ZoomOut();
void saveView();
void copy2Clipbrd();
protected:
void contextMenuEvent(QContextMenuEvent* event) CV_OVERRIDE;

@ -9,6 +9,7 @@
<file alias="zoom_in-icon">files_Qt/Milky/48/106.png</file>
<file alias="zoom_out-icon">files_Qt/Milky/48/107.png</file>
<file alias="save-icon">files_Qt/Milky/48/7.png</file>
<file alias="copy_clipbrd-icon">files_Qt/Milky/48/43.png</file>
<file alias="properties-icon">files_Qt/Milky/48/38.png</file>
<file alias="stylesheet-trackbar">files_Qt/stylesheet_trackbar.qss</file>
</qresource>

@ -154,7 +154,8 @@ enum ImageOrientation
* Usage example for getting the orientation of the image:
*
* @code
* ExifReader reader(fileName);
* std::ifstream stream(filename,std::ios_base::in | std::ios_base::binary);
* ExifReader reader(stream);
* if( reader.parse() )
* {
* int orientation = reader.getTag(Orientation).field_u16;

File diff suppressed because it is too large Load Diff

@ -268,6 +268,10 @@ typedef uint32_t __u32;
#define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ')
#endif
#ifndef V4L2_PIX_FMT_Y12
#define V4L2_PIX_FMT_Y12 v4l2_fourcc('Y', '1', '2', ' ')
#endif
/* Defaults - If your board can do better, set it here. Set for the most common type inputs. */
#define DEFAULT_V4L_WIDTH 640
#define DEFAULT_V4L_HEIGHT 480
@ -570,6 +574,7 @@ bool CvCaptureCAM_V4L::autosetup_capture_mode_v4l2()
V4L2_PIX_FMT_JPEG,
#endif
V4L2_PIX_FMT_Y16,
V4L2_PIX_FMT_Y12,
V4L2_PIX_FMT_Y10,
V4L2_PIX_FMT_GREY,
};
@ -663,6 +668,7 @@ void CvCaptureCAM_V4L::v4l2_create_frame()
size.height = size.height * 3 / 2; // "1.5" channels
break;
case V4L2_PIX_FMT_Y16:
case V4L2_PIX_FMT_Y12:
case V4L2_PIX_FMT_Y10:
depth = IPL_DEPTH_16U;
/* fallthru */
@ -1593,6 +1599,13 @@ void CvCaptureCAM_V4L::convertToRgb(const Buffer &currentBuffer)
cv::cvtColor(temp, destination, COLOR_GRAY2BGR);
return;
}
case V4L2_PIX_FMT_Y12:
{
cv::Mat temp(imageSize, CV_8UC1, buffers[MAX_V4L_BUFFERS].start);
cv::Mat(imageSize, CV_16UC1, currentBuffer.start).convertTo(temp, CV_8U, 1.0 / 16);
cv::cvtColor(temp, destination, COLOR_GRAY2BGR);
return;
}
case V4L2_PIX_FMT_Y10:
{
cv::Mat temp(imageSize, CV_8UC1, buffers[MAX_V4L_BUFFERS].start);

Loading…
Cancel
Save