Commit 0e0fb113 authored by Nadir Dalla Pozza's avatar Nadir Dalla Pozza
Browse files

GOOD: auto detection of areas, correct processing and good thresholds for BERIO060.

parent 1c630295
......@@ -421,14 +421,7 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/ostream
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/bitset
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__bit_reference
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/fstream
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/iostream
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/vector
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/dirent.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/dirent.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/stat.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_s_ifmt.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_filesec_t.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/timeb.h
/usr/local/include/boost/uuid/uuid.hpp
/usr/local/include/boost/cstdint.hpp
......@@ -542,6 +535,7 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o
/usr/local/include/boost/random/detail/generator_bits.hpp
/usr/local/include/boost/random/detail/generator_seed_seq.hpp
/usr/local/include/boost/random/detail/polynomial.hpp
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/vector
/usr/local/include/boost/random/uniform_int.hpp
/usr/local/include/boost/random/uniform_int_distribution.hpp
/usr/local/include/boost/random/detail/operators.hpp
......@@ -937,6 +931,9 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/fcntl.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_o_sync.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_o_dsync.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_s_ifmt.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_filesec_t.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/stat.h
/usr/local/include/boost/uuid/uuid_io.hpp
/usr/local/include/boost/io/ios_state.hpp
/usr/local/include/boost/io_fwd.hpp
......@@ -1182,7 +1179,7 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o
/usr/local/include/nlohmann/ordered_map.hpp
/usr/local/include/nlohmann/detail/macro_unscope.hpp
/usr/local/include/nlohmann/thirdparty/hedley/hedley_undef.hpp
/Users/nadir/Documents/MPAI-CAE/AIMs/VideoAnalyser/src/rapidxml-1.13/rapidxml.hpp
/Users/nadir/Documents/MPAI-CAE/AIMs/VideoAnalyser/src/utility.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/fstream
/Users/nadir/Documents/MPAI-CAE/AIMs/VideoAnalyser/src/forAudioAnalyser.h
......@@ -420,14 +420,7 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o: ../src/script.cpp \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/ostream \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/bitset \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__bit_reference \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/fstream \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/iostream \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/vector \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/dirent.h \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/dirent.h \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/stat.h \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_s_ifmt.h \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_filesec_t.h \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/timeb.h \
/usr/local/include/boost/uuid/uuid.hpp \
/usr/local/include/boost/cstdint.hpp \
......@@ -541,6 +534,7 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o: ../src/script.cpp \
/usr/local/include/boost/random/detail/generator_bits.hpp \
/usr/local/include/boost/random/detail/generator_seed_seq.hpp \
/usr/local/include/boost/random/detail/polynomial.hpp \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/vector \
/usr/local/include/boost/random/uniform_int.hpp \
/usr/local/include/boost/random/uniform_int_distribution.hpp \
/usr/local/include/boost/random/detail/operators.hpp \
......@@ -936,6 +930,9 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o: ../src/script.cpp \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/fcntl.h \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_o_sync.h \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_o_dsync.h \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_s_ifmt.h \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_filesec_t.h \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/stat.h \
/usr/local/include/boost/uuid/uuid_io.hpp \
/usr/local/include/boost/io/ios_state.hpp \
/usr/local/include/boost/io_fwd.hpp \
......@@ -1181,11 +1178,13 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o: ../src/script.cpp \
/usr/local/include/nlohmann/ordered_map.hpp \
/usr/local/include/nlohmann/detail/macro_unscope.hpp \
/usr/local/include/nlohmann/thirdparty/hedley/hedley_undef.hpp \
../src/rapidxml-1.13/rapidxml.hpp \
../src/utility.h \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/fstream \
../src/forAudioAnalyser.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/fstream:
/usr/local/include/nlohmann/thirdparty/hedley/hedley_undef.hpp:
/usr/local/include/nlohmann/detail/output/serializer.hpp:
......@@ -1448,6 +1447,8 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o: ../src/script.cpp \
/usr/local/include/boost/uuid/uuid_io.hpp:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_filesec_t.h:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_o_dsync.h:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_o_sync.h:
......@@ -1650,11 +1651,13 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o: ../src/script.cpp \
/usr/local/include/boost/mpl/identity.hpp:
/usr/local/include/boost/mpl/aux_/reverse_fold_impl.hpp:
/usr/local/include/boost/function_types/is_callable_builtin.hpp:
/usr/local/include/boost/mpl/reverse_fold.hpp:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/wait.h:
/usr/local/include/boost/mpl/aux_/msvc_type.hpp:
/usr/local/include/boost/mpl/aux_/preprocessed/gcc/reverse_fold_impl.hpp:
/usr/local/include/boost/mpl/reverse_fold.hpp:
/usr/local/include/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:
......@@ -2088,6 +2091,10 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o: ../src/script.cpp \
/usr/local/include/boost/type_traits/is_volatile.hpp:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__functional/weak_result_type.h:
/usr/local/include/boost/mpl/aux_/preprocessed/gcc/fold_impl.hpp:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/libkern/_OSByteOrder.h:
/usr/local/include/boost/type_traits/is_const.hpp:
......@@ -2236,6 +2243,10 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o: ../src/script.cpp \
/usr/local/include/boost/type_traits/is_member_pointer.hpp:
/usr/local/include/boost/tti/detail/dnullptr.hpp:
/usr/local/include/boost/type_traits/intrinsics.hpp:
/usr/local/include/boost/mpl/long.hpp:
/usr/local/include/boost/mpl/remove_if.hpp:
......@@ -2312,6 +2323,12 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o: ../src/script.cpp \
/usr/local/include/boost/config/detail/select_stdlib_config.hpp:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__functional/binary_function.h:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/ctype.h:
/usr/local/include/boost/mpl/deref.hpp:
/usr/local/include/boost/config/detail/select_compiler_config.hpp:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__memory/addressof.h:
......@@ -2330,20 +2347,6 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o: ../src/script.cpp \
/usr/local/include/boost/uuid/uuid.hpp:
/usr/local/include/boost/preprocessor/facilities/expand.hpp:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_ct_rune_t.h:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_s_ifmt.h:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/dirent.h:
/usr/local/include/boost/tti/detail/dnullptr.hpp:
/usr/local/include/boost/type_traits/intrinsics.hpp:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/dirent.h:
/usr/local/include/boost/preprocessor/punctuation/paren.hpp:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/bitset:
......@@ -2406,8 +2409,6 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o: ../src/script.cpp \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_gid_t.h:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_filesec_t.h:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_blksize_t.h:
/usr/local/include/boost/mpl/vector/aux_/preprocessed/typeof_based/vector30.hpp:
......@@ -2500,8 +2501,6 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o: ../src/script.cpp \
/usr/local/include/boost/static_assert.hpp:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/fstream:
/usr/local/Cellar/opencv/4.5.5_2/include/opencv4/opencv2/imgproc/segmentation.hpp:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__algorithm/search_n.h:
......@@ -2520,10 +2519,6 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o: ../src/script.cpp \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__algorithm/replace_copy_if.h:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/libkern/i386/_OSByteOrder.h:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/stat.h:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__algorithm/replace_copy.h:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__algorithm/replace.h:
......@@ -2894,6 +2889,12 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o: ../src/script.cpp \
/usr/local/include/boost/mpl/aux_/preprocessed/gcc/apply.hpp:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_s_ifmt.h:
/usr/local/include/boost/preprocessor/facilities/expand.hpp:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_ct_rune_t.h:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/fcntl.h:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/locale:
......@@ -3064,10 +3065,6 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o: ../src/script.cpp \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__algorithm/shuffle.h:
/usr/local/include/boost/mpl/aux_/preprocessed/gcc/fold_impl.hpp:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__functional/weak_result_type.h:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/_ctype.h:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__utility/in_place.h:
......@@ -3166,6 +3163,10 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o: ../src/script.cpp \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/alloca.h:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/stat.h:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/libkern/i386/_OSByteOrder.h:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/_ctermid.h:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__iterator/data.h:
......@@ -3360,8 +3361,6 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o: ../src/script.cpp \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/assert.h:
../src/rapidxml-1.13/rapidxml.hpp:
/usr/local/include/boost/type_traits/type_identity.hpp:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/type_traits:
......@@ -3376,18 +3375,6 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o: ../src/script.cpp \
/usr/local/include/boost/preprocessor/comparison/not_equal.hpp:
/usr/local/include/boost/function_types/is_callable_builtin.hpp:
/usr/local/include/boost/mpl/aux_/preprocessed/gcc/reverse_fold_impl.hpp:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/wait.h:
/usr/local/include/boost/mpl/deref.hpp:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__functional/binary_function.h:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/ctype.h:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/compare:
/usr/local/include/boost/mpl/aux_/preprocessed/gcc/quote.hpp:
......@@ -3414,6 +3401,8 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o: ../src/script.cpp \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__ranges/enable_view.h:
/usr/local/include/boost/mpl/aux_/reverse_fold_impl.hpp:
/usr/local/include/boost/core/bit.hpp:
/usr/local/include/boost/function_types/detail/class_transform.hpp:
......@@ -3432,6 +3421,8 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o: ../src/script.cpp \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_u_int32_t.h:
/usr/local/include/boost/mpl/aux_/msvc_type.hpp:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_u_int8_t.h:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/syslimits.h:
......
/usr/bin/clang++ -std=c++11 -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/frame_extraction.dir/src/script.cpp.o -o ../bin/frame_extraction -Wl,-rpath,/usr/local/lib /usr/local/lib/libopencv_gapi.4.5.5.dylib /usr/local/lib/libopencv_stitching.4.5.5.dylib /usr/local/lib/libopencv_alphamat.4.5.5.dylib /usr/local/lib/libopencv_aruco.4.5.5.dylib /usr/local/lib/libopencv_barcode.4.5.5.dylib /usr/local/lib/libopencv_bgsegm.4.5.5.dylib /usr/local/lib/libopencv_bioinspired.4.5.5.dylib /usr/local/lib/libopencv_ccalib.4.5.5.dylib /usr/local/lib/libopencv_dnn_objdetect.4.5.5.dylib /usr/local/lib/libopencv_dnn_superres.4.5.5.dylib /usr/local/lib/libopencv_dpm.4.5.5.dylib /usr/local/lib/libopencv_face.4.5.5.dylib /usr/local/lib/libopencv_freetype.4.5.5.dylib /usr/local/lib/libopencv_fuzzy.4.5.5.dylib /usr/local/lib/libopencv_hfs.4.5.5.dylib /usr/local/lib/libopencv_img_hash.4.5.5.dylib /usr/local/lib/libopencv_intensity_transform.4.5.5.dylib /usr/local/lib/libopencv_line_descriptor.4.5.5.dylib /usr/local/lib/libopencv_mcc.4.5.5.dylib /usr/local/lib/libopencv_quality.4.5.5.dylib /usr/local/lib/libopencv_rapid.4.5.5.dylib /usr/local/lib/libopencv_reg.4.5.5.dylib /usr/local/lib/libopencv_rgbd.4.5.5.dylib /usr/local/lib/libopencv_saliency.4.5.5.dylib /usr/local/lib/libopencv_sfm.4.5.5.dylib /usr/local/lib/libopencv_stereo.4.5.5.dylib /usr/local/lib/libopencv_structured_light.4.5.5.dylib /usr/local/lib/libopencv_superres.4.5.5.dylib /usr/local/lib/libopencv_surface_matching.4.5.5.dylib /usr/local/lib/libopencv_tracking.4.5.5.dylib /usr/local/lib/libopencv_videostab.4.5.5.dylib /usr/local/lib/libopencv_viz.4.5.5.dylib /usr/local/lib/libopencv_wechat_qrcode.4.5.5.dylib /usr/local/lib/libopencv_xfeatures2d.4.5.5.dylib /usr/local/lib/libopencv_xobjdetect.4.5.5.dylib /usr/local/lib/libopencv_xphoto.4.5.5.dylib /usr/local/lib/libopencv_shape.4.5.5.dylib /usr/local/lib/libopencv_highgui.4.5.5.dylib /usr/local/lib/libopencv_datasets.4.5.5.dylib /usr/local/lib/libopencv_plot.4.5.5.dylib /usr/local/lib/libopencv_text.4.5.5.dylib /usr/local/lib/libopencv_ml.4.5.5.dylib /usr/local/lib/libopencv_phase_unwrapping.4.5.5.dylib /usr/local/lib/libopencv_optflow.4.5.5.dylib /usr/local/lib/libopencv_ximgproc.4.5.5.dylib /usr/local/lib/libopencv_video.4.5.5.dylib /usr/local/lib/libopencv_videoio.4.5.5.dylib /usr/local/lib/libopencv_imgcodecs.4.5.5.dylib /usr/local/lib/libopencv_objdetect.4.5.5.dylib /usr/local/lib/libopencv_calib3d.4.5.5.dylib /usr/local/lib/libopencv_dnn.4.5.5.dylib /usr/local/lib/libopencv_features2d.4.5.5.dylib /usr/local/lib/libopencv_flann.4.5.5.dylib /usr/local/lib/libopencv_photo.4.5.5.dylib /usr/local/lib/libopencv_imgproc.4.5.5.dylib /usr/local/lib/libopencv_core.4.5.5.dylib
/usr/bin/clang++ -std=c++11 -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/frame_extraction.dir/src/script.cpp.o -o ../bin/frame_extraction -Wl,-rpath,/usr/local/opt/opencv/lib /usr/local/opt/opencv/lib/libopencv_gapi.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_stitching.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_alphamat.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_aruco.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_barcode.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_bgsegm.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_bioinspired.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_ccalib.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_dnn_objdetect.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_dnn_superres.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_dpm.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_face.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_freetype.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_fuzzy.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_hfs.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_img_hash.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_intensity_transform.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_line_descriptor.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_mcc.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_quality.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_rapid.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_reg.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_rgbd.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_saliency.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_sfm.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_stereo.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_structured_light.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_superres.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_surface_matching.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_tracking.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_videostab.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_viz.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_wechat_qrcode.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_xfeatures2d.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_xobjdetect.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_xphoto.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_shape.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_highgui.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_datasets.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_plot.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_text.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_ml.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_phase_unwrapping.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_optflow.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_ximgproc.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_video.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_videoio.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_imgcodecs.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_objdetect.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_calib3d.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_dnn.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_features2d.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_flann.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_photo.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_imgproc.4.5.5.dylib /usr/local/opt/opencv/lib/libopencv_core.4.5.5.dylib
......@@ -418,14 +418,7 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o: \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/ostream \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/bitset \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/__bit_reference \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/fstream \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/iostream \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/vector \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/dirent.h \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/dirent.h \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/stat.h \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_s_ifmt.h \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_filesec_t.h \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/timeb.h \
/usr/local/include/boost/uuid/uuid.hpp \
/usr/local/include/boost/cstdint.hpp \
......@@ -539,6 +532,7 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o: \
/usr/local/include/boost/random/detail/generator_bits.hpp \
/usr/local/include/boost/random/detail/generator_seed_seq.hpp \
/usr/local/include/boost/random/detail/polynomial.hpp \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/vector \
/usr/local/include/boost/random/uniform_int.hpp \
/usr/local/include/boost/random/uniform_int_distribution.hpp \
/usr/local/include/boost/random/detail/operators.hpp \
......@@ -934,6 +928,9 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o: \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/fcntl.h \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_o_sync.h \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_o_dsync.h \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_s_ifmt.h \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/_types/_filesec_t.h \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/stat.h \
/usr/local/include/boost/uuid/uuid_io.hpp \
/usr/local/include/boost/io/ios_state.hpp \
/usr/local/include/boost/io_fwd.hpp \
......@@ -1178,6 +1175,6 @@ CMakeFiles/frame_extraction.dir/src/script.cpp.o: \
/usr/local/include/nlohmann/ordered_map.hpp \
/usr/local/include/nlohmann/detail/macro_unscope.hpp \
/usr/local/include/nlohmann/thirdparty/hedley/hedley_undef.hpp \
/Users/nadir/Documents/MPAI-CAE/AIMs/VideoAnalyser/src/rapidxml-1.13/rapidxml.hpp \
/Users/nadir/Documents/MPAI-CAE/AIMs/VideoAnalyser/src/utility.h \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/fstream \
/Users/nadir/Documents/MPAI-CAE/AIMs/VideoAnalyser/src/forAudioAnalyser.h
......@@ -68,7 +68,7 @@ CMAKE_BINARY_DIR = /Users/nadir/Documents/MPAI-CAE/AIMs/VideoAnalyser/build
# Special rule for the target edit_cache
edit_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..."
/usr/local/Cellar/cmake/3.21.0/bin/ccmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
/usr/local/Cellar/cmake/3.23.2/bin/ccmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : edit_cache
# Special rule for the target edit_cache
......
......@@ -2,10 +2,10 @@
"Brands": true,
"IrregularityFileInput": "../input/BERIO060.mov_IrregularityFileInput.json",
"OutputPath": "../output/",
"PreservationAudioVisualFile": "../input/BERIO058.mov",
"Speed": 15,
"ThresholdPercentual": 80,
"ThresholdPercentualPinchRoller": 90,
"PreservationAudioVisualFile": "../input/BERIO060.mov",
"Speed": 7.5,
"ThresholdPercentualTape": 80,
"ThresholdPercentualCapstan": 92,
"MinDist": 10,
"AngleThresh": 10000,
"ScaleThresh": 200,
......
......@@ -10,18 +10,8 @@
@date 29-06-2022
*/
#include <filesystem>
#include <fstream>
#include <iostream>
#include <vector>
#include <dirent.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/timeb.h>
#include <sys/types.h>
#include <time.h>
#include <boost/uuid/uuid.hpp> // uuid class
#include <boost/uuid/uuid_generators.hpp> // generators
......@@ -35,14 +25,11 @@
#include <nlohmann/json.hpp>
#include "rapidxml-1.13/rapidxml.hpp"
#include "utility.h"
#include "forAudioAnalyser.h"
namespace fs = std::__fs::filesystem;
using namespace cv;
using namespace rapidxml;
using namespace std;
using json = nlohmann::json;
......@@ -67,8 +54,8 @@ std::string irregularityFileInputPath;
std::string outputPath;
std::string videoPath;
float speed;
float thresholdPercentual;
float thresholdPercentualPinchRoller;
float tapeThresholdPercentual;
float capstanThresholdPercentual;
// JSON files
json configurationFile;
json irregularityFileInput;
......@@ -77,38 +64,98 @@ json irregularityFileOutput2;
// RotatedRect identifying the processing area
RotatedRect rect, rectTape, rectCapstan;
bool debug = true;
bool frameDifference(cv::Mat prevFrame, cv::Mat currentFrame, int msToEnd) {
// Processing area
int areaPixels = rect.size.width * rect.size.height;
float differentPixelsThreshold = areaPixels * thresholdPercentual / 100;
// // PinchRoller area
// int pixelsNumberPinchRoller = (xc_r - xc_l) * (yc_d - yc_u);
// float differentPixelsThresholdPinchRoller = (thresholdPercentualPinchRoller * pixelsNumberPinchRoller)/100;
/********************************** Capstan analysis *****************************************/
// In the last minute of the video, check for pinchRoller position for endTape event
if (msToEnd < 60000) {
// Capstan area
int capstanAreaPixels = rectCapstan.size.width * rectCapstan.size.height;
float capstanDifferentPixelsThreshold = capstanAreaPixels * capstanThresholdPercentual / 100;
// CODE FROM https://answers.opencv.org/question/497/extract-a-rotatedrect-area/
// matrices we'll use
Mat M, rotatedPrevFrame, croppedPrevFrame, rotatedCurrentFrame, croppedCurrentFrame;
// get angle and size from the bounding box
float angle = rectCapstan.angle;
Size rect_size = rectCapstan.size;
// thanks to http://felix.abecassis.me/2011/10/opencv-rotation-deskewing/
if (rectCapstan.angle < -45.) {
angle += 90.0;
swap(rect_size.width, rect_size.height);
}
// get the rotation matrix
M = getRotationMatrix2D(rectCapstan.center, angle, 1.0);
// perform the affine transformation
warpAffine(prevFrame, rotatedPrevFrame, M, prevFrame.size(), INTER_CUBIC);
warpAffine(currentFrame, rotatedCurrentFrame, M, currentFrame.size(), INTER_CUBIC);
// crop the resulting image
getRectSubPix(rotatedPrevFrame, rect_size, rectCapstan.center, croppedPrevFrame);
getRectSubPix(rotatedCurrentFrame, rect_size, rectCapstan.center, croppedCurrentFrame);
// imshow("Current frame", currentFrame);
// imshow("Cropped Current Frame", croppedCurrentFrame);
// waitKey();
// END CODE FROM https://answers.opencv.org/question/497/extract-a-rotatedrect-area/
cv::Mat differenceFrame = difference(croppedPrevFrame, croppedCurrentFrame);
int blackPixelsCapstan = 0;
for (int i = 0; i < croppedCurrentFrame.rows; i++) {
for (int j = 0; j < croppedCurrentFrame.cols; j++) {
if (differenceFrame.at<cv::Vec3b>(i, j)[0] == 0) {
// There is a black pixel, then there is a difference between previous and current frames
blackPixelsCapstan++;
}
}
}
if (blackPixelsCapstan > capstanDifferentPixelsThreshold) {
savingPinchRoller = true;
return true;
} else {
savingPinchRoller = false;
}
}
/************************************ Tape analysis ******************************************/
// Tape area
int tapeAreaPixels = rectTape.size.width * rectTape.size.height;
float tapeDifferentPixelsThreshold = tapeAreaPixels * tapeThresholdPercentual / 100;
/***************** Extract matrices corresponding to the processing area *********************/
// Tape area
// CODE FROM https://answers.opencv.org/question/497/extract-a-rotatedrect-area/
// matrices we'll use
Mat M, rotatedPrevFrame, croppedPrevFrame, rotatedCurrentFrame, croppedCurrentFrame;
// get angle and size from the bounding box
float angle = rect.angle;
Size rect_size = rect.size;
float angle = rectTape.angle;
Size rect_size = rectTape.size;
// thanks to http://felix.abecassis.me/2011/10/opencv-rotation-deskewing/
if (rect.angle < -45.) {
if (rectTape.angle < -45.) {
angle += 90.0;
swap(rect_size.width, rect_size.height);
}
// get the rotation matrix
M = getRotationMatrix2D(rect.center, angle, 1.0);
M = getRotationMatrix2D(rectTape.center, angle, 1.0);
// perform the affine transformation
warpAffine(prevFrame, rotatedPrevFrame, M, prevFrame.size(), INTER_CUBIC);
warpAffine(currentFrame, rotatedCurrentFrame, M, currentFrame.size(), INTER_CUBIC);
// crop the resulting image
getRectSubPix(rotatedPrevFrame, rect_size, rect.center, croppedPrevFrame);
getRectSubPix(rotatedCurrentFrame, rect_size, rect.center, croppedCurrentFrame);
getRectSubPix(rotatedPrevFrame, rect_size, rectTape.center, croppedPrevFrame);
getRectSubPix(rotatedCurrentFrame, rect_size, rectTape.center, croppedCurrentFrame);
// imshow("Current frame", currentFrame);
// imshow("Cropped Current Frame", croppedCurrentFrame);
......@@ -118,32 +165,11 @@ bool frameDifference(cv::Mat prevFrame, cv::Mat currentFrame, int msToEnd) {
cv::Mat differenceFrame = difference(croppedPrevFrame, croppedCurrentFrame);
int blackPixelsPinchRoller = 0;
int decEnd = (msToEnd % 1000) / 100;
int secEnd = (msToEnd - (msToEnd % 1000)) / 1000;
int minEnd = secEnd / 60;
secEnd = secEnd % 60;
/******************************* PinchRoller analysis ****************************************/
// // In the last minute of the video, check for pinchRoller position for endTape event
// if ((msToEnd < 60000) && pinchRollerRect) {
// for (int i = yc_u; i < yc_d; i++) {
// for (int j = xc_l; j < xc_r; j++) {
// if (differenceFrame.at<cv::Vec3b>(i, j)[0] == 0) {
// // There is a black pixel, then there is a difference between previous and current frames
// blackPixelsPinchRoller++;
// }
// }
// }
// if (blackPixelsPinchRoller > differentPixelsThresholdPinchRoller) {
// savingPinchRoller = true;
// return true;
// } else {
// savingPinchRoller = false;
// }
// }
/****************************** Segment analysis ****************************************/
......@@ -159,11 +185,9 @@ bool frameDifference(cv::Mat prevFrame, cv::Mat currentFrame, int msToEnd) {
}
}
}
mediaCurrFrame = totColoreCF/areaPixels;
float tsh = areaPixels * thresholdPercentual / 100;
mediaCurrFrame = totColoreCF/tapeAreaPixels;
if (blackPixels > tsh) {
if (blackPixels > tapeDifferentPixelsThreshold) {
if (brands) {
if (mediaPrevFrame > (mediaCurrFrame + 10) || mediaPrevFrame < (mediaCurrFrame - 10)) { // They are not similar for color average
// Update mediaPrevFrame
......@@ -246,21 +270,24 @@ int processing(cv::VideoCapture videoCapture, std::string fileName) {
// Finding an image containing the whole tape
Point2f pts[4];
rect.points(pts);
cv::Mat subImageNastro(frame, cv::Rect(100, min(pts[1].y, pts[2].y), frame.cols - 100, static_cast<int>(rect.size.height)));
if (savingPinchRoller)
rectCapstan.points(pts);
else
rectTape.points(pts);
cv::Mat subImage(frame, cv::Rect(100, min(pts[1].y, pts[2].y), frame.cols - 100, static_cast<int>(rectTape.size.height)));
// De-interlacing the image with the whole tape
cv::Mat oddSubImage(subImageNastro.rows/2, subImageNastro.cols, CV_8UC3);
int evenSubImageRows = subImageNastro.rows/2;
if (subImageNastro.rows % 2 != 0) // If the found rectangle is of odd height, we must increase evenSubImage height by 1, otherwise we have segmentation_fault!!!
cv::Mat oddSubImage(subImage.rows/2, subImage.cols, CV_8UC3);
int evenSubImageRows = subImage.rows/2;
if (subImage.rows % 2 != 0) // If the found rectangle is of odd height, we must increase evenSubImage height by 1, otherwise we have segmentation_fault!!!
evenSubImageRows += 1;
cv::Mat evenSubImage(evenSubImageRows, subImageNastro.cols, CV_8UC3);
separateFrame(subImageNastro, oddSubImage, evenSubImage);
cv::Mat evenSubImage(evenSubImageRows, subImage.cols, CV_8UC3);
separateFrame(subImage, oddSubImage, evenSubImage);
std::string timeLabel = getTimeLabel(ms);
std::string safeTimeLabel = getSafeTimeLabel(ms);
saveIrregularityImage(safeTimeLabel, fileName, oddFrame, oddSubImage);
saveIrregularityImage(safeTimeLabel, fileName, oddFrame, oddSubImage, savingPinchRoller);
// Append Irregularity information to JSON
boost::uuids::uuid uuid = boost::uuids::random_generator()();
......@@ -313,9 +340,6 @@ bool findProcessingAreas(json configurationFile) {
/******************************************* JSON PARAMETERS *******************************************/
// Returned variable
bool found = false;
// Read parameters from JSON
int minDist, angleThresh, scaleThresh, posThresh, minDistTape, angleThreshTape, scaleThreshTape, posThreshTape, minDistCapstan, angleThreshCapstan, scaleThreshCapstan, posThreshCapstan;
try {
......@@ -561,10 +585,11 @@ bool findProcessingAreas(json configurationFile) {
}
cout << endl;
imshow("Tape area(s)", myFrame);
waitKey();
// Shows the detected areas
// imshow("Tape area(s)", myFrame);
// waitKey();
return found;
return true;
}
......@@ -582,8 +607,8 @@ int main(int argc, char** argv) {
outputPath = configurationFile["OutputPath"];
videoPath = configurationFile["PreservationAudioVisualFile"];
speed = configurationFile["Speed"];
thresholdPercentual = configurationFile["ThresholdPercentual"];
thresholdPercentualPinchRoller = configurationFile["ThresholdPercentualPinchRoller"];
tapeThresholdPercentual = configurationFile["ThresholdPercentualTape"];
capstanThresholdPercentual = configurationFile["ThresholdPercentualCapstan"];
} catch (nlohmann::detail::type_error e) {
std::cerr << "\033[1;31mconfig.json error!\033[0;31m\n" << e.what() << std::endl;
return -1;
......@@ -603,23 +628,25 @@ int main(int argc, char** argv) {
std::cerr << "\033[1;31mconfig.json error!\033[0;31m\nSpeed parameter must be 7.5 or 15 ips." << std::endl;
return -1;
}
if (thresholdPercentual < 0 || thresholdPercentual > 100) {
if (tapeThresholdPercentual < 0 || tapeThresholdPercentual > 100) {
std::cerr << "\033[1;31mconfig.json error!\033[0;31m\nThresholdPercentual parameter must be a percentage value." << std::endl;
return -1;
}
if (thresholdPercentualPinchRoller < 0 || thresholdPercentualPinchRoller > 100) {
if (capstanThresholdPercentual < 0 || capstanThresholdPercentual > 100) {
std::cerr << "\033[1;31mconfig.json error!\033[0;31m\nThresholdPercentual parameter must be a percentage value." << std::endl;
return -1;
}
// Speed reference = 7.5
// If the speed is 15, then increase threshold percentual by 4 to have similar detection performance
if (speed == 15)
thresholdPercentual += 4;
tapeThresholdPercentual += 4;
std::cout << "\nParameters from config.json file:" << std::endl;
std::cout << " Brands: " << brands << std::endl;
std::cout << " Speed: " << speed << std::endl;
std::cout << " ThresholdPercentual: " << thresholdPercentual << std::endl;
std::cout << " ThresholdPercentualPinchRoller: " << thresholdPercentualPinchRoller << std::endl;
std::cout << " ThresholdPercentual: " << tapeThresholdPercentual << std::endl;
std::cout << " ThresholdPercentualCapstan: " << capstanThresholdPercentual << std::endl;
std::cout << std::endl;
// Read input JSON
......@@ -654,18 +681,18 @@ int main(int argc, char** argv) {
ofstream myFile;
myFile.open("log.txt", ios::app);
myFile << endl << fileName << endl;
myFile << "tsh: " << thresholdPercentual << " tshp: " << thresholdPercentualPinchRoller << std::endl;
myFile << "tsh: " << tapeThresholdPercentual << " tshp: " << capstanThresholdPercentual << std::endl;
myFile << ts; // No endline character for avoiding middle blank line.
if (found) {
std::cout << "Processing area found!" << endl;
myFile << "Processing area found!" << endl;
std::cout << "Processing areas found!" << endl;
myFile << "Processing areas found!" << endl;
myFile.close();
} else {
std::cout << "Processing area not found. Try changing JSON parameters." << endl;
myFile << "Processing area not found." << endl;
myFile.close();
return 1; // Program terminated early
return -1; // Program terminated early
}
/********************************* MAKE REQUIRED DIRECTORIES *********************************/
......
......@@ -4,7 +4,6 @@
namespace fs = std::__fs::filesystem;
using namespace cv;
using namespace rapidxml;
using namespace std;
std::string pathBrand, pathFullFrame, pathTape, pathTape224, pathEndTape;
......@@ -51,7 +50,7 @@ void makeDirectories(std::string fileName, std::string outputPath, bool brands)
int capsDirectory = fs::create_directory(pathEndTape);
}
void saveIrregularityImage(std::string safeTimeLabel, std::string fileName, cv::Mat frame, cv::Mat subFrame) {
void saveIrregularityImage(std::string safeTimeLabel, std::string fileName, cv::Mat frame, cv::Mat subFrame, bool endFrame) {
// if (savingPinchRoller) {
// cv::imwrite(pathEndTape + "/" + fileName + "_" + safeTimeLabel + ".jpg", frame);
......@@ -59,13 +58,20 @@ void saveIrregularityImage(std::string safeTimeLabel, std::string fileName, cv::
// cv::imwrite(pathBrand + "/" + fileName + "_" + safeTimeLabel + ".jpg", frame);
// savingBrand = false;
// } else {
// Writing image
cv::imwrite(pathFullFrame + "/" + fileName + "_" + safeTimeLabel + ".jpg", frame);
cv::imwrite(pathTape + "/" + fileName + "_" + safeTimeLabel + ".jpg", subFrame);
if (!endFrame) {
cv::imwrite(pathTape + "/" + fileName + "_" + safeTimeLabel + ".jpg", subFrame);
} else {
cv::imwrite(pathEndTape + "/" + fileName + "_" + safeTimeLabel + ".jpg", subFrame);
}
cv::Mat resized224Nas;
cv::resize(subFrame, resized224Nas, cv::Size(224, 224));
cv::imwrite(pathTape224 + "/"+ fileName + "_" + safeTimeLabel + ".jpg", resized224Nas);
// }
}
......@@ -210,7 +216,7 @@ void detectShape(Ptr<GeneralizedHoughGuil> alg, Mat templateShape, int posThresh
alg -> detect(processingArea, positivePositions, positiveVotes); // Detect all available shapes
break;
} else if (currentSize == 0 && oldSizePositive == 0) {
// Impossible to found with these parameters
// Impossible to find with these parameters
std::cout << "\033[0;31mNot found for positive angles.\033[0m" << endl;
break;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment