Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

main _ dir = ' C: / Users / MOHAMMED / Desktop / Aliyu / Midterm ' cat _ image = cv 2 . imread

main_dir ='C:/Users/MOHAMMED/Desktop/Aliyu/Midterm'
cat_image = cv2.imread ( main_dir +'/cat_4.png')
#i want the image to be at the right side of the background but its not working
flipped_image = cv2.flip(cat_image, 1) # Flip horizontally
foreground_fimage =n.logical_or (flipped_image , flipped_image [:,:,0]: 150)
nonzero_x, nonzero_y = np.nonzero(foreground_fimage)
nonzero_fcat_values = flipped_image[nonzero_x, nonzero_y,: ]
right_frame = background. copy()
right_frame [nonzero_x, nonzero_y,:]= nonzero_fcat_values
right_frame = right_frame [:,:,[2,1,0]]
images_list =[]
images_list.append(right_frame)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions