Forum

Author Topic: How to create region which has corners on the center point of 4 cameras?  (Read 3178 times)

ach1lles

  • Newbie
  • *
  • Posts: 1
    • View Profile
Hi I have been writing scripts for AGI for a couple of weeks now and I am struggling with one thing.

How can I create a region which has corners located on 4 of my camera center points.

I want to use 3 cameras on the base plane to give centerpoint and width and rotation

then one last camera in the top plane to give height

I am able to iterate through the cameras and find the four center points like this:

app = PhotoScan.app
doc = app.document
chunk = doc.activeChunk

for camera in chunk.cameras:
   if camera.label == 'bottom_03.jpg':
      bot1 = camera
   if camera.label == 'bottom_16.jpg':
      bot16 = camera
   if camera.label == 'bottom_2.jpg':
      bot2 = camera
   if camera.label == 'top_1.jpg':
      top1 = camera


so I can get the center points of each of these.

Then I get stuck since the region wants a size, center and rotation

Any help would be appreciated.

UPDATE

So you can understand, I have a rig with three cameras top, center and bottom looking at an object in the center. The rig rotates around the object taking pictures at exact positions. Once the cameras are aligned I have 17 pictures around the object from each angle. What I need to do during the processing is after point cloud generate automatically adjust the region to be within the circles of camera positions.

camera image attached
« Last Edit: November 05, 2014, 01:15:46 PM by ach1lles »