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 - Thibaud Capra

Pages: 1 ... 5 6 [7]
91
Python and Java API / Export textures only
« on: February 17, 2017, 06:07:41 PM »
Hello,
I'm currently trying to export textures from my model, the "hard" way as I did not find a way of doing it smoothly: I'm extracting the model then I have my texture.

Is there any smoother way to do it? Maybe directly, and I missed it?

Current code:

Code: [Select]
import os
import sys
import PhotoScan
doc = PhotoScan.app.document
chunk = PhotoScan.Chunk()
chunk.label = "New Chunk"
doc.chunks.add(chunk)
nbTrous = int(sys.argv[1])
path_photos = PhotoScan.app.getExistingDirectory("""Spécifiez le dossier
    contenant les photos : """)
path_photos += "/"
path_export = PhotoScan.app.getExistingDirectory("""Spécifiez le dossier
    contenant les exports en fin de traitement : """)
path_export += "/"
for chunk in doc.chunks
    # Export Texture
    exportModel(path_export, binary = False, texture_format = "jpg",
        texture = True, normals = False, colors = False, cameras = False,
strip_extensions = False, format = "obj", projection = "EPSG::3948")

92
Feature Requests / Re: Request: Dense Cloud Filtering
« on: February 17, 2017, 11:05:33 AM »
+1, I have to use derivated ways to decimate / resample / mesh parts of cloud that fit my needs. I'd love to have a whole PhotoScan pipeline and be able to do everything I need from A to Z not having to switch between softwares!

