Exemple #1
0
    public float aspect;               // effective aspect ratio (dimensionless), beyond the
    // effect of skew (division by cos(skew angle)). This is
    // allowed to differ from pixel width / pixel height as an
    // artifact of calibration procedures.
    //

    public void init(LENSMODEL _lensmodel, int _imwidth, int _imheight, float _pixwidth, float _pixheight)
    {
        this.imwidth   = _imwidth;
        this.imheight  = _imheight;
        this.pixwidth  = _pixwidth;
        this.pixheight = _pixheight;

        pc          = new Vector2(imwidth * 0.5f, imheight * 0.5f);
        imageOrigin = IMAGEORIGIN.TOPLEFT;
        setProjection(_lensmodel);
        skew = 0;
        if (imheight > 0)
        {
            aspect = imwidth / imheight;
        }
        else
        {
            aspect = 1.0f;
        }
        //aspect = pixwidth / pixheight;
        fl   = 0.5f * imwidth * pixwidth * 0.001f;    /* 90 degrees horizontal field of view with rectilinear lens */
        hfov = 360;
        vfov = hfov * (imheight * pixheight) / (imwidth * pixwidth);
        if (vfov > 180)
        {
            vfov = 180;
        }
        set();
    }
Exemple #2
0
 public void clear()
 {
     pixwidth          = pixheight = 0.0f;
     imwidth           = imheight = 0;
     imageOrigin       = IMAGEORIGIN.TOPLEFT;
     lensModel         = LENSMODEL.RECTILINEAR;
     pc                = Vector2.zero;
     fl                = aspect = skew = 0.0f;
     hfov              = 360; vfov = 180;
     imageCircleRadius = 0.0f;
     set();
 }
Exemple #3
0
 Vector3 getEyeFlip(IMAGEORIGIN io)
 {
     return(eyeFlip[(int)io]);
 }