nareshmlx/opencv-pr huggingface dataset:
**File:** modules/imgproc/test/test_approxpoly.cpp
**Change Type:** modified
**Context:** PR #25607: Add a new function that approximates the polygon bounding a convex hull with a certain number of sides

**Code Changes:**
```diff
@@ -377,4 +377,79 @@ TEST(Imgproc_ApproxPoly, bad_epsilon)
     ASSERT_ANY_THROW(approxPolyDP(inputPoints, outputPoints, eps, false));
 }
 
+struct ApproxPolyN: public testing::Test
+{
+    void SetUp()
+    {
+        vector<vector<Point>> inputPoints = {
+            {  {87, 103}, {100, 112}, {96, 138}, {80, 169}, {60, 183}, {38, 176}, {41, 145}, {56, 118}, {76, 104} },
```

Review comment:
I might suggest replacing the test image with a 32 point image using **cv::polylines**. Should I reduce/increase the number of points or do something else? ![image](https://github.com/opencv/opencv/assets/98156294/5327c85a-4d5b-4cbc-9e81-afc59e234439) Should I close the PR in opencv_extra in this case?
**File:** modules/imgproc/include/opencv2/imgproc.hpp
**Change Type:** modified
**Context:** PR #25607: Add a new function that approximates the polygon bounding a convex hull with a certain number of sides

**Code Changes:**
```diff
@@ -4060,6 +4060,28 @@ CV_EXPORTS_W void approxPolyDP( InputArray curve,
                                 OutputArray approxCurve,
                                 double epsilon, bool closed );
 
+/** @brief Approximates a polygon with a convex hull with a specified accuracy and number of sides.
+
+The cv::approxPolyN function approximates a polygon with a convex hull
+so that the difference between the contour area of the original contour and the new polygon is minimal.
+It uses a greedy algorithm for contracting two vertices into one in such a way that the additional area is minimal.
+Straight lines formed by each edge of the convex contour are drawn and the areas of the resulting triangles are considered.
```

Review comment:
could you please rename: 1. approxBoundingPoly to approxPolyN 2. side to nsides 3. make_hull to ensure_convex
**File:** modules/core/src/matrix.cpp
**Change Type:** modified
**Context:** PR #25899: Mark cv::Mat(Mat&&) as noexcept
**Review Line:** 598

**Code Changes:**
```diff
@@ -595,7 +595,7 @@ size_t Mat::total(int startDim, int endDim) const
 }
 
 
-Mat::Mat(Mat&& m)
+Mat::Mat(Mat&& m) CV_NOEXCEPT
     : flags(m.flags), dims(m.dims), rows(m.rows), cols(m.cols), data(m.data),
       datastart(m.datastart), dataend(m.dataend), datalimit(m.datalimit), allocator(m.allocator),
       u(m.u), size(&rows)
```

Review comment:
What about assertion in the else branch? ``` CV_Assert(m.step.p != m.step.buf); ```
**File:** modules/core/src/matrix.cpp
**Change Type:** modified
**Context:** PR #25899: Mark cv::Mat(Mat&&) as noexcept
**Review Line:** 598

**Code Changes:**
```diff
@@ -595,7 +595,7 @@ size_t Mat::total(int startDim, int endDim) const
 }
 
 
-Mat::Mat(Mat&& m)
+Mat::Mat(Mat&& m) CV_NOEXCEPT
     : flags(m.flags), dims(m.dims), rows(m.rows), cols(m.cols), data(m.data),
       datastart(m.datastart), dataend(m.dataend), datalimit(m.datalimit), allocator(m.allocator),
       u(m.u), size(&rows)
```

Review comment:
I forgot CV_Assert was more than an assert ... If it can throw, I guess it won't work indeed.
**File:** modules/core/src/matrix.cpp
**Change Type:** modified
**Context:** PR #25899: Mark cv::Mat(Mat&&) as noexcept
**Review Line:** 598

**Code Changes:**
```diff
@@ -595,7 +595,7 @@ size_t Mat::total(int startDim, int endDim) const
 }
 
 
-Mat::Mat(Mat&& m)
+Mat::Mat(Mat&& m) CV_NOEXCEPT
     : flags(m.flags), dims(m.dims), rows(m.rows), cols(m.cols), data(m.data),
       datastart(m.datastart), dataend(m.dataend), datalimit(m.datalimit), allocator(m.allocator),
       u(m.u), size(&rows)
```

Review comment:
I see, `CV_Assert` calls `cv::error` calls `throw` ([here](https://github.com/opencv/opencv/blob/4.x/modules/core/src/system.cpp#L1276)). But still, IIUC, isn't that `CV_Assert` basically asserting an _invariant?_ I mean, IIUC, you're not actually trying to use that exception for control-flow. IIUC, you expect that `(m.step.p != m.step.buf)` will be true literally every time that line is hit. So it would be perfectly appropriate to replace that line with whatever macro OpenCV uses to express invariants. (In most codebases the invariant-checking macro _is_ spelled `assert`, which is why that `CV_Assert` looked harmless at first glance.) If OpenCV _has_ no invariant-checking macro a la `assert`, then I suggest it would be perfectly appropriate to simply eliminate that line, or replace it with a comment.
**File:** modules/core/src/matrix.cpp
**Change Type:** modified
**Context:** PR #25899: Mark cv::Mat(Mat&&) as noexcept
**Review Line:** 598

**Code Changes:**
```diff
@@ -595,7 +595,7 @@ size_t Mat::total(int startDim, int endDim) const
 }
 
 
-Mat::Mat(Mat&& m)
+Mat::Mat(Mat&& m) CV_NOEXCEPT
     : flags(m.flags), dims(m.dims), rows(m.rows), cols(m.cols), data(m.data),
       datastart(m.datastart), dataend(m.dataend), datalimit(m.datalimit), allocator(m.allocator),
       u(m.u), size(&rows)
```

Review comment:
Actually, why even modify `m`? `m` is moved so there is not point in modifying it. `Move constructors typically "steal" the resources held by the argument (e.g. pointers to dynamically-allocated objects, file descriptors, TCP sockets, I/O streams, running threads, etc.) rather than make copies of them, and leave the argument in some valid but otherwise indeterminate state.` https://en.cppreference.com/w/cpp/language/move_constructor
**File:** modules/core/src/matrix.cpp
**Change Type:** modified
**Context:** PR #25899: Mark cv::Mat(Mat&&) as noexcept
**Review Line:** 598

**Code Changes:**
```diff
@@ -595,7 +595,7 @@ size_t Mat::total(int startDim, int endDim) const
 }
 
 
-Mat::Mat(Mat&& m)
+Mat::Mat(Mat&& m) CV_NOEXCEPT
     : flags(m.flags), dims(m.dims), rows(m.rows), cols(m.cols), data(m.data),
       datastart(m.datastart), dataend(m.dataend), datalimit(m.datalimit), allocator(m.allocator),
       u(m.u), size(&rows)
```

Review comment:
> why even modify `m` It is modified to transfer ownership of allocated metadata buffers. To avoid use-after-free when `m` destructor is called. > CV_Assert Basically it checks `invariant` and should never fail. I believe we could replace failure handling code with `abort()` / `std::terminate()`.
**File:** modules/core/include/opencv2/core/base.hpp
**Change Type:** modified
**Context:** PR #25899: Mark cv::Mat(Mat&&) as noexcept

**Code Changes:**
```diff
@@ -297,6 +297,21 @@ It is possible to alternate error processing by using redirectError().
  */
 CV_EXPORTS CV_NORETURN void error(int _code, const String& _err, const char* _func, const char* _file, int _line);
 
+/*! @brief Signals an error and terminate application.
+
+By default the function prints information about the error to stderr, then it terminates application
+with std::terminate. The function is designed for invariants check in functions and methods with
+noexcept attribute.
+@param _code - error code (Error::Code)
```

Review comment:
CV_AssertTerminate
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #25817: handling I32/I64 data types in G-API ONNX back-end

**Code Changes:**
```diff
@@ -123,7 +123,7 @@ class ONNXCompiled {
     std::vector<cv::Mat> out_data;
 
     void Run(const std::vector<cv::Mat>& ins,
-             const std::vector<cv::Mat>& outs);
+             std::vector<cv::Mat>& outs);
 
     std::vector<std::string> in_names_without_const;
 public:
@@ -322,22 +322,20 @@ inline std::vector<int64_t> toORT(const cv::MatSize &sz) {
```

Review comment:
Can we just remove this assert?
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #25817: handling I32/I64 data types in G-API ONNX back-end

**Code Changes:**
```diff
@@ -123,7 +123,7 @@ class ONNXCompiled {
     std::vector<cv::Mat> out_data;
 
     void Run(const std::vector<cv::Mat>& ins,
-             const std::vector<cv::Mat>& outs);
+             std::vector<cv::Mat>& outs);
 
     std::vector<std::string> in_names_without_const;
 public:
@@ -322,22 +322,20 @@ inline std::vector<int64_t> toORT(const cv::MatSize &sz) {
```

Review comment:
`preprocess` should be applied only if `CV_8U` is present - image case This is how I would expect it to work: ``` // no assert here if (src.depth() != CV_8U) { // Just pass the tensor as-is logic } else { // 8U input: full preprocessing path } ```
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #25817: handling I32/I64 data types in G-API ONNX back-end

**Code Changes:**
```diff
@@ -123,7 +123,7 @@ class ONNXCompiled {
     std::vector<cv::Mat> out_data;
 
     void Run(const std::vector<cv::Mat>& ins,
-             const std::vector<cv::Mat>& outs);
+             std::vector<cv::Mat>& outs);
 
     std::vector<std::string> in_names_without_const;
 public:
@@ -322,22 +322,20 @@ inline std::vector<int64_t> toORT(const cv::MatSize &sz) {
```

Review comment:
But exception message still only about `FP32` and `U8`. Btw, all types supported in ONNXRT: https://github.com/microsoft/onnxruntime/blob/main/include/onnxruntime/core/session/onnxruntime_c_api.h#L177-L203 We also need to cover `_INT64`
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #25817: handling I32/I64 data types in G-API ONNX back-end

**Code Changes:**
```diff
@@ -123,7 +123,7 @@ class ONNXCompiled {
     std::vector<cv::Mat> out_data;
 
     void Run(const std::vector<cv::Mat>& ins,
-             const std::vector<cv::Mat>& outs);
+             std::vector<cv::Mat>& outs);
 
     std::vector<std::string> in_names_without_const;
 public:
@@ -322,22 +322,20 @@ inline std::vector<int64_t> toORT(const cv::MatSize &sz) {
```

Review comment:
To cover `_INT64` we also need handling here: https://github.com/opencv/opencv/blob/762ac0f2f394cdbc2837be5ee0735d0812997156/modules/gapi/src/backends/onnx/gonnxbackend.cpp#L467-L474
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #25817: handling I32/I64 data types in G-API ONNX back-end

**Code Changes:**
```diff
@@ -123,7 +123,7 @@ class ONNXCompiled {
     std::vector<cv::Mat> out_data;
 
     void Run(const std::vector<cv::Mat>& ins,
-             const std::vector<cv::Mat>& outs);
+             std::vector<cv::Mat>& outs);
 
     std::vector<std::string> in_names_without_const;
 public:
@@ -322,22 +322,20 @@ inline std::vector<int64_t> toORT(const cv::MatSize &sz) {
```

Review comment:
Note, that there is not `CV_I64` type, in such case we usually apply WA and upcast data from `CV_32` cv::Mat to `int64_t`. Here is example from OpenVINO backend: https://github.com/opencv/opencv/blob/4.x/modules/gapi/src/backends/ov/govbackend.cpp#L144-L146
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #25817: handling I32/I64 data types in G-API ONNX back-end
**Review Line:** 332

**Code Changes:**
```diff
         // Just pass the tensor as-is.
         // No layout or dimension transformations done here!
         // TODO: This needs to be aligned across all NN backends.
-        GAPI_Assert(type == CV_32F && "Only 32F model input is supported for 32F input data");
         const auto tensor_dims = toORT(src.size);
         if (tensor_dims.size() == ti.dims.size()) {
             for (size_t i = 0; i < ti.dims.size(); ++i) {
                 GAPI_Assert((ti.dims[i] == -1 || ti.dims[i] == tensor_dims[i]) &&
-                            "32F tensor dimensions should match with all non-dynamic NN input dimensions");
+                            "Non-U8 tensor dimensions should match with all non-dynamic NN input dimensions");
             }
```

Review comment:
What about this: https://github.com/opencv/opencv/blob/f8ffdae050bc329a1101fb4a05279ad417dc1d55/modules/gapi/src/backends/onnx/gonnxbackend.cpp#L335? Still refers only to `FP32`, can be at least not `U8`?
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #25817: handling I32/I64 data types in G-API ONNX back-end
**Review Line:** 332

**Code Changes:**
```diff
         // Just pass the tensor as-is.
         // No layout or dimension transformations done here!
         // TODO: This needs to be aligned across all NN backends.
-        GAPI_Assert(type == CV_32F && "Only 32F model input is supported for 32F input data");
         const auto tensor_dims = toORT(src.size);
         if (tensor_dims.size() == ti.dims.size()) {
             for (size_t i = 0; i < ti.dims.size(); ++i) {
                 GAPI_Assert((ti.dims[i] == -1 || ti.dims[i] == tensor_dims[i]) &&
-                            "32F tensor dimensions should match with all non-dynamic NN input dimensions");
+                            "Non-U8 tensor dimensions should match with all non-dynamic NN input dimensions");
             }
```

Review comment:
you're right, will change this now
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #25817: handling I32/I64 data types in G-API ONNX back-end

**Code Changes:**
```diff
@@ -123,7 +123,7 @@ class ONNXCompiled {
     std::vector<cv::Mat> out_data;
 
     void Run(const std::vector<cv::Mat>& ins,
-             const std::vector<cv::Mat>& outs);
+             std::vector<cv::Mat>& outs);
 
     std::vector<std::string> in_names_without_const;
 public:
@@ -322,22 +322,20 @@ inline std::vector<int64_t> toORT(const cv::MatSize &sz) {
```

Review comment:
Could you point me where this conversion is carried out? Couldn't find it...
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #25817: handling I32/I64 data types in G-API ONNX back-end

**Code Changes:**
```diff
@@ -123,7 +123,7 @@ class ONNXCompiled {
     std::vector<cv::Mat> out_data;
 
     void Run(const std::vector<cv::Mat>& ins,
-             const std::vector<cv::Mat>& outs);
+             std::vector<cv::Mat>& outs);
 
     std::vector<std::string> in_names_without_const;
 public:
@@ -322,22 +322,20 @@ inline std::vector<int64_t> toORT(const cv::MatSize &sz) {
```

Review comment:
Return back the previous format
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #25817: handling I32/I64 data types in G-API ONNX back-end

**Code Changes:**
```diff
@@ -123,7 +123,7 @@ class ONNXCompiled {
     std::vector<cv::Mat> out_data;
 
     void Run(const std::vector<cv::Mat>& ins,
-             const std::vector<cv::Mat>& outs);
+             std::vector<cv::Mat>& outs);
 
     std::vector<std::string> in_names_without_const;
 public:
@@ -322,22 +322,20 @@ inline std::vector<int64_t> toORT(const cv::MatSize &sz) {
```

Review comment:
and here, format seems to be changed
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #25817: handling I32/I64 data types in G-API ONNX back-end

**Code Changes:**
```diff
@@ -123,7 +123,7 @@ class ONNXCompiled {
     std::vector<cv::Mat> out_data;
 
     void Run(const std::vector<cv::Mat>& ins,
-             const std::vector<cv::Mat>& outs);
+             std::vector<cv::Mat>& outs);
 
     std::vector<std::string> in_names_without_const;
 public:
@@ -322,22 +322,20 @@ inline std::vector<int64_t> toORT(const cv::MatSize &sz) {
```

Review comment:
can we get rid of extra vector?
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #25817: handling I32/I64 data types in G-API ONNX back-end

**Code Changes:**
```diff
@@ -123,7 +123,7 @@ class ONNXCompiled {
     std::vector<cv::Mat> out_data;
 
     void Run(const std::vector<cv::Mat>& ins,
-             const std::vector<cv::Mat>& outs);
+             std::vector<cv::Mat>& outs);
 
     std::vector<std::string> in_names_without_const;
 public:
@@ -322,22 +322,20 @@ inline std::vector<int64_t> toORT(const cv::MatSize &sz) {
```

Review comment:
debug prints
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #25817: handling I32/I64 data types in G-API ONNX back-end

**Code Changes:**
```diff
@@ -123,7 +123,7 @@ class ONNXCompiled {
     std::vector<cv::Mat> out_data;
 
     void Run(const std::vector<cv::Mat>& ins,
-             const std::vector<cv::Mat>& outs);
+             std::vector<cv::Mat>& outs);
 
     std::vector<std::string> in_names_without_const;
 public:
@@ -322,22 +322,20 @@ inline std::vector<int64_t> toORT(const cv::MatSize &sz) {
```

Review comment:
well maybe `i64_tensor` better?
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #25817: handling I32/I64 data types in G-API ONNX back-end

**Code Changes:**
```diff
@@ -123,7 +123,7 @@ class ONNXCompiled {
     std::vector<cv::Mat> out_data;
 
     void Run(const std::vector<cv::Mat>& ins,
-             const std::vector<cv::Mat>& outs);
+             std::vector<cv::Mat>& outs);
 
     std::vector<std::string> in_names_without_const;
 public:
@@ -322,22 +322,20 @@ inline std::vector<int64_t> toORT(const cv::MatSize &sz) {
```

Review comment:
I have this changed now
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #25817: handling I32/I64 data types in G-API ONNX back-end

**Code Changes:**
```diff
@@ -123,7 +123,7 @@ class ONNXCompiled {
     std::vector<cv::Mat> out_data;
 
     void Run(const std::vector<cv::Mat>& ins,
-             const std::vector<cv::Mat>& outs);
+             std::vector<cv::Mat>& outs);
 
     std::vector<std::string> in_names_without_const;
 public:
@@ -322,22 +322,20 @@ inline std::vector<int64_t> toORT(const cv::MatSize &sz) {
```

Review comment:
this is fixed now
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #25817: handling I32/I64 data types in G-API ONNX back-end

**Code Changes:**
```diff
@@ -123,7 +123,7 @@ class ONNXCompiled {
     std::vector<cv::Mat> out_data;
 
     void Run(const std::vector<cv::Mat>& ins,
-             const std::vector<cv::Mat>& outs);
+             std::vector<cv::Mat>& outs);
 
     std::vector<std::string> in_names_without_const;
 public:
@@ -322,22 +322,20 @@ inline std::vector<int64_t> toORT(const cv::MatSize &sz) {
```

Review comment:
reverted to original format now
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #25817: handling I32/I64 data types in G-API ONNX back-end

**Code Changes:**
```diff
@@ -123,7 +123,7 @@ class ONNXCompiled {
     std::vector<cv::Mat> out_data;
 
     void Run(const std::vector<cv::Mat>& ins,
-             const std::vector<cv::Mat>& outs);
+             std::vector<cv::Mat>& outs);
 
     std::vector<std::string> in_names_without_const;
 public:
@@ -322,22 +322,20 @@ inline std::vector<int64_t> toORT(const cv::MatSize &sz) {
```

Review comment:
currently using this tensor to store the converted tensors when running the convertInt32ToInt64 which will then be used to deep copy it into "i64_tensor"
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #25817: handling I32/I64 data types in G-API ONNX back-end
**Review Line:** 472

**Code Changes:**
```diff
         dst = src;
@@ -471,6 +469,25 @@ inline Ort::Value createTensor(const Ort::MemoryInfo& memory_info,
         return createTensor<float>(memory_info, tensor_params, data);
     case ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32:
         return createTensor<int32_t>(memory_info, tensor_params, data);
+    case ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64:{
+        // cv::Mat does not support int64 data directly.
+        // Following steps are applied to create an ONNX tensor from cv::Mat data:
+        // - First create a new ONNX tensor 'i64_tensor' with data type int64_t using the default allocator
+        // - Next retrieve a pointer to the mutable data buffer of 'i64_tensor'
+        // - Convert the data from int32 (see toCV function) to int64 and deep copy it into 'i64_tensor'
```

Review comment:
Can we get rid of `temp` vector here? I assume `convertInt32ToInt64` can write straight to `i64_tensor` memory. You will avoid extra copy by doing this.
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #25817: handling I32/I64 data types in G-API ONNX back-end

**Code Changes:**
```diff
@@ -123,7 +123,7 @@ class ONNXCompiled {
     std::vector<cv::Mat> out_data;
 
     void Run(const std::vector<cv::Mat>& ins,
-             const std::vector<cv::Mat>& outs);
+             std::vector<cv::Mat>& outs);
 
     std::vector<std::string> in_names_without_const;
 public:
@@ -322,22 +322,20 @@ inline std::vector<int64_t> toORT(const cv::MatSize &sz) {
```

Review comment:
Don't think we need it as a separate condition. Can we simply check as part of `else if (!is_dynamic && !is_postproc)` after `this_session.Run`? If `out_tensor_info[0].type == ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64` then we know for sure we need to copy data back otherwise it's already in-place
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #25817: handling I32/I64 data types in G-API ONNX back-end

**Code Changes:**
```diff
@@ -123,7 +123,7 @@ class ONNXCompiled {
     std::vector<cv::Mat> out_data;
 
     void Run(const std::vector<cv::Mat>& ins,
-             const std::vector<cv::Mat>& outs);
+             std::vector<cv::Mat>& outs);
 
     std::vector<std::string> in_names_without_const;
 public:
@@ -322,22 +322,20 @@ inline std::vector<int64_t> toORT(const cv::MatSize &sz) {
```

Review comment:
some `NB` comment would be useful here to understand why it's needed
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #25817: handling I32/I64 data types in G-API ONNX back-end
**Review Line:** 472

**Code Changes:**
```diff
         dst = src;
@@ -471,6 +469,25 @@ inline Ort::Value createTensor(const Ort::MemoryInfo& memory_info,
         return createTensor<float>(memory_info, tensor_params, data);
     case ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32:
         return createTensor<int32_t>(memory_info, tensor_params, data);
+    case ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64:{
+        // cv::Mat does not support int64 data directly.
+        // Following steps are applied to create an ONNX tensor from cv::Mat data:
+        // - First create a new ONNX tensor 'i64_tensor' with data type int64_t using the default allocator
+        // - Next retrieve a pointer to the mutable data buffer of 'i64_tensor'
+        // - Convert the data from int32 (see toCV function) to int64 and deep copy it into 'i64_tensor'
```

Review comment:
also some comment why we need this would be helpful
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #25817: handling I32/I64 data types in G-API ONNX back-end

**Code Changes:**
```diff
@@ -123,7 +123,7 @@ class ONNXCompiled {
     std::vector<cv::Mat> out_data;
 
     void Run(const std::vector<cv::Mat>& ins,
-             const std::vector<cv::Mat>& outs);
+             std::vector<cv::Mat>& outs);
 
     std::vector<std::string> in_names_without_const;
 public:
@@ -322,22 +322,20 @@ inline std::vector<int64_t> toORT(const cv::MatSize &sz) {
```

Review comment:
redundant comment
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #25817: handling I32/I64 data types in G-API ONNX back-end

**Code Changes:**
```diff
@@ -123,7 +123,7 @@ class ONNXCompiled {
     std::vector<cv::Mat> out_data;
 
     void Run(const std::vector<cv::Mat>& ins,
-             const std::vector<cv::Mat>& outs);
+             std::vector<cv::Mat>& outs);
 
     std::vector<std::string> in_names_without_const;
 public:
@@ -322,22 +322,20 @@ inline std::vector<int64_t> toORT(const cv::MatSize &sz) {
```

Review comment:
I've removed it now