Astronomy Python - Jupiter Planet - Cropping Red Gaint Spot
In Astronomy, there will be often need to crop(cut) certain part of image.
By using cropping technique, it becomes easy to highlight import part of the image, as shown in the below example, Red Giant Spot is cropped and then shown in another window (top right).
Image credit -Nasa Jupiter
Below is the python code used. When code is executed original image appears and then selected the part of the image which you want to cut.
******************************************************************
import cv2
import numpy as np
# Read image
image = cv2.imread("E:\\astronomy_related\\image_crop\\jupiter.jpg")
# Select ROI
r = cv2.selectROI("select the area", image)
# Crop image
cropped_image = image[int(r[1]):int(r[1]+r[3]),
int(r[0]):int(r[0]+r[2])]
# Display cropped image
cv2.imshow("Cropped image", cropped_image)
cv2.waitKey(0)
*********************************************************
Credits
code credit-
https://www.geeksforgeeks.org/python-opencv-selectroi-function/
Image Credit: NASA Jupiter
https://solarsystem.nasa.gov/news/1889/jupiter-resources/?page=0&per_page=40&order=created_at+desc&search=&tags=Jupiter%2CJupiter+Moons%2CJuno&category=324
By Staci L. Tiedeken, NASA’s Goddard Space Flight Center
Comments
Post a Comment