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

JavaCV's Frame to OpenCV's Mat #2305

Open
zhang22113 opened this issue Nov 29, 2024 · 3 comments
Open

JavaCV's Frame to OpenCV's Mat #2305

zhang22113 opened this issue Nov 29, 2024 · 3 comments

Comments

@zhang22113
Copy link

For some reasons, I need to convert JavaCV's Frame to OpenCV's Mat. Is there any way to achieve this goal?

@zhang22113
Copy link
Author

zhang22113 commented Nov 29, 2024

Currently, I am using this method
image
But after running for a certain period of time, an error will occur
image
That is to say, BufferedImage image=Java2DFrameUtils. toBufferedImage (frame); This line of code.
The currentframe is the Mat of OpenCV, while the frame comes from JavaCV

@saudet
Copy link
Member

saudet commented Nov 29, 2024

That's what OpenCVFrameConverter is for:
http://bytedeco.org/javacv/apidocs/org/bytedeco/javacv/OpenCVFrameConverter.html

@zhang22113
Copy link
Author

这就是 OpenCVFrameConverter 的用途: http://bytedeco.org/javacv/apidocs/org/bytedeco/javacv/OpenCVFrameConverter.html

Thank you, it solved my great confusion

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