Click here to Skip to main content
15,901,666 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am wondering how to cut out around a part of an image using python. I have the exact l location of the thing I want to be cut out and I just want to cut around around it. Basically I have a list of coordinates that I need to be separate images and want each new image to be like 100x100 pixels. How would this be done? I am looking for a general code where all I would have to do is switch in and out the coordinates of the FITS image that I have and tell the code to find that coordinate and cut 100 pixels around it. It is the format of the image that I am working with. I am wondering if there is a way I could do this without using cv2, but instead PIL and astropy. Thanks for the help! I am very new to the coding world!

What I have tried:

I've tried plugging in coordinates individually, but what I really need is for the code to be able to sift through the string of coordinates (in pixel) and make the stamp cuts. I am using ds9 to view my image if that helps.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900