How to center an image
Mostra commenti meno recenti
hi
im new in the matlab world ..And I have a problem regarding image processing..
I have a image(matrix size: mXn)that in IJ coordinate system (origin at the upper left) and i want to center the image (that the origin will be at the center of the image - XY coordinate system)...
How can I do this? There is a matrix which I can multiply the image and the result is a centered image?
thanks
1 Commento
dpb
il 18 Ago 2013
If you're talking simply of the numbering of the pixels' location in the image, that's simply a translation of round([m|n]/2) in addressing.
Matlab stores everything in 1-based arrays so you can't actually change the addressing directly to be -m/2...0...+m/2 instead of 1...m You could write a helper function that hides the addressing manipulation, of course.
Risposte (1)
Image Analyst
il 18 Ago 2013
0 voti
Use circshift() to translate the image. You need to know the number of rows and columns in the "canvass" and the number of rows and columns in the portion you want to shift, then calculate the shift amounts (in rows and columns) and then call circshift() to do the translation.
Categorie
Scopri di più su Images in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!