diff options
| author | Comment <tim@gray.(none)> | 2013-09-02 13:10:02 +0100 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2013-09-02 13:10:02 +0100 |
| commit | 10a475fe33fc645e3623c2bf4b176194bf45675b (patch) | |
| tree | e501e1bd3df887ccf5155c29e9f015172b5ba77f /rotord | |
| parent | 443992effaf9e1c8e6bf7db938ad3b86bc2ffe64 (diff) | |
scaling position in transform
Diffstat (limited to 'rotord')
| -rw-r--r-- | rotord/src/nodes_transform.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/rotord/src/nodes_transform.h b/rotord/src/nodes_transform.h index 32d9cef..8baf1fa 100644 --- a/rotord/src/nodes_transform.h +++ b/rotord/src/nodes_transform.h @@ -64,7 +64,9 @@ namespace Rotor { cv::Mat trans_mat(2,3,CV_32FC1); cv::Mat out_mat(3,3,CV_32FC1); - + //normally a scale of 1 will place the image on screen at pixel size + //it should be that a scale of 1 places it at width w + //how to scale around the centre cv::Mat inter; if (s<1){ if (s<.01) s=.01; @@ -72,7 +74,10 @@ namespace Rotor { cv::resize(in->rgb,inter,cv::Size(in->w*scalefac,in->h*scalefac),s,s); //double fx=0, double fy=0, int interpolation=INTER_LINEAR )ΒΆ s=1.0f; } - else inter=in->rgb; + else { + inter=in->rgb; + s=((float)image.w/in->w)*s; + } // Compute matrix by creating triangle and transforming //is there a better way - combine the 2? Just a bit of geometry |
