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

Pages: 1 2 [3] 4 5 6
31
Not sure where is the problem. I have further addition to problem.  Based on  mask my results are  random.

Thanks

32
Hi,
I am having a problem on mosaic and generating models when the cameras position is fix and object is paced on turn table. With the metashape gui i am able to see result.  But I follow exact same process  with python script. I am getting wired result. All cameras are not aligned.  Not sure what am I missing in script. Any help Below is my script

Code: [Select]

import Metashape
import os
import glob

Metashape.app.console.clear()

# construct the document class
doc = Metashape.app.document
# doc = Metashape.Document()
output_file_path = './mosaic_result'
project_name = 'object.psx'
output_name = 'object.laz'

file_path = './image/'

psxfile = os.path.join(output_file_path, project_name)
doc.save(psxfile)
chunk = doc.addChunk()
doc.save()

image_path = glob.glob(file_path + '*.jpg')
dir_name = file_path + '/mask'

point_cloud_quality = Metashape.HighQuality

chunk.addPhotos(image_path)
chunk.importMasks(path=dir_name + '/' + '{filename}_mask.png', source=Metashape.MaskSourceFile,
                  operation=Metashape.MaskOperationReplacement)

calib_file = 'lens_calibration.xml'
calibration = Metashape.Calibration()
calibration.load(calib_file, format='xml')
for sensor in chunk.sensors:
    sensor.user_calib = calibration
    sensor.fixed = True


chunk.matchPhotos(accuracy=Metashape.HighAccuracy, preselection=Metashape.GenericPreselection,
                  generic_preselection=True, reference_preselection=False, mask_tiepoints=True,
                  keypoint_limit=40000, tiepoint_limit=4000)

chunk.alignCameras(adaptive_fitting=True)

aligned = list()
not_aligned = list()
for camera in chunk.cameras:
    if camera.transform:
        aligned.append(camera)
    elif camera.enabled:
        not_aligned.append(camera)
        camera.transform = None
if len(not_aligned)>0:
    chunk.alignCameras(cameras = not_aligned, adaptive_fitting=True)

chunk.buildDepthMaps(quality=point_cloud_quality, filter=Metashape.AggressiveFiltering, reuse_depth=True)
chunk.buildDenseCloud(point_colors=True)

pointcloud_filename = os.path.join(output_file_path, output_name)
chunk.exportPoints(pointcloud_filename, colors=True, colors_rgb_8bit=True)

doc.save()

33
Hi,
One way to run the addfolder from the script is by using addphoto with list of lists. For every camera create the list of images and load in MSI view.

I feel that is a way to do. If someone have another idea let me know.

Thanks

34

Hi ,

From the micasense support page what I understand is to mosaic the 10 band cameras we need to choose chunk.addfolder not the addphoto. The works when using the GUI version.

https://support.micasense.com/hc/en-us/articles/360002693373-Process-MicaSense-sensor-data-in-Agisoft-Metashape

I am trying to work on the python script to mosaic 10 band camera.  but chunk has no method to addFolder only I see add photos (version 1.5.5).  Likewise,  for 10 band camera raw images are store in two camera folders 1-5 on camera 1  and  6-10 other camera folder.

Do we need to put the image together in the same folder before mosaic?

Bit confusion when working on a python script to load and mosaic 10 band cameras images.


Thanks
Paras

 

35
Alexy
These are the steps I am doing in my python script to mosaic the image. Am I missing something that is creating such strips in the images.

Code: [Select]
PhotoScan.app.console.clear()
PhotoScan.app.gpu_mask = 1  # GPU devices binary mask
PhotoScan.app.cpu_enable = True

chunk.addPhotos(input_image_files, PhotoScan.MultiplaneLayout)

doc = PhotoScan.app.document
psxfile = os.path.join(output_file_path, project_name)
doc.save(psxfile)
chunk = doc.addChunk()
doc.save()

chunk.addPhotos(input_image_files, PhotoScan.MultiplaneLayout)
chunk.locateReflectancePanels()
# Read white reference target reflectance factor information
albedo = get_white_panel_albedo(white_ref_factor)
for sensor in chunk.sensors:
    sensor.normalize_sensitivity = True
 
for camera in chunk.cameras:
    if camera.group and camera.group.label == "Calibration images":
         for plane in camera.planes:
            plane.meta["ReflectancePanel/Calibration"] = albedo[plane.sensor.bands[0]]
chunk.calibrateReflectance(use_reflectance_panels=True, use_sun_sensor=True)
doc.save()
for camera in chunk.cameras:
camera.reference.location_accuracy = PhotoScan.Vector([5, 5, 5])
camera.reference.rotation_accuracy = PhotoScan.Vector([500, 500, 500])
for sensor in chunk.sensors:
sensor.user_calib = None
sensor.fixed_calibration = False

