Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Combine two images and extract the contour

I would like to combine two images as showed in the attached figure and to extract the yellow region. The input images are attached (image description and image description Could you please provide me some help?

Thank you in advance.image description

Combine two images and extract the contour

I would like to combine two images as showed in the attached figure and to extract the yellow region. The input images are attached (image description and image description Could you please provide me some help?

Thank you in advance.image description

Combine two images and extract the contourcontour of two images

I would like to combine two images as showed in the attached figure and to extract the yellow region. The input images are attached (image description and image description Could you please provide me some help?

Thank you in advance.image description

extract Extract the contour of two images

I would like to combine two images tried the following code:


import cv2
import numpy as showed in np
img1 = cv2.imread("IMG_B_TestCube&1&00.png")
img2 = cv2.imread("IMG_TestCube.png")


h1, w1 = img1.shape[:2]
h2, w2 = img2.shape[:2]

# translation matrix of img2
MT = np.float32([[1,0,190],[0,1,-100]])
dst = cv2.warpAffine(img2,MT,(w2,h2))

#create empty matrix
vis = np.zeros((max(h1, h2), w1+w2,3), np.uint8)


#combine 2 images
vis[:h1, :w1, :3] = img1+dst
#vis[:h2, w1:w1+w2, :3] = img2


cv2.imshow('res',vis)
cv2.waitKey(0)
cv2.destroyAllWindows()

The result which I have got is the attached figure and below:

image description

My new goal is to extract the yellow region. The input images are attached (image description and image description Could you please provide me some help?line of intersection as below:

Thank image description I checked a lot of examples without finding an optimal solution.

Could you please help in advance.image descriptionthis matter?