nareshmlx/opencv-pr huggingface dataset:
**File:** modules/python/test/test_houghcircles.py
**Change Type:** modified
**Context:** PR #20584: Fix hough circles alt dimensions

**Code Changes:**
```diff
@@ -80,5 +80,52 @@ def test_houghcircles(self):
         self.assertLess(float(len(circles) - matches_counter) / len(circles), .75)
 
 
+    def test_houghcircles_alt(self):
+
+        fn = "samples/data/board.jpg"
+
+        src = self.get_sample(fn, 1)
+        img = cv.cvtColor(src, cv.COLOR_BGR2GRAY)
```

Review comment:
Ok, added new assertEqual
**File:** modules/dnn/src/caffe/caffe_io.cpp
**Change Type:** modified
**Context:** PR #20386: Use the one argument version of SetTotalBytesLimit.
**Review Line:** 1114

**Code Changes:**
```diff
 
 #include <opencv2/core.hpp>
@@ -1111,7 +1112,11 @@ static const int kProtoReadBytesLimit = INT_MAX;  // Max size of 2 GB minus 1 by
 
 bool ReadProtoFromBinary(ZeroCopyInputStream* input, Message *proto) {
     CodedInputStream coded_input(input);
+#if GOOGLE_PROTOBUF_VERSION >= 3006000
+    coded_input.SetTotalBytesLimit(kProtoReadBytesLimit);
+#else
     coded_input.SetTotalBytesLimit(kProtoReadBytesLimit, 536870912);
+#endif
```

Review comment:
`#if` with some version detection check is necessary to support old and new protobuf versions.
**File:** modules/imgproc/src/rotcalipers.cpp
**Change Type:** modified
**Context:** PR #20533: MinAreaRect fix rotating calipers

**Code Changes:**
```diff
@@ -88,6 +88,32 @@ enum { CALIPERS_MAXHEIGHT=0, CALIPERS_MINAREARECT=1, CALIPERS_MAXDIST=2 };
  //    Notes:
  //F*/
 
+static void rotate90CCW(const cv::Point2f& in, cv::Point2f &out)
+{
+    out.x = -in.y;
+    out.y = in.x;
+}
+
```

Review comment:
incorrect result is to strong statement. Original solution based on angle comparison produces wrong result due to limited arithmetic accuracy.
**File:** modules/imgproc/src/rotcalipers.cpp
**Change Type:** modified
**Context:** PR #20533: MinAreaRect fix rotating calipers

**Code Changes:**
```diff
@@ -88,6 +88,32 @@ enum { CALIPERS_MAXHEIGHT=0, CALIPERS_MINAREARECT=1, CALIPERS_MAXDIST=2 };
  //    Notes:
  //F*/
 
+static void rotate90CCW(const cv::Point2f& in, cv::Point2f &out)
+{
+    out.x = -in.y;
+    out.y = in.x;
+}
+
```

Review comment:
I propose to replace the comment with more detailed PR description. For example: "Replaced vector sorting by angle cosine with sorting with custom comparator. The comparator determins vector order by dot project sign to fix floating point accuracy issue with colinear and close to colinear vectors."
**File:** modules/imgproc/src/rotcalipers.cpp
**Change Type:** modified
**Context:** PR #20533: MinAreaRect fix rotating calipers

**Code Changes:**
```diff
@@ -88,6 +88,32 @@ enum { CALIPERS_MAXHEIGHT=0, CALIPERS_MINAREARECT=1, CALIPERS_MAXDIST=2 };
  //    Notes:
  //F*/
 
+static void rotate90CCW(const cv::Point2f& in, cv::Point2f &out)
+{
+    out.x = -in.y;
+    out.y = in.x;
+}
+
```

Review comment:
Fixed the comment in the code. Added your note to PR description (second and third item on the list).
**File:** modules/videoio/include/opencv2/videoio.hpp
**Change Type:** modified
**Context:** PR #20541: VideoCapture timeout set/get - The original PR is amazing, a fixed timeout is not that convenient however, so this small patch adds get and...