chunk.matchPhotos(accuracy=PhotoScan.HighAccuracy, preselection=PhotoScan.ReferencePreselection,
  generic_preselection=True, reference_preselection=True, keypoint_limit=40000,
  tiepoint_limit=4000)
chunk.alignCameras(adaptive_fitting=False)
chunk.optimizeCameras(fit_f=True, fit_cx=True, fit_cy=True, fit_b1=True, fit_b2=True, fit_k1=True, fit_k2=True,
  fit_k3=True, fit_k4=False, fit_p1=True, fit_p2=True, fit_p3=False, fit_p4=False,
  adaptive_fitting=False)
chunk.resetRegion()

chunk.buildDepthMaps(quality=PhotoScan.HighQuality, filter=PhotoScan.AggressiveFiltering, reuse_depth=True)
doc.save()
chunk.buildDenseCloud(point_colors=True)
doc.save()
chunk.buildDem(source=PhotoScan.DenseCloudData, interpolation=PhotoScan.EnabledInterpolation)
doc.save()
chunk.buildOrthomosaic(surface=PhotoScan.ElevationData, blending=PhotoScan.MosaicBlending)
chunk.exportOrthomosaic(orthomosaic_uri, projection=crs, white_background=False)


36
When mosaicing larger field around 100 acre of area (1700 camera shot mica sense image ). The orthomosaic mosaicblending is creating strip noise pattern when images are reflectance corrected. if a small area is selected for mosaic those strips are not observed. Not sure why this is happening. Is there an issue with mosaic blending?

Is any one haveing such issue or I am missing some thing.


Thanks

37
I am seeing a stip like a pattern in the mosaic image. I assume they are somehow corresponding to the flight line. These lines are more visible when I am computing vegetation indices. I have sent some mosaic report to you support have not heard. I also tried the 1.4.4 new release (trial version) the result looks to be same. Check attached image BGR bands. The data was collected in a half an hrs time. There was almost not solar change or cloud presence but still see these pattern in the reflectance corrected mosaic. could attach the sample image. Could you give me ur email such that I send you mosaic reports?

Thanks

38
When I mosaic the image with reflectance panel / sun senor correction I am seeing an artifact, a strip line in the mosaic image.  I feel these strips might correspond to images coming from the flight line. I am looking into color correction if possible to remove these artifacts. Could someone suggest how to apply these color correction? Should I need to apply these color correction on orthomosaic output or prior outputs? Or there are some ways to remove these.

I am not seeing those strip pattern when I mosaic the images without applying reflectance and sun sensor data correction.

Thanks

39
Alexey
I tried as you show in the picture I am still not able to output the colorized raster. Could you also show how to do those when with some python scrip?

40
Extension to the previous question. When the missense data are processed with reflectance and sun correction the resulting orthomosaic in the photos gui is too dark to see the groud object. When I export that file in geotiff with CRS UTM zone i am able to get good view data. But when I export that file in the wgs 84 I get a dark image I see as in photoscan GUI. Furthermore when  export that orthomosaic (wgs84) to tiles could not see the image except a dark patch of an image

need some suggestions how to export some photorealistic output as tiles and gotiff in wgs84 after reflectance panel and sun correction

Thanks

41
Alexey
As I am able to export tiles (index color etc). Is there a way to export a RGB mbtiles or google tiles based on micasense sensor data from Photoscan.

Thanks


42
Python and Java API / Re: Export CRI point cloud
« on: May 14, 2018, 05:31:34 PM »
Alexey
Thanks for the information.

ppant

43
Thanks for this information. I will update you the result. How it turns out.

ppant

44
Alexey
Thanks for the information. At the moment I am able to get a reasonably good result after setting calibration parameter to auto.
I will work with reference parameter and see how much improvement I will get.

Thanks

45
Alexy
Thanks for the information
Quote
I suggest to disable this auto-load in the Advanced preferneces tab, then switch the Type in the Camera Calibration dialog to Auto (uncheck Fix Calibration flag if it is enabled) and let PhotoScan to estimate the calibration parameters automatically (with Adaptive camera model fitting disabled).

I am working with a python script, it's unclear from document how to change calibration flag to auto with a script. Could you give some pointers or code snippet?

Quote
If the camera accuracy is also loaded from XMP, I can also suggest to reset the accuracy or at least set it to a few meters and then optimize the alignment (enabling all coefficients except K4, P3 and P4).

How to reset the accuracy via a script to metes.

Thanks

Pages: 1 2 [3] 4 5 6