Question

Write a program that asks the user for the name of an image, the name of an output file. Your program should then save the up
0 0
Add a comment Improve this question Transcribed image text
Answer #1

#inbuild modules are imported
import cv2
import numpy as np

#reading image from the pc
image = cv2.imread('hunterLogo.png')

#making a copy of the readed image
image_copy = np.copy(image)

#finding height and width of the image
height = image_copy.shape[0]
width= image_copy.shape[1]
half_width = (int)(width/2)
half_height = (int)(height/2)

#cropping the image using slicing
cropped_image = image_copy[0:half_height, half_width:width]

#saving the image using cv2 with 'logoUR.png'
cv2.imwrite('logoUR.png',cropped_image)

Add a comment
Know the answer?
Add Answer to:
Write a program that asks the user for the name of an image, the name of an output file. Your pro...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT