Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSS-Vision Library (v1.0.0) #1

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
41f38d8
basic isolation of processing for headless run
Icaro-Nunes May 2, 2024
7d17786
feat(Vision): add frame type argument
acrucha May 8, 2024
db61cc5
refactor(Camera): removing all references to camera manager
acrucha May 14, 2024
0fe9bc3
refactor(GUI): removing all references to the vision ui
acrucha May 14, 2024
fbc5479
refactor(Network): removing all references to logging and communicati…
acrucha May 14, 2024
6118c33
refactor(client): removing client
acrucha May 14, 2024
04e1c16
refactor(*): rmoving all thread locks, temporization and Qt dependencies
acrucha May 14, 2024
800e889
fix(Segmentation): using MaggicSegmentation instead of LUTSegmentation
acrucha May 14, 2024
9f2bc37
feat(MaggicSegmentation): passing hue list by constructor parameter
acrucha May 16, 2024
ffe41b1
feat(headless-vision): implement pybind11
Icaro-Nunes May 21, 2024
81fcf50
feat(*): add hue list to vss-vision function params
acrucha May 28, 2024
1685d68
feat(*): add image and answer examples
acrucha May 28, 2024
9f6a76c
build(*): remove Qt of the dependencies & add python and pybind11 to …
acrucha May 29, 2024
5d72f20
refactor(*): remove Config folder
acrucha May 29, 2024
c284b45
build(*): building and installation of python library now embedded in…
Icaro-Nunes May 31, 2024
29f21cb
fix(MaggicSegmentation): color IDs
acrucha May 31, 2024
da1fa53
feat(*): implementing a function to return the detected blobs
acrucha Jun 1, 2024
58bbdbf
feat(*): returning blobs grouped by team
acrucha Jun 2, 2024
8c8b1eb
chore: update .gitignore
Icaro-Nunes Jun 4, 2024
53e5781
fix: hueList update fixed
Icaro-Nunes Jun 4, 2024
5407f28
wip: remove LUT - already working, but code is too messy
Icaro-Nunes Jun 4, 2024
c5c3b50
feat(BlobsDetection): changing blob position type
acrucha Jun 9, 2024
b0f8e60
chore(Vision): removing comment
bmmuc Jun 9, 2024
7b64768
feat(headless-vision): enable compiler optimizations
Icaro-Nunes Jun 9, 2024
70d4ad0
build: updating shell scripts
acrucha Jun 10, 2024
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 .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ RUN if [ "${REINSTALL_CMAKE_VERSION_FROM_SOURCE}" != "none" ]; then \

# [Optional] Uncomment this section to install additional packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends qtbase5-dev libsfml-dev libopencv-dev freeglut3-dev protobuf-compiler libprotobuf-dev
&& apt-get -y install --no-install-recommends libsfml-dev libopencv-dev freeglut3-dev
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ client/RCClient

# Compiled protobuf
*_pb2.py

# scikit-build
_skbuild/
88 changes: 37 additions & 51 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,23 @@ set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(EXECUTABLE_OUTPUT_PATH "${PROJECT_SOURCE_DIR}/src")
# set(EXECUTABLE_OUTPUT_PATH "${PROJECT_SOURCE_DIR}/src")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/vss_vision)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

include(GNUInstallDirs)
include(FindPackageHandleStandardArgs)
include(FetchContent)

FetchContent_Declare(
pybind11
URL https://github.com/pybind/pybind11/archive/refs/tags/v2.6.2.tar.gz
URL_HASH SHA256=8ff2fff22df038f5cd02cea8af56622bc67f5b64534f1b83b9f133b8366acff2
)
FetchContent_MakeAvailable(pybind11)

set(python_module_name vss_vision)

