Skip to content

Commit

Permalink
Merging
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Paleo committed Jul 25, 2013
1 parent 31bbd68 commit f406a2e
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 774 deletions.
399 changes: 0 additions & 399 deletions openCL/image.cl

Large diffs are not rendered by default.

324 changes: 0 additions & 324 deletions openCL/matching.cl

This file was deleted.

1 change: 1 addition & 0 deletions openCL/matching_gpu.cl
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ __kernel void matching_valid(
*/



__kernel void matching_v2(
__global t_keypoint* keypoints1,
__global t_keypoint* keypoints2,
Expand Down
23 changes: 12 additions & 11 deletions openCL/transform.cl
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ __kernel void transform(
int x = gid0,
y = gid1;

float tx = dot(mat.s02,(float2) (x,y)), //x' = a*x + b*y + c
ty = dot(mat.s13,(float2) (x,y)); //y' = d*x + e*y + f
tx += off.s0;
ty += off.s1;
float tx = mat.s0*x+mat.s2*y,
ty = mat.s1*x+mat.s3*y;

tx += off.s1;
ty += off.s0;

int tx_next = ((int) tx) +1,
tx_prev = (int) tx,
Expand All @@ -58,18 +59,18 @@ __kernel void transform(

float interp = fill;

//why "0 <= tx && 0 <= ty" rather than "0 <= tx_prev && 0 <= ty_prev" ?!
//why this rather than "0 <= tx_prev && 0 <= ty_prev && tx_next < image_width && ty_next < image_height" ?
if (0 <= tx && tx_next < image_width && 0 <= ty && ty_next < image_height) {

//bilinear interpolation
float interp1 = ((float) (tx_next - tx))/((float) (tx_next - tx_prev)) * image[ty_prev*image_width+tx_prev]
+ ((float) (tx - tx_prev))/((float) (tx_next - tx_prev)) * image[ty_prev*image_width+tx_next],
float interp1 = ((float) (tx_next - tx)) * image[ty_prev*image_width+tx_prev]
+ ((float) (tx - tx_prev)) * image[ty_prev*image_width+tx_next],

interp2 = ((float) (tx_next - tx))/((float) (tx_next - tx_prev)) * image[ty_next*image_width+tx_prev]
+ ((float) (tx - tx_prev))/((float) (tx_next - tx_prev)) * image[ty_next*image_width+tx_next];
interp2 = ((float) (tx_next - tx)) * image[ty_next*image_width+tx_prev]
+ ((float) (tx - tx_prev)) * image[ty_next*image_width+tx_next];

interp = ((float) (ty_next - ty))/((float) (ty_next - ty_prev)) * interp1
+ ((float) (ty - ty_prev))/((float) (ty_next - ty_prev)) * interp2;
interp = ((float) (ty_next - ty)) * interp1
+ ((float) (ty - ty_prev)) * interp2;

}

Expand Down
1 change: 1 addition & 0 deletions sift-src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
logging.basicConfig()
from .plan import SiftPlan
from .match import MatchPlan

Loading

0 comments on commit f406a2e

Please sign in to comment.