# \#opengl

**URL:** https://forum.opencv.org/tag/opengl/76.md

[Latest](https://forum.opencv.org/latest.md) · [Categories](https://forum.opencv.org/categories.md) · [Tags](https://forum.opencv.org/tags.md)

---

## [OpenGL texture to GpuMat (CUDA)?](https://forum.opencv.org/t/opengl-texture-to-gpumat-cuda/18817)

<div class="topic-metadata">

**Author:** [@Carmatic\_frua](https://forum.opencv.org/u/Carmatic_frua)\
**Replies:** 43\
**Last updated:** [November 23, 2024, 10:11am UTC](https://forum.opencv.org/t/opengl-texture-to-gpumat-cuda/18817 "2024-11-23T10:11:37Z")

</div>

I am trying to pass an OpenGL texture to CUDA , right now I am doing it via glReadPixels to save it as a Python byte object, which needs to be converted to an image with PIL, then to an array using Numpy, before finally …

---

## [Changing float\* to Mat in functions](https://forum.opencv.org/t/changing-float-to-mat-in-functions/18556)

<div class="topic-metadata">

**Author:** [@sjhalayka](https://forum.opencv.org/u/sjhalayka)\
**Replies:** 1\
**Last updated:** [August 22, 2024, 1:10am UTC](https://forum.opencv.org/t/changing-float-to-mat-in-functions/18556 "2024-08-22T01:10:01Z")

</div>

I am having difficulty. I am using a float\* to handle output from a compute shader. When I try to replace that float\* with a Mat of type CV\_32FC4, I get random noise. It has to be something simple, but I can’t seem to fi…

---

## [GpuMat to openCV](https://forum.opencv.org/t/gpumat-to-opencv/15789)

<div class="topic-metadata">

**Author:** [@roy\_c](https://forum.opencv.org/u/roy_c)\
**Replies:** 1\
**Last updated:** [December 12, 2023, 2:29pm UTC](https://forum.opencv.org/t/gpumat-to-opencv/15789 "2023-12-12T14:29:12Z")

</div>

Hi, I’m trying to genererate an opengl texturedirecly from a GpuMat. I do something like this: struct GPUTexture { std::shared\_ptr\<cv::ogl::Texture2D\> m\_pTexture; std::shared\_ptr\<cv::ogl::Buffer\> m\_pGpuBuffer; unsi…

---

## [openCV (openGL support) display usage](https://forum.opencv.org/t/opencv-opengl-support-display-usage/15433)

<div class="topic-metadata">

**Author:** [@Ziri](https://forum.opencv.org/u/Ziri)\
**Replies:** 3\
**Last updated:** [November 16, 2023, 5:56am UTC](https://forum.opencv.org/t/opencv-opengl-support-display-usage/15433 "2023-11-16T05:56:38Z")

</div>

Is there any minimal example of displaying and image , rectangle , text using : cv::namedWindow(DISPLAY\_WINDOW\_NAME, cv::WINDOW\_OPENGL); I was able to display an image using this callback function : void on\_image\_…

---

## [Show GpuMat whit imshow with opengl flag](https://forum.opencv.org/t/show-gpumat-whit-imshow-with-opengl-flag/14389)

<div class="topic-metadata">

**Author:** [@reza\_hajimohammadi](https://forum.opencv.org/u/reza_hajimohammadi)\
**Replies:** 4\
**Last updated:** [August 29, 2023, 8:31pm UTC](https://forum.opencv.org/t/show-gpumat-whit-imshow-with-opengl-flag/14389 "2023-08-29T20:31:23Z")

</div>

Hello I am showing a cv::cuda::GpuMat whit cv::imshow: cv::cuda::GpuMat myGpuMat; cv::Ptrcv::cudacodec::VideoReader d\_reader = cv::cudacodec::createVideoReader(fname); d\_reader-\>nextFrame(myGpuMat) cv::namedWindow(“…

---

## [Unable to find the symbols for the functions \`cvSetOpenGlDrawCallback\` , \`cvSetOpenGlContext\` , and \`cvUpdateWindow\`](https://forum.opencv.org/t/unable-to-find-the-symbols-for-the-functions-cvsetopengldrawcallback-cvsetopenglcontext-and-cvupdatewindow/13912)

<div class="topic-metadata">

**Author:** [@donvirtus](https://forum.opencv.org/u/donvirtus)\
**Replies:** 1\
**Last updated:** [July 17, 2023, 4:04pm UTC](https://forum.opencv.org/t/unable-to-find-the-symbols-for-the-functions-cvsetopengldrawcallback-cvsetopenglcontext-and-cvupdatewindow/13912 "2023-07-17T16:04:48Z")

</div>

Seems that the linker is still unable to find the symbols for the functions cvSetOpenGlDrawCallback , cvSetOpenGlContext , and cvUpdateWindow Here the errors while I compile my opencv build: \[ 25%\] Building CXX object …

---

## [Building opencv with OpenGL build error](https://forum.opencv.org/t/building-opencv-with-opengl-build-error/7106)

<div class="topic-metadata">

**Author:** [@Benjamin\_Lyderik](https://forum.opencv.org/u/Benjamin_Lyderik)\
**Replies:** 12\
**Last updated:** [February 21, 2023, 2:16am UTC](https://forum.opencv.org/t/building-opencv-with-opengl-build-error/7106 "2023-02-21T02:16:56Z")

</div>

I get this error from multible targets: /usr/bin/ld: ../../lib/libopencv\_highgui.so.4.5.5: undefined reference to 'cvSetOpenGlDrawCallback' /usr/bin/ld: ../../lib/libopencv\_highgui.so.4.5.5: undefined reference to 'cvSe…

---

## [Python Opencv/cuda/Opengl/imshow #18553 #18588](https://forum.opencv.org/t/python-opencv-cuda-opengl-imshow-18553-18588/11581)

<div class="topic-metadata">

**Author:** [@manbehindthemadness](https://forum.opencv.org/u/manbehindthemadness)\
**Replies:** 16\
**Last updated:** [January 14, 2023, 8:03am UTC](https://forum.opencv.org/t/python-opencv-cuda-opengl-imshow-18553-18588/11581 "2023-01-14T08:03:39Z")

</div>

I am attempting to output high resolution imagery in the form of a cv2.cuda\_GpuMat() using python.cv2.imshow using a namedWindow flagged with cv2.WINDOW\_OPENGL. This does not seem to be functional as the console reports …

---

## [Large reprojection error using solvePnP to estimate OpenGL view matrix](https://forum.opencv.org/t/large-reprojection-error-using-solvepnp-to-estimate-opengl-view-matrix/1424)

<div class="topic-metadata">

**Author:** [@e6c1df](https://forum.opencv.org/u/e6c1df)\
**Replies:** 0\
**Last updated:** [February 8, 2021, 4:16pm UTC](https://forum.opencv.org/t/large-reprojection-error-using-solvepnp-to-estimate-opengl-view-matrix/1424 "2021-02-08T16:16:59Z")

</div>

Hi, I’ve been trying to estimate the view matrix used to project points with OpenGL via OpenCV’s solvePnP. Unfortunately, my reprojection error is rather high (50-100+ pixels) and I cannot figure out why. Here is my de…

---

## [Switch cv::ocl context](https://forum.opencv.org/t/switch-cv-ocl-context/7184)

<div class="topic-metadata">

**Author:** [@thehypermodernist](https://forum.opencv.org/u/thehypermodernist)\
**Replies:** 0\
**Last updated:** [January 18, 2022, 2:29pm UTC](https://forum.opencv.org/t/switch-cv-ocl-context/7184 "2022-01-18T14:29:37Z")

</div>

I am trying to understand the opencl context creation and memory allocation order. If I have a (pseudo)code of the following sequence cv::UMat oldMat; cl\_context\_properties props = {glxSharingContextForLinuxCallsHere(…

---

## [Error converting GpuMat to Texture2D](https://forum.opencv.org/t/error-converting-gpumat-to-texture2d/1975)

<div class="topic-metadata">

**Author:** [@samuelcho](https://forum.opencv.org/u/samuelcho)\
**Replies:** 0\
**Last updated:** [March 5, 2021, 1:15pm UTC](https://forum.opencv.org/t/error-converting-gpumat-to-texture2d/1975 "2021-03-05T13:15:41Z")

</div>

Hi everyone! I’m trying to convert a GpuMat (3 channels, CV\_8U format) to a texture. I’m doing this: cv::ogl::Texture2D tex; tex.copyFrom(GpuMat); The code compiles but I get this error at run time. OpenCV(4.5.1) Err…