set(SOURCES
src/main.cpp
Expand All @@ -23,31 +39,15 @@ set(SOURCES
src/Vision/ImageProcessing/MaggicSegmentation.cpp
src/Vision/ImageProcessing/WarpCorrection.cpp
src/Vision/ImageProcessing/OpenCV/connectedcomponents.cpp
src/visionconfigdialog.cpp
src/fieldpointscalibratedialog.cpp
src/segmentationconfigdialog.cpp
src/cameraconfigurationdialog.cpp
src/Logging/logging.cpp
src/Vision/ColorSpace.cpp
src/maggicsegmentationdialog.cpp
src/Timer/Timer.cpp
src/visionthread.cpp
src/CameraManager/CameraManager.cpp
src/CameraManager/CameraThread.cpp
src/Vision/PositionProcessing/runlengthencoding.cpp
src/Vision/PositionProcessing/BlobDetection.cpp
src/TBBThreadManager.cpp
src/Field/Field.cpp
src/GameInfo/GameInfo.cpp
src/Utils/Global.cpp
src/Windows/MainVSSWindow.cpp
src/Utils/Geometry.cpp
src/Utils/Draw.cpp
src/Utils/EnumsAndConstants.cpp
src/Windows/RobotWidget.cpp
src/trackconfigdialog.cpp
src/Network/Network.cpp
src/Network/visionServer/server.cpp
)

set(HEADERS
Expand All @@ -63,66 +63,52 @@ set(HEADERS
src/Vision/ImageProcessing/WarpCorrection.h
src/Vision/ColorSpace.h
src/Vision/ImageProcessing/OpenCV/connectedcomponents.hpp
src/visionconfigdialog.h
src/fieldpointscalibratedialog.h
src/segmentationconfigdialog.h
src/cameraconfigurationdialog.h
src/Logging/logging.h
src/maggicsegmentationdialog.h
src/Timer/Timer.h
src/visionthread.h
src/CameraManager/CameraManager.h
src/CameraManager/CameraThread.h
src/Vision/PositionProcessing/runlengthencoding.h
src/Vision/PositionProcessing/BlobDetection.h
src/TBBThreadManager.h
src/Utils/Types.h
src/Field/Field.h
src/Utils/EnumsAndConstants.h
src/GameInfo/GameInfo.h
src/Utils/Defines.h
src/Utils/Global.h
src/Windows/MainVSSWindow.h
src/Utils/Geometry.h
src/Utils/Draw.h
src/Windows/RobotWidget.h
src/Utils/BetterEnum.h
src/trackconfigdialog.h
src/Windows/FileConstants.h
src/Network/Network.h
src/Network/visionServer/server.h
)

set(RESOURCES
src/image.qrc
src/iconTools/icontools.qrc
)

set(PROTOS
src/Network/protobuf/proto/messages_robocup_ssl_detection.proto
src/Network/protobuf/proto/messages_robocup_ssl_geometry.proto
src/Network/protobuf/proto/wrapper.proto
pybind11_add_module(${python_module_name} MODULE
${SOURCES}
${HEADERS}
)

find_package(Protobuf REQUIRED)
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${PROTOS})

add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS} ${RESOURCES} ${PROTO_SRCS} ${PROTO_HDRS})
# add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS} ${RESOURCES} ${PROTO_SRCS} ${PROTO_HDRS})

target_include_directories(${PROJECT_NAME} PUBLIC "${PROJECT_SOURCE_DIR}/src")
target_include_directories(${PROJECT_NAME} PUBLIC "${PROJECT_SOURCE_DIR}/include")
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
set(CMAKE_CXX_FLAGS -O3)
message(CMAKE_CXX_FLAGS)
message("${CMAKE_CXX_FLAGS}")

find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui Network)
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets Qt5::Gui Qt5::Network)
target_include_directories(${python_module_name} PUBLIC "${PROJECT_SOURCE_DIR}/src")
target_include_directories(${python_module_name} PUBLIC "${PROJECT_SOURCE_DIR}/include")
target_include_directories(${python_module_name} PUBLIC ${CMAKE_CURRENT_BINARY_DIR})

set(OpenCV_STATIC ON)
find_package(OpenCV REQUIRED)
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})
target_link_libraries(${python_module_name} PUBLIC ${OpenCV_LIBS})

find_package(TBB REQUIRED)
target_link_libraries(${PROJECT_NAME} TBB::tbb)
target_link_libraries(${python_module_name} PUBLIC TBB::tbb)

file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/src/__init__.py
DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})

message(${python_module_name})

install(TARGETS ${python_module_name} DESTINATION .)

find_package(SFML REQUIRED COMPONENTS network system)
target_link_libraries(${PROJECT_NAME} sfml-network sfml-system)

target_link_libraries(${PROJECT_NAME} ${Protobuf_LIBRARIES})
33 changes: 26 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
FROM ubuntu:22.04

ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC

# for python3.8
RUN apt update && apt install -y tzdata software-properties-common \
&& add-apt-repository -y ppa:deadsnakes/ppa \
&& apt install -y python3.8 python3.8-dev python3.8-venv \
&& python3.8 -m venv /home/.env \
&& . /home/.env/bin/activate \
&& pip install opencv-python pybind11 scikit-build


RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends \
qtbase5-dev \
build-essential \
pkg-config \
zip \
Expand All @@ -11,16 +22,24 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
libsfml-dev \
libopencv-dev \
freeglut3-dev \
protobuf-compiler \
libprotobuf-dev \
cmake
cmake \
python3 \
libpython3-dev \
python3-dev \
python3-pip

COPY . /opt/vss-vision

WORKDIR /opt/vss-vision/build
WORKDIR /opt/vss-vision

RUN cmake clean .. -Wno-dev && make -j4
RUN . /home/.env/bin/activate \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make \
&& cd .. \
&& pip install -e .

WORKDIR /opt/vss-vision/src

CMD ["./VSS-VISION"]
WORKDIR /opt/vss-vision
32 changes: 17 additions & 15 deletions InstallDependencies
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@
# Update repos
sudo apt update -y

# Install SFML
sudo apt install libsfml-dev -y

# Install OpenCV
sudo apt install libopencv-dev -y

# Install OpenGL + FreeGLUT3
sudo apt install freeglut3-dev -y

# Install QT5
sudo apt install qtbase5-dev -y

# Intall Protobuf
sudo apt install libprotobuf -y
sudo apt install protobuf-compiler -y
sudo apt -y install --no-install-recommends \
build-essential \
pkg-config \
zip \
unzip \
v4l-utils \
libsfml-dev \
libopencv-dev \
freeglut3-dev \
libprotobuf-dev

sudo apt install \
cmake \
python3 \
libpython3-dev \
python3-dev \
python3-pip
15 changes: 0 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,33 +55,20 @@ cd src
├── include
│ └── spdlog
└── src
├── cameraconfigurationdialog.cpp
├── CameraManager
│ ├── CameraManager.cpp
│ └── CameraThread.cpp
├── Config
│ └── Segmentation
├── Entity
│ └── Entity.cpp
├── fieldpointscalibratedialog.cpp
├── iconTools
├── Images
├── Log
│ ├── general
│ ├── others
│ └── vision
├── Logging
│ └── logging.cpp
├── maggicsegmentationdialog.cpp
├── main.cpp
├── mainwindow.cpp
├── qrc_icontools.cpp
├── qrc_image.cpp
├── segmentationconfigdialog.cpp
├── TBBThreadManager.cpp
├── Timer
│ └── Timer.cpp
├── trackconfigdialog.cpp
├── Utils
│ ├── Constants.cpp
│ └── Utils.cpp
Expand All @@ -102,8 +89,6 @@ cd src
│ │ ├── runlengthencoding.cpp
│ │ └── WhereAreThose.cpp
│ └── Vision.cpp
├── visionconfigdialog.cpp
└── visionthread.cpp
```
- - -

Expand Down
2 changes: 0 additions & 2 deletions client/.gitignore

This file was deleted.

42 changes: 0 additions & 42 deletions client/Makefile

This file was deleted.

Binary file removed client/font/UbuntuMono-R.ttf
Binary file not shown.
15 changes: 0 additions & 15 deletions client/include/Base.hpp

This file was deleted.

25 changes: 0 additions & 25 deletions client/include/Entity.hpp

This file was deleted.

Loading