0
votes

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?

1
Please provide simplified example input, desired output, and code you have so far. - Neil Slater
Do you assume periodic boundary conditions for your matrix? - Kostya
Construction of ellipsis is described here stackoverflow.com/questions/2153768/…. You need to define better a meaning of "exclude" :) - Kostya

1 Answers

-1
votes

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);