Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Effect parenting #649

Merged
merged 99 commits into from
Jun 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
5db1c0f
Initial design of new keyframes specialized classes
BrennoCaldato Oct 29, 2020
a4f4561
Merge branch 'opencv' into keyframe-refactor
BrennoCaldato Nov 10, 2020
1215d04
Added scale factor to class to replace OpFPS.
BrennoCaldato Nov 13, 2020
34aabcc
Removed Excess information from json.
BrennoCaldato Nov 13, 2020
940840c
Solved FPS bug.
BrennoCaldato Nov 13, 2020
9113153
Added properties to Tracker effects
BrennoCaldato Nov 13, 2020
1933d88
Fixed opencv example compilation on cmake
BrennoCaldato Nov 28, 2020
a9d783c
Updated include path on opencv examples
BrennoCaldato Nov 28, 2020
dd9e203
Added transform handler for Tracker effect
BrennoCaldato Nov 28, 2020
e3bd2e4
Improved protobuf message compiling
BrennoCaldato Dec 12, 2020
60cec47
Refactored KeyframeBBox
BrennoCaldato Dec 12, 2020
4fdd325
Added rotation transform to the tracker bounding-box.
BrennoCaldato Dec 14, 2020
5b7458a
Fixed protobuf message compiling on Mac
BrennoCaldato Dec 18, 2020
e48405d
Merge remote-tracking branch 'origin/develop' into keyframe-refactor
BrennoCaldato Dec 18, 2020
b579ea6
Added functionality to link a clip to a tracked object (Animations)
BrennoCaldato Dec 23, 2020
61accdf
Merge branch 'opencv' into keyframe-refactor
BrennoCaldato Jan 14, 2021
3d5d907
Updated Clip.cpp to support GUI to select attached object
BrennoCaldato Jan 14, 2021
7cce93e
Removed IKeyFrame.h and applied minor fixes to Clip.cpp
BrennoCaldato Jan 14, 2021
b2cd0a5
Update Clip.cpp apply_keyframes funcion
BrennoCaldato Jan 14, 2021
a5feadc
Changed KeyframeBBox to TrackedObjectBBox and added TrackedObjectBase
BrennoCaldato Jan 18, 2021
f05ded9
Attaching clip to tracked object fixes
BrennoCaldato Jan 18, 2021
b08e65f
Tracked object bounding box transform handler fix
BrennoCaldato Jan 18, 2021
cb61f91
Tracker effect and export video fixes
BrennoCaldato Jan 18, 2021
f8198d6
Fixed codacy review warnings
BrennoCaldato Jan 19, 2021
a7d2b6a
Fixed clip transform handler when attached to object
BrennoCaldato Jan 19, 2021
1746331
Clip.cpp: Removed hard-coded Tracker effect check in AddEffect function
BrennoCaldato Jan 22, 2021
32a217e
Added support to attach clip to detected object (ObjectDetection) effect
BrennoCaldato Jan 22, 2021
5eb9f60
Added support to update the detected bounding-boxes keyframes
BrennoCaldato Jan 22, 2021
d6e0acb
ObjectDetection: show object's icons and transform handlers per frame
BrennoCaldato Jan 22, 2021
ce2c4e0
Updated documentation
BrennoCaldato Jan 22, 2021
4a28654
Added support to show the transform handler for the selected object
BrennoCaldato Jan 27, 2021
a94f09d
ObjectDetection: updated object selection and transform handler
BrennoCaldato Jan 27, 2021
3f11361
Added support to attach a clip to another clip
BrennoCaldato Jan 27, 2021
fd88a60
Updated variable names
BrennoCaldato Jan 27, 2021
b875b4d
Fixed bug in ObjectDetection effect
BrennoCaldato Jan 30, 2021
c0c2a82
Merge branch 'develop' into keyframe-refactor
BrennoCaldato Feb 1, 2021
9df3b51
Removed unused class KeyframeBase
BrennoCaldato Feb 1, 2021
2e47325
Added support to set the visibility of a Tracked Object
BrennoCaldato Feb 4, 2021
d24c2e4
Added support to insert the image of a clip inside a Tracked Object
BrennoCaldato Feb 4, 2021
c60dd40
Updated JSON functions related to Tracked Objects
BrennoCaldato Feb 4, 2021
67895f7
Added support to set an effect's properties by it's parent effect
BrennoCaldato Feb 4, 2021
b71f67e
Minor fix
BrennoCaldato Feb 4, 2021
8b861f0
Merge remote-tracking branch 'origin/develop' into effect-parenting
BrennoCaldato Mar 2, 2021
1f4d33d
Using normalized initial bounding box on CVTracker
BrennoCaldato Mar 16, 2021
a33497a
Added jitter filter on Tracked boxes
BrennoCaldato Mar 16, 2021
7272ff0
Allow the user to hide the blue bounding box on the Tracker effect
BrennoCaldato Mar 18, 2021
3729188
Protect against linking the tracked object with the parent clip
BrennoCaldato Mar 18, 2021
aa30682
Fixed draw_box scope
BrennoCaldato Mar 18, 2021
013a61b
Renamed "Parent Effect ID" to "Parent"
BrennoCaldato Mar 27, 2021
65e33a5
Renamed "Parent Object ID" to "Parent"
BrennoCaldato Mar 27, 2021
4ea85ec
Implemented Stroke width and background color for Tracker bounding boxes
BrennoCaldato Mar 28, 2021
c55efd1
Added opacity to Tracker effect
BrennoCaldato Mar 28, 2021
6b6b6d5
Protecting ObjectDetection when no object is found
BrennoCaldato Apr 8, 2021
1e32ef8
Fixed ObjectDetection crash (disabled effect parenting)
BrennoCaldato Apr 9, 2021
a106ed5
Added Color selection, stroke size and opacity to ObjectDetection rec…
BrennoCaldato Apr 9, 2021
9499211
Added default class colors
BrennoCaldato Apr 9, 2021
9fb4c4a
Added confidence threshold
BrennoCaldato Apr 9, 2021
5e9f5e3
Added class filter and updated visualization
BrennoCaldato Apr 10, 2021
c8c92b5
Merge branch 'develop' into effect-parenting
ferdnyc Apr 10, 2021
93306a4
tests/KeyFrame.cpp: Typo
ferdnyc Apr 10, 2021
cd22b06
tests/KeyFrame.cpp: Typo
ferdnyc Apr 10, 2021
c6d9129
src/effects/Tracker.h: Fix bad merge
ferdnyc Apr 11, 2021
f5d94d3
effects/ObjectDetection: Declare drawPred correctly
ferdnyc Apr 11, 2021
f26b4bf
Give SWIG's Ruby code a namespace hint
ferdnyc Apr 11, 2021
2c0a33f
Merge remote-tracking branch 'origin/effect-parenting' into effect-pa…
BrennoCaldato Apr 11, 2021
d1d9293
tests/KeyFrame: Split a CHECK(), for readability
ferdnyc Apr 12, 2021
99b5d1e
Fixed variable names and comments
BrennoCaldato Apr 13, 2021
32033e0
Changed formatting from tab to spaces
BrennoCaldato Apr 13, 2021
a7cefa4
Removed namespaces, iostream library and added TrackedObject test
BrennoCaldato Apr 13, 2021
2cf2c55
Changed None to empty string, corrected dynamic pointers
BrennoCaldato Apr 13, 2021
ed72fc8
Added option to hide bounding box text in ObjectDetector effect. Fixe…
BrennoCaldato Apr 13, 2021
c27071b
Merge remote-tracking branch 'origin/develop' into effect-parenting
BrennoCaldato Apr 13, 2021
77aa418
Fixed FPS ToInt() conversion and changed initial frame number to 1
BrennoCaldato Apr 16, 2021
2c9d2f2
OpenCV is again an optional dependency
BrennoCaldato Apr 16, 2021
c6aae47
Don't use OpenShot.h in ExampleHtml.cpp
ferdnyc Apr 15, 2021
d73da93
Don't use OpenShot.h in OpenCV example
ferdnyc Apr 18, 2021
5f853a3
Fixed attaching a clip to Tracker and ObjectDetection
BrennoCaldato Apr 18, 2021
f3187cf
Merge remote-tracking branch 'origin/effect-parenting' into effect-pa…
BrennoCaldato Apr 18, 2021
f491d58
Added author and added licence in ClipProcessingJobs
BrennoCaldato Apr 21, 2021
0b8481f
Fixed aspect ratio and off-center displacement when attaching a clip …
BrennoCaldato Apr 21, 2021
4d9d6ec
Merge remote-tracking branch 'origin/develop' into effect-parenting
BrennoCaldato Apr 21, 2021
f412cae
small fix
BrennoCaldato Apr 21, 2021
7a9d196
Fixed missing parent clip in TrackedObjectBoundingbox
BrennoCaldato Apr 26, 2021
d54e1aa
Merge branch 'develop' into effect-parenting
ferdnyc May 4, 2021
c6ce5b0
Key "objects" in Json hold a dict of tracked objects
BrennoCaldato May 8, 2021
40124b1
Merge remote-tracking branch 'origin/effect-parenting' into effect-pa…
BrennoCaldato May 8, 2021
7eb23a9
Removed unnecessary Json tags
BrennoCaldato May 11, 2021
e45b81b
Updated Json communication of Tracker effect
BrennoCaldato May 11, 2021
466755e
Merge remote-tracking branch 'origin/develop' into effect-parenting
BrennoCaldato May 11, 2021
4362c5f
Included AVresample outside if statement
BrennoCaldato May 17, 2021
2e8ff3b
Added TrackedObjectBBox to python bindings
BrennoCaldato May 17, 2021
d9e4f04
Disabling Examples_opencv because it needs a deep refactor
BrennoCaldato May 17, 2021
36c7222
Fixed Json in Tracker Tests
BrennoCaldato May 19, 2021
f51af2e
More permissive range interval for Tracker test
BrennoCaldato May 19, 2021
e2b51da
Fixed missing detection in the first frame
BrennoCaldato May 19, 2021
461a030
Merge pull request #674 from OpenShot/fix-saving
BrennoCaldato May 19, 2021
cd7d6fe
Merge remote-tracking branch 'origin/develop' into effect-parenting
BrennoCaldato May 24, 2021
ae0a635
removed assert from interpolation
BrennoCaldato May 24, 2021
27eb0e6
Fixed Keyframe Test
BrennoCaldato May 24, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions bindings/python/openshot.i
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
#include "effects/Stabilizer.h"
#include "effects/Tracker.h"
#include "effects/ObjectDetection.h"
#include "TrackedObjectBBox.h"
%}
#endif

