Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/effect-parenting' into effect-pa…
Browse files Browse the repository at this point in the history
…renting
  • Loading branch information
BrennoCaldato committed Apr 18, 2021
2 parents 5f853a3 + d73da93 commit f3187cf
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
5 changes: 4 additions & 1 deletion examples/ExampleHtml.cpp
Expand Up @@ -35,7 +35,10 @@
#include <QGuiApplication>
#include <QTimer>

#include "OpenShot.h"
#include "QtHtmlReader.h"
#include "FFmpegWriter.h"
#include "Fraction.h"
#include "Enums.h" // for GRAVITY_BOTTOM_RIGHT
#include "CrashHandler.h"

using namespace openshot;
Expand Down
33 changes: 18 additions & 15 deletions examples/Example_opencv.cpp
Expand Up @@ -31,12 +31,15 @@
#include <fstream>
#include <iostream>
#include <memory>
#include "../../src/CVTracker.h"
#include "../../src/CVStabilization.h"
#include "../../src/CVObjectDetection.h"
#include "CVTracker.h"
#include "CVStabilization.h"
#include "CVObjectDetection.h"

#include "../../src/OpenShot.h"
#include "../../src/CrashHandler.h"
#include "Clip.h"
#include "EffectBase.h"
#include "EffectInfo.h"
#include "Frame.h"
#include "CrashHandler.h"

using namespace openshot;
using namespace std;
Expand All @@ -60,7 +63,7 @@ void displayClip(openshot::Clip &r9){

// Opencv display window
cv::namedWindow("Display Image", cv::WINDOW_NORMAL );

// Get video lenght
int videoLenght = r9.Reader()->info.video_length;

Expand Down Expand Up @@ -223,7 +226,7 @@ string jsonFormat(string key, string value, string type){
// Return JSON string for the tracker effect
string trackerJson(cv::Rect2d r, bool onlyProtoPath){

// Define path to save tracked data
// Define path to save tracked data
string protobufDataPath = "kcf_tracker.data";
// Set the tracker
string tracker = "KCF";
Expand All @@ -232,14 +235,14 @@ string trackerJson(cv::Rect2d r, bool onlyProtoPath){
string protobuf_data_path = jsonFormat("protobuf_data_path", protobufDataPath);
string trackerType = jsonFormat("tracker-type", tracker);
string bboxCoords = jsonFormat(
"region",
"{" + jsonFormat("x", to_string(r.x), "int") +
"," + jsonFormat("y", to_string(r.y), "int") +
"region",
"{" + jsonFormat("x", to_string(r.x), "int") +
"," + jsonFormat("y", to_string(r.y), "int") +
"," + jsonFormat("width", to_string(r.width), "int") +
"," + jsonFormat("height", to_string(r.height), "int") +
"," + jsonFormat("height", to_string(r.height), "int") +
"," + jsonFormat("first-frame", to_string(0), "int") +
"}",
"rstring");
"rstring");

// Return only the the protobuf path in JSON format
if(onlyProtoPath)
Expand All @@ -252,7 +255,7 @@ string trackerJson(cv::Rect2d r, bool onlyProtoPath){
// Return JSON string for the stabilizer effect
string stabilizerJson(bool onlyProtoPath){

// Define path to save stabilized data
// Define path to save stabilized data
string protobufDataPath = "example_stabilizer.data";
// Set smoothing window value
string smoothingWindow = "30";
Expand All @@ -271,13 +274,13 @@ string stabilizerJson(bool onlyProtoPath){

string objectDetectionJson(bool onlyProtoPath){

// Define path to save object detection data
// Define path to save object detection data
string protobufDataPath = "example_object_detection.data";
// Define processing device
string processingDevice = "GPU";
// Set path to model configuration file
string modelConfiguration = "yolov3.cfg";
// Set path to model weights
// Set path to model weights
string modelWeights = "yolov3.weights";
// Set path to class names file
string classesFile = "obj.names";
Expand Down

0 comments on commit f3187cf

Please sign in to comment.