Question: 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)
 main_dir ='C:/Users/MOHAMMED/Desktop/Aliyu/Midterm' cat_image = cv2.imread ( main_dir +'/cat_4.png') #i want the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!