title: How to create an oriented window arround a pixel in an image using MATLAB?
body: <p>I am trying to extract an oriented window of size 15x15(say), around a pixel in an image. The orientation can be of any angle or say step of 15 degrees.</p>
  
  <p>I have tried some logic but did not give satisfactory result, i.e. if I see the oriented Window using imshow(), the window is rotated but the image has some swirl effects.</p>
  
  <pre><code>b=15; % Window Size 
  rm = [cos(rad2deg(theta)) -sin(rad2deg(theta)); sin(rad2deg(theta)) cos(rad2deg(theta))];
  Lx=-floor(b/2):floor(b/2);
  Ly=-floor(b/2):floor(b/2);
  block=zeros(b,b);
  
  for i=1:length(Lx)
      for j=1:length(Ly)
          [T]=rm*[Lx(i) Ly(j)]';
          tx=round(T(1)+x);
          ty=round(T(2)+y);
          block(i,j)=im(tx,ty);
      end
  end
  </code></pre>