Skip to content

Commit 6b099a2

Browse files
committed
Merge branch 'dev' of https://github.com/livecv/livecv into dev
2 parents aa9d302 + 85d07fd commit 6b099a2

File tree

15 files changed

+156
-44
lines changed

15 files changed

+156
-44
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ install:
7777
wget https://github.com/livecv/live-pm/archive/master.zip;
7878
unzip master.zip;
7979
mv live-pm-master/* .;
80-
wget http://download.qt.io/official_releases/qt/5.7/5.7.0/qt-opensource-linux-x64-5.7.0.run;
81-
sudo chmod 777 qt-opensource-linux-x64-5.7.0.run;
82-
./qt-opensource-linux-x64-5.7.0.run --script resources/install-qt.qs --verbose --silent -platform minimal;
80+
wget http://download.qt.io/official_releases/qt/5.7/5.7.1/qt-opensource-linux-x64-5.7.1.run;
81+
sudo chmod 777 qt-opensource-linux-x64-5.7.1.run;
82+
./qt-opensource-linux-x64-5.7.1.run --script resources/install-qt.qs --verbose --silent -platform minimal;
8383
export QTDIR=/opt/qt/5.7/gcc_64;
8484
fi
8585

application/application.pro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ linkLocalLibrary(lveditqmljs, lveditqmljs)
1212
unix:!macx{
1313
QMAKE_LFLAGS += \
1414
'-Wl,-rpath,\'\$$ORIGIN\'' \
15-
'-Wl,-rpath,\'\$$ORIGIN/link\''
15+
'-Wl,-rpath,\'\$$ORIGIN/link\'' \
16+
'-Wl,-rpath,\'\$$ORIGIN/lib\''
1617

1718

1819
createlinkdir.commands += $${QMAKE_MKDIR_CMD} $$shell_path($${DEPLOY_PATH}/link)

application/qml/License.qml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ Rectangle{
8888
Rectangle{
8989
id: boxTop
9090
width: parent.width
91-
height: 30
91+
height: 35
9292
color: 'transparent'
9393
Text{
9494
anchors.centerIn: parent
9595
text: 'Manage Licenses'
9696

9797
color: root.titleColor
98-
font.pixelSize: 14
98+
font.pixelSize: 12
9999
font.family: "Open Sans, sans-serif"
100100
font.weight: Font.Light
101101
}
@@ -110,7 +110,7 @@ Rectangle{
110110
anchors.centerIn: parent
111111
text: "x"
112112
color: root.titleColor
113-
font.pixelSize: closeBoxArea.containsMouse ? 24 : 18
113+
font.pixelSize: closeBoxArea.containsMouse ? 22 : 18
114114
font.family: "Open Sans, sans-serif"
115115
font.weight: Font.Light
116116
Behavior on font.pixelSize{ NumberAnimation{ duration: 250 } }
@@ -273,7 +273,7 @@ Rectangle{
273273
anchors.topMargin: 12
274274

275275
text: licenseList.currentItem
276-
? settings.custom('license').licenseText(licenseList.currentItem.licenseId)
276+
? livecv.settings.file('license').licenseText(licenseList.currentItem.licenseId)
277277
: "No license selected."
278278

279279
width: boxRight.width - 24
@@ -314,7 +314,7 @@ Rectangle{
314314
id: acceptButtonArea
315315
anchors.fill: parent
316316
hoverEnabled: true
317-
onClicked: settings.custom('license').acceptLicense(licenseList.currentItem.licenseId)
317+
onClicked: livecv.settings.file('license').acceptLicense(licenseList.currentItem.licenseId)
318318
}
319319
}
320320
}

doc/src/images/logo-dark.png

16.1 KB
Loading

livecv.json

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"{source}/samples" : "-"
6565
}
6666
},
67+
{ "run" : ["mkdir", "-m", "775", "link"] },
6768
{ "run" : ["chmod", "755", "livecv"] },
6869
{ "solveincludes": [
6970
{
@@ -143,7 +144,7 @@
143144
"libQt5Script.so*": "lib/-",
144145
"libQt5Widgets.so*": "lib/-",
145146
"libQt5Network.so*": "lib/-",
146-
"libQt5Xml.so*": "-",
147+
"libQt5Xml.so*": "lib/-",
147148
"libQt5XcbQpa.so*": "lib/-",
148149
"libicudata.so*": "lib/-",
149150
"libicui18n.so*": "lib/-",
@@ -154,10 +155,10 @@
154155
"libicuuc.so*": "lib/-"
155156
},
156157
"{qtdir}/plugins" : {
157-
"imageformats" : "lib/plugins/imageformats",
158-
"platforminputcontexts" : "lib/plugins/platforminputcontexts",
159-
"platforms" : "lib/plugins/platforms",
160-
"xcbglintegrations" : "lib/plugins/xcbglintegrations"
158+
"imageformats" : "libraries/imageformats",
159+
"platforminputcontexts" : "libraries/platforminputcontexts",
160+
"platforms" : "libraries/platforms",
161+
"xcbglintegrations" : "libraries/xcbglintegrations"
161162
},
162163
"{qtdir}/qml" : {
163164
"QtQuick" : {
@@ -180,32 +181,21 @@
180181
"QtWebSockets" : "plugins/-"
181182
},
182183
"{opencv_dir}" : {
183-
"libopencv_calib3d.so*" : "-",
184-
"libopencv_core.so*" : "-",
185-
"libopencv_features2d.so*" : "-",
186-
"libopencv_shape.so*" : "-",
187-
"libopencv_flann.so*" : "-",
188-
"libopencv_highgui.so*" : "-",
189-
"libopencv_imgproc.so*" : "-",
190-
"libopencv_imgcodecs.so*" : "-",
191-
"libopencv_objdetect.so*" : "-",
192-
"libopencv_stitching.so*" : "-",
193-
"libopencv_photo.so*" : "-",
194-
"libopencv_videoio.so*" : "-",
195-
"libopencv_video.so*" : "-"
184+
"libopencv_*.so*" : "external/opencv/-"
196185
}
197186
}
198187
},
188+
{ "run" : ["mkdir", "-m", "775", "link"] },
199189
{ "run" : ["chmod", "755", "livecv"] },
200190
{ "write" : {
201191
"file": "launcher.sh",
202192
"data": [
203193
"#!/bin/bash\n",
204-
"export LD_LIBRARY_PATH=`pwd`/lib:\n",
194+
"export LD_LIBRARY_PATH=`pwd`/lib:`pwd`:\n",
205195
"export QML_IMPORT_PATH=`pwd`/plugins\n",
206196
"export QML2_IMPORT_PATH=`pwd`/plugins\n",
207-
"export QT_PLUGIN_PATH=`pwd`/lib/plugins\n",
208-
"export QT_QPA_PLATFORM_PLUGIN_PATH=`pwd`/lib/plugins/platforms\n",
197+
"export QT_PLUGIN_PATH=`pwd`/libraries\n",
198+
"export QT_QPA_PLATFORM_PLUGIN_PATH=`pwd`/libraries/platforms\n",
209199
"./livecv"
210200
]
211201
}

plugins/lcvcore/src/qcvglobalobject.cpp

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,94 @@
1515
****************************************************************************/
1616

