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

Pages: [1] 2
1
Thank you so much for your help, paulo

2
I have chunk with 2100 photos. After the alignment process got completed, some images did not get aligned . I want to print all those images' names (camera.label) which could not get aligned. In GUI, if I go to Photos Pane and change the "view" to "details" then all those images which got aligned has a Tick mark next to it in "Aligned" column. I can even sort it based on "Aligned". So basically I want to get those cameras in a list which does not have a tick mark next to it in Aligned Column.

3
Python and Java API / Re: Gradual selection by model confidence
« on: July 09, 2023, 08:38:41 AM »
hello DR, what is the threshold that you have kept for this to keep repeating?? or is it just for the one time that your are selecting -> deleting then closing the holes?

4
Python and Java API / Re: Progress Callback function/Progress Bar?
« on: July 08, 2023, 05:57:43 PM »
Why is it getting freezed? is it because progress_print prints too many lines??
if that is the reason, you can test a workaround..
Code: [Select]
import time, PhotoScan
def progress_print(p):
        elapsed = float(time.time() - start_time)
        if p:
            sec = elapsed / p * 100
print('Current task progress: {:.2f}%, estimated time left: {:.0f} seconds'.format(p, sec), end="\r", flush=True)
else:
print('Current task progress: {:.2f}%, estimated time left: unknown'.format(p), end="\r", flush=True) #if 0% progress

chunk = PhotoScan.app.document.chunk
global start_time
start_time = time.time()
chunk.matchPhotos( progress=progress_print)

5
Hello All,
In the latest Python API documentation of Agisoft Metashape,
for Metashape.Camera instance, and Class Reference of it, there are two separate parameters, named "enabled" and "location_enabled".
The description in the documentation for both are same.

So, I tested it on a sample project.

Code: [Select]
camera = Metashape.app.document.chunk.cameras[0]

print(camera.reference.enabled)  #Prints True
print(camera.reference.location_enabled)  #Prints True

camera.reference.enabled = False
print(camera.reference.enabled)  #Prints False
print(camera.reference.location_enabled)  #Prints False

camera.reference.location_enabled = True
print(camera.reference.enabled)  #Prints True
print(camera.reference.location_enabled)  #Prints True

Both of it do the same thing, i.e. tick or untick the particular camera in the Reference Pane if the reference data of the same are available.

Can anyone help me in understanding the difference??

6
Python and Java API / Re: Progress Callback function/Progress Bar?
« on: July 08, 2023, 05:40:29 PM »
Why is it getting freezed? is it because progress print prints too many lines??
if that is the reason, you can test a workaround..
Code: [Select]
import time, PhotoScan
def progress_print(p):
        elapsed = float(time.time() - start_time)
        if p:
            sec = elapsed / p * 100
print('Current task progress: {:.2f}%, estimated time left: {:.0f} seconds'.format(p, sec), end="\r", flush=True)
else:
print('Current task progress: {:.2f}%, estimated time left: unknown'.format(p), end="\r", flush=True) #if 0% progress

chunk = PhotoScan.app.document.chunk
global start_time
start_time = time.time()
chunk.matchPhotos( progress=progress_print)

7
Hello Paulo,
I have a similar question. What work around should I do to get the footprint of an Orthomosaic like we got footprint for each camera in the question mentioned above?
By footprint of ortho, I meant that a shape that follows boundary of an Ortho.

8
Thank you for the clarification, Alexy..

9
When i try to use the following code snippet, i am getting the error

"AttributeError: attribute 'supports_gpu' of 'Metashape.Tasks.MergeChunks' objects is not writable"

kidnly help me in resolving this..

Code: [Select]
    task = Metashape.Tasks.MergeChunks()
    task.chunks = [chunk.key for chunk in doc.chunks]
    task.copy_point_clouds = True
    task.merge_assets = True
    task.supports_gpu = True
    task.apply(doc)

10
Python and Java API / Re: Extract conents of report using Python
« on: February 22, 2023, 09:20:06 AM »
Hello Alexey,
Thank you for your reply.

After taking a hint from your answer, just for the sake of experiment, I processed 250 Cameras, Coverage Area = 0.86 Sq. Km.
I used same code that you posted here to calculate Coverage Area, I just commented out the lines, where you are removing the shapes, i.e. Seamlines..
Then I exported the shapes. I thought it will export polygons in multiple layers, but that did not happen, so I thought, it worked.
But when I opened that in a GIS software, it had total. 29162 features.
So, theoretically, it worked, but practically it is not feasible. because I generally have 1500-2500 images per flight, which will have around 150k+ - 200k+ features in Seamlines. Running any spatial query on that will be tough and undesirable.

As you mentioned "Concatenation of Seamline Features" in your answer, can it be done in Agisoft?
Is there any way in Metashape, where in something like a for loop, we can concatenate seamlines to one-another, which in turn will make it to a big polygon with only one feature (may be).
It will become like a footprint of ortho in true sense.


If it is doable in that way, then OMG, my weeks of search will finally come to an end.
Can you please help me with that, sir?

11
Python and Java API / Re: Extract conents of report using Python
« on: February 21, 2023, 01:32:11 PM »
Yes, Exactly.. footprint that follows the boundary of Orthomosaic (visible pixels, i.e. non-nodata pixels)..
Is it doable in Metashape?? either in generic way or with some workarounds??
if yes, kindly provide some way..
It will be of a great help for me..
Thank You !!

12
Python and Java API / Re: Extract conents of report using Python
« on: February 20, 2023, 07:26:53 PM »
Thank you so much Alexey..
I will apply and check it in my project and will let you know.
Thanks a lot.
I have been working to solve this for last one month.

My idea was (simpler):
1. Generate footprint of images (code on github)
2. Take the union of all the shapes and then find the area of the union.

My 2nd idea was (complicated):
1. Generate image footprint
2. add area of shapes and subtract area of intersection from it.

I even took help from chatGPT, but that too didn't work.

Similarly, I am working on one more problem.
Just like image footprint, I wanted to generate footprint of Ortho also.
But this one is still unsolved.
I will be highly obliged, if you can provide any help on that as well.

13
Python and Java API / Re: Python and GUI not equivalent
« on: February 19, 2023, 09:16:10 PM »
yeah sure,
here you go..

Code: [Select]
chunk.matchPhotos(accuracy=Metashape.HighAccuracy,
                          generic_preselection=True,
                          reference_preselection=True,
                          keypoint_limit=40000,
                          tiepoint_limit=4000,
                          filter_mask=False,
                          mask_tiepoints=False,)

chunk.alignCameras(adaptive_fitting=True,)

14
Python and Java API / Re: Access to report stats
« on: February 19, 2023, 10:37:20 AM »
Hello Alexey,
I want to calculate "Coverage area", "Ground resolution" and some other stats of report as well using Python. Please Help..

15
Python and Java API / Re: Python and GUI not equivalent
« on: February 19, 2023, 10:11:16 AM »
Hello vkam, My workflow is as follows:

1. Load cameras
2. Load Reference
3. Match Photos
4. Camera Alignment
5. Tie point error optimisation
6. Put the markers (check points)
7. Generate Depth map
8. Build Dense Cloud
9. Bulid DEM
10. Build Ortho
11. Export

Pages: [1] 2