point = [x,y,Z]
point_local = T.inv().mulp(chunk.crs.unproject(point))
print(x,y,Z,point_local,defect_id,'poinnt_local')
if len(point_local) < 2:
continue
count = 0
for idx,camera in enumerate(chunk.cameras):
#print(idx,'idx')
#if idx==12:
#break
if not camera.transform:
print('no transform')
continue
#print('camera',camera.label)
try:
x, y = camera.project(point_local)
except:
print('camera')
continue
if (0 <= x < camera.sensor.width) and (0 <= y < camera.sensor.height):
print(camera.label, str(x), str(y))
count+=1
print(count)
if count == 1:
print('making shape',point_local)
P = surface.pickPoint(camera.center,camera.unproject(Metashape.Vector((x,y))))
I have been using this script to getting cameras from lat, long in orthophoto.
from around 40,000 points I don't get somewhere around 250-300 points found in cameras.
point_local = T.inv().mulp(chunk.crs.unproject(point))
x, y = camera.project(point_local)
P = surface.pickPoint(camera.center,camera.unproject(Metashape.Vector((x,y))))
these 3 lines are null for these points. Any suggestions if I can get these points also as I understand not all the points on ortho are present in cameras.