def filter_within_frame(points, frame_width, frame_height):
    """Filter points that lie within a frame.

    Frame specification:
    y_body ^
           │
                   left
           ╔═════════════════╗────────────────────
           ║                 ║                  ^
     lower ║                 ║ upper  ─> x_body │ frame_width
           ║                 ║                  v
           ╚═════════════════╝────────────────────
           │      right      │
           │                 │
           │<───────────────>│
              frame_height
    """
    lower = 0.0 <= points[0, :]
    upper = points[0, :] <= frame_height
    left = points[1, :] <= 0.5*frame_width
    right = -0.5*frame_width <= points[1, :]
    return points[:, left & right & lower & upper]