Skip to content

3r4y/ImGuiGaussianBlur

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ImGui, Gaussian Blur, OpenCV & DirectX11

ImGuiGaussianBlur

This is an application that combines ImGui for GUI rendering, OpenCV for image processing, and DirectX11 for graphics rendering. This project demonstrates how to use these libraries together to create a simple application that loads, processes, and displays images.

maybe i will add it later 😬

  • video support
  • gif support

🛠 Features

  • ImGui Gaussian Blur with directx11

Install OpenCV for Linux

sudo apt-get install libopencv-dev

Install OpenCV for Windows

mkdir c:\src
cd c:\src
git clone https://github.com/microsoft/vcpkg
cd vcpkg
bootstrap-vcpkg.bat
.\vcpkg.exe integrate install
.\vcpkg.exe integrate powershell
.\vcpkg.exe install opencv[contrib,core,dnn,freetype,jpeg,openmp,png,quirc,tiff,webp,world]:x64-windows

For applying Gaussian Blur

    //with GaussianBlur image (example from https://github.com/JimmyHHua/opencv_tutorials/blob/master/python/code_022/opencv_022.py)
    cv::Mat src = cv::imread("C:/image.jpg");
    cv::Mat dst = ImageProcessor::ApplyGaussianBlur(src, 15);
    ID3D11Texture2D* texture_blur = RenderUtils::LoadTextureFromMat(dst, Render::Data::Device, Render::Data::DeviceContext);
    ID3D11ShaderResourceView* texture_srv = nullptr;
    D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = {};
    srvDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
    srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
    srvDesc.Texture2D.MipLevels = 1;
    srvDesc.Texture2D.MostDetailedMip = 0;
    Render::Data::Device->CreateShaderResourceView(texture_blur, &srvDesc, &texture_srv);
    ImGui::Image(texture_srv, ImVec2(dst.cols, dst.rows));

Screenshots

example

💡 Credits