Giter Site home page Giter Site logo

agatabcool / caltag Goto Github PK

View Code? Open in Web Editor NEW

This project forked from brada/caltag

0.0 2.0 0.0 359 KB

Camera CALibration Tags

Home Page: http://www.cs.ubc.ca/labs/imager/tr/2010/Atcheson_VMV2010_CALTag/

License: Other

Python 7.26% PostScript 15.45% MATLAB 75.77% HTML 1.53%

caltag's Introduction

CALTag instructions for use:
----------------------------

0) Requirements:

- MATLAB (tested with R2010a) with Image Processing toolbox. It has been reported broken in MATLAB 2014. You can work around the problem by copying the kmeans function from an earlier version of MATLAB, or uncommenting the "MATLAB 2014" lines in caltag.m
- Python (tested with 2.6)


1) Create pattern and datafile:

Run the generate_pattern.py script and convert the ps file to pdf, e.g.:

$ cd GeneratePattern
$ chmod u+x generate_pattern
$ ./generate_pattern -r 8 -c 4

This will produce an output.ps and output.mat file
Convert the ps to pdf for easier printing:

$ ps2pdf output.ps output.pdf

Print the output.pdf file, mount it to a flat surface and photograph it.


2) Run CALTag:

Download the photos and start Matlab. Please note that Matlab 2010a or later is
required, since parts of the code make use of the new "[~,x] = func()" syntax
to ignore some return values. These can be easily replaced with junk variables
if you wish to run on an older version of Matlab. The one other point of
incompatibility is the use of the "bwconncomp" and "regionprops" functions,
which have altered their semantics in recent versions for reduced memory use.
See
<a
href="http://blogs.mathworks.com/steve/2009/07/06/a-new-look-for-connected-component-labeling-in-r2009a/">here</a>
for details.

Add CALTag to your path

> addpath( '/path/to/caltag' )

Load an image and run CALTag

>> I = imread( 'IMG001.jpg' );
>> [wPt,iPt] = caltag( I, '/path/to/caltag/GeneratePattern/output.mat', false );

The second argument is the location of the datafile produced by
generate_pattern. It contains all the parameters of your particular pattern.
The third argument may be set to true if you want to see debugging information.

This will return two matrices (or nulls, if no pattern is detected). World
points are in wPt, image-space points are in iPt. These are both Nx2 matrices
where each row corresponds to a [y,x] coordinate. Note that the image points
are in Matlab-style 1-based [row,col] coordinates. There is a flag in the code
you can switch if you prefer C-style 0-based [x,y] coordinates, or else you can
just modify the return value.


3) Contact:

This code is supported on a best-effort basis. I have no plans to make any further modifications.
Email: atcheson [NOSPAM] [at] cs [dot] ubc [dot] ca

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.