Skip to content

Instantly share code, notes, and snippets.

@TakashiNakagawa
Created May 6, 2014 02:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TakashiNakagawa/e827041dfa8259e60110 to your computer and use it in GitHub Desktop.
Save TakashiNakagawa/e827041dfa8259e60110 to your computer and use it in GitHub Desktop.
computer vision5章
#!/usr/bin/python
# -*- coding: utf-8 -*-
from PIL import Image
from pylab import *
import camera
# 画像を読み込む
im1 = array(Image.open('images/001.jpg'))
im2 = array(Image.open('images/002.jpg'))
# 各画像上の2D点をリストに読み込む
points2D = [loadtxt('2D/00'+str(i+1)+'.corners').T for i in range(3)]
# 3D点を読み込む
points3D = loadtxt('3D/p3d').T
# 対応関係を読み込む
corr = genfromtxt('2D/nview-corners',dtype='int',missing='*')
# カメラパラメータをCameraオブジェクトに読み込む
P = [camera.Camera(loadtxt('2D/00'+str(i+1)+'.P')) for i in range(3)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment