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

Mac OS: opencv_window sample doesn't work #545

Open
tomo0310 opened this issue May 19, 2018 · 3 comments
Open

Mac OS: opencv_window sample doesn't work #545

tomo0310 opened this issue May 19, 2018 · 3 comments
Labels

Comments

@tomo0310
Copy link

tomo0310 commented May 19, 2018

Hi.
I want to use opencv_window sample. But it doesn't work.
https://gobot.io/documentation/examples/opencv_window/

OS:OSX 10.12.6

2018/05/19 17:32:54 Initializing devices...
2018/05/19 17:32:54 Initializing device Window ...
2018/05/19 17:32:54 Initializing device Camera ...
2018/05/19 17:32:54 Robot cameraBot initialized.
2018/05/19 17:32:54 Starting Robot cameraBot ...
2018/05/19 17:32:54 Starting connections...
2018/05/19 17:32:54 Starting devices...
2018/05/19 17:32:54 Starting device Window...
2018/05/19 17:32:54 Starting device Camera...
2018/05/19 17:32:55 Starting work...
2018-05-19 17:32:55.728 opencv_window[6016:520299] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'nextEventMatchingMask should only be called from the Main Thread!'

I saw that issue.
hybridgroup/gocv#31

So, I Add this code to the main function.But It doesn't work too.
runtime.LockOSThread()

Does anyone know how to solve the problem?

@emf42
Copy link

emf42 commented May 20, 2018

For Mac OS, all opencv code must be run from the main thread, so using the goroutines provided by gobot are out of the question.
Use this instead https://github.com/hybridgroup/gocv/blob/master/cmd/capwindow/main.go

@tomo0310
Copy link
Author

Thank you for your answer. I finally want to run tello_opencv.go. It doesn't work because of the same reason. I'll use my old windows PC until opencv for Mac OS supports multi thread.

@gen2thomas
Copy link
Collaborator

Since this is now closed in Allure - is it also fixed for gobot?

@gen2thomas gen2thomas changed the title opencv_window sample doesn't work Mac OS: opencv_window sample doesn't work Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants