Forum

Author Topic: Help needed - Problem using OpenCV in Metashape (related to numpy)  (Read 1613 times)

jenkinsm

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
I'm still learning Python and don't know much, so please tell me if what I'm trying to do is impossible.

I used ChatGPT to write a script that uses OpenCV to mask out the sky in my input images and another script that will detect cars and mask them out.

I installed OpenCV both within Metashape using pip and on my system, and I made sure that my system version of Python is 3.9, same as in Metashape.

Unfortunately, when I try 'import cv2' in Metashape, it gives an error saying that numpy is not installed and I need to install it using 'pip install numpy' — but when I do that, it says that numpy is already found in the installation directory.

I'm stuck in this loop where OpenCV thinks numpy isn't installed, but in reality it is installed.

What am I doing wrong here? How can I get it to work?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Help needed - Problem using OpenCV in Metashape (related to numpy)
« Reply #1 on: March 07, 2023, 02:41:31 PM »
Hello jenkinsm,

What version of Metashape Pro do you have installed and what OS you are using?
Best regards,
Alexey Pasumansky,
Agisoft LLC

jenkinsm

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Re: Help needed - Problem using OpenCV in Metashape (related to numpy)
« Reply #2 on: March 09, 2023, 09:05:04 AM »
Hello jenkinsm,

What version of Metashape Pro do you have installed and what OS you are using?

Hi Alexey, I am using 2.0.1 on Windows 10 Pro version 10.0.19045 Build 19045