**Code Changes:**
```diff
@@ -179,6 +179,8 @@ enum VideoCaptureProperties {
        CAP_PROP_BITRATE       =47, //!< (read-only) Video bitrate in kbits/s
        CAP_PROP_ORIENTATION_META=48, //!< (read-only) Frame rotation defined by stream meta (applicable for FFmpeg back-end only)
        CAP_PROP_ORIENTATION_AUTO=49, //!< if true - rotates output frames of CvCapture considering video file's metadata  (applicable for FFmpeg back-end only) (https://github.com/opencv/opencv/issues/15499)
+       CAP_PROP_OPEN_TIMEOUT_MSEC=53,
+       CAP_PROP_READ_TIMEOUT_MSEC=54,
 #ifndef CV_DOXYGEN
        CV__CAP_PROP_LATEST
 #endif
```

Review comment:
Please follow common formatting approach. No need 2 spaces pefore equal sign.
**File:** modules/videoio/src/cap_ffmpeg_api.hpp
**Change Type:** modified
**Context:** PR #20541: VideoCapture timeout set/get - The original PR is amazing, a fixed timeout is not that convenient however, so this small patch adds get and...

**Code Changes:**
```diff
@@ -30,7 +30,9 @@ enum
     CV_FFMPEG_CAP_PROP_CODEC_PIXEL_FORMAT=46,
     CV_FFMPEG_CAP_PROP_BITRATE=47,
     CV_FFMPEG_CAP_PROP_ORIENTATION_META=48,
-    CV_FFMPEG_CAP_PROP_ORIENTATION_AUTO=49
+    CV_FFMPEG_CAP_PROP_ORIENTATION_AUTO=49,
+    CV_FFMPEG_CAP_PROP_OPEN_TIMEOUT_MSEC=53,
+    CV_FFMPEG_CAP_PROP_READ_TIMEOUT_MSEC=54
 };
 
```

Review comment:
Need to restore defined enum values in videoio.hpp. It is a public API header, from which users know how to use this feature. Also please use 53, 54 as values to align with master (for both "enums").
**File:** doc/tutorials/introduction/config_reference/config_reference.markdown
**Change Type:** modified
**Context:** PR #20440: Update config_reference.markdown

**Code Changes:**
```diff
@@ -589,6 +589,14 @@ Some features have been added specifically for automated build environments, lik
 | `OPENCV_CMAKE_HOOKS_DIR` | _empty_ | OpenCV allows to customize configuration process by adding custom hook scripts at each stage and substage. cmake scripts with predefined names located in the directory set by this variable will be included before and after various configuration stages. Examples of file names: _CMAKE_INIT.cmake_, _PRE_CMAKE_BOOTSTRAP.cmake_, _POST_CMAKE_BOOTSTRAP.cmake_, etc.. Other names are not documented and can be found in the project cmake files by searching for the _ocv_cmake_hook_ macro calls. |
 | `OPENCV_DUMP_HOOKS_FLOW` | _OFF_ | Enables a debug message print on each cmake hook script call. |
 
+## Contrib Modules
+
+Following build options are utilized in `opencv_contrib` modules, as stated [previously](#tutorial_config_reference_general_contrib), these extra modules can be added to your final build by setting `DOPENCV_EXTRA_MODULES_PATH` option.
+
+| Option | Default | Description |
+| ------ | ------- | ----------- |
```

Review comment:
It's better to name it "Math Libraries" or something like that. Eigen and LAPACK should be there too.
**File:** doc/tutorials/introduction/config_reference/config_reference.markdown
**Change Type:** modified
**Context:** PR #20440: Update config_reference.markdown

