{"action":"created","issue":{"url":"https://api.github.com/repos/timholy/Images.jl/issues/231","labels_url":"https://api.github.com/repos/timholy/Images.jl/issues/231/labels{/name}","comments_url":"https://api.github.com/repos/timholy/Images.jl/issues/231/comments","events_url":"https://api.github.com/repos/timholy/Images.jl/issues/231/events","html_url":"https://github.com/timholy/Images.jl/pull/231","id":51043307,"number":231,"title":"Discrete Fourier transform registration (subpixel translation correction)","user":{"login":"romainFr","id":1626262,"avatar_url":"https://avatars.githubusercontent.com/u/1626262?v=3","gravatar_id":"","url":"https://api.github.com/users/romainFr","html_url":"https://github.com/romainFr","followers_url":"https://api.github.com/users/romainFr/followers","following_url":"https://api.github.com/users/romainFr/following{/other_user}","gists_url":"https://api.github.com/users/romainFr/gists{/gist_id}","starred_url":"https://api.github.com/users/romainFr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romainFr/subscriptions","organizations_url":"https://api.github.com/users/romainFr/orgs","repos_url":"https://api.github.com/users/romainFr/repos","events_url":"https://api.github.com/users/romainFr/events{/privacy}","received_events_url":"https://api.github.com/users/romainFr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-12-04T23:20:57Z","updated_at":"2015-12-04T14:53:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/timholy/Images.jl/pulls/231","html_url":"https://github.com/timholy/Images.jl/pull/231","diff_url":"https://github.com/timholy/Images.jl/pull/231.diff","patch_url":"https://github.com/timholy/Images.jl/pull/231.patch"},"body":"Something I needed at some point that might be useful to more people. It's taken from [Guizar & al](http://www.opticsinfobase.org/ol/fulltext.cfm?uri=ol-33-2-156&id=148843) (Manuel Guizar-Sicairos, Samuel T. Thurman, and James R. Fienup, \"Efficient subpixel image registration algorithms,\" Opt. Lett. 33, 156-158 (2008)) and (very) inspired by the [matlab code] (http://www.mathworks.com/matlabcentral/fileexchange/18401-efficient-subpixel-image-registration-by-cross-correlation) provided by the authors.\r\n\r\nFunction ```subpixelshift(img,rowShift,colShift)``` translates an image by the given amount. ```dftReg(imgser,[ref,ufac,align])``` performs the registration of ```imgser``` to a reference ```ref``` (by default the first frame of ```imgser```). Either returns an array of registration parameters (by default), or the registered image (if ```align==true```). ```usfac``` is the upsampling factor (10 by default). Finally ```alignFromDft``` performs the registration given an array of registration parameters.\r\n\r\nThis doesn't work with color images for now.\r\n\r\nAs a side-note, this would also work for rotations by transforming the image to polar coordinates beforehand.\r\n\r\n```julia\r\n> using Images, TestImages\r\n> img = testimage(\"mandril_gray\");\r\n> img2 = subpixelshift(img,40.3,30.7);\r\n> dftReg(img2,ref=img,ufac=10)\r\n       1x3 Array{Float64,2}:\r\n       0.332617  -40.3  -30.7\r\n```"},"comment":{"url":"https://api.github.com/repos/timholy/Images.jl/issues/comments/161985469","html_url":"https://github.com/timholy/Images.jl/pull/231#issuecomment-161985469","issue_url":"https://api.github.com/repos/timholy/Images.jl/issues/231","id":161985469,"user":{"login":"jianghaizhu","id":16137435,"avatar_url":"https://avatars.githubusercontent.com/u/16137435?v=3","gravatar_id":"","url":"https://api.github.com/users/jianghaizhu","html_url":"https://github.com/jianghaizhu","followers_url":"https://api.github.com/users/jianghaizhu/followers","following_url":"https://api.github.com/users/jianghaizhu/following{/other_user}","gists_url":"https://api.github.com/users/jianghaizhu/gists{/gist_id}","starred_url":"https://api.github.com/users/jianghaizhu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jianghaizhu/subscriptions","organizations_url":"https://api.github.com/users/jianghaizhu/orgs","repos_url":"https://api.github.com/users/jianghaizhu/repos","events_url":"https://api.github.com/users/jianghaizhu/events{/privacy}","received_events_url":"https://api.github.com/users/jianghaizhu/received_events","type":"User","site_admin":false},"created_at":"2015-12-04T14:53:53Z","updated_at":"2015-12-04T14:53:53Z","body":"Has the license issue been solved yet?"}}