To Apply 2D sliding window on data to calculate doppler parameter rapidly
Show older comments
I need help to merge 2-for loops using filter2 (2D) filter or any suitable way to make my code efficient enough.
I want to run a 2D sliding window of 256*256 to move through whole data and calculate one 'dc' for each patch, moreover, I just received last value of ''dc'' while rest of previous values are 0.
img= [1:1664,1:4352] %% Size of image
PRF = 1925;
k = 128; % size of patch
C= zeros(size(img));
for i = k+1:size(img_o,1)-k
for j = k+1:size(img_o,2)-k
Bb = img_o(i-kk:i+kk-1, j-kk:j+kk-1);
dc(k) = doppler_centroid(Bb, PRF); %% this function calculate doppler centroid ''dc''
C(i,j) = dc(k);
end;
end;
Accepted Answer
More Answers (0)
Categories
Find more on ROI-Based Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!