Skip to content
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
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@
############################################################################

# Validate CMake version.
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)

if(COMMAND CMAKE_POLICY)
cmake_policy(SET CMP0003 NEW)
cmake_policy(SET CMP0075 NEW)
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.28")
cmake_policy(SET CMP0153 OLD)
cmake_policy(SET CMP0145 OLD)
endif()
endif(COMMAND CMAKE_POLICY)

# Required C++ Standard.
Expand Down
5 changes: 5 additions & 0 deletions cmake/Architecture.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ macro(dune_test_cpu cpu bits endianess macro header)

if(${output})
check_cxx_source_compiles("#if defined(__arch64__)\n#else\n#error not defined\n#endif\nint main(void) {return 0; }\n" __ARCH64__)
check_cxx_source_compiles("#if defined(__aarch64__)\n#else\n#error not defined\n#endif\nint main(void) {return 0; }\n" __AARCH64__)
if(__ARCH64__)
set(gbits 64)
endif(__ARCH64__)
if(__AARCH64__)
set(gbits 64)
endif(__AARCH64__)

set(DUNE_CPU 1)
set(DUNE_CPU_${ucpu} 1)
Expand Down Expand Up @@ -91,6 +95,7 @@ macro(dune_probe_cpu)
dune_test_cpu(ARMv4 32 unknown __ARM_ARCH_4T__ cstdio)
dune_test_cpu(ARMv5 32 unknown __ARM_ARCH_5T__ cstdio)
dune_test_cpu(ARMv7 32 unknown __ARM_ARCH_7A__ cstdio)
dune_test_cpu(ARMv8 64 little __aarch64__ cstdio)
dune_test_cpu(ARM 32 unknown __arm__ cstdio)
dune_test_cpu(SPARC 32 big __sparc__ cstdio)
dune_test_cpu(SPARCv9 64 big __sparcv9 cstdio)
Expand Down
4 changes: 2 additions & 2 deletions cmake/Libraries/Exiv2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

if(EXIV2)
find_library(EXIV2_LIBRARY NAMES exiv2 PATHS /usr/lib)

if(${EXIV2_LIBRARY} STRLESS "libexiv2.so")
if(${EXIV2_LIBRARY} MATCHES "libexiv2.so")
message(STATUS "Found Exiv2 library: ${EXIV2_LIBRARY}")
# Exiv2 Present
set(DUNE_SYS_HAS_EXIV2 1 CACHE INTERNAL "Exiv2 library")
set(DUNE_USING_EXIV2 1 CACHE INTERNAL "Exiv2 library")
Expand Down
15 changes: 3 additions & 12 deletions cmake/Libraries/JPEG.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,11 @@
CHECK_LIBRARY_EXISTS(jpeg jpeg_set_defaults "" HAVE_LIB_JPEG)
dune_test_header_deps(jpeglib.h "sys/types.h;stdio.h")

check_cxx_source_compiles("
#include <stdio.h>
#include <jpeglib.h>
#if JPEG_LIB_VERSION < 80
# error JPEG too old
#endif
int main(void) {return 0;}"
HAVE_LIB_JPEG_80)

if(HAVE_LIB_JPEG AND HAVE_LIB_JPEG_80 AND DUNE_SYS_HAS_JPEGLIB_H)
if(HAVE_LIB_JPEG AND DUNE_SYS_HAS_JPEGLIB_H)
dune_add_lib(jpeg)
set(DUNE_SYS_HAS_JPEG 1 CACHE INTERNAL "JPEG library")
set(DUNE_USING_JPEG 1 CACHE INTERNAL "JPEG library")
else(HAVE_LIB_JPEG AND HAVE_LIB_JPEG_80 AND DUNE_SYS_HAS_JPEGLIB_H)
else(HAVE_LIB_JPEG AND DUNE_SYS_HAS_JPEGLIB_H)
set(DUNE_SYS_HAS_JPEG 0 CACHE INTERNAL "JPEG library")
set(DUNE_USING_JPEG 0 CACHE INTERNAL "JPEG library")
endif(HAVE_LIB_JPEG AND HAVE_LIB_JPEG_80 AND DUNE_SYS_HAS_JPEGLIB_H)
endif(HAVE_LIB_JPEG AND DUNE_SYS_HAS_JPEGLIB_H)
29 changes: 12 additions & 17 deletions cmake/Libraries/OpenCV.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@
############################################################################

