Peter's Projective Matlab Function

Source code

1. function circle(c, r, nsides)  % Do you use “nargin“ and “line(x,y,z)“?

2. function plotPoint(p, mark, txt)   % “text(x,y,txt)”

3. function t = homoTrans(P,v); % “t = P*v“; “ then normalized t“; x = t(1,:); y=t(2,:)

4. function hline(a,b,c) % plot 2D line from homogeneous coordinates; using “isa“

5. function c = hcross(a,b) %c = cross(a,b); c = c/c(3);

6. function [i1, i2] = circleintersect(c1, r1, c2, r2, lr)

% cosR2 = (b^2 + r1^2 - r2^2)/(2*b*r1);    sinR2 = sqrt(1-cosR2^2);

%  i1 = c1 + r1*cosR2*bv + r1*sinR2*bvp;     i2 = c1 + r1*cosR2*bv - r1*sinR2*bvp;
7. function H = homography1d(x1, x2);  %the 2x2 homography such that x2 = H*x1, using SVD

8. function H = homography2d(varargin) % like 2D counterpart, using SVD to fit into homo

%%%%%%%%%%%%%%%%%%%%%%%%%% others

  • invpersp.m calculates the 3x3 homogeneous inverse transformation matrix describing the perspective transformation of a planar surface in an image. Four or more known image points are required.
  • fundmatrix.m computes the fundamental matrix from 8 or more matching points in a stereo pair of images using the normalised 8 point algorithm.
  • normalise2dpts.m translates and normalises a set of 2D homogeneous points so that their centroid is at the origin and their mean distance from the origin is sqrt(2). This is used to improve the conditioning of any equations used to solve homographies, fundamental matrices etc.
  • hnormalise.m normalises an array of homogeneous coordinates so that their scale parameter is 1. Points at infinity are unchanged.
  • imTrans.m applies a homogeneous transform to an image.
  • digiplane.m allows you to digitise and transform points within a planar region in an image.
  • equalAngleConstraint.m Affine transform constraints given two equal angles.
  • knownAngleConstraint.m Affine transform constraints given a known angle.
  • lengthRatioConstraint Affine transform constraints given a length ratio.  
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值