**Code Changes:**
```diff
@@ -589,6 +589,14 @@ Some features have been added specifically for automated build environments, lik
 | `OPENCV_CMAKE_HOOKS_DIR` | _empty_ | OpenCV allows to customize configuration process by adding custom hook scripts at each stage and substage. cmake scripts with predefined names located in the directory set by this variable will be included before and after various configuration stages. Examples of file names: _CMAKE_INIT.cmake_, _PRE_CMAKE_BOOTSTRAP.cmake_, _POST_CMAKE_BOOTSTRAP.cmake_, etc.. Other names are not documented and can be found in the project cmake files by searching for the _ocv_cmake_hook_ macro calls. |
 | `OPENCV_DUMP_HOOKS_FLOW` | _OFF_ | Enables a debug message print on each cmake hook script call. |
 
+## Contrib Modules
+
+Following build options are utilized in `opencv_contrib` modules, as stated [previously](#tutorial_config_reference_general_contrib), these extra modules can be added to your final build by setting `DOPENCV_EXTRA_MODULES_PATH` option.
+
+| Option | Default | Description |
+| ------ | ------- | ----------- |
```

Review comment:
How about `Contrib Modules`? Since to the best of my knowledge, it's only utilized in opencv_contrib:videostab module. But I agree with the naming for Eigen and LAPACK ...
**File:** doc/tutorials/introduction/config_reference/config_reference.markdown
**Change Type:** modified
**Context:** PR #20440: Update config_reference.markdown

**Code Changes:**
```diff
@@ -589,6 +589,14 @@ Some features have been added specifically for automated build environments, lik
 | `OPENCV_CMAKE_HOOKS_DIR` | _empty_ | OpenCV allows to customize configuration process by adding custom hook scripts at each stage and substage. cmake scripts with predefined names located in the directory set by this variable will be included before and after various configuration stages. Examples of file names: _CMAKE_INIT.cmake_, _PRE_CMAKE_BOOTSTRAP.cmake_, _POST_CMAKE_BOOTSTRAP.cmake_, etc.. Other names are not documented and can be found in the project cmake files by searching for the _ocv_cmake_hook_ macro calls. |
 | `OPENCV_DUMP_HOOKS_FLOW` | _OFF_ | Enables a debug message print on each cmake hook script call. |
 
+## Contrib Modules
+
+Following build options are utilized in `opencv_contrib` modules, as stated [previously](#tutorial_config_reference_general_contrib), these extra modules can be added to your final build by setting `DOPENCV_EXTRA_MODULES_PATH` option.
+
+| Option | Default | Description |
+| ------ | ------- | ----------- |
```

Review comment:
You can add reference to contrib to the option description.
**File:** doc/tutorials/introduction/config_reference/config_reference.markdown
**Change Type:** modified
**Context:** PR #20440: Update config_reference.markdown

**Code Changes:**
```diff
@@ -589,6 +589,14 @@ Some features have been added specifically for automated build environments, lik
 | `OPENCV_CMAKE_HOOKS_DIR` | _empty_ | OpenCV allows to customize configuration process by adding custom hook scripts at each stage and substage. cmake scripts with predefined names located in the directory set by this variable will be included before and after various configuration stages. Examples of file names: _CMAKE_INIT.cmake_, _PRE_CMAKE_BOOTSTRAP.cmake_, _POST_CMAKE_BOOTSTRAP.cmake_, etc.. Other names are not documented and can be found in the project cmake files by searching for the _ocv_cmake_hook_ macro calls. |
 | `OPENCV_DUMP_HOOKS_FLOW` | _OFF_ | Enables a debug message print on each cmake hook script call. |
 
+## Contrib Modules
+
+Following build options are utilized in `opencv_contrib` modules, as stated [previously](#tutorial_config_reference_general_contrib), these extra modules can be added to your final build by setting `DOPENCV_EXTRA_MODULES_PATH` option.
+
+| Option | Default | Description |
+| ------ | ------- | ----------- |
```

Review comment:
Added in 79d03fd25f546257b1942cac1924f9f487bab6fc There is a bit of an issue though ... can't cross-reference to other sections of the document using anchors. Do Github's markdown engine support id extensions?
**File:** modules/core/include/opencv2/core/hal/intrin_rvv.hpp
**Change Type:** modified
**Context:** PR #20412: bug fixes for universal intrinsics of RISC-V back-end

