Windows11とpython3.12とpylsd

windows11上のpython3.12でpylsdを使うために

> pip install pylsd

するとインストールは出来るがlsd()が動かない

代替として提供されている

> pip install orcd-fork-pylsd

をインストールしようとするとエラーがでてインストールできない


ここを読むとオリジナルの不具合がfork版で修正されているらしい

PyLSD 0.0.2 の修正 on Python 3.9.1

https://mitsuharua.blogspot.com/2021/02/pylsd-02-on-python-391.html


しかしながらfork版がインストールできないのでオリジナルにパッチを適用

しようとしたがエラーがでてパッチが完了しなかった

パッチには詳しくないのでパッチのエラー対策は諦めて

パッチの内容を手作業で反映した


具体的にはlsd.pyを修正

from bindings.lsd_ctypes import *

from .bindings.lsd_ctypes import *

lsdlib.lsdGet(src, ctypes.c_int(rows), ctypes.c_int(cols), temp)

#lsdlib.lsdGet(src, ctypes.c_int(rows), ctypes.c_int(cols), temp)

enc_temp = temp.encode('utf-8')

cstr_temp = ctypes.create_string_buffer(enc_temp)

lsdlib.lsdGet(src, ctypes.c_int(rows), ctypes.c_int(cols), cstr_temp

このファイル以外のパッチは正常に適用されていた


pylsdの管理状況にもやっとはするが楽はしたいので動けばいいや論を適用する


pylsdの場所はpipで確認

> pip show pylsd

Name: pylsd

Version: 0.0.2

Summary: pylsd is the python bindings for LSD - Line Segment Detector

Home-page: https://github.com/primetang/pylsd

Author: Gefu Tang

Author-email: tanggefu@gmail.com

License: BSD

Location: C:\Users\chrome\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages

Requires:

Required-by:


--




コメント

このブログの人気の投稿

Ubuntu20.04にxrdpで接続するとAuthentication Requiredが発生する件

Oculus Quest 2と音ゲー

WSL2でKVMを動かす