if(OPENCV)
CHECK_LIBRARY_EXISTS(opencv_core cvGetImage "" HAVE_LIB_OPENCV)
#find_package(OpenCV4 REQUIRED)
find_library(OPENCV_LIBRARY NAMES opencv_core PATHS /usr/lib)
if(${OPENCV_LIBRARY} MATCHES "libopencv_core.so")
# OPENCV Present
message(STATUS "Found Opencv library: ${OPENCV_LIBRARY}")
set(DUNE_SYS_HAS_OPENCV 1 CACHE INTERNAL "Opencv library")
set(DUNE_USING_OPENCV 1 CACHE INTERNAL "Opencv library")

if(HAVE_LIB_OPENCV)
# OpenCV Present
set(DUNE_SYS_HAS_OPENCV 1 CACHE INTERNAL "OpenCV library")
set(DUNE_USING_OPENCV 1 CACHE INTERNAL "OpenCV library")

# FIND_PACKAGE(OpenCV REQUIRED)
# FIND_PACKAGE(OpenCV REQUIRED)
dune_add_lib(opencv_calib3d)
dune_add_lib(opencv_core)
dune_add_lib(opencv_features2d)
Expand All @@ -54,19 +55,13 @@ if(OPENCV)
#dune_add_lib(opencv_contrib)
#dune_add_lib(opencv_gpu)
#dune_add_lib(opencv_legacy)
dune_add_lib(opencv_imgcodecs)

# Check Header
dune_test_header(opencv2/opencv.hpp)

dune_test_header(opencv2/imgcodecs.hpp)
if(DUNE_SYS_HAS_OPENCV2_IMGCODECS_HPP)
dune_add_lib(opencv_imgcodecs)
endif(DUNE_SYS_HAS_OPENCV2_IMGCODECS_HPP)

else(HAVE_LIB_OPENCV)
else()
# OpenCV not found on the system.
message(SEND_ERROR "OpenCV was not found on the system.")
set(DUNE_SYS_HAS_OPENCV 0 CACHE INTERNAL "OpenCV library")
set(DUNE_USING_OPENCV 0 CACHE INTERNAL "OpenCV library")
endif(HAVE_LIB_OPENCV)
endif()

endif(OPENCV)
19 changes: 7 additions & 12 deletions cmake/Libraries/PointGrey.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,21 @@
############################################################################

if(POINTGREY)
CHECK_LIBRARY_EXISTS(flycapture-c GetInternal "" HAVE_LIB_FLYCAPTURE)

if(HAVE_LIB_FLYCAPTURE)
# FlyCapture Present
find_library(POINTGREY_LIBRARY NAMES flycapture PATHS /usr/lib)
if(${POINTGREY_LIBRARY} MATCHES "libflycapture.so")
message(STATUS "Found Pointgrey library: ${POINTGREY_LIBRARY}")
# Flycapture Present
set(DUNE_SYS_HAS_FLYCAPTURE 1 CACHE INTERNAL "FlyCapture library")
set(DUNE_USING_FLYCAPTURE 1 CACHE INTERNAL "FlyCapture library")


dune_add_lib(flycapture)
dune_add_lib(flycapture-c)

# Check Header
dune_test_header(flycapture/FlyCapture2.h)
dune_test_header(flycapture/FlyCapture2_C.h)

else(HAVE_LIB_FLYCAPTURE)
# FlyCapture not found on the system.
else()
# FlyCapture not found on the system.
message(SEND_ERROR "FlyCapture was not found on the system.")
set(DUNE_SYS_HAS_FLYCAPTURE 0 CACHE INTERNAL "FlyCapture library")
set(DUNE_USING_FLYCAPTURE 0 CACHE INTERNAL "FlyCapture library")
endif(HAVE_LIB_FLYCAPTURE)
endif()

