Forum

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - chehroma

Pages: [1]
1
Python and Java API / rotation bounding box and model if given 3 point
« on: February 23, 2023, 04:26:21 PM »
Good afternoon.

Please tell me if it is possible to write a script like this:

I have 3 points on the model (point 1, point 2, point 3). Is it possible, if i have these three points (which form a plane), to rotate the model and the bounding box to the xz plane direction?

In my understanding, it is necessary to form a plane from points p1 p2 p3, place it parallel to the plane YZ, but I can’t understand how to attach the reconstruction area to them.

I added the picture for visual understanding.

Thank you.

2
Python and Java API / renderImage Camera position
« on: September 08, 2020, 10:41:17 AM »
Добрый день. Использую скрипт, который нашел в одной из тем. Но есть один нюанс: конечное изображение почему то всегда получается под разным углом (примеры http://prntscr.com/udgmvp http://prntscr.com/udgn6z). Как подправить скрипт, что бы виртуальная камера постоянно смотрела на центр области реконструкции (как то так http://prntscr.com/udgpg7). Буду очень благодарен за помощь.
Code: [Select]
import Metashape

chunk = Metashape.app.document.chunk
T = chunk.crs.localframe(chunk.transform.translation) * chunk.transform.matrix

location = chunk.region.center + chunk.region.rot * chunk.region.size
direction = (chunk.region.center - location).normalized()
vertical = T.inv().mulv(Metashape.Vector([0, 0, 1]))
horizontal = Metashape.Vector.cross(direction, vertical).normalized()
vertical = Metashape.Vector.cross(direction, horizontal).normalized()
R = Metashape.Matrix([horizontal, vertical, direction])

cameraT = Metashape.Matrix().Translation(location) * Metashape.Matrix().Rotation(R.t())

image = chunk.model.renderImage(cameraT, chunk.sensors[0].calibration)
image.save("c://Work//render2.jpg")

3
Добрый день. Я работаю с full body scans. Сейчас возникла необходимость подгонять их к одному размеру (точнее, что бы они были все одного роста). А так же выставить модель в 0 точку. Можете подсказать скрипты, куда смотреть и, что почитать, что бы решить эту задачу средствами python.

4
Python and Java API / ANIMATION
« on: November 29, 2018, 11:35:41 AM »
Can somebody give sample script how to great animation and take avi file???? VERY important.

5
Python and Java API / Example for rotation region and animation
« on: November 28, 2018, 11:56:27 AM »
Can somebody write some examples which explain how rotate bounding box region (need that read area will be down). And I need some of code example, which explain how to do animation.

6
General / Change photo
« on: January 16, 2018, 12:27:39 PM »
In 1.3.4 i use script for change photo
Code: [Select]
for i in range(len(chunk.cameras)):
camera = chunk.cameras[i]
photo = camera.photo.copy()
photo.path = firstdir + camera.label
camera.photo = photo
Now in 1.4 I have an error:
Quote
Error: Can't open file: No such file or directory (2): d:/FTP/1516031537175/firstdir/1

Can you help me?

7
Face and Body Scanning / Error
« on: August 18, 2017, 11:24:13 PM »
When i try save project, I have an error "Invalid marker id" .  And then when i open this project again it is empty. Can you help?.

8
Python and Java API / Bounding box
« on: July 31, 2017, 03:17:49 PM »
Hello.
I need help with the question. I'm using scripting on the alignment and on bounding box which I took from the post:

http://www.agisoft.com/forum/index.php?topic=4913.msg24588#msg24588

But the height of the "bounding box" does not suit me. When I try to change it with boxheight, it makes the reconstruction area smaller, but not at the top, and bottom (it turns out to cut some of the model). Is it possible to change the area of ​​reconstruction in such a way that the script cuts it from top, not from bottom?

And another question: is it possible to write the script that checks if the cameras are align? If yes,  where can I look information on this issue.

THX.

Pages: [1]