python - Matching two different images of the same object -
i looking @ application have 2 images single object (a smartphone) acquired using x-ray. 2 images have been acquired @ different instant. intensity content of 2 images different , able fuse 2 images in order extract information phones.
in between 2 images, set have been changed such phone not placed @ same pixel value in 2 images. able correctly compare 2 images, need translate , rotate images of phones such overlap as possible.
for using python , open cv (cv2). thinking use thresholding , find coordinate of 2 thresholded images , use coordinate map yellow image on red 1 (or opposite). attached image shows have obtained far.
the pseudo code given in following:
ret1, thresh1 = cv2.threshold(img1.astype(np.uint8),200,255,cv2.thresh_binary_inv) ret2, thresh2 = cv2.threshold(template.astype(np.uint8),200,255,cv2.thresh_binary_inv) plt.figure(1) plt.subplot(121) plt.imshow(thresh1) plt.subplot(122) plt.imshow(thresh2) plt.show()
where img1 1 image acquired first filter , template image acquired second filter. 1 can see phones @ different position in yellow , green images respectivelly.
my question how perform next step. how can find coordinate of thresholded images , superpose images of 2 phones? right strategy @ or there better solutions?
i have been looking @ this link on template matching, moment have had no success.
hei, image-registration did tricks, thanks! followed following tutorial: image-registration , manage looking for.
thanks! greg
Comments
Post a Comment