1
# mesh tools
2

3 0
meshgrid(v::AbstractVector) = meshgrid(v, v)
4

5
function meshgrid(vx::AbstractVector{T}, vy::AbstractVector{T}) where T
6 0
    m, n = length(vy), length(vx)
7 0
    vx = reshape(vx, 1, n)
8 0
    vy = reshape(vy, m, 1)
9 0
    (repmat(vx, m, 1), repmat(vy, 1, n))
10
end
11

12

13
# Construct mesh for quick reconstruction
14
function buildmesh!(dc::DepthCamera)
15 0
  H, W = dc.shape
16 0
  xs,ys = collect(1:W), collect(1:H)
17 0
  fxinv = 1.0 / dc.K[1,1];
18 0
  fyinv = 1.0 / dc.K[2,2];
19

20 0
  xs = (xs-dc.K[1,3]) * fxinv
21 0
  xs = xs[1:dc.skip:end]
22 0
  ys = (ys-dc.K[2,3]) * fyinv
23 0
  ys = ys[1:dc.skip:end]
24

25 0
  dc.xs, dc.ys = meshgrid(xs, ys);
26 0
  nothing
27
end

Read our documentation on viewing source code .

Loading