Expand Down Expand Up @@ -291,6 +292,7 @@

#ifdef USE_OPENCV
%include "ClipProcessingJobs.h"
%include "TrackedObjectBBox.h"
#endif

#ifdef USE_IMAGEMAGICK
Expand Down
12 changes: 12 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,15 @@ if (BLACKMAGIC_FOUND)
# Link test executable to the new library
target_link_libraries(openshot-blackmagic openshot)
endif()

############### OPENCV EXAMPLE ################
#if (DEFINED CACHE{HAVE_OPENCV})
# # Create test executable
# add_executable(openshot-example-opencv
# Example_opencv.cpp)
#
# target_compile_definitions(openshot-example-opencv PRIVATE
# -DTEST_MEDIA_PATH="${TEST_MEDIA_PATH}" )
# # Link test executable to the new library
# target_link_libraries(openshot-example-opencv openshot)
#endif()
40 changes: 22 additions & 18 deletions examples/Example_opencv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@
#include <fstream>
#include <iostream>
#include <memory>
#include "../../include/CVTracker.h"
#include "../../include/CVStabilization.h"
#include "../../include/CVObjectDetection.h"
#include "CVTracker.h"
#include "CVStabilization.h"
#include "CVObjectDetection.h"

#include "../../include/OpenShot.h"
#include "../../include/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 @@ -118,7 +121,7 @@ int main(int argc, char* argv[]) {
CVTracker tracker(trackerJson(r, false), processingController);

