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 - rbhurtha

Pages: [1]
1
Solved it, thanks.

2
Good day everyone,
I am trying to disable some photos, for the texturing part, when modelling an object on a turntable. The object is scaled.
It seems that photos that are too close to the object are only focused on part of the object, due to the DOF.  These closer images are blurring the texture, hence me trying to disable them. There are many other photos further away, in a larger orbit that I can use to texture.
So I am trying to disable the photos closer to the object by calculating their distances from the centroid of the object. Then I could disable those that are closer to the object.
I have a piece of code for that, but it seems to be giving me wrong measurements when I look at the relative distances of the cameras to the centroid.
I understand the centroid method is not exact, but it might be good enough.
Any ideas why, or any other method I could use?
Thanks
Roshan

def calculate_distance_of_camera_from_object_centroid():
    reference_point = Metashape.Vector([0, 0, 0])
    obj_path = "C:\\02854\\MS\\02854.psx"
    if os.path.exists(obj_path):
        doc = Metashape.Document()
        doc.open(obj_path)
       
        ch_index = 0
        chunk = doc.chunks[ch_index]
       
        #centre model
        centroid = Metashape.Vector([0, 0, 0])
        for vertex in chunk.model.vertices:
            centroid += vertex.coord
        centroid /= len(chunk.model.vertices)
       
       
        print("Centroid:",centroid)
       
        # Get the translation vector to move the centroid to the origin (0, 0, 0)
        translation_vector = -centroid
        # print('trans vector:',translation_vector)
       
        # Create a transformation matrix for translation
        translation_matrix = Metashape.Matrix().Translation(translation_vector)
       
        # Apply the transformation to the chunk
        chunk.transform.matrix = translation_matrix * chunk.transform.matrix
       
        # Optionally, update bounding box and region
        chunk.resetRegion()
       
        reference_point = centroid
        for camera in chunk.cameras:
            if camera.transform is not None:  # Ensure the camera has a known position
                # Calculate the camera's position in world coordinates
                camera_position = chunk.transform.matrix.mulp(camera.center)
                print(camera_position)
               
                # Calculate the distance from the camera to the reference point
                distance = (camera_position - reference_point).norm()
               
                # Print the camera label and its distance to the object
                print(f"Camera {camera.label}: Distance to object = {distance:.2f} meters")
               
                # Optionally, disable cameras that are too close (e.g., less than 0.5 meters)
                distance_threshold = 0.5  # Set the desired threshold
                if distance < distance_threshold:
                    camera.enabled = False
                    print(f"Camera {camera.label} disabled due to being too close: {distance:.2f} meters")
            else:
                 print(f"Camera {camera.label} has no position data.")

       
        doc.save()
        print("project saved")



3
General / Nvidia Geforce GTX 1080 Ti crashing on dense point cloud creation
« on: September 27, 2018, 01:18:24 PM »
Hello,

I am doing a project just have 25 images. The alignment of images works fine, but the building of the dense point cloud crashes. (High quality)
We tried it with Photoscan Professional 1.4.3  and 1.4.4 .

We did a driver update for the Nvidia Geforce GTX 1080 Ti on the 26.09.2018.

Can you please help with this problem.
Thank you.

PC configuration is:

Windows 10 Enterprise, 64-bit
Intel i7-7800X CPU
Nvidia Geforce GTX 1080 Ti
RAM: 128 GB



Here is the NVIDIA System Information report:

Operating System:   Windows 10 Enterprise, 64-bit
DirectX version:   12.0
GPU processor:   GeForce GTX 1080 Ti
Driver version:      411.63
Direct3D API version:   12
Direct3D feature level:   12_1
CUDA Cores:      3584
Core clock:      1493 MHz
Memory data rate:   11010 MHz
Memory interface:   352-bit
Memory bandwidth:   484.44 GB/s
Total available graphics memory:   76636 MB
Dedicated video memory:   11264 MB GDDR5X
System video memory:   0 MB
Shared system memory:   65372 MB
Video BIOS version:   86.02.39.00.54
IRQ:         Not used
Bus:         PCI Express x16 Gen3
Device Id:      10DE 1B06 85F11043
Part Number:      G611 0050

[Components]

nvui.dll      8.17.14.1163      NVIDIA User Experience Driver Component
nvxdplcy.dll      8.17.14.1163      NVIDIA User Experience Driver Component
nvxdbat.dll      8.17.14.1163      NVIDIA User Experience Driver Component
nvxdapix.dll      8.17.14.1163      NVIDIA User Experience Driver Component
NVCPL.DLL      8.17.14.1163      NVIDIA User Experience Driver Component
nvCplUIR.dll      8.1.940.0      NVIDIA Control Panel
nvCplUI.exe      8.1.940.0      NVIDIA Control Panel
nvWSSR.dll      24.21.14.1163      NVIDIA Workstation Server
nvWSS.dll      24.21.14.1163      NVIDIA Workstation Server
nvViTvSR.dll      24.21.14.1163      NVIDIA Video Server
nvViTvS.dll      24.21.14.1163      NVIDIA Video Server
nvLicensingS.dll      6.14.14.1163      NVIDIA Licensing Server
NVSTVIEW.EXE      7.17.14.1163      NVIDIA 3D Vision Photo Viewer
NVSTTEST.EXE      7.17.14.1163      NVIDIA 3D Vision Test Application
NVSTRES.DLL      7.17.14.1163      NVIDIA 3D Vision Module
nvDispSR.dll      24.21.14.1163      NVIDIA Display Server
NVMCTRAY.DLL      24.21.14.1163      NVIDIA Media Center Library
nvDispS.dll      24.21.14.1163      NVIDIA Display Server
PhysX      09.18.0907      NVIDIA PhysX
NVCUDA.DLL      24.21.14.1163      NVIDIA CUDA 10.0.150 driver
nvGameSR.dll      24.21.14.1163      NVIDIA 3D Settings Server
nvGameS.dll      24.21.14.1163      NVIDIA 3D Settings Server








4
Python and Java API / Re: Sort photos by Image Enabled / Disabled
« on: August 26, 2015, 04:43:32 PM »
Thanks Alexey!
I will use it :)
regards
Roshan

5
Python and Java API / Sort photos by Image Enabled / Disabled
« on: August 21, 2015, 12:57:23 PM »
 Hello Everyone, does anyone have a script that can sort images in the Photo pane by the criteria: if they are Enabled or Disabled ?

thanks
Roshan

Pages: [1]