Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenCV 4.4.0.44 macOS Catalina - Hang/Frozen #18416

Closed
JapinderSandhu opened this issue Sep 25, 2020 · 2 comments
Closed

OpenCV 4.4.0.44 macOS Catalina - Hang/Frozen #18416

JapinderSandhu opened this issue Sep 25, 2020 · 2 comments

Comments

@JapinderSandhu
Copy link

JapinderSandhu commented Sep 25, 2020

System information (version)
  • OpenCV => 4.4.0.44
  • numpy => 1.19.2
  • Operating System / Platform => macOS Catalina Version 10.15.6
  • Code Editor => Visual Studio Code 2020
  • Compiler => Anaconda 4.7.12 & 4.7.10
Detailed description

I am trying to convert a video frame to gray using cvtColor. This code works perfectly fine in macOS Mojave, MacOS High Sierra but Breaks in macOS Catalina. Other than these I have not tested other macOS. This code is not meant for Windows so I have not tested it on that.

The video frame is loading successfully, cap.read() is returning a frame with boolean True, so the video file path is correct and confirmed.

I tried #18079

openCV 4.3.0.36 as mentioned in #18079

The code stops at "BEFORE CVT GRAY" and never prints "AFTER CVT GRAY"

Steps to reproduce
code snippet
        ##############################################################
        #  Step 2: Read the first frame and convert it to grayscale
        ##############################################################

        cap = cv2.VideoCapture(input["mediaPath"] )

        # set frame to startFrame
        cap.set(cv2.CAP_PROP_POS_FRAMES, 0)

        # Read first frame
        ret, prev = cap.read()

        print("FRAME READ",ret)

        if not ret:

            print("Error cant read frames")

        print("IMAGE TEST", prev)

        print("BEFORE CVT GRAY")
        # Convert frame to grayscale
        prev_gray = cv2.cvtColor(prev, cv2.COLOR_BGR2GRAY)
        print("AFTER CVT GRAY")
Issue submission checklist
  • [ ✅] I report the issue, it's not a question
  • [ ✅] I checked the problem with documentation, FAQ, open issues,
    answers.opencv.org, Stack Overflow, etc and have not found solution
  • [:white_check_mark: ] I updated to latest OpenCV version and the issue is still there
  • [:white_check_mark: ] There is reproducer code and related data files: videos, images, onnx, etc
@alalek
Copy link
Member

alalek commented Sep 25, 2020

Provide complete minimal reproducer. Exclude unnecessary parts if they works (like VideoCapture, use np.zeros() instead).

code stops

Please attach stack trace.

@JapinderSandhu
Copy link
Author

JapinderSandhu commented Sep 27, 2020

SOLVED: added line in server for multiprocessing

this code snippet was in a larger multiprocessing function with a server so thats why I was unable to include it all for minimal reproducer. But I found the solution here.

Turns out I needed to add the line

multiprocessing.set_start_method('spawn')

#5150

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants