Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix bugs

  • Loading branch information...
commit d3e72967ddbaf65e13f1d9c137fa420e4ec6d68c 1 parent 64fd1fd
@zenixls2 zenixls2 authored
Showing with 21 additions and 15 deletions.
  1. +5 −2 UnveilinWaves.cpp
  2. +16 −13 main.cpp
View
7 UnveilinWaves.cpp
@@ -235,7 +235,7 @@ int UnveilinWaves::ProcessRotates(IplImage *showImg)
cvCopy(rotated, showImg, NULL);
cvReleaseImage(&rotated);
- if(_angle > -177){
+ if(_angle > -132){
_angle -= 2;
rotateFound = 1;
}
@@ -300,7 +300,10 @@ IplImage *UnveilinWaves::rotateImage(const IplImage *src, float angleDegrees)
m[4] = m[0];
m[2] = w*0.5f;
m[5] = h*0.5f;
-
+ /*
+ * [cos(rad), sin(rad), width*0.5 ]
+ * [-sin(rad), cos(rad), height*0.5]
+ */
// Make a spare image for the result
CvSize sizeRotated;
sizeRotated.width = cvRound(w);
View
29 main.cpp
@@ -100,11 +100,11 @@ void UpdateEnabledTime(int64 enable_time[], const int &idx, const int64 &now_ti
enable_time[idx] = now_time;
delay_sec = 0.1;
// Left-Up
- key = idx - IMG_COL_NUM - 1;
+ /*key = idx - IMG_COL_NUM - 1;
if (key >= 0 && key < IMG_COL_NUM * IMG_ROW_NUM && enable_time[key] == 0 && (idx % IMG_COL_NUM > 0)) {
enable_time[key] = (int64) (now_time + freq * delay_sec);
delay_sec += 0.2;
- }
+ }*/
// Upside
key = idx - IMG_COL_NUM;
if (key >= 0 && key < IMG_COL_NUM * IMG_ROW_NUM && enable_time[key] == 0) {
@@ -112,11 +112,11 @@ void UpdateEnabledTime(int64 enable_time[], const int &idx, const int64 &now_ti
delay_sec += 0.2;
}
// Right-Up
- key = idx - IMG_COL_NUM + 1;
+ /*key = idx - IMG_COL_NUM + 1;
if (key >= 0 && key < IMG_COL_NUM * IMG_ROW_NUM && enable_time[key] == 0 && (idx % IMG_COL_NUM < IMG_COL_NUM - 1)) {
enable_time[key] = (int64) (now_time + freq * delay_sec);
delay_sec += 0.2;
- }
+ }*/
// Right
key = idx + 1;
if (key >= 0 && key < IMG_COL_NUM * IMG_ROW_NUM && enable_time[key] == 0 && (idx % IMG_COL_NUM < IMG_COL_NUM - 1)) {
@@ -124,11 +124,11 @@ void UpdateEnabledTime(int64 enable_time[], const int &idx, const int64 &now_ti
delay_sec += 0.2;
}
// Right-down
- key = idx + IMG_COL_NUM + 1;
+ /*key = idx + IMG_COL_NUM + 1;
if (key >= 0 && key < IMG_COL_NUM * IMG_ROW_NUM && enable_time[key] == 0 && (idx % IMG_COL_NUM < IMG_COL_NUM - 1)) {
enable_time[key] = (int64) (now_time + freq * delay_sec);
delay_sec += 0.2;
- }
+ }*/
// Downside
key = idx + IMG_COL_NUM;
if (key >= 0 && key < IMG_COL_NUM * IMG_ROW_NUM && enable_time[key] == 0) {
@@ -136,11 +136,11 @@ void UpdateEnabledTime(int64 enable_time[], const int &idx, const int64 &now_ti
delay_sec += 0.2;
}
// Left-down
- key = idx + IMG_COL_NUM - 1;
+ /*key = idx + IMG_COL_NUM - 1;
if (key >= 0 && key < IMG_COL_NUM * IMG_ROW_NUM && enable_time[key] == 0 && (idx % IMG_COL_NUM > 0)) {
enable_time[key] = (int64) (now_time + freq * delay_sec);
delay_sec += 0.2;
- }
+ }*/
// Left
key = idx - 1;
if (key >= 0 && key < IMG_COL_NUM * IMG_ROW_NUM && enable_time[key] == 0 && (idx % IMG_COL_NUM > 0)) {
@@ -148,28 +148,31 @@ void UpdateEnabledTime(int64 enable_time[], const int &idx, const int64 &now_ti
}
// Left
- key = idx - 2;
+ /*key = idx - 2;
if (key >= 0 && key < IMG_COL_NUM * IMG_ROW_NUM && enable_time[key] == 0 && (idx % IMG_COL_NUM > 0)) {
enable_time[key] = (int64) (now_time + freq * delay_sec);
- }
+ }*/
// Left
+ /*
key = idx - 2 * IMG_COL_NUM;
if (key >= 0 && key < IMG_COL_NUM * IMG_ROW_NUM && enable_time[key] == 0 && (idx % IMG_COL_NUM > 0)) {
enable_time[key] = (int64) (now_time + freq * delay_sec);
- }
+ }*/
// Left
+ /*
key = idx + 2;
if (key >= 0 && key < IMG_COL_NUM * IMG_ROW_NUM && enable_time[key] == 0 && (idx % IMG_COL_NUM > 0)) {
enable_time[key] = (int64) (now_time + freq * delay_sec);
- }
+ }*/
// Left
+ /*
key = idx + 2 * IMG_COL_NUM;
if (key >= 0 && key < IMG_COL_NUM * IMG_ROW_NUM && enable_time[key] == 0 && (idx % IMG_COL_NUM > 0)) {
enable_time[key] = (int64) (now_time + freq * delay_sec);
- }
+ }*/
}
Please sign in to comment.
Something went wrong with that request. Please try again.