Skip to content

Commit 85d07fd

Browse files
committed
Merge branch 'dev' of github.com:livecv/livecv into dev
2 parents dd58f0d + 21942c0 commit 85d07fd

File tree

15 files changed

+154
-42
lines changed

15 files changed

+154
-42
lines changed

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
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,92 @@
11
#include "qcvglobalobject.h"
2+
#include "opencv2/core.hpp"
3+
4+
namespace helpers{
5+
6+
template<typename T, typename LT> void getValues( cv::Mat& m, QVariantList& output){
7+
T* data = reinterpret_cast<T*>(m.data);
8+
int step = (int)(m.step / sizeof(T));
9+
10+
for ( int i = 0; i < m.rows; ++i ){
11+
int rowstep = i * step;
12+
for ( int j = 0; j < m.cols * m.channels(); ++j ){
13+
output.append(data[rowstep + j]);
14+
}
15+
}
16+
}
17+
18+
template<typename T, typename LT> void setValues(const QVariantList& values, cv::Mat& m){
19+
T* data = reinterpret_cast<T*>(m.data);
20+
int step = (int)(m.step / sizeof(T));
21+
22+
for ( int i = 0; i < m.rows; ++i ){
23+
int rowstep = i * step;
24+
for ( int j = 0; j < m.cols * m.channels(); ++j ){
25+
data[rowstep + j] =values.at(j + i * m.cols * m.channels()).value<T>();
26+
}
27+
}
28+
}
29+
30+
} // namespace
231

332
QCvGlobalObject::QCvGlobalObject(QObject *parent)
433
: QObject(parent){
534

635
}
36+
37+
QVariantList QCvGlobalObject::matToArray(QMat *m){
38+
QVariantList values;
39+
cv::Mat* cvmat = m->cvMat();
40+
switch(cvmat->depth()){
41+
case CV_8U:
42+
helpers::getValues<uchar, int>(*cvmat, values);
43+
break;
44+
case CV_8S:
45+
helpers::getValues<uchar, int>(*cvmat, values);
46+
break;
47+
case CV_16U:
48+
helpers::getValues<short, int>(*cvmat, values);
49+
break;
50+
case CV_16S:
51+
helpers::getValues<short, int>(*cvmat, values);
52+
break;
53+
case CV_32S:
54+
helpers::getValues<int, int>(*cvmat, values);
55+
break;
56+
case CV_32F:
57+
helpers::getValues<float, float>(*cvmat, values);
58+
break;
59+
case CV_64F:
60+
helpers::getValues<float, qreal>(*cvmat, values);
61+
break;
62+
}
63+
64+
return values;
65+
}
66+
67+
void QCvGlobalObject::assignArrayToMat(const QVariantList &a, QMat *m){
68+
cv::Mat* cvmat = m->cvMat();
69+
switch(cvmat->depth()){
70+
case CV_8U:
71+
helpers::setValues<uchar, int>(a, *cvmat);
72+
break;
73+
case CV_8S:
74+
helpers::setValues<uchar, int>(a, *cvmat);
75+
break;
76+
case CV_16U:
77+
helpers::setValues<short, int>(a, *cvmat);
78+
break;
79+
case CV_16S:
80+
helpers::setValues<short, int>(a, *cvmat);
81+
break;
82+
case CV_32S:
83+
helpers::setValues<int, int>(a, *cvmat);
84+
break;
85+
case CV_32F:
86+
helpers::setValues<float, float>(a, *cvmat);
87+
break;
88+
case CV_64F:
89+
helpers::setValues<float, qreal>(a, *cvmat);
90+
break;
91+
}
92+
}

plugins/lcvcore/src/qcvglobalobject.h

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

1515
QMat* nullMat() const;
16+
17+
public slots:
18+
QVariantList matToArray(QMat* m);
19+
void assignArrayToMat(const QVariantList &a, QMat *m);
1620
};
1721

1822
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:

plugins/lcvfeatures2d/src/qfeaturedetector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Q_LCVFEATURES2D_EXPORT QFeatureDetector : public QQuickItem{
5555

5656
cv::FeatureDetector* detector();
5757
void initializeDetector(cv::Ptr<cv::FeatureDetector> detector);
58-
void detect();
58+
virtual void detect();
5959
virtual void componentComplete();
6060

6161
public:

0 commit comments

Comments
 (0)