1717
#include "qcvglobalobject.h"
18+
#include "opencv2/core.hpp"
19+
20+
namespace helpers{
21+
22+
template<typename T, typename LT> void getValues( cv::Mat& m, QVariantList& output){
23+
T* data = reinterpret_cast<T*>(m.data);
24+
int step = (int)(m.step / sizeof(T));
25+
26+
for ( int i = 0; i < m.rows; ++i ){
27+
int rowstep = i * step;
28+
for ( int j = 0; j < m.cols * m.channels(); ++j ){
29+
output.append(data[rowstep + j]);
30+
}
31+
}
32+
}
33+
34+
template<typename T, typename LT> void setValues(const QVariantList& values, cv::Mat& m){
35+
T* data = reinterpret_cast<T*>(m.data);
36+
int step = (int)(m.step / sizeof(T));
37+
38+
for ( int i = 0; i < m.rows; ++i ){
39+
int rowstep = i * step;
40+
for ( int j = 0; j < m.cols * m.channels(); ++j ){
41+
data[rowstep + j] =values.at(j + i * m.cols * m.channels()).value<T>();
42+
}
43+
}
44+
}
45+
46+
} // namespace
1847

1948
QCvGlobalObject::QCvGlobalObject(QObject *parent)
2049
: QObject(parent){
2150

2251
}
52+
53+
QVariantList QCvGlobalObject::matToArray(QMat *m){
54+
QVariantList values;
55+
cv::Mat* cvmat = m->cvMat();
56+
switch(cvmat->depth()){
57+
case CV_8U:
58+
helpers::getValues<uchar, int>(*cvmat, values);
59+
break;
60+
case CV_8S:
61+
helpers::getValues<uchar, int>(*cvmat, values);
62+
break;
63+
case CV_16U:
64+
helpers::getValues<short, int>(*cvmat, values);
65+
break;
66+
case CV_16S:
67+
helpers::getValues<short, int>(*cvmat, values);
68+
break;
69+
case CV_32S:
70+
helpers::getValues<int, int>(*cvmat, values);
71+
break;
72+
case CV_32F:
73+
helpers::getValues<float, float>(*cvmat, values);
74+
break;
75+
case CV_64F:
76+
helpers::getValues<float, qreal>(*cvmat, values);
77+
break;
78+
}
79+
80+
return values;
81+
}
82+
83+
void QCvGlobalObject::assignArrayToMat(const QVariantList &a, QMat *m){
84+
cv::Mat* cvmat = m->cvMat();
85+
switch(cvmat->depth()){
86+
case CV_8U:
87+
helpers::setValues<uchar, int>(a, *cvmat);
88+
break;
89+
case CV_8S:
90+
helpers::setValues<uchar, int>(a, *cvmat);
91+
break;
92+
case CV_16U:
93+
helpers::setValues<short, int>(a, *cvmat);
94+
break;
95+
case CV_16S:
96+
helpers::setValues<short, int>(a, *cvmat);
97+
break;
98+
case CV_32S:
99+
helpers::setValues<int, int>(a, *cvmat);
100+
break;
101+
case CV_32F:
102+
helpers::setValues<float, float>(a, *cvmat);
103+
break;
104+
case CV_64F:
105+
helpers::setValues<float, qreal>(a, *cvmat);
106+
break;
107+
}
108+
}