**Code Changes:**
```diff
@@ -737,7 +737,7 @@ OPENCV_HAL_IMPL_RVV_LOADSTORE_OP(v_float64x2, vfloat64m1_t, double, 1, 2, 64, f6
 
 inline v_int8x16 v_load_halves(const schar* ptr0, const schar* ptr1)
 {
-    schar CV_DECL_ALIGNED(32) elems[16] =
+    schar elems[16] =
     {
         ptr0[0], ptr0[1], ptr0[2], ptr0[3], ptr0[4], ptr0[5], ptr0[6], ptr0[7],
         ptr1[0], ptr1[1], ptr1[2], ptr1[3], ptr1[4], ptr1[5], ptr1[6], ptr1[7]
@@ -748,7 +748,7 @@ inline v_uint8x16 v_load_halves(const uchar* ptr0, const uchar* ptr1) { return v
```

Review comment:
Please move implementation to the new line as in function above.
**File:** modules/core/include/opencv2/core/hal/intrin_rvv.hpp
**Change Type:** modified
**Context:** PR #20412: bug fixes for universal intrinsics of RISC-V back-end

**Code Changes:**
```diff
@@ -737,7 +737,7 @@ OPENCV_HAL_IMPL_RVV_LOADSTORE_OP(v_float64x2, vfloat64m1_t, double, 1, 2, 64, f6
 
 inline v_int8x16 v_load_halves(const schar* ptr0, const schar* ptr1)
 {
-    schar CV_DECL_ALIGNED(32) elems[16] =
+    schar elems[16] =
     {
         ptr0[0], ptr0[1], ptr0[2], ptr0[3], ptr0[4], ptr0[5], ptr0[6], ptr0[7],
         ptr1[0], ptr1[1], ptr1[2], ptr1[3], ptr1[4], ptr1[5], ptr1[6], ptr1[7]
@@ -748,7 +748,7 @@ inline v_uint8x16 v_load_halves(const uchar* ptr0, const uchar* ptr1) { return v
```

Review comment:
Memory usage looks very strange here. There are 32 vector registers and expect that universal intrisnic can be implemented without memory transactions.
**File:** modules/core/include/opencv2/core/hal/intrin_rvv.hpp
**Change Type:** modified
**Context:** PR #20412: bug fixes for universal intrinsics of RISC-V back-end

**Code Changes:**
```diff
@@ -737,7 +737,7 @@ OPENCV_HAL_IMPL_RVV_LOADSTORE_OP(v_float64x2, vfloat64m1_t, double, 1, 2, 64, f6
 
 inline v_int8x16 v_load_halves(const schar* ptr0, const schar* ptr1)
 {
-    schar CV_DECL_ALIGNED(32) elems[16] =
+    schar elems[16] =
     {
         ptr0[0], ptr0[1], ptr0[2], ptr0[3], ptr0[4], ptr0[5], ptr0[6], ptr0[7],
         ptr1[0], ptr1[1], ptr1[2], ptr1[3], ptr1[4], ptr1[5], ptr1[6], ptr1[7]
@@ -748,7 +748,7 @@ inline v_uint8x16 v_load_halves(const uchar* ptr0, const uchar* ptr1) { return v
```

Review comment:
The same for memory here.
**File:** modules/core/include/opencv2/core/hal/intrin_rvv.hpp
**Change Type:** modified
**Context:** PR #20412: bug fixes for universal intrinsics of RISC-V back-end

**Code Changes:**
```diff
@@ -737,7 +737,7 @@ OPENCV_HAL_IMPL_RVV_LOADSTORE_OP(v_float64x2, vfloat64m1_t, double, 1, 2, 64, f6
 
 inline v_int8x16 v_load_halves(const schar* ptr0, const schar* ptr1)
 {
-    schar CV_DECL_ALIGNED(32) elems[16] =
+    schar elems[16] =
     {
         ptr0[0], ptr0[1], ptr0[2], ptr0[3], ptr0[4], ptr0[5], ptr0[6], ptr0[7],
         ptr1[0], ptr1[1], ptr1[2], ptr1[3], ptr1[4], ptr1[5], ptr1[6], ptr1[7]
@@ -748,7 +748,7 @@ inline v_uint8x16 v_load_halves(const uchar* ptr0, const uchar* ptr1) { return v
```

Review comment:
I removed all the redundant CV_DECL_ALIGNED statements. They seem unnecessary. Now all the tests can still pass.
**File:** modules/core/include/opencv2/core/hal/intrin_rvv.hpp
**Change Type:** modified
**Context:** PR #20412: bug fixes for universal intrinsics of RISC-V back-end

**Code Changes:**
```diff
@@ -737,7 +737,7 @@ OPENCV_HAL_IMPL_RVV_LOADSTORE_OP(v_float64x2, vfloat64m1_t, double, 1, 2, 64, f6
 
 inline v_int8x16 v_load_halves(const schar* ptr0, const schar* ptr1)
 {
-    schar CV_DECL_ALIGNED(32) elems[16] =
+    schar elems[16] =
     {
         ptr0[0], ptr0[1], ptr0[2], ptr0[3], ptr0[4], ptr0[5], ptr0[6], ptr0[7],
         ptr1[0], ptr1[1], ptr1[2], ptr1[3], ptr1[4], ptr1[5], ptr1[6], ptr1[7]
@@ -748,7 +748,7 @@ inline v_uint8x16 v_load_halves(const uchar* ptr0, const uchar* ptr1) { return v
```

Review comment:
The same as above.
**File:** modules/core/include/opencv2/core/hal/intrin_rvv.hpp
**Change Type:** modified
**Context:** PR #20412: bug fixes for universal intrinsics of RISC-V back-end

**Code Changes:**
```diff
@@ -737,7 +737,7 @@ OPENCV_HAL_IMPL_RVV_LOADSTORE_OP(v_float64x2, vfloat64m1_t, double, 1, 2, 64, f6
 
 inline v_int8x16 v_load_halves(const schar* ptr0, const schar* ptr1)
 {
-    schar CV_DECL_ALIGNED(32) elems[16] =
+    schar elems[16] =
     {
         ptr0[0], ptr0[1], ptr0[2], ptr0[3], ptr0[4], ptr0[5], ptr0[6], ptr0[7],
         ptr1[0], ptr1[1], ptr1[2], ptr1[3], ptr1[4], ptr1[5], ptr1[6], ptr1[7]
@@ -748,7 +748,7 @@ inline v_uint8x16 v_load_halves(const uchar* ptr0, const uchar* ptr1) { return v
```

Review comment:
Just removal of `CV_DECL_ALIGNED(32)` modifier is a bad idea. I believe you have asked to remove usage of memory buffer. BTW, modern compilers are smart enough to eliminate unnecessary memory operations. Check generated assembly code of some test function to see result.
**File:** modules/core/CMakeLists.txt
**Change Type:** modified
**Context:** PR #20392: AArch64 semihosting

**Code Changes:**
```diff
@@ -157,6 +157,10 @@ if(OPENCV_DISABLE_THREAD_SUPPORT)
   ocv_target_compile_definitions(${the_module} PUBLIC "OPENCV_DISABLE_THREAD_SUPPORT=1")
 endif()
 
+if(OPENCV_SEMIHOSTING)
+  ocv_target_compile_definitions(${the_module} PRIVATE "-DOPENCV_SEMIHOSTING")
+endif(OPENCV_SEMIHOSTING)
+
 if(HAVE_HPX)
   ocv_target_link_libraries(${the_module} LINK_PRIVATE "${HPX_LIBRARIES}")
```

Review comment:
- Prefix `CV_` => `OPENCV_` - no space after if: `if(...)` (it is CMake not C++) - reuse `OPENCV_DISABLE_THREAD_SUPPORT` approach (probably as `PRIVATE`)
**File:** platforms/semihosting/include/aarch64_semihosting_port.hpp
**Change Type:** added
**Context:** PR #20392: AArch64 semihosting

**Code Changes:**
```diff
@@ -0,0 +1,42 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#ifndef AARCH64_BAREMETAL_PORT_HPP
+#define AARCH64_BAREMETAL_PORT_HPP
+
+#include <malloc.h> // Needed for `memalign`.
+#include <sys/errno.h> // Needed for `ENOMEM`.
```

