我正在尝试从 flea3 相机(代码为“FL3-U3-32S2C-CS”,显示其为彩色相机)获取彩色图像(在我的情况下 rgb 或 bgr 没有区别),但我的代码生成灰度照片.. . 下面的代码片段有什么问题?任何的想法?
# Begin acquiring images
cam.BeginAcquisition()
# Retrieve next image and convert it
image_result = cam.GetNextImage()
img_converted = image_result.Convert(PySpin.PixelFormat_RGB8, PySpin.HQ_LINEAR)
# Convert the Image object to RGB array
width = image_result.GetWidth()
height = image_result.GetHeight()
rgb_array = img_converted.GetData()
rgb_array = rgb_array.reshape(height, width, 3)
Run Code Online (Sandbox Code Playgroud) 我正在将 PySpin api 用于 Anaconda 中的 Point Grey 相机。该 API 是名为 Spinnaker ( https://www.ptgrey.com/spinnaker-sdk )的 C++ 库的 Python 包装器。
当我在 Spyder ( import PySpin) 中导入时,一切正常(请注意,我从安装了所有内容的环境中的 Conda 提示符启动了 Spyder)。不幸的是,从 conda 提示符而不是 Spyder(python foo.py其中foo.py包含import PySpin)运行导入会产生:
英特尔 MKL 致命错误:无法加载 mkl_intel_thread.dll。
序号242在动态链接库C:\Anaconda3\Library\bin\mkl_intel_thread.dll中找不到
注意我在 anaconda 提示符下从一个轮子安装了 Spinnaker (PySpin):
pip install spinnaker_python-1.20.0.15-cp36-cp36m-win_amd64.whl
Run Code Online (Sandbox Code Playgroud)
网上一堆地方说要在 C:\Windows\System32 中找到以下文件并重命名或删除它们:
mkl_core.dll
mkl_def.dll
mkl_intel_thread.dll
Run Code Online (Sandbox Code Playgroud)
这些文件不存在于我的机器上,所以这似乎不是我的问题。
例如,他们在这里提到了该解决方案:
序号 242 无法位于动态链接库 Anaconda3\Library\bin\mkl_intel_thread.dll 中