Skip to content

Instantly share code, notes, and snippets.

@rishimukherjee
Created April 4, 2012 20:01
Show Gist options
  • Save rishimukherjee/2305166 to your computer and use it in GitHub Desktop.
Save rishimukherjee/2305166 to your computer and use it in GitHub Desktop.
from SimpleCV import *
import cv2
import cv
import numpy as np
img1 = Image("s.jpg")
img1cv = cv.imread("s.jpg")
img2 = Image("t.jpg")
img2cv = cv.imread("t.jpg")
dst = Image((1600, 1200))
ofimg = img1.findKeypointMatch(img2)
homo = ofimg[1]
result = cv.CreateImage((img2.width*2, img2.height), 8, 3)
cv.Zero(result)
cv.SetImageROI(result, (img2.width, 0, img2.width, img2.height))
cv.Copy(img2cv, result)
cv.ResetImageROI(result)
warpImage = cv.CloneImage(result)
cv.Zero(warpImage)
cv.WarpPerspective(img1cv, warpImage, homo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment