def project_velo_points_in_img(pts3d, T_cam_velo, Rrect, Prect):
	"""
	Project 3D points into 2D image. Expects pts3d as a 4xN
	numpy array. Returns the 2D projection of the points that
	are in front of the camera only an the corresponding 3D points.
	"""

	# 3D points in camera reference frame.
	pts3d_cam = Rrect.dot(T_cam_velo.dot(pts3d))

	# Before projecting, keep only points with z>0 
	# (points that are in fronto of the camera).
	idx = (pts3d_cam[2,:]>=0)
	pts2d_cam = Prect.dot(pts3d_cam[:,idx])

	return pts3d[:, idx], pts2d_cam/pts2d_cam[2,:]