def rotate_patches_90deg(patches):
    """
    Rotate patch dictionary as if original image is rotated by 90-degree
    CCW.
    """
    def rot_pos(i, j):
        """
        Board Coordinates:
              i
        9 ... 1
         ------  1 j
         |    | ...
         ------  9
        """
        return (10 - j, i)

    def rot_patch(patch):
        """
        Image coordinates:
         |---->x
         |
        \|/ y
        """
        return {
            "image": patch["image"].transpose([1, 0, 2])[::-1]
        }

    return {
        rot_pos(*pos): rot_patch(patch)
        for (pos, patch) in patches.items()
    }