GithubHelp home page GithubHelp logo

huginpto-py's Introduction

Hugin .pto File Parser

Useful for image correspondences definition.

Example usage:

>>> import huginpto
>>> pto = huginpto.HuginPto('test/kamera1-8.pto')
>>> pto.parsed.keys()
['c', 'i', 'k', 'm', 'o', 'p', 'v']

>>> pto.parsed['c'][0]
{'N': '1',
'X': '565',
'Y': '749',
'n': '0',
't': '0',
'x': '1034',
'y': '619'}

>>> pto.parsed['i'][0]
{'E': ['ev0', 'r1', 'b1'],
'Ra': '0',
'Rb': '0',
'Rc': '0',
'Rd': '0',
'Re': '0',
'TrX': '0',
'TrY': '0',
'TrZ': '0',
'V': ['a1', 'b0', 'c0', 'd0', 'x0', 'y0', 'm5'],
'a': '0',
'b': '0',
'c': '0',
'd': '0',
'e': '0',
'f': '0',
'g': '0',
'h': '1024',
'j': '0',
'n': '"kamera1.png"',
'p': '0',
'r': '0',
't': '0',
'v': '50',
'w': '1280',
'y': '0'}

>>> import matplotlib.pylab as plt
>>> img = plt.imread('test/kamera2.png')
>>> plt.imshow(img)
>>> pto.get_available_correspondence_pairs()
[[0, 1], [1, 2], [2, 3], [1, 3], [1, 4], [1, 5], [4, 6], [4, 5], [4, 7]]

>>> c0, c1 = pto.get_correspondences(0, 1)
>>> c0 = np.array(c0)
>>> c1 = np.array(c1)
>>> plt.plot(c1[:, 0], c1[:, 1], '+')
>>> plt.show()

displayed correspondences

huginpto-py's People

Contributors

smidm avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.