diff --git a/.gitignore b/.gitignore index cb9a0c40e8eda317ba3477008419219242b198f5..d21da98baf316a02e809830091b2fbe5ba45f456 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ a/hardware b/data dox/old +.cache diff --git a/a/setup/camo-big-innenkante.png b/a/setup/camo-big-innenkante.png new file mode 100644 index 0000000000000000000000000000000000000000..120aabd720dc6391d5c0733e191a742bbe996cb1 Binary files /dev/null and b/a/setup/camo-big-innenkante.png differ diff --git a/a/setup/camo-big-innenkante.xcf b/a/setup/camo-big-innenkante.xcf new file mode 100644 index 0000000000000000000000000000000000000000..80266beac69a1e1fbc294dc9251c08c14c162554 Binary files /dev/null and b/a/setup/camo-big-innenkante.xcf differ diff --git a/a/setup/camo-pattern-innenkante.xcf b/a/setup/camo-pattern-innenkante.xcf new file mode 100644 index 0000000000000000000000000000000000000000..7af990ed1c7ee309d1079510f2e83172af183fe6 Binary files /dev/null and b/a/setup/camo-pattern-innenkante.xcf differ diff --git a/a/setup/camo-sedruck-order.png b/a/setup/camo-sedruck-order.png new file mode 100644 index 0000000000000000000000000000000000000000..e9e21da01a64e5ab380d39fafefb8d16c184f148 Binary files /dev/null and b/a/setup/camo-sedruck-order.png differ diff --git a/a/setup/camocalc b/a/setup/camocalc index 929e2e3cae46dadc52eb7af6a10c31ca7bea8744..0893c21b1de1a89d1d3e7ed450f19fb1989ff194 100644 --- a/a/setup/camocalc +++ b/a/setup/camocalc @@ -1,6 +1,22 @@ +alle umrechnungen bei 300dpiâ€¼ï¸ +############################### +INNENKANTE +56.2cm - 1.2 = 55cm diameter +172.78 x 39.5cm - 20407 x 4665px + +21.60 x 19.75cm - 2551 x 2333px - 8tel der breite und haelfte der hoehe - pattern +> export as pattern to ~/.config/GIMP/2.10/patterns/camo.pat +86.39 x 39.5cm - 10204 x 4665px - 0.5breite + 1hoehe +add border overlap on one side +91 x 39.5cm - 10748 x 4665px #print 2x for 1 arena/cylinder + + + + +############################### +AUSSENKANTE 22 x 20cm - 2598 x 2362px - ne 8tel der breite und haelfte der hoehe -export as pattern to ~/.config/GIMP/2.10/patterns/camo.pat 176 x 40cm - 20784 x 4724px (3px zu klein in der breite) fill with pattern @@ -10,7 +26,6 @@ add 5cm border overlap on right side druck max 160 x 106cm - ############################### 88 x 40cm - 10394 x 4724px - 0.5breite + 1hoehe add 5cm border overlap on right side @@ -22,3 +37,4 @@ add 5cm border overlap on right side aufkleber 72€ * 12 - 864€ + diff --git a/b b/b index baf20feef3380d7ac1193f54ecf761454eb466c6..f357a09457a5acd2704bffe3d9b0de6e2d73f7b2 160000 --- a/b +++ b/b @@ -1 +1 @@ -Subproject commit baf20feef3380d7ac1193f54ecf761454eb466c6 +Subproject commit f357a09457a5acd2704bffe3d9b0de6e2d73f7b2 diff --git a/compile_commands.json b/compile_commands.json new file mode 100644 index 0000000000000000000000000000000000000000..25f94c468acf351baccfe43091ece9bf9c299779 --- /dev/null +++ b/compile_commands.json @@ -0,0 +1,514 @@ +[ + { + "arguments": [ + "/usr/bin/g++", + "-c", + "-pipe", + "-Wno-deprecated-enum-enum-conversion", + "-O2", + "-Wall", + "-Wextra", + "-D_REENTRANT", + "-fPIC", + "-DQT_USE_QSTRINGBUILDER", + "-DCONSOLE", + "-DQT_NO_DEBUG", + "-DQT_GUI_LIB", + "-DQT_CORE_LIB", + "-I.", + "-I../vimbax/api/include", + "-I/usr/include/opencv4", + "-I/usr/include/x86_64-linux-gnu/qt5", + "-I/usr/include/x86_64-linux-gnu/qt5/QtGui", + "-I/usr/include/x86_64-linux-gnu/qt5/QtCore", + "-I.", + "-I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++", + "-o", + "console.o", + "../src/cmd/console.cpp" + ], + "directory": "/home/kr69sugu/code/idiv/camtron_all/b/obj", + "file": "/home/kr69sugu/code/idiv/camtron_all/b/src/cmd/console.cpp", + "output": "/home/kr69sugu/code/idiv/camtron_all/b/obj/console.o" + }, + { + "arguments": [ + "/usr/bin/g++", + "-c", + "-pipe", + "-Wno-deprecated-enum-enum-conversion", + "-O2", + "-Wall", + "-Wextra", + "-D_REENTRANT", + "-fPIC", + "-DQT_USE_QSTRINGBUILDER", + "-DCONSOLE", + "-DQT_NO_DEBUG", + "-DQT_GUI_LIB", + "-DQT_CORE_LIB", + "-I.", + "-I../vimbax/api/include", + "-I/usr/include/opencv4", + "-I/usr/include/x86_64-linux-gnu/qt5", + "-I/usr/include/x86_64-linux-gnu/qt5/QtGui", + "-I/usr/include/x86_64-linux-gnu/qt5/QtCore", + "-I.", + "-I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++", + "-o", + "main.o", + "../src/cmd/main.cpp" + ], + "directory": "/home/kr69sugu/code/idiv/camtron_all/b/obj", + "file": "/home/kr69sugu/code/idiv/camtron_all/b/src/cmd/main.cpp", + "output": "/home/kr69sugu/code/idiv/camtron_all/b/obj/main.o" + }, + { + "arguments": [ + "/usr/bin/g++", + "-c", + "-pipe", + "-Wno-deprecated-enum-enum-conversion", + "-O2", + "-Wall", + "-Wextra", + "-D_REENTRANT", + "-fPIC", + "-DQT_USE_QSTRINGBUILDER", + "-DCONSOLE", + "-DQT_NO_DEBUG", + "-DQT_GUI_LIB", + "-DQT_CORE_LIB", + "-I.", + "-I../vimbax/api/include", + "-I/usr/include/opencv4", + "-I/usr/include/x86_64-linux-gnu/qt5", + "-I/usr/include/x86_64-linux-gnu/qt5/QtGui", + "-I/usr/include/x86_64-linux-gnu/qt5/QtCore", + "-I.", + "-I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++", + "-o", + "cam.o", + "../src/cam.cpp" + ], + "directory": "/home/kr69sugu/code/idiv/camtron_all/b/obj", + "file": "/home/kr69sugu/code/idiv/camtron_all/b/src/cam.cpp", + "output": "/home/kr69sugu/code/idiv/camtron_all/b/obj/cam.o" + }, + { + "arguments": [ + "/usr/bin/g++", + "-c", + "-pipe", + "-Wno-deprecated-enum-enum-conversion", + "-O2", + "-Wall", + "-Wextra", + "-D_REENTRANT", + "-fPIC", + "-DQT_USE_QSTRINGBUILDER", + "-DCONSOLE", + "-DQT_NO_DEBUG", + "-DQT_GUI_LIB", + "-DQT_CORE_LIB", + "-I.", + "-I../vimbax/api/include", + "-I/usr/include/opencv4", + "-I/usr/include/x86_64-linux-gnu/qt5", + "-I/usr/include/x86_64-linux-gnu/qt5/QtGui", + "-I/usr/include/x86_64-linux-gnu/qt5/QtCore", + "-I.", + "-I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++", + "-o", + "camobserver.o", + "../src/camobserver.cpp" + ], + "directory": "/home/kr69sugu/code/idiv/camtron_all/b/obj", + "file": "/home/kr69sugu/code/idiv/camtron_all/b/src/camobserver.cpp", + "output": "/home/kr69sugu/code/idiv/camtron_all/b/obj/camobserver.o" + }, + { + "arguments": [ + "/usr/bin/g++", + "-c", + "-pipe", + "-Wno-deprecated-enum-enum-conversion", + "-O2", + "-Wall", + "-Wextra", + "-D_REENTRANT", + "-fPIC", + "-DQT_USE_QSTRINGBUILDER", + "-DCONSOLE", + "-DQT_NO_DEBUG", + "-DQT_GUI_LIB", + "-DQT_CORE_LIB", + "-I.", + "-I../vimbax/api/include", + "-I/usr/include/opencv4", + "-I/usr/include/x86_64-linux-gnu/qt5", + "-I/usr/include/x86_64-linux-gnu/qt5/QtGui", + "-I/usr/include/x86_64-linux-gnu/qt5/QtCore", + "-I.", + "-I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++", + "-o", + "core.o", + "../src/core.cpp" + ], + "directory": "/home/kr69sugu/code/idiv/camtron_all/b/obj", + "file": "/home/kr69sugu/code/idiv/camtron_all/b/src/core.cpp", + "output": "/home/kr69sugu/code/idiv/camtron_all/b/obj/core.o" + }, + { + "arguments": [ + "/usr/bin/g++", + "-c", + "-pipe", + "-Wno-deprecated-enum-enum-conversion", + "-O2", + "-Wall", + "-Wextra", + "-D_REENTRANT", + "-fPIC", + "-DQT_USE_QSTRINGBUILDER", + "-DCONSOLE", + "-DQT_NO_DEBUG", + "-DQT_GUI_LIB", + "-DQT_CORE_LIB", + "-I.", + "-I../vimbax/api/include", + "-I/usr/include/opencv4", + "-I/usr/include/x86_64-linux-gnu/qt5", + "-I/usr/include/x86_64-linux-gnu/qt5/QtGui", + "-I/usr/include/x86_64-linux-gnu/qt5/QtCore", + "-I.", + "-I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++", + "-o", + "frameobserver.o", + "../src/frameobserver.cpp" + ], + "directory": "/home/kr69sugu/code/idiv/camtron_all/b/obj", + "file": "/home/kr69sugu/code/idiv/camtron_all/b/src/frameobserver.cpp", + "output": "/home/kr69sugu/code/idiv/camtron_all/b/obj/frameobserver.o" + }, + { + "arguments": [ + "/usr/bin/g++", + "-c", + "-pipe", + "-Wno-deprecated-enum-enum-conversion", + "-O2", + "-Wall", + "-Wextra", + "-D_REENTRANT", + "-fPIC", + "-DQT_USE_QSTRINGBUILDER", + "-DCONSOLE", + "-DQT_NO_DEBUG", + "-DQT_GUI_LIB", + "-DQT_CORE_LIB", + "-I.", + "-I../vimbax/api/include", + "-I/usr/include/opencv4", + "-I/usr/include/x86_64-linux-gnu/qt5", + "-I/usr/include/x86_64-linux-gnu/qt5/QtGui", + "-I/usr/include/x86_64-linux-gnu/qt5/QtCore", + "-I.", + "-I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++", + "-o", + "frameprocessor.o", + "../src/frameprocessor.cpp" + ], + "directory": "/home/kr69sugu/code/idiv/camtron_all/b/obj", + "file": "/home/kr69sugu/code/idiv/camtron_all/b/src/frameprocessor.cpp", + "output": "/home/kr69sugu/code/idiv/camtron_all/b/obj/frameprocessor.o" + }, + { + "arguments": [ + "/usr/bin/g++", + "-c", + "-pipe", + "-Wno-deprecated-enum-enum-conversion", + "-O2", + "-Wall", + "-Wextra", + "-D_REENTRANT", + "-fPIC", + "-DQT_USE_QSTRINGBUILDER", + "-DCONSOLE", + "-DQT_NO_DEBUG", + "-DQT_GUI_LIB", + "-DQT_CORE_LIB", + "-I.", + "-I../vimbax/api/include", + "-I/usr/include/opencv4", + "-I/usr/include/x86_64-linux-gnu/qt5", + "-I/usr/include/x86_64-linux-gnu/qt5/QtGui", + "-I/usr/include/x86_64-linux-gnu/qt5/QtCore", + "-I.", + "-I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++", + "-o", + "iprinter.o", + "../src/iprinter.cpp" + ], + "directory": "/home/kr69sugu/code/idiv/camtron_all/b/obj", + "file": "/home/kr69sugu/code/idiv/camtron_all/b/src/iprinter.cpp", + "output": "/home/kr69sugu/code/idiv/camtron_all/b/obj/iprinter.o" + }, + { + "arguments": [ + "/usr/bin/g++", + "-c", + "-pipe", + "-Wno-deprecated-enum-enum-conversion", + "-O2", + "-Wall", + "-Wextra", + "-D_REENTRANT", + "-fPIC", + "-DQT_USE_QSTRINGBUILDER", + "-DCONSOLE", + "-DQT_NO_DEBUG", + "-DQT_GUI_LIB", + "-DQT_CORE_LIB", + "-I.", + "-I../vimbax/api/include", + "-I/usr/include/opencv4", + "-I/usr/include/x86_64-linux-gnu/qt5", + "-I/usr/include/x86_64-linux-gnu/qt5/QtGui", + "-I/usr/include/x86_64-linux-gnu/qt5/QtCore", + "-I.", + "-I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++", + "-o", + "utils.o", + "../src/utils.cpp" + ], + "directory": "/home/kr69sugu/code/idiv/camtron_all/b/obj", + "file": "/home/kr69sugu/code/idiv/camtron_all/b/src/utils.cpp", + "output": "/home/kr69sugu/code/idiv/camtron_all/b/obj/utils.o" + }, + { + "arguments": [ + "/usr/bin/g++", + "-c", + "-pipe", + "-Wno-deprecated-enum-enum-conversion", + "-O2", + "-Wall", + "-Wextra", + "-D_REENTRANT", + "-fPIC", + "-DQT_USE_QSTRINGBUILDER", + "-DCONSOLE", + "-DQT_NO_DEBUG", + "-DQT_GUI_LIB", + "-DQT_CORE_LIB", + "-I.", + "-I../vimbax/api/include", + "-I/usr/include/opencv4", + "-I/usr/include/x86_64-linux-gnu/qt5", + "-I/usr/include/x86_64-linux-gnu/qt5/QtGui", + "-I/usr/include/x86_64-linux-gnu/qt5/QtCore", + "-I.", + "-I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++", + "-o", + "moc_console.o", + "moc_console.cpp" + ], + "directory": "/home/kr69sugu/code/idiv/camtron_all/b/obj", + "file": "/home/kr69sugu/code/idiv/camtron_all/b/obj/moc_console.cpp", + "output": "/home/kr69sugu/code/idiv/camtron_all/b/obj/moc_console.o" + }, + { + "arguments": [ + "/usr/bin/g++", + "-c", + "-pipe", + "-Wno-deprecated-enum-enum-conversion", + "-O2", + "-Wall", + "-Wextra", + "-D_REENTRANT", + "-fPIC", + "-DQT_USE_QSTRINGBUILDER", + "-DCONSOLE", + "-DQT_NO_DEBUG", + "-DQT_GUI_LIB", + "-DQT_CORE_LIB", + "-I.", + "-I../vimbax/api/include", + "-I/usr/include/opencv4", + "-I/usr/include/x86_64-linux-gnu/qt5", + "-I/usr/include/x86_64-linux-gnu/qt5/QtGui", + "-I/usr/include/x86_64-linux-gnu/qt5/QtCore", + "-I.", + "-I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++", + "-o", + "moc_cam.o", + "moc_cam.cpp" + ], + "directory": "/home/kr69sugu/code/idiv/camtron_all/b/obj", + "file": "/home/kr69sugu/code/idiv/camtron_all/b/obj/moc_cam.cpp", + "output": "/home/kr69sugu/code/idiv/camtron_all/b/obj/moc_cam.o" + }, + { + "arguments": [ + "/usr/bin/g++", + "-c", + "-pipe", + "-Wno-deprecated-enum-enum-conversion", + "-O2", + "-Wall", + "-Wextra", + "-D_REENTRANT", + "-fPIC", + "-DQT_USE_QSTRINGBUILDER", + "-DCONSOLE", + "-DQT_NO_DEBUG", + "-DQT_GUI_LIB", + "-DQT_CORE_LIB", + "-I.", + "-I../vimbax/api/include", + "-I/usr/include/opencv4", + "-I/usr/include/x86_64-linux-gnu/qt5", + "-I/usr/include/x86_64-linux-gnu/qt5/QtGui", + "-I/usr/include/x86_64-linux-gnu/qt5/QtCore", + "-I.", + "-I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++", + "-o", + "moc_camobserver.o", + "moc_camobserver.cpp" + ], + "directory": "/home/kr69sugu/code/idiv/camtron_all/b/obj", + "file": "/home/kr69sugu/code/idiv/camtron_all/b/obj/moc_camobserver.cpp", + "output": "/home/kr69sugu/code/idiv/camtron_all/b/obj/moc_camobserver.o" + }, + { + "arguments": [ + "/usr/bin/g++", + "-c", + "-pipe", + "-Wno-deprecated-enum-enum-conversion", + "-O2", + "-Wall", + "-Wextra", + "-D_REENTRANT", + "-fPIC", + "-DQT_USE_QSTRINGBUILDER", + "-DCONSOLE", + "-DQT_NO_DEBUG", + "-DQT_GUI_LIB", + "-DQT_CORE_LIB", + "-I.", + "-I../vimbax/api/include", + "-I/usr/include/opencv4", + "-I/usr/include/x86_64-linux-gnu/qt5", + "-I/usr/include/x86_64-linux-gnu/qt5/QtGui", + "-I/usr/include/x86_64-linux-gnu/qt5/QtCore", + "-I.", + "-I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++", + "-o", + "moc_core.o", + "moc_core.cpp" + ], + "directory": "/home/kr69sugu/code/idiv/camtron_all/b/obj", + "file": "/home/kr69sugu/code/idiv/camtron_all/b/obj/moc_core.cpp", + "output": "/home/kr69sugu/code/idiv/camtron_all/b/obj/moc_core.o" + }, + { + "arguments": [ + "/usr/bin/g++", + "-c", + "-pipe", + "-Wno-deprecated-enum-enum-conversion", + "-O2", + "-Wall", + "-Wextra", + "-D_REENTRANT", + "-fPIC", + "-DQT_USE_QSTRINGBUILDER", + "-DCONSOLE", + "-DQT_NO_DEBUG", + "-DQT_GUI_LIB", + "-DQT_CORE_LIB", + "-I.", + "-I../vimbax/api/include", + "-I/usr/include/opencv4", + "-I/usr/include/x86_64-linux-gnu/qt5", + "-I/usr/include/x86_64-linux-gnu/qt5/QtGui", + "-I/usr/include/x86_64-linux-gnu/qt5/QtCore", + "-I.", + "-I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++", + "-o", + "moc_frameobserver.o", + "moc_frameobserver.cpp" + ], + "directory": "/home/kr69sugu/code/idiv/camtron_all/b/obj", + "file": "/home/kr69sugu/code/idiv/camtron_all/b/obj/moc_frameobserver.cpp", + "output": "/home/kr69sugu/code/idiv/camtron_all/b/obj/moc_frameobserver.o" + }, + { + "arguments": [ + "/usr/bin/g++", + "-c", + "-pipe", + "-Wno-deprecated-enum-enum-conversion", + "-O2", + "-Wall", + "-Wextra", + "-D_REENTRANT", + "-fPIC", + "-DQT_USE_QSTRINGBUILDER", + "-DCONSOLE", + "-DQT_NO_DEBUG", + "-DQT_GUI_LIB", + "-DQT_CORE_LIB", + "-I.", + "-I../vimbax/api/include", + "-I/usr/include/opencv4", + "-I/usr/include/x86_64-linux-gnu/qt5", + "-I/usr/include/x86_64-linux-gnu/qt5/QtGui", + "-I/usr/include/x86_64-linux-gnu/qt5/QtCore", + "-I.", + "-I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++", + "-o", + "moc_frameprocessor.o", + "moc_frameprocessor.cpp" + ], + "directory": "/home/kr69sugu/code/idiv/camtron_all/b/obj", + "file": "/home/kr69sugu/code/idiv/camtron_all/b/obj/moc_frameprocessor.cpp", + "output": "/home/kr69sugu/code/idiv/camtron_all/b/obj/moc_frameprocessor.o" + }, + { + "arguments": [ + "/usr/bin/g++", + "-c", + "-pipe", + "-Wno-deprecated-enum-enum-conversion", + "-O2", + "-Wall", + "-Wextra", + "-D_REENTRANT", + "-fPIC", + "-DQT_USE_QSTRINGBUILDER", + "-DCONSOLE", + "-DQT_NO_DEBUG", + "-DQT_GUI_LIB", + "-DQT_CORE_LIB", + "-I.", + "-I../vimbax/api/include", + "-I/usr/include/opencv4", + "-I/usr/include/x86_64-linux-gnu/qt5", + "-I/usr/include/x86_64-linux-gnu/qt5/QtGui", + "-I/usr/include/x86_64-linux-gnu/qt5/QtCore", + "-I.", + "-I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++", + "-o", + "moc_iprinter.o", + "moc_iprinter.cpp" + ], + "directory": "/home/kr69sugu/code/idiv/camtron_all/b/obj", + "file": "/home/kr69sugu/code/idiv/camtron_all/b/obj/moc_iprinter.cpp", + "output": "/home/kr69sugu/code/idiv/camtron_all/b/obj/moc_iprinter.o" + } +] diff --git a/dox/cmds.cpp b/dox/cmds.cpp index fcee97203a0a1f31526b8214859b405b153c3612..c0fe56fb7dc00433b3b9bbb4da5b5cb6a79ada19 120000 --- a/dox/cmds.cpp +++ b/dox/cmds.cpp @@ -1 +1 @@ -/home/sugu/dox/cmds/cmds.cpp \ No newline at end of file +/home/kr69sugu/dox/cmds/cmds.cpp \ No newline at end of file diff --git a/dox/notes_a b/dox/notes_a index f03ccaabc9baf068666fa53e8843fbe5e6835b20..82b7827743ca073514068bff45765dd198076852 100644 --- a/dox/notes_a +++ b/dox/notes_a @@ -15,21 +15,13 @@ Does ############################### # arena: - 3D printed PETG-Arena + 3D printed PETG-Arena + camo pattern ## Camera Settings ########################## - MAC ADDRESSES: - camtron1: 000A4708ED3F - camtron2: 000A471COC9D - camtron3: 000A47372777 - camtron4: 000A471D2A66 - camtron5: 000A471D208D - camtron6: 000A47139EA6 - * lens aperture and focus should be adjusted optimal to have a pin sharp pictures with no overexposure -> fix screw on lens gain?? use pix of written text of diff size diff --git a/dox/notes_b b/dox/notes_b index 1369f57d2bbc0ee5d6ed732f062e12bf87c5e8ad..a703a4d9abe3444563bd0a17f0691531a7a4ad81 100644 --- a/dox/notes_b +++ b/dox/notes_b @@ -21,11 +21,12 @@ map cam -> MAC -> IP -> name (contains ID) camtron2 000A471C0C9D 172.18.227.211 allied-alviumg1-240c-04ytp.idiv.de camtron3 000A47372777 172.18.225.164 allied-alviumg1-240c-04ytn.idiv.de camtron4 000A471D2A66 172.18.227.213 allied-alviumg1-240c-04ytm.idiv.de - camtron5 000A471D208D 172.18.225.129 allied-alviumg1-240c-04ytt.idiv.de + camtron5 000A471D208D 172.18.225.198 allied-alviumg1-240c-04ytt.idiv.de camtron6 000A47139EA6 172.18.227.215 allied-alviumg1-240c-04ytv.idiv.de - direct: 169.254.75.147 - + direct (find with ping scan in 169.254.x.x): + ct1 169.254.75.147 + ct4 169.254.224.36 camtron1/// @@ -36,6 +37,7 @@ camtron1/// + wired settings 169.254.100.3 255.255.0.0 @@ -386,3 +388,22 @@ Save "reasonable" settings in XML. If dark, set ExposureTimeAbs Q: how to set fps to 3? ############################### + +The approach you've taken to save images asynchronously in a separate thread is generally a good practice, as it helps prevent blocking the main thread and allows for better resource management. However, it's crucial to ensure that you properly handle file operations and resource cleanup within your asynchronous processing logic to avoid issues such as file leaks. + +In your code snippet, it seems that you're moving the FrameProcessor object to a separate thread (QThread) and connecting signals and slots to manage the processing of frames and their subsequent handling. While this setup is appropriate for asynchronous processing, it's essential to verify that you're closing files after writing images. + +Here are some steps you can take to ensure proper file handling and cleanup: + + Verify File Closure: Double-check your FrameProcessor class implementation (specifically, the processFrame() method) to ensure that after calling cv::imwrite(), you properly close the file handle. The cv::imwrite() function should handle file writing and closing internally, but it's still essentia to ensure there are no leaks in your code. + + Error Handling: Implement error handling mechanisms to catch any exceptions or errors that might occur during file writing. If an error occurs, make sure to close the file handle and handle the error gracefully. + + Resource Monitoring: Monitor your application's resource usage, including file descriptors, to identify any potential leaks or issues with file handling. You can use system monitoring tools or utilities to track file descriptor usage over time and detect any abnormal behavior. + + Testing: Perform thorough testing of your application, including stress testing and long-running tests, to verify that file handling is robust and doesn't lead to resource leaks or errors over time. + +Additionally, ensure that your application doesn't hit system-imposed limits on the number of open files. If necessary, you can adjust the file descriptor limit for your process using system configuration or programmatically within your application (although this should be done cautiously). + +By implementing these steps and carefully reviewing your asynchronous file writing logic, you can ensure that your application handles file operations correctly and efficiently, minimizing the risk of resource leaks or errors related to file handling. +ChatGPT can make mistakes. Consider checking important information. diff --git a/dox/scrap b/dox/scrap index 83d21848ed7777a9a62ac4de04a18d9bc549058e..2ab804b197acedab18995487fc63c7417ea858c0 100644 --- a/dox/scrap +++ b/dox/scrap @@ -1,3 +1,154 @@ +use as cali? +sightcalibrator/jammy 21.0.0-4 amd64 + Camera calibration software + ###############################console non block input + read user input + // // Non-blocking input +#include <unistd.h> +#include <fcntl.h> +void setNonBlockingMode() { + int flags = fcntl(STDIN_FILENO, F_GETFL, 0); + if (flags != -1) { + fcntl(STDIN_FILENO, F_SETFL, flags | O_NONBLOCK); + } +} +void restoreBlockingMode() { + int flags = fcntl(STDIN_FILENO, F_GETFL, 0); + if (flags != -1) { + fcntl(STDIN_FILENO, F_SETFL, flags & ~O_NONBLOCK); + } +} +////would need to change +setNonBlockingMode(); + +std::string input; +char c; +bool hasInput = false; + +while (running) { + // Check if there's any input available + if (read(STDIN_FILENO, &c, 1) > 0) { + // Append the character to the input string + input.push_back(c); + hasInput = true; + } else if (hasInput) { + // If there was previous input and no more input available, + // process the input + if (input == "q\n") { // Check for 'q' followed by newline + qDebug() << "User requested exit"; + running = false; + QMetaObject::invokeMethod(qApp, "quit", Qt::QueuedConnection); + break; + } else if (!input.empty()) { + // Process the input here + qDebug() << "Received input:" << QString::fromStdString(input); + } + input.clear(); // Clear the input buffer + hasInput = false; + } + // Add a small delay to avoid busy-waiting + QThread::msleep(100); + } + + restoreBlockingMode(); // Revert back to blocking mode before exiting + +############################### +QString randomString() +{ + QStringList list{"a", "b", "c", "d", "e", "f", "g"}; + //, "h", "i", "j", "k", "l", "m"}; + std::random_device rd; + std::mt19937 g(rd()); + std::shuffle(list.begin(), list.end(), g); + QString randomString = list.join(""); + qDebug() << "Random string:" << randomString; + return randomString; +} + +bool maybeCreateDir(QDir out_dir) +{ + if( !out_dir.exists() ) + { + qDebug() << "out_dir (" << out_dir.absolutePath() << ") doesn't exist. Should I Create it? ['y'-yes, '?'-no]"; + char c='y'; + std::cin >> c; + if( c == 'y' ) + { + qDebug() << "u pressed yes"; + if( out_dir.mkpath(out_dir.absolutePath())) { + qDebug() << "created out_dir"; + } + else + { + std::cerr << "failed to create out_dir '" << out_dir.absolutePath().toStdString() << "'" << std::endl; + return false; + } + } + else + { + qDebug() << "u pressed no"; + return false; + } + } + qDebug() << "out_dir: " << out_dir.dirName(); + return true; +} +############################### +updateCameras() + // CameraPtrVector vmbCameras; + // if ( f(_sys.GetCameras( vmbCameras ), "update cameras") ) + // return; + + // if( (int)vmbCameras.size() != ncam() ) //update number of cameras + // error(QString("Expected %1 cams!").arg(ncam()),errLessCamsThanExpected); //XXX warning + + // // vector< shared_ptr<Camera> > vmbCameras + // // vector< shared_ptr<Cam> > _cameras + + // // Add new cameras + // for (const auto& vcam : vmbCameras) + // { + // bool found = false; + // for (const auto& cam : _cameras) + // { + // if (cam->getCameraPtr() == vcam) + // { + // found = true; + // break; + // } + // } + // if (!found) + // { + // _cameras.push_back(std::make_shared<Cam>(vcam)); //create Cam() from CameraPtr vcam + // print(QString("cam connected: %1").arg(_cameras.back()->id())); + // } + // } + + // // Remove cameras that are no longer present + // auto it = _cameras.begin(); + // while (it != _cameras.end()) + // { + // // qDebug() << "check " << (*it)->id(); + + // bool found = false; + // for (const auto& vcam : vmbCameras) + // { + // if ((*it)->getCameraPtr() == vcam) + // { + // found = true; + // ++it; + // break; + // } + // } + + // if (!found) + // { + // qDebug() << __LINE__ << "-" << __PRETTY_FUNCTION__ << " !!! "; + // print({"cam disconnected",(*it)->id()}); + // it = _cameras.erase(it); + // } + // } +} // now ~Camera() should be called on removed cams. >> triggers camObserver + //############################### // // We create a FrameProcessor class that subclasses QObject and defines a slot processFrame() to handle frame processing. @@ -16,68 +167,68 @@ using namespace AVT::VmbAPI; class FrameProcessor : public QObject { - Q_OBJECT + Q_OBJECT public slots: - void processFrame(FramePtr pFrame) - { - VmbUint64_t timestamp; - if (VmbErrorSuccess == pFrame->GetTimestamp(timestamp)) - { - // Convert timestamp to QDateTime for better handling with Qt - QDateTime dateTime = QDateTime::fromMSecsSinceEpoch(timestamp / 1000); - - // Convert QDateTime to a string format - QString timestampStr = dateTime.toString("yyyy-MM-dd_HH-mm-ss"); - - // Process the frame - VmbUchar_t *buffer; - if (VmbErrorSuccess == pFrame->GetImage(buffer)) - { - int width, height; - VmbUint32_t imageSize; - pFrame->GetWidth(width); - pFrame->GetHeight(height); - pFrame->GetImageSize(imageSize); - - cv::Mat image(height, width, CV_8UC1, buffer); - - // Save the frame with timestamp using Qt functions - QString filename = "camera_image_" + timestampStr + ".jpg"; - cv::imwrite(filename.toStdString(), image); - } - } - } + void processFrame(FramePtr pFrame) + { + VmbUint64_t timestamp; + if (VmbErrorSuccess == pFrame->GetTimestamp(timestamp)) + { + // Convert timestamp to QDateTime for better handling with Qt + QDateTime dateTime = QDateTime::fromMSecsSinceEpoch(timestamp / 1000); + + // Convert QDateTime to a string format + QString timestampStr = dateTime.toString("yyyy-MM-dd_HH-mm-ss"); + + // Process the frame + VmbUchar_t *buffer; + if (VmbErrorSuccess == pFrame->GetImage(buffer)) + { + int width, height; + VmbUint32_t imageSize; + pFrame->GetWidth(width); + pFrame->GetHeight(height); + pFrame->GetImageSize(imageSize); + + cv::Mat image(height, width, CV_8UC1, buffer); + + // Save the frame with timestamp using Qt functions + QString filename = "camera_image_" + timestampStr + ".jpg"; + cv::imwrite(filename.toStdString(), image); + } + } + } }; class FrameObserver : public IFrameObserver { public: - FrameObserver(CameraPtr pCamera, QObject *parent = nullptr) : IFrameObserver(pCamera), m_processor(new FrameProcessor), m_thread(new QThread(parent)) - { - m_processor->moveToThread(m_thread); - connect(this, &FrameObserver::frameReceived, m_processor, &FrameProcessor::processFrame); - m_thread->start(); - } - - ~FrameObserver() - { - m_thread->quit(); - m_thread->wait(); - delete m_thread; - } - - void FrameReceived(const FramePtr pFrame) override - { - emit frameReceived(pFrame); - } + FrameObserver(CameraPtr pCamera, QObject *parent = nullptr) : IFrameObserver(pCamera), m_processor(new FrameProcessor), m_thread(new QThread(parent)) + { + m_processor->moveToThread(m_thread); + connect(this, &FrameObserver::frameReceived, m_processor, &FrameProcessor::processFrame); + m_thread->start(); + } + + ~FrameObserver() + { + m_thread->quit(); + m_thread->wait(); + delete m_thread; + } + + void FrameReceived(const FramePtr pFrame) override + { + emit frameReceived(pFrame); + } signals: - void frameReceived(FramePtr pFrame); + void frameReceived(FramePtr pFrame); private: - FrameProcessor *m_processor; - QThread *m_thread; + FrameProcessor *m_processor; + QThread *m_thread; }; ############################### @@ -90,48 +241,48 @@ using namespace AVT::VmbAPI; void FrameObserver::FrameReceived(const FramePtr pFrame) { - VmbUint64_t timestamp; - if (VmbErrorSuccess == pFrame->GetTimestamp(timestamp)) - { - // Convert timestamp to QDateTime for better handling with Qt - QDateTime dateTime = QDateTime::fromMSecsSinceEpoch(timestamp / 1000); - - // Convert QDateTime to a string format - QString timestampStr = dateTime.toString("yyyy-MM-dd_HH-mm-ss"); - - // Process the frame - VmbUchar_t *buffer; - if (VmbErrorSuccess == pFrame->GetImage(buffer)) - { - int width, height; - VmbUint32_t imageSize; - pFrame->GetWidth(width); - pFrame->GetHeight(height); - pFrame->GetImageSize(imageSize); - - cv::Mat image(height, width, CV_8UC1, buffer); - - // Save the frame with timestamp using Qt functions - QString filename = "camera_image_" + timestampStr + ".jpg"; - cv::imwrite(filename.toStdString(), image); - } - } + VmbUint64_t timestamp; + if (VmbErrorSuccess == pFrame->GetTimestamp(timestamp)) + { + // Convert timestamp to QDateTime for better handling with Qt + QDateTime dateTime = QDateTime::fromMSecsSinceEpoch(timestamp / 1000); + + // Convert QDateTime to a string format + QString timestampStr = dateTime.toString("yyyy-MM-dd_HH-mm-ss"); + + // Process the frame + VmbUchar_t *buffer; + if (VmbErrorSuccess == pFrame->GetImage(buffer)) + { + int width, height; + VmbUint32_t imageSize; + pFrame->GetWidth(width); + pFrame->GetHeight(height); + pFrame->GetImageSize(imageSize); + + cv::Mat image(height, width, CV_8UC1, buffer); + + // Save the frame with timestamp using Qt functions + QString filename = "camera_image_" + timestampStr + ".jpg"; + cv::imwrite(filename.toStdString(), image); + } + } } ############################### ## IsCommandDone err = feature->RunCommand(); - if (err == VmbErrorSuccess) - { - bool commandDone = false; - do - { - if (feature->IsCommandDone(commandDone) != VmbErrorSuccess) - { - break; - } - } while (commandDone == false); - } + if (err == VmbErrorSuccess) + { + bool commandDone = false; + do + { + if (feature->IsCommandDone(commandDone) != VmbErrorSuccess) + { + break; + } + } while (commandDone == false); + } ############################### #include <VimbaC/Include/VimbaC.h> @@ -143,151 +294,151 @@ using namespace chrono; class Camera { public: - Camera(); - ~Camera(); + Camera(); + ~Camera(); - bool initialize(); - bool open(); - void close(); - bool startCapture(); - void stopCapture(); - bool captureFrame(); + bool initialize(); + bool open(); + void close(); + bool startCapture(); + void stopCapture(); + bool captureFrame(); private: - VmbHandle_t cameraHandle; + VmbHandle_t cameraHandle; }; Camera::Camera() : cameraHandle(nullptr) {} Camera::~Camera() { - close(); + close(); } bool Camera::initialize() { - return VmbErrorSuccess == VmbStartup(); + return VmbErrorSuccess == VmbStartup(); } bool Camera::open() { - VmbError_t err; - - VmbCameraInfo_t* pCameraList = nullptr; - VmbUint32_t nCount = 0; - - err = VmbCamerasList(nullptr, 0, &nCount, sizeof(VmbCameraInfo_t)); - if (err != VmbErrorSuccess || nCount == 0) { - cout << "No cameras found or error listing cameras" << endl; - return false; - } - - pCameraList = new VmbCameraInfo_t[nCount]; - err = VmbCamerasList(pCameraList, nCount, &nCount, sizeof(VmbCameraInfo_t)); - if (err != VmbErrorSuccess) { - cout << "Error retrieving camera list" << endl; - delete[] pCameraList; - return false; - } - - if (nCount == 0) { - cout << "No cameras found" << endl; - delete[] pCameraList; - return false; - } - - err = VmbCameraOpen(pCameraList[0].cameraIdString, VmbAccessModeFull, &cameraHandle); - delete[] pCameraList; - - return err == VmbErrorSuccess; + VmbError_t err; + + VmbCameraInfo_t* pCameraList = nullptr; + VmbUint32_t nCount = 0; + + err = VmbCamerasList(nullptr, 0, &nCount, sizeof(VmbCameraInfo_t)); + if (err != VmbErrorSuccess || nCount == 0) { + cout << "No cameras found or error listing cameras" << endl; + return false; + } + + pCameraList = new VmbCameraInfo_t[nCount]; + err = VmbCamerasList(pCameraList, nCount, &nCount, sizeof(VmbCameraInfo_t)); + if (err != VmbErrorSuccess) { + cout << "Error retrieving camera list" << endl; + delete[] pCameraList; + return false; + } + + if (nCount == 0) { + cout << "No cameras found" << endl; + delete[] pCameraList; + return false; + } + + err = VmbCameraOpen(pCameraList[0].cameraIdString, VmbAccessModeFull, &cameraHandle); + delete[] pCameraList; + + return err == VmbErrorSuccess; } void Camera::close() { - if (cameraHandle != nullptr) { - VmbCameraClose(cameraHandle); - cameraHandle = nullptr; - } + if (cameraHandle != nullptr) { + VmbCameraClose(cameraHandle); + cameraHandle = nullptr; + } } bool Camera::startCapture() { - return VmbErrorSuccess == VmbCaptureStart(cameraHandle); + return VmbErrorSuccess == VmbCaptureStart(cameraHandle); } void Camera::stopCapture() { - VmbCaptureEnd(cameraHandle); + VmbCaptureEnd(cameraHandle); } bool Camera::captureFrame() { - VmbError_t err; - - VmbFrame_t frame; - err = VmbFrameAnnounce(cameraHandle, &frame, sizeof(VmbFrame_t)); - if (err != VmbErrorSuccess) { - cout << "Error announcing frame" << endl; - return false; - } - - err = VmbCaptureFrameQueue(cameraHandle, &frame, nullptr); - if (err != VmbErrorSuccess) { - cout << "Error queuing frame" << endl; - return false; - } - - err = VmbCaptureFrameWait(cameraHandle, &frame, VMB_INFINITE); - if (err != VmbErrorSuccess) { - cout << "Error waiting for frame" << endl; - return false; - } - - // Get timestamp - VmbUint64_t timestamp; - err = VmbFrameGetTimestamp(cameraHandle, frame, ×tamp); - if (err == VmbErrorSuccess) { - auto duration = duration_cast<milliseconds>(nanoseconds(timestamp)); - cout << "Frame captured at timestamp: " << duration.count() << "ms" << endl; - } - - err = VmbFrameRevoke(cameraHandle, &frame); - if (err != VmbErrorSuccess) { - cout << "Error revoking frame" << endl; - return false; - } - - return true; + VmbError_t err; + + VmbFrame_t frame; + err = VmbFrameAnnounce(cameraHandle, &frame, sizeof(VmbFrame_t)); + if (err != VmbErrorSuccess) { + cout << "Error announcing frame" << endl; + return false; + } + + err = VmbCaptureFrameQueue(cameraHandle, &frame, nullptr); + if (err != VmbErrorSuccess) { + cout << "Error queuing frame" << endl; + return false; + } + + err = VmbCaptureFrameWait(cameraHandle, &frame, VMB_INFINITE); + if (err != VmbErrorSuccess) { + cout << "Error waiting for frame" << endl; + return false; + } + + // Get timestamp + VmbUint64_t timestamp; + err = VmbFrameGetTimestamp(cameraHandle, frame, ×tamp); + if (err == VmbErrorSuccess) { + auto duration = duration_cast<milliseconds>(nanoseconds(timestamp)); + cout << "Frame captured at timestamp: " << duration.count() << "ms" << endl; + } + + err = VmbFrameRevoke(cameraHandle, &frame); + if (err != VmbErrorSuccess) { + cout << "Error revoking frame" << endl; + return false; + } + + return true; } int main() { - Camera camera; + Camera camera; - if (!camera.initialize()) { - cout << "Failed to initialize Vimba" << endl; - return -1; - } + if (!camera.initialize()) { + cout << "Failed to initialize Vimba" << endl; + return -1; + } - if (!camera.open()) { - cout << "Failed to open camera" << endl; - return -1; - } + if (!camera.open()) { + cout << "Failed to open camera" << endl; + return -1; + } - if (!camera.startCapture()) { - cout << "Failed to start capture" << endl; - return -1; - } + if (!camera.startCapture()) { + cout << "Failed to start capture" << endl; + return -1; + } - // Capture frames and perform processing + // Capture frames and perform processing - // For demonstration purposes, let's capture 10 frames - for (int i = 0; i < 10; ++i) { - if (!camera.captureFrame()) { - cout << "Error capturing frame" << endl; - break; - } - // Add your processing logic here - } + // For demonstration purposes, let's capture 10 frames + for (int i = 0; i < 10; ++i) { + if (!camera.captureFrame()) { + cout << "Error capturing frame" << endl; + break; + } + // Add your processing logic here + } - camera.stopCapture(); - camera.close(); + camera.stopCapture(); + camera.close(); - VmbShutdown(); + VmbShutdown(); - return 0; + return 0; } ############################### @@ -300,175 +451,175 @@ int main() { #include <opencv2/opencv.hpp> class VimbaCamera : public QObject { - Q_OBJECT + Q_OBJECT public: - VimbaCamera(QObject *parent = nullptr); - ~VimbaCamera(); + VimbaCamera(QObject *parent = nullptr); + ~VimbaCamera(); - bool initialize(); - bool open(); - void close(); - bool startCapture(); - void stopCapture(); - bool captureFrame(); + bool initialize(); + bool open(); + void close(); + bool startCapture(); + void stopCapture(); + bool captureFrame(); signals: - void frameCaptured(const QString ×tamp, const cv::Mat &image); + void frameCaptured(const QString ×tamp, const cv::Mat &image); private: - VmbHandle_t cameraHandle; - VmbFrame_t frame; - // Add other camera-related members here + VmbHandle_t cameraHandle; + VmbFrame_t frame; + // Add other camera-related members here }; VimbaCamera::VimbaCamera(QObject *parent) : QObject(parent), cameraHandle(nullptr) {} VimbaCamera::~VimbaCamera() { - close(); + close(); } bool VimbaCamera::initialize() { - return VmbErrorSuccess == VmbStartup(); + return VmbErrorSuccess == VmbStartup(); } bool VimbaCamera::open() { - VmbError_t err; + VmbError_t err; - // Add code to list and open the Vimba camera - // ... + // Add code to list and open the Vimba camera + // ... - return err == VmbErrorSuccess; + return err == VmbErrorSuccess; } void VimbaCamera::close() { - if (cameraHandle != nullptr) { - // Add code to close the Vimba camera - // ... - cameraHandle = nullptr; - } + if (cameraHandle != nullptr) { + // Add code to close the Vimba camera + // ... + cameraHandle = nullptr; + } } bool VimbaCamera::startCapture() { - VmbError_t err; + VmbError_t err; - // Add code to configure camera settings for capturing - // ... + // Add code to configure camera settings for capturing + // ... - // Announce the frame - err = VmbFrameAnnounce(cameraHandle, &frame, sizeof(VmbFrame_t)); - if (err != VmbErrorSuccess) { - qDebug() << "Error announcing frame"; - return false; - } + // Announce the frame + err = VmbFrameAnnounce(cameraHandle, &frame, sizeof(VmbFrame_t)); + if (err != VmbErrorSuccess) { + qDebug() << "Error announcing frame"; + return false; + } - // Add code to start capturing frames using Vimba API - // ... + // Add code to start capturing frames using Vimba API + // ... - return true; + return true; } void VimbaCamera::stopCapture() { - // Add code to stop capturing frames using Vimba API - // ... - - // Revoke the frame - VmbError_t err = VmbFrameRevoke(cameraHandle, &frame); - if (err != VmbErrorSuccess) { - qDebug() << "Error revoking frame"; - } + // Add code to stop capturing frames using Vimba API + // ... + + // Revoke the frame + VmbError_t err = VmbFrameRevoke(cameraHandle, &frame); + if (err != VmbErrorSuccess) { + qDebug() << "Error revoking frame"; + } } bool VimbaCamera::captureFrame() { - VmbError_t err; - - // Add code to capture a frame with timestamp using Vimba API - // ... - - err = VmbCaptureFrameWait(cameraHandle, &frame, VMB_INFINITE); - if (err != VmbErrorSuccess) { - qDebug() << "Error waiting for frame"; - return false; - } - - // Get timestamp - VmbUint64_t timestamp; - err = VmbFrameGetTimestamp(cameraHandle, frame, ×tamp); - if (err == VmbErrorSuccess) { - auto duration = QDateTime::fromMSecsSinceEpoch(timestamp / 1000000); // Convert microseconds to milliseconds - qDebug() << "Frame captured at timestamp:" << duration.toString("yyyy-MM-dd hh:mm:ss.zzz"); - - // Convert the frame to a QImage and emit the signal - cv::Mat image(frame.height, frame.width, CV_8UC1, frame.buffer); - emit frameCaptured(duration.toString("yyyy-MM-dd_hhmmsszzz"), image.clone()); - } - - // Revoke the frame - err = VmbFrameRevoke(cameraHandle, &frame); - if (err != VmbErrorSuccess) { - qDebug() << "Error revoking frame"; - return false; - } - - return true; + VmbError_t err; + + // Add code to capture a frame with timestamp using Vimba API + // ... + + err = VmbCaptureFrameWait(cameraHandle, &frame, VMB_INFINITE); + if (err != VmbErrorSuccess) { + qDebug() << "Error waiting for frame"; + return false; + } + + // Get timestamp + VmbUint64_t timestamp; + err = VmbFrameGetTimestamp(cameraHandle, frame, ×tamp); + if (err == VmbErrorSuccess) { + auto duration = QDateTime::fromMSecsSinceEpoch(timestamp / 1000000); // Convert microseconds to milliseconds + qDebug() << "Frame captured at timestamp:" << duration.toString("yyyy-MM-dd hh:mm:ss.zzz"); + + // Convert the frame to a QImage and emit the signal + cv::Mat image(frame.height, frame.width, CV_8UC1, frame.buffer); + emit frameCaptured(duration.toString("yyyy-MM-dd_hhmmsszzz"), image.clone()); + } + + // Revoke the frame + err = VmbFrameRevoke(cameraHandle, &frame); + if (err != VmbErrorSuccess) { + qDebug() << "Error revoking frame"; + return false; + } + + return true; } class CameraThread : public QThread { - Q_OBJECT + Q_OBJECT public: - CameraThread(int cameraIndex, QObject *parent = nullptr) : QThread(parent), cameraIndex(cameraIndex) {} + CameraThread(int cameraIndex, QObject *parent = nullptr) : QThread(parent), cameraIndex(cameraIndex) {} protected: - void run() override { - VimbaCamera camera; - connect(&camera, &VimbaCamera::frameCaptured, this, &CameraThread::handleFrameCaptured); + void run() override { + VimbaCamera camera; + connect(&camera, &VimbaCamera::frameCaptured, this, &CameraThread::handleFrameCaptured); - if (!camera.initialize()) { - qDebug() << "Camera" << cameraIndex << "Failed to initialize Vimba"; - return; - } + if (!camera.initialize()) { + qDebug() << "Camera" << cameraIndex << "Failed to initialize Vimba"; + return; + } - if (!camera.open()) { - qDebug() << "Camera" << cameraIndex << "Failed to open Vimba camera"; - return; - } + if (!camera.open()) { + qDebug() << "Camera" << cameraIndex << "Failed to open Vimba camera"; + return; + } - if (!camera.startCapture()) { - qDebug() << "Camera" << cameraIndex << "Failed to start capturing frames"; - return; - } + if (!camera.startCapture()) { + qDebug() << "Camera" << cameraIndex << "Failed to start capturing frames"; + return; + } - exec(); // Start the thread event loop - } + exec(); // Start the thread event loop + } private: - int cameraIndex; + int cameraIndex; private slots: - void handleFrameCaptured(const QString ×tamp, const cv::Mat &image) { - // Handle the captured frame (e.g., save as JPEG) - QString filename = "camera" + QString::number(cameraIndex) + "_" + timestamp + ".jpg"; - cv::imwrite(filename.toStdString(), image); - qDebug() << "Camera" << cameraIndex << "Frame saved as:" << filename; - } + void handleFrameCaptured(const QString ×tamp, const cv::Mat &image) { + // Handle the captured frame (e.g., save as JPEG) + QString filename = "camera" + QString::number(cameraIndex) + "_" + timestamp + ".jpg"; + cv::imwrite(filename.toStdString(), image); + qDebug() << "Camera" << cameraIndex << "Frame saved as:" << filename; + } }; int main(int argc, char *argv[]) { - QCoreApplication a(argc, argv); + QCoreApplication a(argc, argv); - // For demonstration purposes, create two camera threads - CameraThread cameraThread1(1); - CameraThread cameraThread2(2); + // For demonstration purposes, create two camera threads + CameraThread cameraThread1(1); + CameraThread cameraThread2(2); - // Start the camera threads - cameraThread1.start(); - cameraThread2.start(); + // Start the camera threads + cameraThread1.start(); + cameraThread2.start(); - // Wait for the threads to finish (this won't block the main thread event loop) - cameraThread1.wait(); - cameraThread2.wait(); + // Wait for the threads to finish (this won't block the main thread event loop) + cameraThread1.wait(); + cameraThread2.wait(); - return a.exec(); + return a.exec(); } diff --git a/dox/timeplan_milestones.ods b/dox/timeplan_milestones.ods index 05908b03092a8dd4c446c24ebddd0566eff2451d..fae7ba5666e679f7088fd37d0d5656108a12690b 100644 Binary files a/dox/timeplan_milestones.ods and b/dox/timeplan_milestones.ods differ diff --git a/dox/todo_ct b/dox/todo_ct index f38802e526726d2acf7e5428d332420332a9997e..728debd3d459b0d9e4a8d63724925e2d8e5129c9 100644 --- a/dox/todo_ct +++ b/dox/todo_ct @@ -8,26 +8,30 @@ CAMTRON PROCESSING PIPELINE ########################### "tackle long-term complex projects from beginning to end" +A) +########################### + - eval vm performance + - â€¼ï¸ âº light + - day + night + dirt (later) + - find ecolux hw (Boxes, DMX per unit, DMX splitter/controller, PIs) + - â€¼ï¸ â¶ eval arena 3D-printed + attach camo > if good order 5more + - camo pattern print+create + - floor: find big white paperrolle in BUG/Storage + B) recorder - camera produces frames and timestamps ########################### - - test if solved ... ðŸ—£ï¸ sebastian hostname-fix IP -> â€¼ï¸ cam works with VM? - - BUG occasionaly frames are incomplete -> calling VV once fixes issues. why? maybe PACKSIZE ADjustment? - - â€¼ï¸ BUG files are not closed, causing OS limit crash (ulimit -n, too many open files...). why? + - â€¼ï¸ â¸ BUG occasionaly frames are incomplete -> calling VV once fixes issues. why? maybe PACKSIZE ADjustment? + - â€¼ï¸ â· BUG files are not closed, causing OS limit crash (ulimit -n, too many open files...). why? - test with 1 cam - test with x cams ============================ CORE - - â€¼ï¸ cam settings - save/load - - add camera name to filename - framerate, brightness ... - opencv or vimba? - - eval: use same settings(file) for all cams!? - app settings: - - save/load settings - out_dir, threads_per_cam, - - camName (hostname possible?), ... - record duration - - â€¼ï¸ calibrate + - â€¼ï¸ â¹ calibrate - see opencv tut + code/bash cali example - ada-HPC-CALISW @@ -50,15 +54,7 @@ B) recorder - camera produces frames and timestamps - where to store frames? estimate size. -A) -########################### - - test vm, else buy ws! - - â€¼ï¸ light - - 2*LEDs: 1*day + 1*night - - find ecolux hw (Boxes, DMX per unit, DMX splitter/controller) - - â€¼ï¸ ðŸ—£ï¸ arenas - - checkerboardpattern - - floor: find big white paperrolle in BUG/Storage + C) background subtraction @@ -93,7 +89,6 @@ D) process scripts X) HPC - High Performance Cluster #################################### - - gamify - lvl up - try script to send over data - script that copies data once a day from VM to HPC - Secure-Shell-ID angepasst @@ -124,34 +119,4 @@ ctb Done ####################### -- put cams in own class -- name / id -- state open/close, recording/stopped, timer -- track states - need to update open / closed states -- update state: camObserver: cameraOpenStateChanged(CameraPtr); -- detect cams -> camera interface listener! -- MS! produce frames & timestamps & save as jpg â˜ºï¸ - - frameObser + frameProcessor - - start recording - - stop recording -- use new api VimbaX -- read manual (c++ / vimba) -- write alliedvision (MTU) -- HPC. store some data 2018/2019 + vids. delete rest. write HPC guy -- use copilot more efficiently -> read Tuts, configure -> see ai -- print and printlist() -- integrate versionstring in new arch -- mark current cam [*] <-- selected. others [] -- write allied: submax MTU shouldnt be a huge performance hit! -- write mail HPC guy -- write joerdis -- list 1 cam and send to console via signal-slots -- version -- setup IDE (LSP plugins), QT, codecompletion -- get copilot -- automate + fix backup script -- get VM -- direct VV: got pictures, tested all 6 cams :) -- bup old camtrack -- start implementing new arch - - console app. thread. signal-slot connections. +