Unable to 'pip install hsi' (Hugin Scripting Interface)

40 views
Skip to first unread message

Thomas B.

unread,
Oct 30, 2022, 6:38:38 AM10/30/22
to hugin and other free panoramic software
Hello all,

I have some Python scripts for automated panorama creation. Those are relying on HSI (Hugin Scripting Interface). But since I installed a new machine, I was not able to make passing "pip install hsi": no matter what I tried (installing opencv, building it from source, ...) installation always fails with :
src/classifiedhsimage.h:7:10: fatal error: opencv2/core.hpp: No such file or directory

I have no more ideas about what to try. I will be happy to try anything! Please let me know your ideas.
This is reproducible by creating a new linux machine (Linux Mint) then `sudo apt install python3-pip && pip3 install hsi`.

ScreenCapture_Terminal_pip-install-hsi.png

FYI, the script I cannot run: https://github.com/Thomas-Baeckeroot/photo-scripts-python/blob/master/createPanorama.py (always developed for my own needs, so that it's not "nice" but really time saving for me!)

Thanks in advance,
Thomas BAECKEROOT

Bruno Postle

unread,
Oct 30, 2022, 7:23:42 AM10/30/22
to hugin and other free panoramic software
I didn't know you could install hsi this way, but the error is because you don't have opencv2 header files on your system. On fedora these would be in the opencv-devel package.

-- 
Bruno

T. Modes

unread,
Oct 30, 2022, 8:24:57 AM10/30/22
to hugin and other free panoramic software
Thomas B. schrieb am Sonntag, 30. Oktober 2022 um 11:38:38 UTC+1:
Hello all,

I have some Python scripts for automated panorama creation. Those are relying on HSI (Hugin Scripting Interface). But since I installed a new machine, I was not able to make passing "pip install hsi": no matter what I tried (installing opencv, building it from source, ...) installation always fails with :
src/classifiedhsimage.h:7:10: fatal error: opencv2/core.hpp: No such file or directory

pip install hsi installs another program: https://pypi.org/project/HSI/
Hugins scripting interface does not use opencv. Also the mentioned file is not part of Hugin.
You have probably to install Hugin via the package manager of your distribution (or compile and install from source) and not via pip.

Thomas

PS: PTBatcherGUI has already some feature for automatic processing also of folders.

Thomas B.

unread,
Nov 2, 2022, 4:58:48 PM11/2/22
to hugin and other free panoramic software
Thank you all for the information and quick response!

So I understand now that I was not installing HSI correctly.
I had installed a Flatpak pre-compiled version that was apparently not installing HSI: I used the `sudo apt install hugin` from Mint (21).
So I decided to build hugin myself. I followed instructions from https://wiki.panotools.org/Hugin_Compiling_Ubuntu to try to build it but instructions are a bit outdated there.

Is there a more indicated url to build Hugin from source?


Please find below the notes I took during my tentative of build:
Below line is not correct anymore:
sudo echo 'deb-src ftp://ftp.at.debian.org/debian ../project/experimental main' > /etc/apt/sources.list.d/debian-experimental.list
I also had difficulties with Vigra, I replaced part:

cd ~/src
wget http://hci.iwr.uni-heidelberg.de/vigra/vigra-1.9.0-src.tar.gz
tar -zxvf vigra-1.9.0-src.tar.gz
cd vigra-1.9.0


by the below:

cd ~/src
git clone https://github.com/ukoethe/vigra.git
cd vigra


So that I had "recent" Vigra. Mamy a not-so-good idea but worth a try... But then, later when I `cmake ../hugin.hg [...]` it's failing with:

-- VIGRA version: 1.11.1
CMake Error at CMakeModules/FindVIGRA.cmake:78 (MESSAGE):
  Libvigraimpex found.  But vigraimpex seems to compiled without OpenEXR
  support.  OpenEXR support is required for Hugin.
Call Stack (most recent call first):
  CMakeLists.txt:226 (FIND_PACKAGE)

cmake_..._hugin.hg.png

T. Modes

unread,
Nov 3, 2022, 12:15:42 PM11/3/22
to hugin and other free panoramic software
Thomas B. schrieb am Mittwoch, 2. November 2022 um 21:58:48 UTC+1:
cd ~/src
git clone https://github.com/ukoethe/vigra.git
cd vigra


So that I had "recent" Vigra. Mamy a not-so-good idea but worth a try... But then, later when I `cmake ../hugin.hg [...]` it's failing with:

-- VIGRA version: 1.11.1
CMake Error at CMakeModules/FindVIGRA.cmake:78 (MESSAGE):
  Libvigraimpex found.  But vigraimpex seems to compiled without OpenEXR
  support.  OpenEXR support is required for Hugin.
Call Stack (most recent call first):
  CMakeLists.txt:226 (FIND_PACKAGE)

I thought the error message is clear.
You need to build vigra with OpenEXR support (this is disabled by default). To do so add -DWITH_OPENEXR=1 to the CMake command line of vigra.
There is also a GUI for CMake which allows to set these options and path inside a GUI. This can be more convenient than adding many switches on the command line.


Reply all
Reply to author
Forward
0 new messages