Skip to content
This repository was archived by the owner on Oct 10, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/travis/package
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
set -e
. ${TRAVIS_BUILD_DIR}/git_commit_date.sh
mkdir -p "$TRAVIS_BUILD_DIR/packages"

if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
source ~/virtualenv/python3.6/bin/activate
Expand All @@ -11,6 +12,5 @@ fi
if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
cd "$TRAVIS_BUILD_DIR/build"
make package -j4
mkdir -p "$TRAVIS_BUILD_DIR/packages"
cp -av *.dmg "$TRAVIS_BUILD_DIR/packages"
fi
1 change: 1 addition & 0 deletions src/commons/opencv_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ namespace cv {
// const int COLOR_RGBA2RGB = CV_RGBA2RGB;
// const int COLOR_HSV2BGR = CV_HSV2BGR;
// const int COLOR_BGR2HSV = CV_BGR2HSV;
// const int COLOR_YUV2RGB_YUYV = CV_YUV2RGB_YUYV;
// const int IMWRITE_JPEG_QUALITY = CV_IMWRITE_JPEG_QUALITY;
// const int IMWRITE_PXM_BINARY = CV_IMWRITE_PXM_BINARY;
// const int IMREAD_UNCHANGED = CV_LOAD_IMAGE_UNCHANGED;
Expand Down
5 changes: 5 additions & 0 deletions src/drivers/supporteddrivers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include <QFileInfo>
#include <QDirIterator>
#include <QJsonDocument>
#include <QMutex>
#include <QMutexLocker>
#include "drivers/imagerexception.h"

using namespace std;
Expand Down Expand Up @@ -62,6 +64,7 @@ std::shared_ptr<Driver> SupportedDriver::driver()
DPTR_IMPL(SupportedDrivers) {
SupportedDrivers *q;
QList<SupportedDriver::ptr> supported_drivers;
shared_ptr<QMutex> drivers_scan_mutex;

void find_drivers(const QString &directory);
void load_driver(const QString &filename);
Expand All @@ -70,6 +73,7 @@ DPTR_IMPL(SupportedDrivers) {

SupportedDrivers::SupportedDrivers(const QStringList &driversPath) : dptr(this)
{
d->drivers_scan_mutex = make_shared<QMutex>();
for(const QString &path: driversPath)
d->find_drivers(path);
}
Expand Down Expand Up @@ -134,6 +138,7 @@ void SupportedDrivers::aboutToQuit()

QList<CameraPtr> SupportedDrivers::cameras() const
{
QMutexLocker lock(d->drivers_scan_mutex.get());
qDebug() << "Detecting active cameras";
QList<CameraPtr> cameras;
for(auto supported_driver: d->supported_drivers) {
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/v4l2/v4l2imagingworker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ V4L2ImagingWorker::V4L2ImagingWorker(const V4L2DevicePtr& device, const v4l2_for
// Compressed formats
{V4L2_PIX_FMT_MJPEG, bind(&Private::import_frame, d.get(), _1)},
// YUV Colorspace
{V4L2_PIX_FMT_YUYV, bind(&Private::convert_frame, d.get(), _1, CV_8UC2, CV_YUV2RGB_YUYV, Frame::RGB)},
{V4L2_PIX_FMT_YUYV, bind(&Private::convert_frame, d.get(), _1, CV_8UC2, cv::COLOR_YUV2RGB_YUYV, Frame::RGB)},
};
auto pixelformat = format.fmt.pix.pixelformat;
if(!formats.contains(pixelformat))
Expand Down
2 changes: 0 additions & 2 deletions support/docker/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

docker_path = os.path.abspath(os.path.dirname(__file__))
code_path = os.path.dirname(os.path.dirname(docker_path))
os.chdir(docker_path)

images = [
Ubuntu('19.04', 'x86_64'),
Expand Down Expand Up @@ -68,7 +67,6 @@ def list_images():
def package(args):
if args.clean_logs:
cleanup_logs()

destination_path = os.path.abspath(args.dest) if args.dest and args.dest != 'none' else None
filtered_images = filter_images(args.images_filter)
cmake_defines = args.cmake_define
Expand Down
14 changes: 8 additions & 6 deletions support/docker/dockerfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
import subprocess
from datetime import datetime

images_dir = 'images'
logs_dir = os.path.abspath('./logs')
docker_path = os.path.abspath(os.path.dirname(__file__))

images_dir = os.path.join(docker_path, 'images')
logs_dir = os.path.abspath(os.path.join(docker_path, 'logs'))

def cleanup_logs():
shutil.rmtree(logs_dir, ignore_errors=True)
Expand All @@ -15,7 +17,7 @@ def cleanup_logs():
class Dockerfile:
def __init__(self, name, snippets, files, substitutions):
self.name = name
self.snippets = [Snippet(os.path.join('snippets', snippet + '.in')) for snippet in snippets]
self.snippets = [Snippet(os.path.join(docker_path, 'snippets', snippet + '.in')) for snippet in snippets]
self.substitutions = substitutions
self.files = files
self.status = None
Expand All @@ -33,8 +35,8 @@ def write(self):
snippets = []

snippets.extend(self.snippets)
snippets.append(Snippet('snippets/workdir.in'))
snippets.append(Snippet('snippets/entrypoint.in'))
snippets.append(Snippet(os.path.join(docker_path, 'snippets/workdir.in')))
snippets.append(Snippet(os.path.join(docker_path, 'snippets/entrypoint.in')))

for snippet in snippets:
with open(dockerfile, 'a') as f:
Expand Down Expand Up @@ -62,7 +64,7 @@ def package(self, code_path, destination_path, make_jobs, cmake_defines, stderr=
'-e',
'MAKE_OPTS=-j{}'.format(make_jobs),
]
if destination_path and destination_path != 'none':
if destination_path:
cmdline.extend([
'-v',
'{}:/dest'.format(os.path.abspath(destination_path)),
Expand Down
2 changes: 1 addition & 1 deletion support/docker/fedora.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

class Fedora(LinuxBase):
def __init__(self, version, arch):
super().__init__('fedora', 'fedora', version, arch)
super().__init__('fedora', 'fedora', version, arch, ['libusb', 'opencv'])


2 changes: 1 addition & 1 deletion support/docker/files/configuration-fedora-29.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include(${CMAKE_CURRENT_LIST_DIR}/configuration-fedora-base.cmake)
set(CPACK_RPM_PACKAGE_REQUIRES "libusb, qt5-qtbase >= 5.5.0, opencv >= 2.4.0 , fxload, CCfits" CACHE STRING "")
set(CPACK_RPM_PACKAGE_REQUIRES "qt5-qtbase >= 5.5.0, fxload, CCfits, libdc1394" CACHE STRING "")

2 changes: 1 addition & 1 deletion support/docker/files/configuration-fedora-30.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include(${CMAKE_CURRENT_LIST_DIR}/configuration-fedora-base.cmake)
set(CPACK_RPM_PACKAGE_REQUIRES "libusb, qt5-qtbase >= 5.5.0, opencv >= 2.4.0 , fxload, CCfits" CACHE STRING "")
set(CPACK_RPM_PACKAGE_REQUIRES "qt5-qtbase >= 5.5.0, fxload, CCfits, libdc1394" CACHE STRING "")

2 changes: 1 addition & 1 deletion support/docker/files/configuration-fedora-31.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include(${CMAKE_CURRENT_LIST_DIR}/configuration-fedora-base.cmake)
set(CPACK_RPM_PACKAGE_REQUIRES "libusb, qt5-qtbase >= 5.5.0, opencv >= 2.4.0 , fxload, CCfits" CACHE STRING "")
set(CPACK_RPM_PACKAGE_REQUIRES "qt5-qtbase >= 5.5.0, fxload, CCfits, libdc1394" CACHE STRING "")

3 changes: 1 addition & 2 deletions support/docker/snippets/fedora.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ RUN yum install -y \
qt5-qtdeclarative-devel \
gcc-c++ \
cmake \
opencv-devel \
boost-devel \
git \
libusb-devel \
CCfits-devel \
libdc1394-devel \
autoconf automake libtool libudev-devel \
&& yum clean all -y
WORKDIR /build
RUN mkdir /cmake
Expand Down
9 changes: 4 additions & 5 deletions support/docker/snippets/opencv.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#RUN cd / && git clone https://github.com/libusb/libusb.git libusb-git && cd libusb-git && ./autogen.sh && ./configure --enable-static=yes --enable-shared=no --prefix=/opt/libusb-git && make all install && cd / && rm -rf /libusb-git
RUN cd / && git clone https://github.com/opencv/opencv.git opencv-git -b 3.1.0 && \
RUN cd / && git clone https://github.com/opencv/opencv.git opencv-git -b 4.1.0 && \
mkdir -p opencv-git/build && \
cd opencv-git/build && \
$CMAKE_BIN ../ \
-DCMAKE_INSTALL_PREFIX=/opt/opencv%{OPENCV_DIR_SUFFIX} \
%{CMAKE_BIN} ../ \
-DCMAKE_INSTALL_PREFIX=/opt/opencv-git \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_WIN32UI=Off \
-DWITH_QT=Off \
Expand All @@ -28,4 +27,4 @@ RUN cd / && git clone https://github.com/opencv/opencv.git opencv-git -b 3.1.0 &
-DBUILD_PERF_TESTS=Off \
&& make all install && \
cd / && rm -rf /opencv-git
ENV CMAKE_PREFIX_PATH="/opt/opencv;$CMAKE_PREFIX_PATH}"
ENV CMAKE_PREFIX_PATH="/opt/opencv-git;$CMAKE_PREFIX_PATH}"