Find Jobs
Hire Freelancers

Convert matlab code to c++

$10-30 USD

Cancelled
Posted about 9 years ago

$10-30 USD

Paid on delivery
Convert matlab code to c++: function rec = interpolate(s,shifts,factor) n=length(s); ss = size(s{1}); if (length(ss)==2) ss=[ss 1]; end % compute the coordinates of the pixels from the N images. for k=1:ss(3) % for each color channel for i=1:n % for each image s_c{i}=s{i}(:,:,k); s_c{i} = s_c{i}(:); r{i} = [1:factor:factor*ss(1)]'*ones(1,ss(2)); % create matrix with row indices c{i} = ones(ss(1),1)*[1:factor:factor*ss(2)]; % create matrix with column indices r{i} = r{i}+factor*shifts(i,2); %% the problem is here. c{i} = c{i}+factor*shifts(i,1); %% the problem is here. rn{i} = r{i}((r{i}>0)&(r{i}<=factor*ss(1))&(c{i}>0)&(c{i}<=factor*ss(2))); cn{i} = c{i}((r{i}>0)&(r{i}<=factor*ss(1))&(c{i}>0)&(c{i}<=factor*ss(2))); sn{i} = s_c{i}((r{i}>0)&(r{i}<=factor*ss(1))&(c{i}>0)&(c{i}<=factor*ss(2))); end s_ = []; r_ = []; c_ = []; sr_ = []; rr_ = []; cr_ = []; for i=1:n % for each image s_ = [s_; sn{i}]; r_ = [r_; rn{i}]; c_ = [c_; cn{i}]; end clear s_c r c coord rn cn sn % interpolate the high resolution pixels using cubic interpolation rec_col = griddata(c_,r_,s_,[1:ss(2)*factor],[1:ss(1)*factor]','cubic'); rec(:,:,k) = reshape(rec_col,ss(1)*factor,ss(2)*factor); end rec(isnan(rec))=0;
Project ID: 7338379

About the project

5 proposals
Remote project
Active 9 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs

About the client

Flag of POLAND
Wolbrom, Poland
5.0
29
Member since Jul 1, 2011

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.