Пример #1
0
    def __init__(self,lx,ly,frames):
        if world_coords:
            # Match up nominal grid points with other cameras globally.
            # Add in the local offset from camera center to surveyed grid point.
            self.lx, self.ly, self.lt = worldTransform.worldTransform(
                options, lx + options['camera_x'], ly + options['camera_y'], 0)
        else:
            # Leave the nominal grid point coords alone.
            self.lx = lx
            self.ly = ly
            self.lt = options['world_theta']
            pass

        self.frames = frames
        pass
Пример #2
0
    def __init__(self, lx, ly, frames):
        if world_coords:
            # Match up nominal grid points with other cameras globally.
            # Add in the local offset from camera center to surveyed grid point.
            self.lx, self.ly, self.lt = worldTransform.worldTransform(
                options, lx + options['camera_x'], ly + options['camera_y'], 0)
        else:
            # Leave the nominal grid point coords alone.
            self.lx = lx
            self.ly = ly
            self.lt = options['world_theta']
            pass

        self.frames = frames
        pass
Пример #3
0
    def __init__(self,ax,ay,bx,by,wx,wy,wa):

        # Pixel coords of blob centers.
        self.ax = ax
        self.ay = ay
        self.bx = bx
        self.by = by

        if world_coords:
            # Match up grid points with other cameras globally.
            self.wx, self.wy, self.wa = worldTransform.worldTransform(
                options, wx, wy, wa)
        else:
            # Subtract local camera offset to match nominal grid point coords.
            self.wx = wx - options['camera_x']
            self.wy = wy - options['camera_y']
            self.wa = wa
        pass
Пример #4
0
    def __init__(self, ax, ay, bx, by, wx, wy, wa):

        # Pixel coords of blob centers.
        self.ax = ax
        self.ay = ay
        self.bx = bx
        self.by = by

        if world_coords:
            # Match up grid points with other cameras globally.
            self.wx, self.wy, self.wa = worldTransform.worldTransform(
                options, wx, wy, wa)
        else:
            # Subtract local camera offset to match nominal grid point coords.
            self.wx = wx - options['camera_x']
            self.wy = wy - options['camera_y']
            self.wa = wa
        pass
Пример #5
0
            options[m2.group(1)] = float(m2.group(2))
            pass
        pass
    else:
        # Frame data.
        lineHead = m1.group(1)
        data = [float(f) for f in m1.groups()[1:]]

        # Optionally output only gnuplot lines for the triangles.
        # Moved here from above because we first need world params for -t -g.
        if printTris:                       
            for tri in triangles:
                for v in tri.target:
                    if globalCoords:
                        wc = worldTransform.worldTransform(
                            options,
                            v[0] + options['camera_x'],
                            v[1] + options['camera_y'], 0.0)
                        print '%f, %f'%(wc[0], wc[1])
                    else:
                        print '%f, %f'%tuple(v)
                # No need to output first vertex again in this triangle pattern.
                # (And doing so messes up dashed triangle lines in the plot.)
                print ""         # Blank line separates line chains in gnuplot.
                pass
            sys.exit(0)
            pass

        # XXX Horrid Hack Warning - We need right-handed coordinates,
        # but the image Y coordinate goes down from 0 at the top.
        # Negate it internally.
        pixLoc = geom.ptBlend((data[0], -data[1]), (data[2], -data[3]))
Пример #6
0
            options[m2.group(1)] = float(m2.group(2))
            pass
        pass
    else:
        # Frame data.
        lineHead = m1.group(1)
        data = [float(f) for f in m1.groups()[1:]]

        # Optionally output only gnuplot lines for the triangles.
        # Moved here from above because we first need world params for -t -g.
        if printTris:                       
            for tri in triangles:
                for v in tri.target:
                    if globalCoords:
                        wc = worldTransform.worldTransform(
                            options,
                            v[0] + options['camera_x'],
                            v[1] + options['camera_y'], 0.0)
                        print '%f, %f'%(wc[0], wc[1])
                    else:
                        print '%f, %f'%tuple(v)
                # No need to output first vertex again in this triangle pattern.
                # (And doing so messes up dashed triangle lines in the plot.)
                print ""         # Blank line separates line chains in gnuplot.
                pass
            sys.exit(0)
            pass

        # XXX Horrid Hack Warning - We need right-handed coordinates,
        # but the image Y coordinate goes down from 0 at the top.
        # Negate it internally.
        pixLoc = geom.ptBlend((data[0], -data[1]), (data[2], -data[3]))