I have an image having pixel values in rows: 350-1000, and columns: 100-250
I want to shift these pixel values from columns 100-250 to 130-280.
which command should I use?
Thanks!

 채택된 답변

Iain
Iain 2014년 9월 8일

2 개 추천

shifted = zeros(size(original));
shifted(:, 130:280,:) = original(:,100:250,:);

댓글 수: 3

Hamza Ahmed
Hamza Ahmed 2014년 9월 8일
Sorry I forgot to mention that the image is grayscale. how should I do it then? Thanks
Image Analyst
Image Analyst 2014년 9월 8일
Get rid of the final ",:" (comma colon).
Hamza Ahmed
Hamza Ahmed 2014년 9월 9일
편집: Hamza Ahmed 2014년 9월 9일
I ended up using this: I = circshift(I, [30 30]);
Both methods do the same thing I guess. Problem solved. Thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

질문:

2014년 9월 8일

편집:

2014년 9월 9일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by