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

Pages: [1] 2 3
1
If it's all pure Python code, you could use the multiprocessing module (https://docs.python.org/3/library/multiprocessing.html), which creates new python processes and passes data between the processes
Thanks for the suggestion. I remembered I tried it before but it spawned other Metashape application windows with an empty project there and the program stuck there because the data was not passed to other Metashape programs.  Is it the case? Maybe my memory is wrong.

2
Hi Alexey,
Replacing the libopenblas file works. Thanks. Hopefully, it will be fixed in the next release.

3
I see. Thanks for the interpretation. Does it mean that I have to use C/C++ tool to achieve multithreading? Just wondering if there are easier ways to achieve multi-threading without changing too many codes?
I also tried dask.delayed before but didn't seem to work either.

4
Hi,
I noticed that in the official Python scripts collection (https://github.com/agisoft-llc/metashape-scripts), footprints-to-shapes and automatic_masking use concurrent.futures.ThreadPoolExecutor to achieve multi-threading processing.
However, I use the same method in my script but no matter I run it from either Tool>Run script or from the Python console directly, it seems to always use only one core for processing. Could you please enlighten me what might go wrong?
Below is my code
Code: [Select]
def GetPointMatchList(chunk, *band, collate=True):
    point_cloud = chunk.point_cloud
    points = point_cloud.points
    point_proj = point_cloud.projections
    npoints = len(points)
    camera_matches = dict()
    point_matches = dict()
    for camera in chunk.cameras:
        total = dict()
        point_index = 0
        # If no band number input, only process the master channel
        try:
            proj = point_proj[camera.planes[band[0]]]
        except IndexError:
            proj = point_proj[camera]
        except KeyError:
            # Skip the camera if there is no projection information
            continue

        for cur_point in proj:
            track_id = cur_point.track_id
            # Match the point track ID
            while point_index < npoints and points[point_index].track_id < track_id:
                point_index += 1
            if point_index < npoints and points[point_index].track_id == track_id:
                # Add point matches and save their pixel coordinates to list
                total[point_index] = cur_point.coord
                try:
                    point_matches[point_index][camera.planes[band[0]]] = cur_point.coord
                except KeyError:
                    point_matches[point_index] = dict()
                    try:
                        point_matches[point_index][camera.planes[band[0]]] = cur_point.coord
                    except IndexError:
                        point_matches[point_index][camera] = cur_point.coord
                except IndexError:
                    point_matches[point_index][camera] = cur_point.coord
        try:
            camera_matches[camera.planes[band[0]]] = total
        except IndexError:
            camera_matches[camera] = total

    if collate:
        # Keep tie points which have at least 3 observation in same band if collate is True
        point_to_keep = set()
        new_camera_matches = dict()
        new_point_matches = dict()
        for point_index, value in point_matches.items():
            if len(value) >= 3:
                new_point_matches[point_index] = value
                point_to_keep.add(point_index)
        for camera, points in camera_matches.items():
            new_camera_matches[camera] = {point: coord for point, coord in iter(points.items()) if
                                          point in point_to_keep}

    # camera_matches describes point indice and their projected pixel coordinates for each camera
    # point_matches describes point's pixel coordinates in different cameras for each point
    return camera_matches, point_matches

with concurrent.futures.ThreadPoolExecutor() as exe:
    results = exe.map(lambda _index: GetPointMatchList(chunk, _index),
                      [_index for _index, _band_name in enumerate(bands)])
    for result in results:
        cameras, points = result
        camera_matches = {**camera_matches, **cameras}
        point_matches = {**point_matches, **points}
I also tried to put multiprocessing.cpu_count() as an argument of the executor, but didn't work either.

5
Hi,
My OS is up-to-date Manjaro Linux with kernel 5.15.28.
Yes, I reported the crash several times  ;D.
I just reported another one with the link in the comment. Hope it helps.

6
Hi,
I would like to report that Metashape 1.8.2 crashes whenever I try to call linear algebra methods from numpy.
I tried

Code: [Select]
np.dot
np.linalg.lstsq

And they all crashes the program.
I tried to use them with the Python comes with Metashape from a terminal outside Metashape, and it didn't cause problems.
I guess there might be something related to QT.
The numpy version is 1.22.3, and scipy is 1.8.0.

7
Python and Java API / Re: External python modules not found
« on: August 07, 2020, 06:49:13 AM »
Hi @Alexey,
Just would like to know if your team started to investigate this? It seems that this issue affects many users. However, unlike Ubuntu users who can choose to roll back to an older release, users like Arch just simply can't resolve this issue by doing so. I looked up online and some answers suggested that it may be related to some out-dated virtual environment script. Hope this information help.

Hi,
The same thing happened here on Arch Linux. I already installed either the openssl098 as suggested https://agisoft.freshdesk.com/support/solutions/articles/31000136860-how-to-install-external-python-module-to-photoscan-professional-pacakge or the latest openssl, but still got the HTTPSHandler error. Here's the command and output I tried to execute:
command:
Code: [Select]
LD_LIBRARY_PATH=/opt/agisoft/metashape-pro/python/lib /opt/agisoft/metashape-pro/python/bin/python3.5 -m pip install --user Pillowoutput:
Code: [Select]
Traceback (most recent call last):
  File "/opt/agisoft/metashape-pro/python/lib/python3.5/runpy.py", line 174, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/opt/agisoft/metashape-pro/python/lib/python3.5/runpy.py", line 133, in _get_module_details
return _get_module_details(pkg_main_name, error)
  File "/opt/agisoft/metashape-pro/python/lib/python3.5/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
  File "/opt/agisoft/metashape-pro/python/lib/python3.5/site-packages/pip/__init__.py", line 16, in <module>
from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/opt/agisoft/metashape-pro/python/lib/python3.5/site-packages/pip/vcs/subversion.py", line 9, in <module>
from pip.index import Link
  File "/opt/agisoft/metashape-pro/python/lib/python3.5/site-packages/pip/index.py", line 30, in <module>
from pip.wheel import Wheel, wheel_ext
  File "/opt/agisoft/metashape-pro/python/lib/python3.5/site-packages/pip/wheel.py", line 39, in <module>
from pip._vendor.distlib.scripts import ScriptMaker
  File "/opt/agisoft/metashape-pro/python/lib/python3.5/site-packages/pip/_vendor/distlib/scripts.py", line 14, in <module>
from .compat import sysconfig, detect_encoding, ZipFile
  File "/opt/agisoft/metashape-pro/python/lib/python3.5/site-packages/pip/_vendor/distlib/compat.py", line 66, in <module>
from urllib.request import (urlopen, urlretrieve, Request, url2pathname,
ImportError: cannot import name 'HTTPSHandler'

The metashape-pro version is 1.6.3, and I believe I used the correct python
Code: [Select]
$ LD_LIBRARY_PATH=/opt/agisoft/metashape-pro/python/lib /opt/agisoft/metashape-pro/python/bin/python3.5 --version
Python 3.5.2

Any suggestions to resolve this issue would be appreciated.

8
Python and Java API / Re: External python modules not found
« on: July 30, 2020, 07:02:53 AM »
Hi,
The same thing happened here on Arch Linux. I already installed either the openssl098 as suggested https://agisoft.freshdesk.com/support/solutions/articles/31000136860-how-to-install-external-python-module-to-photoscan-professional-pacakge or the latest openssl, but still got the HTTPSHandler error. Here's the command and output I tried to execute:
command:
Code: [Select]
LD_LIBRARY_PATH=/opt/agisoft/metashape-pro/python/lib /opt/agisoft/metashape-pro/python/bin/python3.5 -m pip install --user Pillowoutput:
Code: [Select]
Traceback (most recent call last):
  File "/opt/agisoft/metashape-pro/python/lib/python3.5/runpy.py", line 174, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/opt/agisoft/metashape-pro/python/lib/python3.5/runpy.py", line 133, in _get_module_details
return _get_module_details(pkg_main_name, error)
  File "/opt/agisoft/metashape-pro/python/lib/python3.5/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
  File "/opt/agisoft/metashape-pro/python/lib/python3.5/site-packages/pip/__init__.py", line 16, in <module>
from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/opt/agisoft/metashape-pro/python/lib/python3.5/site-packages/pip/vcs/subversion.py", line 9, in <module>
from pip.index import Link
  File "/opt/agisoft/metashape-pro/python/lib/python3.5/site-packages/pip/index.py", line 30, in <module>
from pip.wheel import Wheel, wheel_ext
  File "/opt/agisoft/metashape-pro/python/lib/python3.5/site-packages/pip/wheel.py", line 39, in <module>
from pip._vendor.distlib.scripts import ScriptMaker
  File "/opt/agisoft/metashape-pro/python/lib/python3.5/site-packages/pip/_vendor/distlib/scripts.py", line 14, in <module>
from .compat import sysconfig, detect_encoding, ZipFile
  File "/opt/agisoft/metashape-pro/python/lib/python3.5/site-packages/pip/_vendor/distlib/compat.py", line 66, in <module>
from urllib.request import (urlopen, urlretrieve, Request, url2pathname,
ImportError: cannot import name 'HTTPSHandler'

The metashape-pro version is 1.6.3, and I believe I used the correct python
Code: [Select]
$ LD_LIBRARY_PATH=/opt/agisoft/metashape-pro/python/lib /opt/agisoft/metashape-pro/python/bin/python3.5 --version
Python 3.5.2

Any suggestions to resolve this issue would be appreciated.

9
General / Fit additional correction: what coefficients it fit?
« on: April 08, 2020, 09:08:01 AM »
Hi,
I notice that since version 1.6, p3 and p4 in camera optimization are removed, and a new option "fit additional correction" is added. However, I can't find much information about what coefficients this option enable to fit. In the 1.6.0 pre-release thread, I read someone said it is used especially for wide-angle lens.
May I ask which coefficients are used to enable "fit additional coefficients"? Is it just using p3, p4, or a totally different correction model?

Cheers,

10
General / Re: Error: Can't read file: input/output error (5)
« on: February 25, 2020, 05:38:26 AM »
Hi Alexey,
I asked the IT to check the integrity of the storage device and seems they found some issues and fixed it. After that, it seems normal again. I'll let you know if I encounter the same issue again.

11
General / Re: Error: Can't read file: input/output error (5)
« on: February 24, 2020, 05:27:17 AM »
Hi,
The version of Metashape Pro is 1.5.5, and the files are saved on a network drive.

12
General / Error: Can't read file: input/output error (5)
« on: February 23, 2020, 01:27:40 PM »
Hi,
Recently, when I try to build mesh, after generating depth map and estimating surface, it very often shows the below error:
Quote
Generating mesh...
      44084677 vertices total
      88128127 faces total
    done in 98.2883 sec
  Calculating colors...
Error: Can't read file: Input/output error (5): /PATH/TO/AN/IMAGE
The indicated image seems to be random every time. I tried to access the indicated image and it can be opened normally so it shouldn't be a file corruption issue. Could someone enlighten me what the problem is?
The parameter for building mesh is:
Quote
source=depth map
surface type=arbitrary
face count=high
calculate colour=yes
reuse depth map=yes/no (tried both)

13
General / AUR for MetaShape Pro is available now
« on: October 01, 2019, 12:59:40 AM »
Hi all,
I just publish the PKGBUILD for this package to AUR. You can find this package here:
https://aur.archlinux.org/packages/metashape-pro/

Installing from AUR can help the users easier to manage this application via pacman. It's available for all Arch-based Linux distributions.
The Linux package available from the official website doesn't have icons so I extracted them from our Windows installation and upload them as encoded text since we can't upload binaries to AUR.
I also create the MIME type association so that you can double click PSX or other MetaShape file types to open MetaShape directly.

I notice that MetaShape will create .agisoft .config/agisoft folders under $HOME for saving user configurations. Are there any other files that will be created by MetaShape? I can modify the PKGBUILD to check those files before removal.

Let me know if you think there's anything can be improved.
Cheers.

14
General / Re: Any chance to publish PhotoScan as AUR packages
« on: September 29, 2019, 11:03:54 PM »
Hi,
It's been a while since I start to have the idea, but I finally make a prototype of the PKGBUILD to install MetaShape Pro on Manjaro Linux. I also attach the PKGBUILD and INSTALL file here for you to give me some feedback. At the moment I have some problem with this PKGBUILD:
  • I can't find the icon for each desktop entry (agisoft-metashape-pro, agisoft-network-monitor, and agisoft-viewer). Could you please advise me where to get them?
  • Are there any files that MetaShape will create during usage? Like config files under HOME folder or under /etc /var? I can write backup information in PKGBUILD and a post_remove function in the INSTALL information to remove those files after uninstallation.
  • Does the user need sudo for product activation and deactivation?
Another problem is that during the makepkg process, when Stripping unneeded symbols from binaries and libraries, it gave me the following message:
Code: [Select]
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/zmq/.libs/stg7BaCf: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/zmq/.libs/stg7BaCf[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/zmq/backend/cython/stMFmwvq: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/zmq/backend/cython/stMFmwvq[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/zmq/backend/cython/st8hqlgq: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/zmq/backend/cython/st8hqlgq[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/zmq/backend/cython/stKVIEhp: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/zmq/backend/cython/stKVIEhp[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/zmq/backend/cython/st8Ywr8o: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/zmq/backend/cython/st8Ywr8o[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/zmq/backend/cython/stcckUfs: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/zmq/backend/cython/stcckUfs[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/zmq/backend/cython/stFuvU3r: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/zmq/backend/cython/stFuvU3r[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/zmq/backend/cython/stgVujfr: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/zmq/backend/cython/stgVujfr[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/zmq/backend/cython/stSjph2q: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/zmq/backend/cython/stSjph2q[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/zmq/backend/cython/stQMMkVq: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/zmq/backend/cython/stQMMkVq[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/zmq/devices/stltxQMo: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/zmq/devices/stltxQMo[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stUuOBlm: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stUuOBlm[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stljwwar: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stljwwar[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stFO4jSq: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stFO4jSq[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stmLK76t: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stmLK76t[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stQ8WkRu: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stQ8WkRu[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/st1t6vCu: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/st1t6vCu[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stSrmcuu: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stSrmcuu[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stdZIk2s: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stdZIk2s[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stiwhfuw: warning: allocated section `.dynstr' not in segment
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stZiVYhw: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stZiVYhw[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stvFUp4v: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stvFUp4v[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/sta729Rv: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/sta729Rv[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stYlgJnx: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stYlgJnx[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/styCAG1w: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/styCAG1w[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stHYR2Lx: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stHYR2Lx[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stJ7kd1A: warning: allocated section `.dynstr' not in segment
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stU4Ag5C: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stU4Ag5C[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/st7ioeRD: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/st7ioeRD[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/st9zQJsC: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/st9zQJsC[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/st4FSBdC: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/st4FSBdC[.note.gnu.build-id]: bad value
strip: ./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stQRDO7B: not enough room for program headers, try linking with -N
strip:./opt/metashape-pro/python/lib/python3.5/site-packages/PySide2/stQRDO7B[.note.gnu.build-id]: bad value
Not sure whether this will cause any problem.
Appreciated for your help. Hopefully, this can benefit Arch-based users for using MetaShape Pro.


15
General / Any chance to publish PhotoScan as AUR packages
« on: September 18, 2018, 11:34:25 AM »
Hi,
Just wondering that whether we can get AUR packages for PhotoScan (Pro) for convenient installation/upgrade for Arch-based Linux system?
I'm glad to make one but don't know the process to install PhotoScan (Pro). Is it just (1) Download tar.gz file, (2) unzip to a specific folder (e.g. /opt), then (3) sudo ./photoscan.sh ? When does activation take part?
Cheers,

Pages: [1] 2 3