I would like to start off by saying that I am an extreme beginner who may have no clue as to what I am actually doing.
I am currently creating a script that takes in an image, creates a camera based on the Exif data of the image, then draws a bounding box onto the chunk based on the image. The code below is how I create the camera.
addedCam = chunk.addCamera()
addedCam.sensor = chunk.addSensor()
addedCam.label = "Test Camera"
addedCam.reference.location = [pictureLon, pictureLat, pictureAlt]
addedCam.reference.rotation = [pictureYaw, picturePit, pictureRoll]
addedCam.sensor.width = img.imageDimensions["Width"]
addedCam.sensor.height = img.imageDimensions["Height"]
addedCam.sensor.focal_length = img.focalLength
addedCam.transform = ??????
With all that information, I have a couple of questions:
1- Is there an easier (possibly a one-step) approach to creating a new camera where the only input that I would need is the image? If so, how do I go about doing so?
2- Is there any way to assign the camera a transformation matrix through Agisoft Metashape, or will I have to manually calculate the transform matrix? If I will need to manually calculate it, how do I go about doing so in terms of latitude, longitude, altitude, and yaw, pitch and roll?
3- I believe that I will need the transformation matrix in order to use the camera's unproject function but is there anything else that I will need besides the transformation matrix?
Thank you in advance to whomever helps out!