endif(POINTGREY)
34 changes: 27 additions & 7 deletions src/Vision/PointGrey/SaveImage.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
/*
* SavImage.hpp
*
* Created on: May 8, 2017
* Author: Pedro Gonçalves
*/
//***************************************************************************
// Copyright 2007-2022 Universidade do Porto - Faculdade de Engenharia *
// Laboratório de Sistemas e Tecnologia Subaquática (LSTS) *
//***************************************************************************
// This file is part of DUNE: Unified Navigation Environment. *
// *
// Commercial Licence Usage *
// Licencees holding valid commercial DUNE licences may use this file in *
// accordance with the commercial licence agreement provided with the *
// Software or, alternatively, in accordance with the terms contained in a *
// written agreement between you and Universidade do Porto. For licensing *
// terms, conditions, and further information contact [email protected]. *
// *
// European Union Public Licence - EUPL v.1.1 Usage *
// Alternatively, this file may be used under the terms of the EUPL, *
// Version 1.1 only (the "Licence"), appearing in the file LICENCE.md *
// included in the packaging of this file. You may not use this work *
// except in compliance with the Licence. Unless required by applicable *
// law or agreed to in writing, software distributed under the Licence is *
// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF *
// ANY KIND, either express or implied. See the Licence for the specific *
// language governing permissions and limitations at *
// http://ec.europa.eu/idabc/eupl.html. *
//***************************************************************************
// Author: Pedro Gonçalves *
//***************************************************************************

#ifndef VISION_POINTGREY_SAVEIMAGE_HPP_INCLUDED_
#define VISION_POINTGREY_SAVEIMAGE_HPP_INCLUDED_
Expand Down Expand Up @@ -78,7 +98,7 @@ namespace Vision
{
m_name_thread = name;
m_new_image = false;
m_jpeg_params.push_back(CV_IMWRITE_JPEG_QUALITY);
m_jpeg_params.push_back(cv::IMWRITE_JPEG_QUALITY);
m_jpeg_params.push_back(65);
m_row_bytes = 0;
cv::setNumThreads(1);
Expand Down
31 changes: 15 additions & 16 deletions src/Vision/PointGrey/Task.cmake
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
if(POINTGREY)
if(DUNE_SYS_HAS___ARM_ARCH_7A__)
if(NOT DUNE_SYS_HAS_OPENCV)
set(TASK_ENABLED FALSE)
endif(NOT DUNE_SYS_HAS_OPENCV)
if(DUNE_SYS_HAS___ARM_ARCH_7A__ OR DUNE_SYS_HAS___AARCH64__)

if(NOT DUNE_SYS_HAS_EXIV2)
set(TASK_ENABLED FALSE)
endif(NOT DUNE_SYS_HAS_EXIV2)
if(NOT DUNE_SYS_HAS_OPENCV)
set(TASK_ENABLED FALSE)
endif(NOT DUNE_SYS_HAS_OPENCV)

if(NOT DUNE_SYS_HAS_EXIV2)
set(TASK_ENABLED FALSE)
endif(NOT DUNE_SYS_HAS_EXIV2)

if(NOT DUNE_SYS_HAS_FLYCAPTURE)
set(TASK_ENABLED FALSE)
endif(NOT DUNE_SYS_HAS_FLYCAPTURE)
elseif(DUNE_OS_WINDOWS)
if(NOT DUNE_SYS_HAS_FLYCAPTURE)
set(TASK_ENABLED FALSE)
endif(DUNE_SYS_HAS___ARM_ARCH_7A__)
else()
endif(NOT DUNE_SYS_HAS_FLYCAPTURE)

else(DUNE_SYS_HAS___ARM_ARCH_7A__ OR DUNE_SYS_HAS___AARCH64__)
set(TASK_ENABLED FALSE)
endif(POINTGREY)

set(TASK_LICENSE "Proprietary")
endif(DUNE_SYS_HAS___ARM_ARCH_7A__ OR DUNE_SYS_HAS___AARCH64__)

set(TASK_LICENSE "Proprietary")
Loading