Skip to main content
. 2019 Sep 22;19(19):4093. doi: 10.3390/s19194093
Algorithm 1: 3D Generalized Intersection Over Union Loss
Input: The information of the predicted Bp and ground truth Bg bounding box:
    Bp=(xp,yp,zp,lp,wp,hp,θp),  Bg=(xg,yg,zg,lg,wg,hg,θg)
Output: L3D_GIoU
  • 1.

    Calculating projections Bp and Bg of box Bp and Bg on the bird’s eye view, respectively.

    Bp=(xp1,yp1,xp2,yp2,θp),  Bg=(xg1,yg1,xg2,yg2,θg)

  • 2.

    Bc=(xc1,yc1,xc2,yc2,θc) the information of smallest enclosing box;

  • 3.

    Ap the area of the 2D box Bp;

  • 4.

    Ag the area of the 2D box Bg;

  • 5.

    Ac the area of the 2D box Bc;

  • 6.

    I2D intersection between Bp and Bg;

  • 7.

    U2D union between Bp and Bg;

  • 8.

    Ih the height of the intersection of Bp and Bg;

  • 9.

    Uh the height of the union of Bp and Bg;

  • 10.

    Vp the volume of the 3D box Bp;

  • 11.

    Vg the volume of the 3D box Bg;

  • 12.

    Vc the volume of the 3D box Bc, where Bc represents the smallest 3D enclosing box;

  • 13.

    Calculating intersection Iv of Bp and Bg:

    ifI2D0:

    Iv=0;

    else:

    ifIh0:

    Iv=0;

      else:

        Iv=I2D×Ih;

  • 14.

    IoU3D=IvUv, where Uv=Vp+VgIv;

  • 15.

    GIoU3D=IoU3D(VcUv)Vc;

  • 16.

    L3D_GIoU=1GIoU3D;