0

I have an image (intensity plot) a nxn square matrix. On the image, I want to choose a point and center the image to that point (to make that point as the center of the image). How can I do that in Matlab?

Also, how can I choose a region (an elliptical) and exclude all the data (intensity points) outside that region?

Aneps
  • 133
  • 10
  • Please provide simplified example input, desired output, and code you have so far. – Neil Slater Nov 10 '14 at 12:18
  • Do you assume periodic boundary conditions for your matrix? – Kostya Nov 10 '14 at 14:27
  • Construction of ellipsis is described here http://stackoverflow.com/questions/2153768/draw-ellipse-and-ellipsoid-in-matlab. You need to define better a meaning of "exclude" :) – Kostya Nov 10 '14 at 15:04

1 Answers1

-1

Assuming periodic boundary conditions, you can center the image a like this

clear all;
N = 11; a = randi(N^2,N,N);

c = floor([median(1:N) median(1:N)]); %old center
nc = [3 9]; %new center
na = circshift(a, c - newc);
Kostya
  • 1,552
  • 1
  • 10
  • 16