import bpy, os
import numpy as np
from mathutils import Vector
from bpy_extras.object_utils import world_to_camera_view

p = r"<home>\AppData\Local\Temp\check_render4.png"
img = bpy.data.images.load(p)
w, h = img.size
px = np.array(img.pixels[:], dtype=float).reshape((h, w, 4))[..., :3]

cam = bpy.data.objects['Camera']
scene = bpy.context.scene

def sample(xyz, label):
    v = world_to_camera_view(scene, cam, Vector(xyz))
    if v.x < 0 or v.x > 1 or v.y < 0 or v.y > 1:
        print(label, 'off-screen', (round(v.x,3), round(v.y,3)))
        return
    col = int(v.x * w); row = int((1-v.y) * h)
    rgb = px[row, col]
    print(label, 'ndc', (round(v.x,3), round(v.y,3)), 'rgb', rgb.round(3))

sample((-4,1,1.6), 'cabin_center')
sample((-4,1,6.2), 'cabin_ridge')
sample((8,-7,0.25), 'pond_center_water')
sample((8,-3,0.25), 'pond_north_water')
sample((4.6,-4.9,0.9), 'dock_start')
sample((7.2,-6.2,0.9), 'dock_end')
sample((-8.6,5.8,4.0), 'tree_back_l')
sample((2.6,7.6,4.0), 'tree_back_r')
print('overall mean', px[..., :3].mean(axis=(0,1)).round(3))
bpy.data.images.remove(img)