@numba.njit
def _add_rgb_to_points_kernel(points_2d, image, points_rgb):
    num_points = points_2d.shape[0]
    (image_h, image_w) = image.shape[:2]
    for i in range(num_points):
        img_pos = np.floor(points_2d[i]).astype(np.int32)
        if ((img_pos[0] >= 0) and (img_pos[0] < image_w)):
            if ((img_pos[1] >= 0) and (img_pos[1] < image_h)):
                points_rgb[i, :] = image[img_pos[1], img_pos[0], :]
@numba.njit
def _add_rgb_to_points_kernel(points_2d, image, points_rgb):
    num_points = points_2d.shape[0]
    (image_h, image_w) = image.shape[:2]
    for i in range(num_points):
        img_pos = np.floor(points_2d[i]).astype(np.int32)
        if ((img_pos[0] >= 0) and (img_pos[0] < image_w)):
            if ((img_pos[1] >= 0) and (img_pos[1] < image_h)):
                points_rgb[i, :] = image[img_pos[1], img_pos[0], :]