93
Being able to train an algorithm using a few cross sections to further improve an upcoming ground extraction would be awesome too (I know I'm asking for a lot!)

+1 though.

94
Feature Requests / Re: Pause/Save/Resume Later
« on: February 17, 2017, 10:58:15 AM »
That's a tough feature to add in my opinion. That'd mean that processes would be split in parts and compensation algorithms are hardly splittable.

As for now, if you're dealing with everlasting calculations, and you sometimes have to shut down / restart / do other things with your computer, try dividing your work in smaller chunks!
On the other hand, the Pause button is usually working wonders for me. Instant pause and I can use the whole power from my computer. Resuming my take a few seconds to get back to the right timestamp but I have absolutely no problem doing it, whether on my personnal computer (i7-6700K / GTX 1060 / 16 Gb RAM) or my work computer (2x Xeon E3 / Quadro M4000 / 64 Gb RAM).

95
Hello vathsasri321,

First, as this is a Python-related question, you should try to post it in the Python Scripting category!

Now to your problem.

Your export format should be 'jpg', not 'jpeg' I guess.
Quote
format (string) – Export format in [’tif’, ‘jpg’, ‘png’, ‘kmz’].
This is from the Python Reference Guide.

Also, your TiffCompression argument has no reason to be there as you're exporting a jpg image. I'd ditch it.

96
General / Re: Merge Two projects
« on: February 15, 2017, 06:41:08 PM »
Hello Carlo90.
What you can do is split your project into two chunks, and process each chunk separately then merge your chunks.
Be sure to keep some overlap between the chunks!

Best regards

97
Hello,
I'm working on a Python pipeline to process large amounts of photos (1500-2000 per project) that is subdivided in two parts: the first part allows the user to add photos and define the number of chunks needed for the second part.

Since my images were taken with our UAV, some are a bit blurry in the set. I'd like to be able to estimate image quality and remove from the photo alignment images with a score below a user-defined threshold.

So far, I have the following code:

Code: [Select]
import os
import PhotoScan

print(">>> Initialisation du script <<<")

doc = PhotoScan.app.document
chunk = PhotoScan.Chunk()
chunk.label = "New Chunk"
doc.chunks.add(chunk)

path_photos = PhotoScan.app.getExistingDirectory("Spécifiez le dossier contenant les photos : ")
path_photos += "/"

# Vérification du chemin d'enregistrement
project_path = PhotoScan.app.getSaveFileName("Spécifiez le nom du projet à enregistrer : ")
if not project_path:
print("Annulation du script : pas de chemin d'enregistrement fourni")
return 0

if project_path[-4:].lower() != ".psz":
project_path += ".psz"

# Détermination du nombre de trous/chunks
nbTrous = input("Saisissez le nombre de trous dans le golf :")
print(nbTrous + "chunks seront créés, à l'issue de ce script, il faudra détourer chaque trou.")

# Ajout de photos
image_list = os.listdir(path_photos)
for photo in image_list:
if ("jpg" or "jpeg" or "tif" or "png") in photo.lower():
chunk.photos.add(path_photos + photo)
PhotoScan.app.update()
doc.save(project_path)
print("- Photos ajoutées")

# Estimation de la qualité des photos
chunk.estimateImageQuality()

# Alignement des photos
chunk.matchPhotos(accuracy = "medium", preselection = "reference", filter_mask = False, point_limit = 20000)
chunk.alignPhotos()
doc.save(project_path)
print("-- Photos alignées")

# Création de chunks pour chaque trou
chunkIter = 1
while chunkIter <= nbTrous:
chunk.copy()
chunk.label("Trou_" + chunkIter)
chunkIter += 1
print("--- " + nbTrous + " chunks créés.")

# Sauvegarde finale
doc.save(project_path)
print("Projet enregistré, vous pouvez maintenant adapter les Bounding Box de chaque chunk.")

print(">>> Script terminé <<<")

Don't mind the French comments, it's mostly there to be user-friendly as is it meant to be used by French people.
Here the interesting part is this one:
Code: [Select]
# Estimation de la qualité des photos
chunk.estimateImageQuality()

So estimateImageQuality returns a floating number, but I honestly don't know how to exploit it!
I'd like any photo with a quality score under 0.5 to be removed from the photo alignment process I'm running right after.
Any help would be appreciated!

Best regards

98
Feature Requests / Re: Use shapes / KML files to fit bounding box size
« on: February 14, 2017, 04:45:43 PM »
Hello Alexey,
Non-rectangular boxes would be the pinnacle, but being able automatically fit the bounding box to an imported shape or KML would be a great start to begin with.

99
Feature Requests / Use shapes / KML files to fit bounding box size
« on: February 14, 2017, 03:51:29 PM »
Hi,
As an upcoming feature for PhotoScan, the possibility of fitting the bounding box to a shape (in X, Y of course) would be very interesting to speed up processes.

For instance, when processing UAV-acquired photos, even with a planned flight, some areas are not interesting. Using KMLs, it would be a very fast and convenient way to process the parts that actually present some kind of interest to us.

Best regards

100
General / Re: rx 480 opencl vs 1070 -1060 cuda
« on: February 09, 2017, 01:06:49 PM »
Hello lunar,

From a pure hardware point of view, it depends on your budget I'd say.

Here's a benchmark comparison between the 3 of them: http://www.videocardbenchmark.net/compare.php?cmp%5B%5D=3533&cmp%5B%5D=3548&cmp%5B%5D=3521

The RX 480 has better value but the GTX 1070 has the best performance. the 1060 is a compromise between both.
If budget isn't a problem, I'd go for a 1070 even a 1080 if you can afford it.
Mind your PSU too, AMD GPUs are more energy-demanding than nVidias usually.

As for the 1.3 optimization, I can't really tell yet.

101
General / Using KML files as bouding boxes
« on: February 09, 2017, 11:53:00 AM »
Hello everyone,
I am currently working on a project for my internship where I've been given multiple tasks to do.
My main goal is to produce various files (OBJ, orthomosaics mostly) from UAV images in the most automated way possible. I'm currently using Python to do it, but we'll leave it for now, my concern being focused on another issue :

How can I use KML files to create areas of interest for PhotoScan to densify in?

Let me explain a bit more: I work with a large number of photos acquired with an UAV (~1400 photos) and I have to cover large areas (golfs). One of my goals is to have two different outputs with 2 different levels of detail (LoD) : the first one should be light, with a global model of the whole golf course, the second one should be very detailed, clean and accurately filtered, for the greens' details. The main idea behind this two LoD is to optimize the computing time as I don't need a very accurate definition of the whole golf, but something very accurate on every green.

In order not to build a very dense point cloud (DPC) of the whole golf, I'd like to create two different clouds, one for the whole golf where I'd build a DPC with medium/low quality and another one for each green where I'd build the DPC in high/ultra high quality then filter it.

I have at my disposal KML files delimiting every single green area in my georeferenced cloud.
I would like to use them to isolate my greens in the sparse cloud and create new files containing the greens only to build DPC with a different LoD.

Remember that the main goal here is to maximize the automation of the process.

TL;DR: How can I use my KML files to export parts of my sparse point cloud in different projects to create two different clouds with two different LoD?

Thanks at lot, any help is greatly appreciated!

EDIT: Just had a talk with some coworkers, would it be easier to fit the bounding box to each KML's bounding box and export it one by one?

Pages: 1 ... 5 6 [7]