// Start the tracking
tracker.trackClip(r9, 0, 100, true);
tracker.trackClip(r9, 0, 0, true);
// Save the tracked data
tracker.SaveTrackedData();

Expand Down Expand Up @@ -223,22 +226,23 @@ 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";

// Construct all the composition of the JSON string
string protobuf_data_path = jsonFormat("protobuf_data_path", protobufDataPath);
string trackerType = jsonFormat("tracker_type", tracker);
string trackerType = jsonFormat("tracker-type", tracker);
string bboxCoords = jsonFormat(
"bbox",
"{" + jsonFormat("x", to_string(r.x), "int") +
"," + jsonFormat("y", to_string(r.y), "int") +
"," + jsonFormat("w", to_string(r.width), "int") +
"," + jsonFormat("h", to_string(r.height), "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("first-frame", to_string(0), "int") +
"}",
"rstring");
"rstring");

// Return only the the protobuf path in JSON format
if(onlyProtoPath)
Expand All @@ -251,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 @@ -270,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
5 changes: 4 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ set(OPENSHOT_SOURCES
FrameMapper.cpp
Json.cpp
KeyFrame.cpp
TrackedObjectBase.cpp
OpenShotVersion.cpp
ZmqLogger.cpp
PlayerBase.cpp
Expand All @@ -105,6 +106,7 @@ set(OPENSHOT_CV_SOURCES
CVStabilization.cpp
ClipProcessingJobs.cpp
CVObjectDetection.cpp
TrackedObjectBBox.cpp
effects/Stabilizer.cpp
effects/Tracker.cpp
effects/ObjectDetection.cpp
Expand Down Expand Up @@ -288,7 +290,7 @@ mark_as_advanced(QT_VERSION_STR)
# Find FFmpeg libraries (used for video encoding / decoding)
find_package(FFmpeg REQUIRED COMPONENTS avcodec avformat avutil swscale)

set(all_comps avcodec avformat avutil swscale)
set(all_comps avcodec avformat avutil swscale avresample)
if(TARGET FFmpeg::swresample)
list(APPEND all_comps swresample)
else()
Expand Down Expand Up @@ -507,3 +509,4 @@ endif()
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Jonathan Thomas") #required

include(CPack)

28 changes: 20 additions & 8 deletions src/CVObjectDetection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* @file
* @brief Source file for CVObjectDetection class
* @author Jonathan Thomas <jonathan@openshot.org>
* @author Brenno Caldato <brenno.caldato@outlook.com>
*
* @ref License
*/
Expand Down Expand Up @@ -82,10 +83,10 @@ void CVObjectDetection::detectObjectsClip(openshot::Clip &video, size_t _start,
setProcessingDevice();

size_t frame_number;
if(!process_interval || end == 0 || end-start == 0){
if(!process_interval || end <= 1 || end-start == 0){
// Get total number of frames in video
start = video.Start() * video.Reader()->info.fps.ToInt();
end = video.End() * video.Reader()->info.fps.ToInt();
start = (int)(video.Start() * video.Reader()->info.fps.ToFloat());
end = (int)(video.End() * video.Reader()->info.fps.ToFloat());
}

for (frame_number = start; frame_number <= end; frame_number++)
Expand All @@ -105,7 +106,6 @@ void CVObjectDetection::detectObjectsClip(openshot::Clip &video, size_t _start,
// Update progress
processingController->SetProgress(uint(100*(frame_number-start)/(end-start)));

// std::cout<<"Frame: "<<frame_number<<"\n";
}
}

Expand Down Expand Up @@ -138,6 +138,7 @@ void CVObjectDetection::postprocess(const cv::Size &frameDims, const std::vector
std::vector<int> classIds;
std::vector<float> confidences;
std::vector<cv::Rect> boxes;
std::vector<int> objectIds;

for (size_t i = 0; i < outs.size(); ++i)
{
Expand Down Expand Up @@ -180,13 +181,14 @@ void CVObjectDetection::postprocess(const cv::Size &frameDims, const std::vector
sort.update(sortBoxes, frameId, sqrt(pow(frameDims.width,2) + pow(frameDims.height, 2)), confidences, classIds);

// Clear data vectors
boxes.clear(); confidences.clear(); classIds.clear();
boxes.clear(); confidences.clear(); classIds.clear(); objectIds.clear();
// Get SORT predicted boxes
for(auto TBox : sort.frameTrackingResult){
if(TBox.frame == frameId){
boxes.push_back(TBox.box);
confidences.push_back(TBox.confidence);
classIds.push_back(TBox.classId);
objectIds.push_back(TBox.id);
}
}

Expand All @@ -202,12 +204,14 @@ void CVObjectDetection::postprocess(const cv::Size &frameDims, const std::vector
boxes.erase(boxes.begin() + j);
classIds.erase(classIds.begin() + j);
confidences.erase(confidences.begin() + j);
objectIds.erase(objectIds.begin() + j);
break;
}
else{
boxes.erase(boxes.begin() + i);
classIds.erase(classIds.begin() + i);
confidences.erase(confidences.begin() + i);
objectIds.erase(objectIds.begin() + i);
i = 0;
break;
}
Expand All @@ -226,12 +230,14 @@ void CVObjectDetection::postprocess(const cv::Size &frameDims, const std::vector
boxes.erase(boxes.begin() + j);
classIds.erase(classIds.begin() + j);
confidences.erase(confidences.begin() + j);
objectIds.erase(objectIds.begin() + j);
break;
}
else{
boxes.erase(boxes.begin() + i);
classIds.erase(classIds.begin() + i);
confidences.erase(confidences.begin() + i);
objectIds.erase(objectIds.begin() + i);
i = 0;
break;
}
Expand All @@ -251,7 +257,7 @@ void CVObjectDetection::postprocess(const cv::Size &frameDims, const std::vector
normalized_boxes.push_back(normalized_box);
}

detectionsData[frameId] = CVDetectionData(classIds, confidences, normalized_boxes, frameId);
detectionsData[frameId] = CVDetectionData(classIds, confidences, normalized_boxes, frameId, objectIds);
}

// Compute IOU between 2 boxes
Expand Down Expand Up @@ -359,6 +365,7 @@ void CVObjectDetection::AddFrameDataToProto(pb_objdetect::Frame* pbFrameData, CV
box->set_h(dData.boxes.at(i).height);
box->set_classid(dData.classIds.at(i));
box->set_confidence(dData.confidences.at(i));
box->set_objectid(dData.objectIds.at(i));

}
}
Expand Down Expand Up @@ -461,7 +468,10 @@ bool CVObjectDetection::_LoadObjDetectdData(){
const google::protobuf::RepeatedPtrField<pb_objdetect::Frame_Box > &pBox = pbFrameData.bounding_box();

// Construct data vectors related to detections in the current frame
std::vector<int> classIds; std::vector<float> confidences; std::vector<cv::Rect_<float>> boxes;
std::vector<int> classIds;
std::vector<float> confidences;
std::vector<cv::Rect_<float>> boxes;
std::vector<int> objectIds;

for(int i = 0; i < pbFrameData.bounding_box_size(); i++){
// Get bounding box coordinates
Expand All @@ -472,13 +482,15 @@ bool CVObjectDetection::_LoadObjDetectdData(){

// Get class Id (which will be assign to a class name) and prediction confidence
int classId = pBox.Get(i).classid(); float confidence = pBox.Get(i).confidence();
// Get object Id
int objectId = pBox.Get(i).objectid();

// Push back data into vectors
boxes.push_back(box); classIds.push_back(classId); confidences.push_back(confidence);
}

// Assign data to object detector map
detectionsData[id] = CVDetectionData(classIds, confidences, boxes, id);
detectionsData[id] = CVDetectionData(classIds, confidences, boxes, id, objectIds);
}

// Delete all global objects allocated by libprotobuf.
Expand Down
11 changes: 10 additions & 1 deletion src/CVObjectDetection.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* @file
* @brief Header file for CVObjectDetection class
* @author Jonathan Thomas <jonathan@openshot.org>
* @author Brenno Caldato <brenno.caldato@outlook.com>
*
* @ref License
*/
Expand Down Expand Up @@ -49,16 +50,24 @@ namespace openshot
// Stores the detected object bounding boxes and its properties.
struct CVDetectionData{
CVDetectionData(){}
CVDetectionData(std::vector<int> _classIds, std::vector<float> _confidences, std::vector<cv::Rect_<float>> _boxes, size_t _frameId){
CVDetectionData(
std::vector<int> _classIds,
std::vector<float> _confidences,
std::vector<cv::Rect_<float>> _boxes,
size_t _frameId,
std::vector<int> _objectIds)
{
classIds = _classIds;
confidences = _confidences;
boxes = _boxes;
frameId = _frameId;
objectIds = _objectIds;
}
size_t frameId;
std::vector<int> classIds;
std::vector<float> confidences;
std::vector<cv::Rect_<float>> boxes;
std::vector<int> objectIds;
};

/**
Expand Down
11 changes: 6 additions & 5 deletions src/CVStabilization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* @file
* @brief Source file for CVStabilization class
* @author Jonathan Thomas <jonathan@openshot.org>
* @author Brenno Caldato <brenno.caldato@outlook.com>
*
* @ref License
*/
Expand Down Expand Up @@ -43,8 +44,8 @@ using google::protobuf::util::TimeUtil;
CVStabilization::CVStabilization(std::string processInfoJson, ProcessingController &processingController)
: processingController(&processingController){
SetJson(processInfoJson);
start = 0;
end = 0;
start = 1;
end = 1;
}

// Process clip and store necessary stabilization data
Expand All @@ -64,10 +65,10 @@ void CVStabilization::stabilizeClip(openshot::Clip& video, size_t _start, size_t
cv::Size readerDims(video.Reader()->info.width, video.Reader()->info.height);

size_t frame_number;
if(!process_interval || end == 0 || end-start == 0){
if(!process_interval || end <= 1 || end-start == 0){
// Get total number of frames in video
start = video.Start() * video.Reader()->info.fps.ToInt();
end = video.End() * video.Reader()->info.fps.ToInt();
start = (int)(video.Start() * video.Reader()->info.fps.ToFloat()) + 1;
end = (int)(video.End() * video.Reader()->info.fps.ToFloat()) + 1;
}

// Extract and track opticalflow features for each frame
Expand Down
1 change: 1 addition & 0 deletions src/CVStabilization.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* @file
* @brief Header file for CVStabilization class
* @author Jonathan Thomas <jonathan@openshot.org>
* @author Brenno Caldato <brenno.caldato@outlook.com>
*
* @ref License
*/
Expand Down