[Continue to walk on the shoulders of the predecessors] Windows installs Python-PCL, Python.3.8.5

Install python-pcl under Windows

Well, recently I want to combine the depth map with the original image to generate a point cloud map to take a look at. Try running PCL on Windows to look at the point cloud map. It seems that the difficulty is still very high. The precompiled version is popular all over the line . , I was a little scared to see a senior who happened to be python3.8 on windows and finally gave up. But in the attitude of giving it a try, I followed it up and took a look.

Follow the elders for a while

The next paragraph is similar to the blog of the seniors above, and I will write it again for the convenience of those who read it.

environment

windows10 64-bit
visual studio >= 2017 (it seems that Github only has 2017 files left)
python 3.8.x
python-pcl 1.9.1

Note: The version of the python-pcl library itself has reached 1.12, but because there is a process in the future that restricts our version to be less than or equal to 1.9, so here is 1.9.1. I did not follow the steps to install 1.12 before, and I have to uninstall it. go all over again, split

Similar steps

  1. Download python-pcl
  2. Download the All-In-One Installer of PCL1.9.1
    (download the PCL-1.9.1-AllInOne-msvc20xx-win64.exe corresponding to the visual studio version, I am from 2019, but I also installed some files from 2017, so it is ok)
  3. Click the exe file to install, during which the OpenNI2 installation interface will pop up automatically, just install it directly
  4. Setting environment variables, according to another predecessor , actually feels like too much, but I am afraid of making mistakes, so I added them all
  5. I missed this step during the installation process, and I didn't find it after the compilation was completed. It was a bit embarrassing, and even made me a little doubtful about whether this step was necessary. Download GTK+ , and then unzip it. My personal download is GTK+ 3.6.4 64-bit
  6. In the folder downloaded in the first step, open the pkg_config folder, open the Install-GTKPlus.ps1 file in administrator mode, and wait for more files after completion. Some people say that there is no bin file in this directory. It may be that this step has not been done, or because of the domestic network, some things have failed to download, and it may be necessary to go online scientifically. Then copy the contents of the bin directory in the folder in the previous step to the bin directory of the pkg_config folder here (I missed this step once as above), and then I chose the same file to overwrite.
  7. Make sure that cython and numpy are installed in the environment. I don’t know why the predecessor’s version 0.25.2 can’t be installed. After testing, the latest version installed by pip can be used. For the record, it is 0.29.28
  8. Go back to the folder downloaded in the first step, and execute the commands in sequence
python setup.py build_ext -i
python setup.py install
  1. In theory, it should be installed, and then you can try importing it in python:
import pcl
import pcl.pcl_visualization

go your own way

After following the ninth step above, a classic error occurred:
insert image description here

>>> import pcl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\ASUS\PycharmProjects\pyqt_test\venv\lib\site-packages\python_pcl-0.3.0rc1-py3.8-win-amd64.egg\pcl\__init__.py", line 2, in <module>
    from ._pcl import *
ImportError: DLL load failed while importing _pcl: 找不到指定的模块。

Then I honestly put OpenNI2.dll in that directory according to some blogs (I don’t know why the directory is very strange here, just follow the location of the py file that reported the error), it still doesn’t work, in that __init__.py I can't see where the problem is even after a show of operation in the file.

Ummmmm??!

Then look around in the directory, and see a bunch of dll files in the path of site-packages\python_pcl-0.3.0rc1-py3.8-win-amd64.egg\Lib\site-packages\pcl, should it be OpenNI2.dll put here? Still the same
insert image description here
Emmmmm? ! !

Then I didn’t have any ideas, and it didn’t work if I changed it blindly. Finally, forget it, copy all the dlls in the above folder to the previous __init__.py location. Oh, insert image description here
Emmmmm insert image description here
! ! !
I just want to say one thing: TNND, you are playing dirty. . .

Finally, put a picture and use PCL to display something casually. It looks a bit abstract. I feel that I need to adjust some parameters. I will take a look at it later. insert image description here
PS: Then a colleague told me that I can use pybind to seal pcl by myself, it seems to be possible, so I won’t try it, there is a senior blog here

Citation list:

  1. https://www.cnblogs.com/shepherd2015/p/11157240.html
  2. https://blog.csdn.net/weixin_42291376/article/details/106307408
  3. https://blog.csdn.net/l494924841/article/details/105622454

Guess you like

Origin blog.csdn.net/weixin_42492254/article/details/123852093