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

Save with time #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add diagonal move
barmikser committed Aug 18, 2015
commit aab6dca15b3066bd9d859400c121271072b47a62
2 changes: 2 additions & 0 deletions sample_barinov_m/application.cpp
Original file line number Diff line number Diff line change
@@ -59,6 +59,8 @@ int Application::drawButtons(Mat &display)
return 0;
}



int Application::showFrame(const std::string &caption,
const Mat& src, Mat& dst)
{
18 changes: 17 additions & 1 deletion sample_barinov_m/processing.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include "processing.hpp"
#include "time.h"
#include <cmath>

#include <opencv2/imgproc/imgproc.hpp>

@@ -8,7 +10,21 @@ void Processing::processFrame(const cv::Mat& src, cv::Mat& dst)
{
src.copyTo(dst);

cv::Rect region(src.rows/4, src.cols/4, src.rows/2, src.cols/2);
cv::Rect region((int)((sin((long double)(clock() / CLOCKS_PER_SEC *3))*src.rows/4)+src.rows/4),
(int)((sin((long double)(clock() / CLOCKS_PER_SEC *3))*src.cols/4)+src.cols/4),
src.rows/2, src.cols/2);

/*if (y % (src.cols/2) > 1)
{
if (x % (src.rows/2) > 1)
x=x+1;
else x=0;
y=y+1;
}
else y=0;*/

//cv::Rect region(src.rows/4, src.cols/4, src.rows/2, src.cols/2);
Mat roi = dst(region);

const int kSize = 11;