Review comment:
Please keep license header "as is" without extra modifications
**File:** samples/CMakeLists.txt
**Change Type:** modified
**Context:** PR #20392: AArch64 semihosting

**Code Changes:**
```diff
@@ -45,7 +45,12 @@ endif()
 if(INSTALL_PYTHON_EXAMPLES)
   add_subdirectory(python)
 endif()
-
+# The examples in this folder will work with a semihosting version of
+# OpenCV. For more information about semihosting, see
+# https://developer.arm.com/documentation/100863/latest
+if(OPENCV_SEMIHOSTING)
+  add_subdirectory(semihosting)
```

Review comment:
put this under "if" condition
**File:** samples/semihosting/norm/norm.cpp
**Change Type:** added
**Context:** PR #20392: AArch64 semihosting

**Code Changes:**
```diff
@@ -0,0 +1,33 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+
+#include <opencv2/core.hpp>
+#include <opencv2/imgcodecs.hpp>
+
+#include <cstdint>
+#include <array>
```

Review comment:
unnecessary double space before comma
**File:** samples/semihosting/norm/norm.cpp
**Change Type:** added
**Context:** PR #20392: AArch64 semihosting
**Review Line:** 32

**Code Changes:**
```diff
+    for(int i=0; i < no_runs; i++){
+        std::cout << "Running iteration # "<< i << std::endl;
+        cv::norm(src);
+    }
+
+    return 0;
+}
```

Review comment:
it makes sense to print something
**File:** platforms/semihosting/aarch64-semihosting.toolchain.cmake
**Change Type:** added
**Context:** PR #20392: AArch64 semihosting

**Code Changes:**
```diff
@@ -0,0 +1,40 @@
+# This file is part of OpenCV project.
+# It is subject to the license terms in the LICENSE file found in the top-level directory
+# of this distribution and at http://opencv.org/license.html
+
+set(CMAKE_SYSTEM_NAME               Generic)
+set(CMAKE_SYSTEM_PROCESSOR          AArch64)
+
+set(CMAKE_TRY_COMPILE_TARGET_TYPE   STATIC_LIBRARY)
+
```

Review comment:
It makes sense to handle that in dedicated .cmake file similar to OPENCV_DISABLE_THREAD_SUPPORT.cmake (also some of these variables are already handled by OPENCV_DISABLE_THREAD_SUPPORT flag)
**File:** platforms/semihosting/include/aarch64_semihosting_port.hpp
**Change Type:** added
**Context:** PR #20392: AArch64 semihosting

**Code Changes:**
```diff
@@ -0,0 +1,42 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#ifndef AARCH64_BAREMETAL_PORT_HPP
+#define AARCH64_BAREMETAL_PORT_HPP
+
+#include <malloc.h> // Needed for `memalign`.
+#include <sys/errno.h> // Needed for `ENOMEM`.
```

Review comment:
Sure - may I ask you to provide the exact text, to make sure we don't have to reiterate on this?
**File:** platforms/semihosting/include/aarch64_semihosting_port.hpp
**Change Type:** added
**Context:** PR #20392: AArch64 semihosting

**Code Changes:**
```diff
@@ -0,0 +1,42 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#ifndef AARCH64_BAREMETAL_PORT_HPP
+#define AARCH64_BAREMETAL_PORT_HPP
+
+#include <malloc.h> // Needed for `memalign`.
+#include <sys/errno.h> // Needed for `ENOMEM`.
```

Review comment:
https://github.com/opencv/opencv/wiki/Coding_Style_Guide#file-structure
**File:** samples/semihosting/histogram/histogram.cpp
**Change Type:** added
**Context:** PR #20392: AArch64 semihosting

**Code Changes:**
```diff
@@ -0,0 +1,43 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+
+#include <opencv2/imgproc.hpp>
+#include <opencv2/imgcodecs.hpp>
+
+#include <cstdint>
+#include <array>
```

