I have this two images:
And I want to use the white shape of the first one to crop the image like this:
Wihtout the blue lines and the info.
So that's what I'm trying to do:
def find_intersection(self, mask, image):
image = cv2.cvtColor(np.float32(image), cv2.COLOR_BGR2GRAY)
masked = cv2.bitwise_and(mask, image, mask=mask)
plt.imshow(masked)
plt.show()
But I get this error:
cv2.error: OpenCV(4.5.1) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-kh7iq4w7\opencv\modules\core\src\arithm.cpp:234: error: (-209:Sizes of input arguments do not match) The operation is neither 'array op array' (where arrays have the same size and type), nor 'array op scalar', nor 'scalar op array' in function 'cv::binary_op'
The dimensions and channels of the picture are the same, so I don't know what's the problem.



