- ducdanganhit
- Posts: 25
- Joined:
Re: [C++, OpenCV] Display image CV::Mat queue as video in XAML
Hi,If you search inside the code you will find the implementation in the D3D11RenderDevice.cpp file.It seems that the program could not find implementation of WrapTexture. does libNoesisApp.so or libNoesis.socontain WrapTexture implementation?
Thank you!
D3D11RenderDevice.cpp includes D3D11RenderDevice.h.
D3D11RenderDevice.h includes <d3d11_1.h> which does not exist on Ubuntu system, only available on Windows. I am using Ubuntu. How we can solve this problem?
Do we have another way to show image from byte array?
Last edited by ducdanganhit on 19 Jun 2019, 12:01, edited 1 time in total.
- ducdanganhit
- Posts: 25
- Joined:
Re: [C++, OpenCV] Display image CV::Mat queue as video in XAML
Do you have any example or more suggestion? Thanks you :)guess you would like to use cbimtmap ..
Re: [C++, OpenCV] Display image CV::Mat queue as video in XAML
There is no D3D in Linux, you need to use OpenGL (GLRenderDevice). The functionality is the same.D3D11RenderDevice.cpp includes D3D11RenderDevice.h.
D3D11RenderDevice.h includes <d3d11_1.h> which does not exist on Ubuntu system, only available on Windows. I am using Ubuntu. How we can solve this problem?
Going through textures is the only way to do this efficiently.Do we have another way to show image from byte array?
- ducdanganhit
- Posts: 25
- Joined:
Re: [C++, OpenCV] Display image CV::Mat queue as video in XAML
Do we have any example using OpenGL in Noesis?
I got some problems of integrating Noesis to use OpenGL :(
I got some problems of integrating Noesis to use OpenGL :(
Re: [C++, OpenCV] Display image CV::Mat queue as video in XAML
All our samples are multiplatorm, so they also work in OpenGL.
You can find a minimal sample integrating NoesisGUI + GLUT at Github.
You can find a minimal sample integrating NoesisGUI + GLUT at Github.
- ducdanganhit
- Posts: 25
- Joined:
Re: [C++, OpenCV] Display image CV::Mat queue as video in XAML
On Ubuntu 16.04, I've tried to use WrapTexture to load an image to texture using code below:
But glGenerateMipmap(GL_TEXTURE_2D); is not found.
I include these headers:
#include <GL/gl.h>
#include <GL/glut.h>
Result:
What is wrong here?
Many thanks
But glGenerateMipmap(GL_TEXTURE_2D); is not found.
I include these headers:
#include <GL/gl.h>
#include <GL/glut.h>
Code: Select all
InitializeComponent();
cv::Mat image = cv::imread("./1.jpg");
_image = FindName<Image>("img1");
GLuint TextureID;
if (image.empty()) {
std::cout << "image empty" << std::endl;
} else {
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glGenTextures(1, &TextureID);
glBindTexture(GL_TEXTURE_2D, TextureID);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
// Set texture clamping method
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
cv::cvtColor(image, image, CV_RGB2BGRA);
glTexImage2D(GL_TEXTURE_2D, // Type of texture
0, // Pyramid level (for mip-mapping) - 0 is the top level
GL_BGR, // Internal colour format to convert to
image.cols, // Image width i.e. 640 for Kinect in standard mode
image.rows, // Image height i.e. 480 for Kinect in standard mode
0, // Border width in pixels (can either be 1 or 0)
GL_BGR, // Input image format (i.e. GL_RGB, GL_RGBA, GL_BGR etc.)
GL_UNSIGNED_BYTE, // Image data type
image.ptr()); // The actual image data itself
}
Ptr<Texture> NsTexture = GLRenderDevice::WrapTexture(TextureID, 300, 450, 0, false);
Ptr<TextureSource> NsTextureSource = MakePtr<TextureSource>(NsTexture);
_image->SetSource(NsTextureSource);
What is wrong here?
Many thanks
Re: [C++, OpenCV] Display image CV::Mat queue as video in XAML
I am sorry to say you need to get help somewhere else because this is a GL question, not related to Noesis.On Ubuntu 16.04, I've tried to use WrapTexture to load an image to texture using code below:
But glGenerateMipmap(GL_TEXTURE_2D); is not found.
Who is online
Users browsing this forum: maherne and 1 guest