How can i make automatic rotation using PCA to set the galaxies oriantation to be horizontal?
Ältere Kommentare anzeigen
Please help me >>

How can i make automatic rotation using PCA to set the galaxies oriantation to be horizontal and cropping the image?
Knowing that the galaxies in the original images have different directions
I searched a lot and could not find any code
1 Kommentar
If you're working with image data you could use the Orientation property of the regionprops() function to get the angle between the x-axis and the major axis of the galaxy ellipse.

Akzeptierte Antwort
Weitere Antworten (1)
Image Analyst
am 10 Feb. 2020
3 Stimmen
One way that does not depend on selecting a threshold for your image is to use the radon transform. Look how I used it to rotate the football to the two image axes:

Basically the radon transform gets the projection of the image along a line perpendicular to the projection direction. This is the concept of CT - computed tomgraphy - and MRI. You can just read off the angle by looking at the maximum of the radon transform, then call imrotate() to do the rotation by that angle. See attached demo script. Adapt as needed.
2 Kommentare
Adam Danz
am 10 Feb. 2020
This is one of my favorite things about volunteering here. This morning I spent some time reading about the Radon transfer and it's definitely one I'll keep in mind. Thanks for sharing, Image Analyst! I applied your demo to the galaxy image and it worked well. The transfer in the demo works on the grayscaled image which is the red component of the RGB image. Since the galaxy backgrounds are all black, I suppose it wouldn't matter which RGB value was extracted (it certainly didn't matter for the image I tested). I wonder how it would perform in the galaxies listed in the bottom row of the image in the question.
Aya Ahmed
am 16 Feb. 2020
Kategorien
Mehr zu Image Arithmetic finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



