Hi,
When I tried to modified the loaded image with:
camera.photo.image = New_Image
It always shows the error
'PhotoScan.Photo' object attribute 'image' is read-only
Although I am able to manage modifying it with:
width = camera.sensor.width
height = camera.sensor.height
for u, v in [(u, v) for u in range(width) for v in range(height)]:
camera.photo.image()[u, v] = New_Image()[u, v]
The efficiency is terrible in this case. It costs around one hour to process a 1280*960 image.
The reason I do this is I want to apply two different linear regression model to the image based on its DN value, and New_Image is the image I calculated and wish to be used for further process. The concept is like this:
if DN >= criteria:
DN = linear_model1(DN)
else:
DN = linear_model2(DN)
Then the modified images can be used to process the orthomosaic directly so that I don't need to run photo alignment and other workflow again.
Any idea about how to achieve this would be very appreciated.