From f6de53350f163faae4e496224594389de452ed9d Mon Sep 17 00:00:00 2001 From: Brenno Date: Wed, 13 Jan 2021 20:22:17 -0300 Subject: [PATCH] Minor fixes - Moved TimeUtil from header to src - Fixed issue with Qimage -> Mat conversion --- src/CVObjectDetection.cpp | 2 ++ src/CVObjectDetection.h | 4 ---- src/CVStabilization.cpp | 3 ++- src/CVStabilization.h | 4 ---- src/CVTracker.cpp | 2 ++ src/CVTracker.h | 4 ---- src/Frame.cpp | 2 +- src/effects/ObjectDetection.cpp | 8 +------- src/effects/Stabilizer.cpp | 2 ++ src/effects/Stabilizer.h | 4 ---- src/effects/Tracker.cpp | 2 ++ src/effects/Tracker.h | 5 ----- 12 files changed, 12 insertions(+), 30 deletions(-) diff --git a/src/CVObjectDetection.cpp b/src/CVObjectDetection.cpp index 44a46fec..ca0e92ae 100644 --- a/src/CVObjectDetection.cpp +++ b/src/CVObjectDetection.cpp @@ -29,9 +29,11 @@ */ #include "CVObjectDetection.h" +#include using namespace std; using namespace openshot; +using google::protobuf::util::TimeUtil; CVObjectDetection::CVObjectDetection(std::string processInfoJson, ProcessingController &processingController) : processingController(&processingController), processingDevice("CPU"){ diff --git a/src/CVObjectDetection.h b/src/CVObjectDetection.h index 61abd48e..ae3dbf7d 100644 --- a/src/CVObjectDetection.h +++ b/src/CVObjectDetection.h @@ -30,8 +30,6 @@ #pragma once -#include - #define int64 opencv_broken_int #define uint64 opencv_broken_uint #include @@ -48,8 +46,6 @@ namespace openshot { - using google::protobuf::util::TimeUtil; - // Stores the detected object bounding boxes and its properties. struct CVDetectionData{ CVDetectionData(){} diff --git a/src/CVStabilization.cpp b/src/CVStabilization.cpp index f8f2332a..b2f944b9 100644 --- a/src/CVStabilization.cpp +++ b/src/CVStabilization.cpp @@ -29,10 +29,11 @@ */ #include "CVStabilization.h" +#include using namespace std; using namespace openshot; - +using google::protobuf::util::TimeUtil; // Set default smoothing window value to compute stabilization CVStabilization::CVStabilization(std::string processInfoJson, ProcessingController &processingController) diff --git a/src/CVStabilization.h b/src/CVStabilization.h index 961fb19f..7c41ac7c 100644 --- a/src/CVStabilization.h +++ b/src/CVStabilization.h @@ -31,8 +31,6 @@ #ifndef OPENSHOT_STABILIZATION_H #define OPENSHOT_STABILIZATION_H -#include - #define int64 opencv_broken_int #define uint64 opencv_broken_uint #include @@ -45,8 +43,6 @@ #include "Clip.h" #include "Json.h" -using google::protobuf::util::TimeUtil; - // Store the relative transformation parameters between consecutive frames struct TransformParam { diff --git a/src/CVTracker.cpp b/src/CVTracker.cpp index 23310dda..75742025 100644 --- a/src/CVTracker.cpp +++ b/src/CVTracker.cpp @@ -29,9 +29,11 @@ */ #include "CVTracker.h" +#include using namespace std; using namespace openshot; +using google::protobuf::util::TimeUtil; // Constructor diff --git a/src/CVTracker.h b/src/CVTracker.h index b845f280..918072ce 100644 --- a/src/CVTracker.h +++ b/src/CVTracker.h @@ -31,8 +31,6 @@ #ifndef OPENSHOT_CVTRACKER_H #define OPENSHOT_CVTRACKER_H -#include - #define int64 opencv_broken_int #define uint64 opencv_broken_uint #include @@ -51,8 +49,6 @@ #include "sort_filter/sort.hpp" -using google::protobuf::util::TimeUtil; - namespace openshot { diff --git a/src/Frame.cpp b/src/Frame.cpp index 24acdc40..d25def6d 100644 --- a/src/Frame.cpp +++ b/src/Frame.cpp @@ -943,7 +943,7 @@ std::shared_ptr Frame::GetImage() // Convert Qimage to Mat cv::Mat Frame::Qimage2mat( std::shared_ptr& qimage) { - cv::Mat mat = cv::Mat(qimage->height(), qimage->width(), CV_8UC4, (const uchar*)qimage->constbits(), qimage->bytesPerLine()).clone(); + cv::Mat mat = cv::Mat(qimage->height(), qimage->width(), CV_8UC4, (uchar*)qimage->constBits(), qimage->bytesPerLine()).clone(); cv::Mat mat2 = cv::Mat(mat.rows, mat.cols, CV_8UC3 ); int from_to[] = { 0,0, 1,1, 2,2 }; cv::mixChannels( &mat, 1, &mat2, 1, from_to, 3 ); diff --git a/src/effects/ObjectDetection.cpp b/src/effects/ObjectDetection.cpp index 58febd98..7c84e716 100644 --- a/src/effects/ObjectDetection.cpp +++ b/src/effects/ObjectDetection.cpp @@ -72,7 +72,7 @@ std::shared_ptr ObjectDetection::GetFrame(std::shared_ptr frame, i { // Get the frame's image cv::Mat cv_image = frame->GetImageCV(); - std::cout<<"Frame number: "< using namespace std; using namespace openshot; +using google::protobuf::util::TimeUtil; /// Blank constructor, useful when using Json to load the effect properties Stabilizer::Stabilizer(std::string clipStabilizedDataPath):protobuf_data_path(clipStabilizedDataPath) diff --git a/src/effects/Stabilizer.h b/src/effects/Stabilizer.h index 724d5849..0d24b6c0 100644 --- a/src/effects/Stabilizer.h +++ b/src/effects/Stabilizer.h @@ -33,8 +33,6 @@ #include "../EffectBase.h" -#include - #include #include #include @@ -43,8 +41,6 @@ #include "../KeyFrame.h" #include "protobuf_messages/stabilizedata.pb.h" -using google::protobuf::util::TimeUtil; - // Store the relative transformation parameters between consecutive frames struct EffectTransformParam { diff --git a/src/effects/Tracker.cpp b/src/effects/Tracker.cpp index 02804ac5..6b4130a3 100644 --- a/src/effects/Tracker.cpp +++ b/src/effects/Tracker.cpp @@ -29,9 +29,11 @@ */ #include "effects/Tracker.h" +#include using namespace std; using namespace openshot; +using google::protobuf::util::TimeUtil; /// Blank constructor, useful when using Json to load the effect properties Tracker::Tracker(std::string clipTrackerDataPath) diff --git a/src/effects/Tracker.h b/src/effects/Tracker.h index 854ffdfc..ad39b6b9 100644 --- a/src/effects/Tracker.h +++ b/src/effects/Tracker.h @@ -33,8 +33,6 @@ #include "../EffectBase.h" -#include - #include #include #include @@ -44,9 +42,6 @@ #include "../KeyFrame.h" #include "protobuf_messages/trackerdata.pb.h" -using google::protobuf::util::TimeUtil; - - // Tracking info struct struct EffectFrameData{ size_t frame_id = -1;