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

Pages: [1] 2
1
Python and Java API / Re: get current Optimize Camera parameters
« on: February 04, 2021, 08:26:51 AM »
One more note: I just found that I continue to get "Error: 'NoneType' object has no attribute 'find'" if I run my code before having run the standard Optimization tool in MetaShape.

2
Wow! That was not very obvious, but didn't take too long to figure out.  I'm on version 1.6.5 and only saw the single edit box for camera accuracy in the Reference Settings and the single column in the Cameras table within the Reference pane.  So I had not realized this was possible. 

For others, this is what I did to implement Alexey's suggestion.  First "Export Reference" for Cameras.  My project had some of the cameras well aligned with coordinates based on GCPs, so I included the "Save estimated values".  Saved that and opened it as a spreadsheet. I calculated average values for cameras with estimated X, Y, and Z values.  I used the average X and Y for cameras that had no estimated values and the average Z for *all* cameras.  Then added 3 more columns for the accuracy of X, Y, and Z.  For cameras with X and Y positions, I figured 3 meters is reasonable accuracy for my project; 200 m for cameras that are using the averaged X and Y values.  Then I set 0.5 for the Z accuracy of all cameras.  Back to MetaShape, Import Reference, set the columns for Label, X, Y, and Z, then checked the box for "Accuracy" and set the columns for X, Y, and Z accuracy.

The result was that the Reference table for Cameras now has values like "3/0.5" in the accuracy column. 

3
Python and Java API / Re: Some user interaction / dialog box basics
« on: February 04, 2021, 06:49:41 AM »
Thanks Alexey - that did the trick! 
For others who may come across this, note that values need to be stored as strings.

Code: [Select]

### near top of code, I start my default value
Metashape.app.document.chunk.meta['Mycobiont/ReproErr'] = "0.5"

         ### later using it in a routine
         reproErr = float(Metashape.app.document.chunk.meta['Mycobiont/ReproErr'])

         ### then after user may have changed it, store the current value
         Metashape.app.document.chunk.meta['Mycobiont/ReproErr'] = str(reproErr)


4
Python and Java API / Re: Removing markers from selected cameras (python)
« on: February 03, 2021, 09:24:02 PM »
Perfect - thank you Paulo!

Functioning script for the record:
Code: [Select]
def cameraMarkerClear():
        print("Clearing markers from selected cameras...", flush=True)
        chunk = doc.chunk
        countCams = 0
        countMarks = 0
        for camera in chunk.cameras:
                if camera.selected:
                        countCams = countCams + 1
                        for marker in chunk.markers:
                                proj = marker.projections[camera]
                                if proj is not None:
                                        if proj.pinned:
                                                countMarks = countMarks + 1
                                                marker.projections[camera] = None
                                                print("removing " + marker.label + " from " + camera.label, flush = True)
                       
        print("Removed " + str(countMarks) + " markers from " + str(countCams) + " cameras.")

app.addMenuItem("Testing/Clear Markers From Selected Cameras", cameraMarkerClear)

5
Python and Java API / Re: get current Optimize Camera parameters
« on: February 03, 2021, 08:17:21 PM »
With the shift to Metashape, I think this may have changed?  The following code errors on the lack of a .find method.

Code: [Select]
optParams = Metashape.app.document.chunk.meta['optimize/fit_flags']
chunk.optimizeCameras(fit_f =  (optParams.find('f') > 1))
/code]

6
Python and Java API / Some user interaction / dialog box basics
« on: February 03, 2021, 08:03:33 PM »
Two questions:
1. I have a custom dialog box that runs from a menu item. When the user adjusts values in the dialog and runs a routine, I want their adjusted values to show up as default the next time they pull it up from the menu (within the session is fine - I don't need to save between sessions).  I tried using global variables within the python script: defined at the top of the script and then set to new values as the routine runs.  The original values set at the top of the script do appear within my dialog class, but setting the new values does not allow them to persist into the next run of the dialog.  How is this best handled?

2. My dialog is modeled primarily from the "split in chunks" script, where the dialog does not close until the user clicks on the quit button.  I would like to automatically close the dialog after the routine runs.  Simply calling QtCore.SLOT("reject()") does not seem to do the job.  How should this be done?

Thanks!

7
Feature Requests / Constrained camera altitude but not horizontal position
« on: February 03, 2021, 05:28:27 AM »
I have a project with no GPS camera positions, but I do have good 3D GCP positions.  The project is for underwater topography and there is a lot of noise in the tie points due to light ripples on the ground surface.  Modeling camera positions is going ok, but I often have camera positions modeled too high or too low.  All camera positions were taken from just below the surface of the water, so I do know the altitude +/- about 20 cm.  It would be great to specify the camera Z-values and an associated accuracy without needing to specify X and Y.

8
Python and Java API / Removing markers from selected cameras (python)
« on: February 03, 2021, 04:59:16 AM »
I'm trying to script the removal of markers that have been placed on selected photos.  I can get them to go from green to blue, and I've seen other scripts for removing blue markers, so I thought it should be simple to combine the two concepts.  But it isn't working.  The following shifts them to blue but does not remove them.  Any suggestions?

Code: [Select]
def cameraMarkerClear():
        print("Clearing markers from selected cameras...", flush=True)
        chunk = doc.chunk
        countCams = 0
        countMarks = 0
        for camera in chunk.cameras:
                if camera.selected:
                        countCams = countCams + 1
                        for marker in chunk.markers:
                                proj = marker.projections[camera]
                                if proj is not None:
                                        if proj.pinned:
                                                countMarks = countMarks + 1
                                                proj.pinned = False  ### this turns them from green to blue
                                                proj = None  ### this should be what other scripts use to remove blue markers
                                                print("removing " + marker.label + " from " + camera.label, flush = True)
                       
        print("Removed " + str(countMarks) + " markers from " + str(countCams) + " cameras.")

app.addMenuItem("Testing/Clear Markers From Selected Cameras", cameraMarkerClear)

Thanks!

9
I do a lot of topography with oblique photos (walking around with the camera).  My feature request is to be able to remove (or prevent) photos from being used for tie-points based on distance.  It is really two requests, because I'd like to be able to remove both far away, and very close tie points.  Those far away have both poor resolution in the photograph and typically poor base-height ratios with other photos (yes, the Reconstruction Uncertainty get at this to some degree).  Tie points from the immediate foreground of my oblique photos can be very sensitive to lens model imperfections and often cause problems in optimizing my models.  So for my work, I would probably remove tie-point projections from a particular camera if they are closer than 5 meters or further than 100 meters.

I don't know the math behind the scenes well enough to know exactly what is best, but I can imagine two possibilities:

1. A pair of Reference Settings would be available that specify a minimum and maximum estimated distance from the camera for that camera (photo) to be used for a tie point.  This may not be possible with initial alignment if the scale is not yet available, but could go into force once the distance is known.

2. A pair of Gradual Selection filters for removing tie points based on camera distance.  Since these filters act on tie points that have multiple cameras involved, perhaps it would need to work on average distance from the cameras.  I think that would still do an OK job for what I'm thinking of.  It would be ideal if the measure was in meters.

Thanks!

10
Feature Requests / Setting for marker size
« on: January 28, 2018, 06:35:44 AM »
Much like discussed in this post (http://www.agisoft.com/forum/index.php?topic=6788.msg32781#msg32781), I now have a laptop with a high resolution screen.  But the settings available in windows for increasing the size of icons and such has no effect on the marker symbol that PhotoScan overlays onto photos.  I'm now squinting at my screen to see where I placed markers... the symbol (both circle and flag) now covers little more than 1 mm on my screen - the circle itself less than half a mm.

A setting in preferences for the icon size would be very helpful.

11
General / Re: Meaning of ! (exclaimation point) when optimizing cameras?
« on: February 17, 2017, 10:20:25 PM »
I've run into these again and am still wondering what they indicate?  While my first message on this question is old, there are 400 reads, which suggests to me that I'm not the only one to wonder.  Any clarification would be appreciated!

Thanks!

12
Feature Requests / Re: autosave
« on: January 04, 2017, 03:16:05 AM »
I too, have just discovered the autosave feature within batch processing.  Quite a relief! The IT strategy at my work frequently involves mandatory reboots without warning - often over night or over weekends when I try to get large processes going.  I can't count how many times I've gotten back to the office expecting a new point cloud only to discover the computer rebooted.  I can't even tell if the process completed, because I didn't know about the hidden autosave.

So my feature request is to simply make an autosave standard at the end of every time consuming item in the workflow menu.

Additionally, I think that the Align Photos process could be split into two segments(?): key point identification and point matching.  For projects involving hundreds of images, the ability to autosave after point identification and restart processes at the point matching step would be a time-saver!

13
Presently (v. 1.2.3) the Worksplace provides a list of all photos in the project with an indicator of "NA" for non-aligned photos, but you only see the photo thumbnail one at a time as you click on them.

Conversely, the Photos pane shows thumbnails of everything, with indicators for markers placed in the photos, but no indication of whether or not they are aligned.  It would be great to add an icon indicator, much like the marker flags, that shows if the photo is aligned, or better yet, maybe have a gray frame around the image (similarly, disabled photos currently indicated with a red icon could have a red frame).

To make this even better, perhaps a couple numerical values could be displayed next to the icons?  I'd suggest [Projections] / [Total Key Points Available] : [Error (pix)]

Why do this?  In my case, I work primarily with very oblique photos for natural topography.  I often need to go through a manual process of resetting alignment of photos to get an optimal model.  Having the thumbnail and the alignment indicator right together, particularly with adding the Pixel Error and some Key Point details would increase my work efficiency quite a bit.

Thanks!
-Eric

14
General / Meaning of ! (exclaimation point) when optimizing cameras?
« on: November 24, 2015, 02:56:56 AM »
I'm sure it indicates some sort of problem in my model, but it might help to know what problem to look for... so just what does the exclamation point mean in

Optimizing point cloud...
adjusting: xxxxxx!xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 0.569732 -> 0.517

also I think I've seen cases where the last x was followed by a '-' Does that have some meaning too?

Thanks!

15
General / Re: Point colors in Point View Mode, what does it mean?
« on: November 13, 2015, 11:23:16 PM »
Thanks Alexey, I think that does clarify things for me!

Wishgranter: I'm not using a multicamera rig for my obliques.

Pages: [1] 2