plugins/lcvcore/src/qcvglobalobject.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ class QCvGlobalObject : public QObject{
2929
explicit QCvGlobalObject(QObject *parent = nullptr);
3030

3131
QMat* nullMat() const;
32+
33+
public slots:
34+
QVariantList matToArray(QMat* m);
35+
void assignArrayToMat(const QVariantList &a, QMat *m);
3236
};
3337

3438
inline QMat *QCvGlobalObject::nullMat() const{

plugins/lcvfeatures2d/include/qdescriptoratchfilter.h renamed to plugins/lcvfeatures2d/include/qdescriptormatchfilter.h

File renamed without changes.

plugins/lcvfeatures2d/src/lcvfeatures2d_plugin.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,13 @@
2222
#include "qbriskfeaturedetector.h"
2323
//#include "qdensefeaturedetector.h"
2424
//#include "qgoodfeaturestotrackdetector.h"
25-
//#include "qstarfeaturedetector.h" IN OPENCV_EXPERIMENTAL
2625
#include "qorbfeaturedetector.h"
2726
#include "qmserfeaturedetector.h"
2827
#include "qsimpleblobdetector.h"
2928

3029
#include "qdescriptorextractor.h"
31-
//#include "qbriefdescriptorextractor.h" IN OPENCV_EXPERIMENTAL
3230
#include "qbriskdescriptorextractor.h"
3331
#include "qorbdescriptorextractor.h"
34-
//#include "qfreakdescriptorextractor.h" IN OPENCV_EXPERIMENTAL
3532

3633
#include "qdescriptormatcher.h"
3734
#include "qbruteforcematcher.h"
@@ -53,18 +50,13 @@ void Lcvfeatures2dPlugin::registerTypes(const char *uri){
5350
qmlRegisterType<QFeatureDetector>( uri, 1, 0, "FeatureDetector");
5451
qmlRegisterType<QFastFeatureDetector>( uri, 1, 0, "FastFeatureDetector");
5552
qmlRegisterType<QBriskFeatureDetector>( uri, 1, 0, "BriskFeatureDetector");
56-
// qmlRegisterType<QDenseFeatureDetector>( uri, 1, 0, "DenseFeatureDetector");
57-
// qmlRegisterType<QGoodFeaturesToTrackDetector>(uri, 1, 0, "GoodFeaturesToTrackFeatureDetector");
58-
// qmlRegisterType<QStarFeatureDetector>( uri, 1, 0, "StarFeatureDetector");
5953
qmlRegisterType<QOrbFeatureDetector>( uri, 1, 0, "OrbFeatureDetector");
6054
qmlRegisterType<QMSerFeatureDetector>( uri, 1, 0, "MSerFeatureDetector");
6155
qmlRegisterType<QSimpleBlobDetector>( uri, 1, 0, "SimpleBlobDetector");
6256

6357
qmlRegisterType<QDescriptorExtractor>( uri, 1, 0, "DescriptorExtractor");
64-
// qmlRegisterType<QBriefDescriptorExtractor>( uri, 1, 0, "BriefDescriptorExtractor");
6558
qmlRegisterType<QBriskDescriptorExtractor>( uri, 1, 0, "BriskDescriptorExtractor");
6659
qmlRegisterType<QOrbDescriptorExtractor>( uri, 1, 0, "OrbDescriptorExtractor");
67-
// qmlRegisterType<QFreakDescriptorExtractor>( uri, 1, 0, "FreakDescriptorExtractor");
6860

6961
qmlRegisterType<QDMatchVector>( uri, 1, 0, "DMatchVector");
7062
qmlRegisterType<QDescriptorMatcher>( uri, 1, 0, "DescriptorMatcher");

plugins/lcvfeatures2d/src/qdescriptorextractor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class Q_LCVFEATURES2D_EXPORT QDescriptorExtractor : public QQuickItem{
5858
void paramsChanged();
5959

6060
public slots:
61-
void compute();
61+
virtual void compute();
6262
void setParams(const QVariantMap &arg);
6363

6464
private:

0 commit comments

Comments
 (0)