Commit 333a767b authored by Alexander Alekhin's avatar Alexander Alekhin

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

parents db5f1c35 5012fc5d
...@@ -153,6 +153,10 @@ if(CV_GCC OR CV_CLANG) ...@@ -153,6 +153,10 @@ if(CV_GCC OR CV_CLANG)
if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) 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+ add_extra_compiler_option(-Wno-missing-field-initializers) # GCC 4.x emits warnings about {}, fixed in GCC 5+
endif() 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() endif()
add_extra_compiler_option(-fdiagnostics-show-option) add_extra_compiler_option(-fdiagnostics-show-option)
......
...@@ -54,6 +54,21 @@ ...@@ -54,6 +54,21 @@
#pragma warning( disable: 4127 ) #pragma warning( disable: 4127 )
#endif #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 namespace cv
{ {
CV__DEBUG_NS_BEGIN CV__DEBUG_NS_BEGIN
...@@ -3980,4 +3995,9 @@ inline void UMatData::markDeviceCopyObsolete(bool flag) ...@@ -3980,4 +3995,9 @@ inline void UMatData::markDeviceCopyObsolete(bool flag)
#pragma warning( pop ) #pragma warning( pop )
#endif #endif
#ifdef CV_DISABLE_CLANG_ENUM_WARNINGS
#undef CV_DISABLE_CLANG_ENUM_WARNINGS
#pragma clang diagnostic pop
#endif
#endif #endif
...@@ -442,13 +442,14 @@ void InfEngineNgraphNet::initPlugin(InferenceEngine::CNNNetwork& net) ...@@ -442,13 +442,14 @@ void InfEngineNgraphNet::initPlugin(InferenceEngine::CNNNetwork& net)
config.emplace("VPU_DETECT_NETWORK_BATCH", CONFIG_VALUE(NO)); config.emplace("VPU_DETECT_NETWORK_BATCH", CONFIG_VALUE(NO));
} }
bool isHetero = false; bool isHetero = device_name == "FPGA";
if (device_name != "CPU") // 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& node : net.getFunction()->get_ops())
for (auto& layer : net)
{ {
if (layer->type == kOpenCVLayersType) if (node->description() == kOpenCVLayersType)
{ {
isHetero = true; isHetero = true;
break; break;
......
...@@ -1856,7 +1856,7 @@ void CvWindow::displayStatusBar(QString text, int delayms) ...@@ -1856,7 +1856,7 @@ void CvWindow::displayStatusBar(QString text, int delayms)
void CvWindow::enablePropertiesButton() void CvWindow::enablePropertiesButton()
{ {
if (!vect_QActions.empty()) if (!vect_QActions.empty())
vect_QActions[9]->setDisabled(false); vect_QActions[10]->setDisabled(false);
} }
...@@ -1991,7 +1991,7 @@ void CvWindow::createView() ...@@ -1991,7 +1991,7 @@ void CvWindow::createView()
void CvWindow::createActions() void CvWindow::createActions()
{ {
vect_QActions.resize(10); vect_QActions.resize(11);
QWidget* view = myView->getWidget(); QWidget* view = myView->getWidget();
...@@ -2032,18 +2032,22 @@ void CvWindow::createActions() ...@@ -2032,18 +2032,22 @@ void CvWindow::createActions()
vect_QActions[8]->setIconVisibleInMenu(true); vect_QActions[8]->setIconVisibleInMenu(true);
QObject::connect(vect_QActions[8], SIGNAL(triggered()), view, SLOT(saveView())); 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); 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) if (global_control_panel->myLayout->count() == 0)
vect_QActions[9]->setDisabled(true); vect_QActions[10]->setDisabled(true);
} }
void CvWindow::createShortcuts() void CvWindow::createShortcuts()
{ {
vect_QShortcuts.resize(10); vect_QShortcuts.resize(11);
QWidget* view = myView->getWidget(); QWidget* view = myView->getWidget();
...@@ -2074,8 +2078,11 @@ void CvWindow::createShortcuts() ...@@ -2074,8 +2078,11 @@ void CvWindow::createShortcuts()
vect_QShortcuts[8] = new QShortcut(shortcut_save_img, this); vect_QShortcuts[8] = new QShortcut(shortcut_save_img, this);
QObject::connect(vect_QShortcuts[8], SIGNAL(activated()), view, SLOT(saveView())); QObject::connect(vect_QShortcuts[8], SIGNAL(activated()), view, SLOT(saveView()));
vect_QShortcuts[9] = new QShortcut(shortcut_properties_win, this); vect_QShortcuts[9] = new QShortcut(shortcut_copy_clipbrd, this);
QObject::connect(vect_QShortcuts[9], SIGNAL(activated()), this, SLOT(displayPropertiesWin())); 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() ...@@ -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) void DefaultViewPort::contextMenuEvent(QContextMenuEvent* evnt)
{ {
if (centralWidget->vect_QActions.size() > 0) if (centralWidget->vect_QActions.size() > 0)
......
...@@ -76,6 +76,7 @@ ...@@ -76,6 +76,7 @@
#include <QDate> #include <QDate>
#include <QFileDialog> #include <QFileDialog>
#include <QToolBar> #include <QToolBar>
#include <QClipboard>
#include <QAction> #include <QAction>
#include <QCheckBox> #include <QCheckBox>
...@@ -91,6 +92,7 @@ enum { CV_MODE_NORMAL = 0, CV_MODE_OPENGL = 1 }; ...@@ -91,6 +92,7 @@ enum { CV_MODE_NORMAL = 0, CV_MODE_OPENGL = 1 };
enum { shortcut_zoom_normal = Qt::CTRL + Qt::Key_Z, enum { shortcut_zoom_normal = Qt::CTRL + Qt::Key_Z,
shortcut_zoom_imgRegion = Qt::CTRL + Qt::Key_X, shortcut_zoom_imgRegion = Qt::CTRL + Qt::Key_X,
shortcut_save_img = Qt::CTRL + Qt::Key_S, 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_properties_win = Qt::CTRL + Qt::Key_P,
shortcut_zoom_in = Qt::CTRL + Qt::Key_Plus,//QKeySequence(QKeySequence::ZoomIn), shortcut_zoom_in = Qt::CTRL + Qt::Key_Plus,//QKeySequence(QKeySequence::ZoomIn),
shortcut_zoom_out = Qt::CTRL + Qt::Key_Minus,//QKeySequence(QKeySequence::ZoomOut), shortcut_zoom_out = Qt::CTRL + Qt::Key_Minus,//QKeySequence(QKeySequence::ZoomOut),
...@@ -518,6 +520,7 @@ public slots: ...@@ -518,6 +520,7 @@ public slots:
void ZoomOut(); void ZoomOut();
void saveView(); void saveView();
void copy2Clipbrd();
protected: protected:
void contextMenuEvent(QContextMenuEvent* event) CV_OVERRIDE; void contextMenuEvent(QContextMenuEvent* event) CV_OVERRIDE;
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<file alias="zoom_in-icon">files_Qt/Milky/48/106.png</file> <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="zoom_out-icon">files_Qt/Milky/48/107.png</file>
<file alias="save-icon">files_Qt/Milky/48/7.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="properties-icon">files_Qt/Milky/48/38.png</file>
<file alias="stylesheet-trackbar">files_Qt/stylesheet_trackbar.qss</file> <file alias="stylesheet-trackbar">files_Qt/stylesheet_trackbar.qss</file>
</qresource> </qresource>
......
...@@ -154,7 +154,8 @@ enum ImageOrientation ...@@ -154,7 +154,8 @@ enum ImageOrientation
* Usage example for getting the orientation of the image: * Usage example for getting the orientation of the image:
* *
* @code * @code
* ExifReader reader(fileName); * std::ifstream stream(filename,std::ios_base::in | std::ios_base::binary);
* ExifReader reader(stream);
* if( reader.parse() ) * if( reader.parse() )
* { * {
* int orientation = reader.getTag(Orientation).field_u16; * int orientation = reader.getTag(Orientation).field_u16;
......
This diff is collapsed.
...@@ -268,6 +268,10 @@ typedef uint32_t __u32; ...@@ -268,6 +268,10 @@ typedef uint32_t __u32;
#define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') #define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ')
#endif #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. */ /* 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_WIDTH 640
#define DEFAULT_V4L_HEIGHT 480 #define DEFAULT_V4L_HEIGHT 480
...@@ -570,6 +574,7 @@ bool CvCaptureCAM_V4L::autosetup_capture_mode_v4l2() ...@@ -570,6 +574,7 @@ bool CvCaptureCAM_V4L::autosetup_capture_mode_v4l2()
V4L2_PIX_FMT_JPEG, V4L2_PIX_FMT_JPEG,
#endif #endif
V4L2_PIX_FMT_Y16, V4L2_PIX_FMT_Y16,
V4L2_PIX_FMT_Y12,
V4L2_PIX_FMT_Y10, V4L2_PIX_FMT_Y10,
V4L2_PIX_FMT_GREY, V4L2_PIX_FMT_GREY,
}; };
...@@ -663,6 +668,7 @@ void CvCaptureCAM_V4L::v4l2_create_frame() ...@@ -663,6 +668,7 @@ void CvCaptureCAM_V4L::v4l2_create_frame()
size.height = size.height * 3 / 2; // "1.5" channels size.height = size.height * 3 / 2; // "1.5" channels
break; break;
case V4L2_PIX_FMT_Y16: case V4L2_PIX_FMT_Y16:
case V4L2_PIX_FMT_Y12:
case V4L2_PIX_FMT_Y10: case V4L2_PIX_FMT_Y10:
depth = IPL_DEPTH_16U; depth = IPL_DEPTH_16U;
/* fallthru */ /* fallthru */
...@@ -1593,6 +1599,13 @@ void CvCaptureCAM_V4L::convertToRgb(const Buffer &currentBuffer) ...@@ -1593,6 +1599,13 @@ void CvCaptureCAM_V4L::convertToRgb(const Buffer &currentBuffer)
cv::cvtColor(temp, destination, COLOR_GRAY2BGR); cv::cvtColor(temp, destination, COLOR_GRAY2BGR);
return; 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: case V4L2_PIX_FMT_Y10:
{ {
cv::Mat temp(imageSize, CV_8UC1, buffers[MAX_V4L_BUFFERS].start); cv::Mat temp(imageSize, CV_8UC1, buffers[MAX_V4L_BUFFERS].start);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment