diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-09-02 17:15:22 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-09-02 17:15:22 +0100 |
| commit | 2469ddabe2b6e7746984339db84dbe0e7b069255 (patch) | |
| tree | d43205fd842e7bc5d6b2f0785f6603dd5f19bc14 /rotord/src/nodes_transform.h | |
| parent | 7e543cdaff89e99a9940624b949d684d4aed69c0 (diff) | |
working on transform algorithm
Diffstat (limited to 'rotord/src/nodes_transform.h')
| -rw-r--r-- | rotord/src/nodes_transform.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/rotord/src/nodes_transform.h b/rotord/src/nodes_transform.h index 8baf1fa..8b94d33 100644 --- a/rotord/src/nodes_transform.h +++ b/rotord/src/nodes_transform.h @@ -68,16 +68,16 @@ namespace Rotor { //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; - float scalefac=((float)image.w/in->w)*s; - 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 { + //if (s<1){ + // if (s<.01) s=.01; + // float scalefac=((float)image.w/in->w)*s; + // 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; 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 @@ -105,14 +105,14 @@ namespace Rotor { //warpAffine( inter.rgb, image.rgb, rot_mat, image.rgb.size(), filtmode, cv::BORDER_WRAP); //BORDER_WRAP - //trans_mat.resize(3); - //rot_mat.resize(3); - //trans_mat.data[8]=1.0f; - //rot_mat.data[8]=1.0f; - //out_mat=rot_mat*trans_mat; - //out_mat.resize(2); + trans_mat.resize(3); + rot_mat.resize(3); + trans_mat.data[8]=1.0f; + rot_mat.data[8]=1.0f; + out_mat=rot_mat*trans_mat; + out_mat.resize(2); - warpAffine( inter, image.rgb, rot_mat, image.rgb.size(), filtmode, cv::BORDER_WRAP); + warpAffine( inter, image.rgb, out_mat, image.rgb.size(), filtmode, cv::BORDER_WRAP); return ℑ } |
