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.


Messages - chehroma

Pages: [1] 2
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 / Re: renderImage Camera position
« on: October 15, 2020, 03:50:48 PM »
Добрый день,

Данный скрипт должен создавать рендер модели с видом из одного из углов области реконструкции на её центр.

Уточните, пожалуйста, с какой точки Вы хотите рендерить вид модели? Например, с центра какой-либо грани?

Если взять область реконструкции, на ней есть крестик, так нужно напротив (см. скриншот http://prntscr.com/uzv4wn). Спасибо.

3
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")

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

5
Python and Java API / Re: ANIMATION
« on: December 06, 2018, 07:14:46 PM »
Thank for reply

6
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.

7
Python and Java API / Re: Example for rotation region and animation
« on: November 28, 2018, 12:47:35 PM »
I need that red region will be on the floor(down). Only box, not model. I attached picture for example. How I can modify this script, in which place? I not correctly understand how it work.

8
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.

9
General / Re: Change photo
« on: January 16, 2018, 03:17:33 PM »
Help me add + ".jpg", but i dont understund why it?

Code: [Select]
for i in range(len(chunk.cameras)):
camera = chunk.cameras[i]
photo = camera.photo.copy()
photo.path = firstdir + camera.label + ".jpg"
camera.photo = photo

10
General / Re: Change photo
« on: January 16, 2018, 02:26:39 PM »
I turn off "strip file extensions", restart agisoft, add photo by script (it added). Than try change to another and have the same problem.

11
General / Re: Change photo
« on: January 16, 2018, 01:48:12 PM »
Please)

12
General / Re: Change photo
« on: January 16, 2018, 12:55:52 PM »
This is my preference.

13
General / Re: Change photo
« on: January 16, 2018, 12:54:42 PM »
Dont work, the same error.
Quote
Error: Can't open file: No such file or directory (2): d:/FTP/1516031537175/first/1

14
General / Re: Change photo
« on: January 16, 2018, 12:46:35 PM »
Thank, but I have the same problem. This is my advanced preferences dialog. What are items I need to off/on.

15
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?

Pages: [1] 2