Review comment:
`cv::IMREAD_GRAYSCALE` -- wrong cv::Mat type.
**File:** samples/semihosting/include/CMakeLists.txt
**Change Type:** added
**Context:** PR #20392: AArch64 semihosting

**Code Changes:**
```diff
@@ -0,0 +1,16 @@
+# Populate a C array with random data.
+set(RAW_PIXELS_SIZE 102400)
+set(RAW_PIXELS_HEADER ${CMAKE_CURRENT_BINARY_DIR}/raw_pixels.hpp)
+set(RAW_PIXELS_HEADER_IN ${CMAKE_CURRENT_SOURCE_DIR}/raw_pixels.hpp.in)
+
+set(RAW_PIXEL_VALUES "")
+# Seed the random number generator.
+string(RANDOM LENGTH 8 ALPHABET 0123456789abcdf RANDOM_SEED 314 number)
+math(EXPR LOOP_RANGE "${RAW_PIXELS_SIZE} - 1")
```

Review comment:
I propose to use template and fill options/random values. https://cmake.org/cmake/help/latest/command/configure_file.html. It's readable and easy to modify.
**File:** samples/semihosting/histogram/histogram.cpp
**Change Type:** added
**Context:** PR #20392: AArch64 semihosting

**Code Changes:**
```diff
@@ -0,0 +1,43 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+
+#include <opencv2/imgproc.hpp>
+#include <opencv2/imgcodecs.hpp>
+
+#include <cstdint>
+#include <array>
```

Review comment:
oh - what would be the right type?
**File:** samples/semihosting/include/CMakeLists.txt
**Change Type:** added
**Context:** PR #20392: AArch64 semihosting

**Code Changes:**
```diff
@@ -0,0 +1,16 @@
+# Populate a C array with random data.
+set(RAW_PIXELS_SIZE 102400)
+set(RAW_PIXELS_HEADER ${CMAKE_CURRENT_BINARY_DIR}/raw_pixels.hpp)
+set(RAW_PIXELS_HEADER_IN ${CMAKE_CURRENT_SOURCE_DIR}/raw_pixels.hpp.in)
+
+set(RAW_PIXEL_VALUES "")
+# Seed the random number generator.
+string(RANDOM LENGTH 8 ALPHABET 0123456789abcdf RANDOM_SEED 314 number)
+math(EXPR LOOP_RANGE "${RAW_PIXELS_SIZE} - 1")
```

Review comment:
Just to make sure I understand: 1. Have a header file that has the setting of the variable, something like: ``` #ifndef RAW_PIXELS_HPP #define RAW_PIXELS_HPP static std::uint32_t raw_pixels[RAW_PIXELS_SIZE + 1] = { __SOME_MACRO }; #endif //RAW_PIXELS_HPP ``` 2. Use the `string(RANDOM LENGTH ...` facility to populate a variable, say `RANDOM_PIXELS` in cmake with all the random integers. 3. Use https://cmake.org/cmake/help/latest/command/configure_file.html to define `__SOME_MACRO` as `RANDOM_PIXEL`. I like the idea (I agree it will make it easier to modify), I am just making sure my understanding is correct.
**File:** samples/semihosting/histogram/histogram.cpp
**Change Type:** added
**Context:** PR #20392: AArch64 semihosting

**Code Changes:**
```diff
@@ -0,0 +1,43 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+
+#include <opencv2/imgproc.hpp>
+#include <opencv2/imgcodecs.hpp>
+
+#include <cstdint>
+#include <array>
```

Review comment:
it should be `CV_8UC1`, if it's grayscale matrix.
**File:** samples/semihosting/histogram/histogram.cpp
**Change Type:** added
**Context:** PR #20392: AArch64 semihosting

**Code Changes:**
```diff
@@ -0,0 +1,43 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+
+#include <opencv2/imgproc.hpp>
+#include <opencv2/imgcodecs.hpp>
+
+#include <cstdint>
+#include <array>
```

Review comment:
Like this? ``` cv::Mat src_new(IMG_ROWS, IMG_COLS, CV_8UC1, (void *)raw_pixels); ```