# Understanding the Philosophy Behind OpenCV's DNN Module

**URL:** <https://forum.opencv.org/t/understanding-the-philosophy-behind-opencvs-dnn-module/20906>\
**Category:** Uncategorized\
**Tags:** dnn, tensorflow, onnx\
**Created:** [April 27, 2025, 3:10pm UTC](https://forum.opencv.org/t/understanding-the-philosophy-behind-opencvs-dnn-module/20906 "2025-04-27T15:10:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![radiantb](https://avatars.discourse-cdn.com/v4/letter/r/a87d85/32.png) [@radiantb](https://forum.opencv.org/u/radiantb)\
**Post date:** [April 27, 2025, 3:10pm UTC](https://forum.opencv.org/t/understanding-the-philosophy-behind-opencvs-dnn-module/20906/1 "2025-04-27T15:10:35Z")

</div>

Hello everyone,

Sometime back, I was working on a proposal for a GSoC project about integrating LightGlue and ALIKED into OpenCV by using the DNN module and extending Feature2D modules. While experimenting with LightGlue ONNX models, I encountered challenges like lack of dynamic input shape support and unsupported operations (like ScatterND, GridSample, logical layers like `And`, `Or`, etc.).

This made me wonder:

- Given that frameworks like ONNX Runtime and TensorFlow already provide C++ APIs for running deep learning models, what was the core motivation behind creating the OpenCV DNN module?
- Was it mainly for ease of integration into OpenCV pipelines (image processing, feature matching, etc.), portability across CPU architectures, minimal dependencies, or something else?
- Was one of the original goals to enable efficient inference across different CPU architectures (x86, ARM, etc.) with the same lightweight C++ codebase, without heavy external dependencies?
- How should one decide when it is appropriate to use OpenCV DNN versus integrating external runtime libraries?

I would love to understand the original design and what kinds of problems OpenCV DNN is best suited to solve.  
Sorry if these are very basic questions — I’m just trying to learn the background properly.

Thank you!
