nareshmlx/opencv-pr huggingface dataset:
**File:** samples/cpp/facedetect.cpp
**Change Type:** modified
**Context:** PR #16652: Using argv[0] represent binary executable files' name in help() function in sample codes instead of cpp files' name.

**Code Changes:**
```diff
@@ -7,19 +7,21 @@
 using namespace std;
 using namespace cv;
 
-static void help()
+static void help(const char** argv)
 {
     cout << "\nThis program demonstrates the use of cv::CascadeClassifier class to detect objects (Face + eyes). You can use Haar or LBP features.\n"
             "This classifier can recognize many kinds of rigid objects, once the appropriate classifier is trained.\n"
             "It's most known use is for faces.\n"
```

Review comment:
There is no such `.cmd` file in the repository, please remove it from help message.
**File:** samples/cpp/select3dobj.cpp
**Change Type:** modified
**Context:** PR #16652: Using argv[0] represent binary executable files' name in help() function in sample codes instead of cpp files' name.

**Code Changes:**
```diff
@@ -19,48 +19,51 @@
 #include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string>
 
 using namespace std;
 using namespace cv;
 
-const char* helphelp =
```

Review comment:
You can wrap the first part of message with `std::string()` and not introduce extra empty line.
**File:** samples/cpp/select3dobj.cpp
**Change Type:** modified
**Context:** PR #16652: Using argv[0] represent binary executable files' name in help() function in sample codes instead of cpp files' name.

**Code Changes:**
```diff
@@ -19,48 +19,51 @@
 #include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string>
 
 using namespace std;
 using namespace cv;
 
-const char* helphelp =
```

Review comment:
Thinks a lot. I will continue improving these problems.
**File:** samples/cpp/facedetect.cpp
**Change Type:** modified
**Context:** PR #16652: Using argv[0] represent binary executable files' name in help() function in sample codes instead of cpp files' name.

**Code Changes:**
```diff
@@ -7,19 +7,21 @@
 using namespace std;
 using namespace cv;
 
-static void help()
+static void help(const char** argv)
 {
     cout << "\nThis program demonstrates the use of cv::CascadeClassifier class to detect objects (Face + eyes). You can use Haar or LBP features.\n"
             "This classifier can recognize many kinds of rigid objects, once the appropriate classifier is trained.\n"
             "It's most known use is for faces.\n"
```

Review comment:
The line is redundant. Original help message mentioned `facedetect.cmd` file, but there is no such file in the repository now. Please, replace `"see " << argv[0] << " for one call:\n"` with something like `"example:\n"` and the following command line.
**File:** modules/dnn/test/test_model.cpp
**Change Type:** modified
**Context:** PR #16225: dnn: small fix in pose estimation model - resolves #16204 , if merged with https://github.com/opencv/opencv_extra/pull/692 insert (-1,-1) k...

**Code Changes:**
```diff
@@ -273,9 +273,15 @@ TEST_P(Test_Model, Keypoints_pose)
 #endif
 
     Mat inp = imread(_tf("pose.png"));
-    std::string weights = _tf("onnx/models/lightweight_pose_estimation.onnx", false);
-    Mat exp = blobFromNPY(_tf("keypoints_exp.npy"));
-
+    std::string weights = _tf("onnx/models/lightweight_pose_estimation_201912.onnx", false);
+    float kpdata[] = {
+        237.65625f, 78.25f, 237.65625f, 136.9375f,
```

Review comment:
Keep `onnx/models`. Model is not updated yet through `download_models.py` - this not fully automated process. ETA 10-20min - need to scan SHA of several Gb (on all build machines).
**File:** modules/dnn/test/test_model.cpp
**Change Type:** modified
**Context:** PR #16225: dnn: small fix in pose estimation model - resolves #16204 , if merged with https://github.com/opencv/opencv_extra/pull/692 insert (-1,-1) k...
**Review Line:** 276

**Code Changes:**
```diff
 
     Mat inp = imread(_tf("pose.png"));
-    std::string weights = _tf("onnx/models/lightweight_pose_estimation.onnx", false);
-    Mat exp = blobFromNPY(_tf("keypoints_exp.npy"));
-
+    std::string weights = _tf("onnx/models/lightweight_pose_estimation_201912.onnx", false);
+    float kpdata[] = {
+        237.65625f, 78.25f, 237.65625f, 136.9375f,
+        190.125f, 136.9375f, 142.59375f, 195.625f, 79.21875f, 176.0625f, 285.1875f, 117.375f,
+        348.5625f, 195.625f, 396.09375f, 176.0625f, 205.96875f, 313.0f, 205.96875f, 430.375f,
+        205.96875f, 528.1875f, 269.34375f, 293.4375f, 253.5f, 430.375f, 237.65625f, 528.1875f,
```

Review comment:
So may I ask you to highlight once again the difference comparing previous version?
**File:** modules/dnn/test/test_model.cpp
**Change Type:** modified
**Context:** PR #16225: dnn: small fix in pose estimation model - resolves #16204 , if merged with https://github.com/opencv/opencv_extra/pull/692 insert (-1,-1) k...

**Code Changes:**
```diff
@@ -273,9 +273,15 @@ TEST_P(Test_Model, Keypoints_pose)
 #endif
 
     Mat inp = imread(_tf("pose.png"));
-    std::string weights = _tf("onnx/models/lightweight_pose_estimation.onnx", false);
-    Mat exp = blobFromNPY(_tf("keypoints_exp.npy"));
-
+    std::string weights = _tf("onnx/models/lightweight_pose_estimation_201912.onnx", false);
+    float kpdata[] = {
+        237.65625f, 78.25f, 237.65625f, 136.9375f,
```

Review comment:
Let's keep `facial_keypoints_exp.npy`
**File:** modules/dnn/test/test_model.cpp
**Change Type:** modified
**Context:** PR #16225: dnn: small fix in pose estimation model - resolves #16204 , if merged with https://github.com/opencv/opencv_extra/pull/692 insert (-1,-1) k...

**Code Changes:**
```diff
@@ -273,9 +273,15 @@ TEST_P(Test_Model, Keypoints_pose)
 #endif
 
     Mat inp = imread(_tf("pose.png"));
-    std::string weights = _tf("onnx/models/lightweight_pose_estimation.onnx", false);
-    Mat exp = blobFromNPY(_tf("keypoints_exp.npy"));
-
+    std::string weights = _tf("onnx/models/lightweight_pose_estimation_201912.onnx", false);
+    float kpdata[] = {
+        237.65625f, 78.25f, 237.65625f, 136.9375f,
```

Review comment:
ok, i'll do that. should i change to the new model, containing concatenated heat&paf maps, and add some code to model.cpp like: ``` // slice output, if it's the lightweight_human_pose one, or the openpose model with original prototxt if (nPoints == 57) { nPoints = 19; } ``` or keep it as is (model w. 19 heatmaps, code unchanged) ?
**File:** modules/dnn/test/test_model.cpp
**Change Type:** modified
**Context:** PR #16225: dnn: small fix in pose estimation model - resolves #16204 , if merged with https://github.com/opencv/opencv_extra/pull/692 insert (-1,-1) k...

**Code Changes:**
```diff
@@ -273,9 +273,15 @@ TEST_P(Test_Model, Keypoints_pose)
 #endif
 
     Mat inp = imread(_tf("pose.png"));
-    std::string weights = _tf("onnx/models/lightweight_pose_estimation.onnx", false);
-    Mat exp = blobFromNPY(_tf("keypoints_exp.npy"));
-
+    std::string weights = _tf("onnx/models/lightweight_pose_estimation_201912.onnx", false);
+    float kpdata[] = {
+        237.65625f, 78.25f, 237.65625f, 136.9375f,
```

Review comment:
I think it's better to keep as is for now. It's easier for user to process output.
**File:** modules/core/src/parallel.cpp
**Change Type:** modified
**Context:** PR #16457: Fixed getCPUCount | Issue #16268 -  #### This pullrequest changes Fixed getCPUCount to account for cgroups. Added common code to parse CPU ...

**Code Changes:**
```diff
@@ -58,13 +58,20 @@
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+    #include <fstream>
     #if defined __ANDROID__
         #include <sys/sysconf.h>
+        #include <sys/syscall.h>
+        #include <sched.h>
     #elif defined __APPLE__
```

Review comment:
This is cgroup v1 files, for v2 it will be different: http://man7.org/linux/man-pages/man7/cgroups.7.html https://wiki.archlinux.org/index.php/cgroups Shouldn't we first determine cgroup of current process and then use it in the path?
**File:** modules/core/src/parallel.cpp
**Change Type:** modified
**Context:** PR #16457: Fixed getCPUCount | Issue #16268 -  #### This pullrequest changes Fixed getCPUCount to account for cgroups. Added common code to parse CPU ...

**Code Changes:**
```diff
@@ -58,13 +58,20 @@
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+    #include <fstream>
     #if defined __ANDROID__
         #include <sys/sysconf.h>
+        #include <sys/syscall.h>
+        #include <sched.h>
     #elif defined __APPLE__
```

Review comment:
Does HAIKU and EMSCRIPTEN have cgroups at all?
**File:** modules/core/src/parallel.cpp
**Change Type:** modified
**Context:** PR #16457: Fixed getCPUCount | Issue #16268 -  #### This pullrequest changes Fixed getCPUCount to account for cgroups. Added common code to parse CPU ...

**Code Changes:**
```diff
@@ -58,13 +58,20 @@
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+    #include <fstream>
     #if defined __ANDROID__
         #include <sys/sysconf.h>
+        #include <sys/syscall.h>
+        #include <sched.h>
     #elif defined __APPLE__
```

Review comment:
> In dockers, this file is a single number It can be anything: ``` docker run -it --cpuset-cpus 1-2,5 ubuntu:18.04 # cat /sys/fs/cgroup/cpuset/cpuset.cpus 1-2,5 ```
**File:** modules/core/src/parallel.cpp
**Change Type:** modified
**Context:** PR #16457: Fixed getCPUCount | Issue #16268 -  #### This pullrequest changes Fixed getCPUCount to account for cgroups. Added common code to parse CPU ...

**Code Changes:**
```diff
@@ -58,13 +58,20 @@
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+    #include <fstream>
     #if defined __ANDROID__
         #include <sys/sysconf.h>
+        #include <sys/syscall.h>
+        #include <sched.h>
     #elif defined __APPLE__
```

Review comment:
Please refactor very long lines like this one. We have soft limitation of 100 columns.
**File:** modules/core/src/parallel.cpp
**Change Type:** modified
**Context:** PR #16457: Fixed getCPUCount | Issue #16268 -  #### This pullrequest changes Fixed getCPUCount to account for cgroups. Added common code to parse CPU ...

**Code Changes:**
```diff
@@ -58,13 +58,20 @@
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+    #include <fstream>
     #if defined __ANDROID__
         #include <sys/sysconf.h>
+        #include <sys/syscall.h>
+        #include <sched.h>
     #elif defined __APPLE__
```

Review comment:
I think it is better to restore previous behavior for HAIKU and EMSCRIPTEN cases.
**File:** modules/core/src/parallel.cpp
**Change Type:** modified
**Context:** PR #16457: Fixed getCPUCount | Issue #16268 -  #### This pullrequest changes Fixed getCPUCount to account for cgroups. Added common code to parse CPU ...

**Code Changes:**
```diff
@@ -58,13 +58,20 @@
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+    #include <fstream>
     #if defined __ANDROID__
         #include <sys/sysconf.h>
+        #include <sys/syscall.h>
+        #include <sched.h>
     #elif defined __APPLE__
```

Review comment:
I've rebooted with `cgroup_no_v1=all` option and this path is not available anymore: ``` $ ls /sys/fs/cgroup/ blkio cpuset freezer memory perf_event rdma unified cpu,cpuacct devices hugetlb net_cls,net_prio pids systemd $ ls /sys/fs/cgroup/cpuset/ ``` I think we should have fallback to previous method if it is not readable.
**File:** modules/core/src/parallel.cpp
**Change Type:** modified
**Context:** PR #16457: Fixed getCPUCount | Issue #16268 -  #### This pullrequest changes Fixed getCPUCount to account for cgroups. Added common code to parse CPU ...

**Code Changes:**
```diff
@@ -58,13 +58,20 @@
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+    #include <fstream>
     #if defined __ANDROID__
         #include <sys/sysconf.h>
+        #include <sys/syscall.h>
+        #include <sched.h>
     #elif defined __APPLE__
```

Review comment:
I thought just `3` or `4` means one CPU with this id.
**File:** modules/core/src/parallel.cpp
**Change Type:** modified
**Context:** PR #16457: Fixed getCPUCount | Issue #16268 -  #### This pullrequest changes Fixed getCPUCount to account for cgroups. Added common code to parse CPU ...

**Code Changes:**
```diff
@@ -58,13 +58,20 @@
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+    #include <fstream>
     #if defined __ANDROID__
         #include <sys/sysconf.h>
+        #include <sys/syscall.h>
+        #include <sched.h>
     #elif defined __APPLE__
```

Review comment:
Oh cool, sounds good. I'll remove HAIKU and EMSCRIPTEN. I'll return 0 if the file is absent and handle.
**File:** modules/core/src/parallel.cpp
**Change Type:** modified
**Context:** PR #16457: Fixed getCPUCount | Issue #16268 -  #### This pullrequest changes Fixed getCPUCount to account for cgroups. Added common code to parse CPU ...

**Code Changes:**
```diff
@@ -58,13 +58,20 @@
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+    #include <fstream>
     #if defined __ANDROID__
         #include <sys/sysconf.h>
+        #include <sys/syscall.h>
+        #include <sched.h>
     #elif defined __APPLE__
```

Review comment:
Exactly what I thought too, you can try alpine, it gives count, surprised me as well.
**File:** modules/core/src/parallel.cpp
**Change Type:** modified
**Context:** PR #16457: Fixed getCPUCount | Issue #16268 -  #### This pullrequest changes Fixed getCPUCount to account for cgroups. Added common code to parse CPU ...

**Code Changes:**
```diff
@@ -58,13 +58,20 @@
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+    #include <fstream>
     #if defined __ANDROID__
         #include <sys/sysconf.h>
+        #include <sys/syscall.h>
+        #include <sched.h>
     #elif defined __APPLE__
```

Review comment:
``` docker run -v $PWD:/var/tmp --cpuset-cpus=3 -it alpine sh / # cat /sys/fs/cgroup/cpuset/cpuset.cpus 3 ``` ``` docker run -v $PWD:/var/tmp --cpuset-cpus=4 -it alpine sh / # cat /sys/fs/cgroup/cpuset/cpuset.cpus 4 ```
**File:** modules/core/src/parallel.cpp
**Change Type:** modified
**Context:** PR #16457: Fixed getCPUCount | Issue #16268 -  #### This pullrequest changes Fixed getCPUCount to account for cgroups. Added common code to parse CPU ...

**Code Changes:**
```diff
@@ -58,13 +58,20 @@
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+    #include <fstream>
     #if defined __ANDROID__
         #include <sys/sysconf.h>
+        #include <sys/syscall.h>
+        #include <sched.h>
     #elif defined __APPLE__
```

Review comment:
What does it show? You set cpuset-cpus and get exactly what you've passed. ``` --cpus decimal Number of CPUs --cpuset-cpus string CPUs in which to allow execution (0-3, 0,1) ``` Docker image does not matter, kernel from the host system is used in containers.
**File:** modules/core/src/parallel.cpp
**Change Type:** modified
**Context:** PR #16457: Fixed getCPUCount | Issue #16268 -  #### This pullrequest changes Fixed getCPUCount to account for cgroups. Added common code to parse CPU ...

**Code Changes:**
```diff
@@ -58,13 +58,20 @@
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+    #include <fstream>
     #if defined __ANDROID__
         #include <sys/sysconf.h>
+        #include <sys/syscall.h>
+        #include <sched.h>
     #elif defined __APPLE__
```

Review comment:
I haven't removed Haiku and emscripten to avoid extra # ifs and a possibility of the file existing, but handled it logically.
**File:** modules/core/src/parallel.cpp
**Change Type:** modified
**Context:** PR #16457: Fixed getCPUCount | Issue #16268 -  #### This pullrequest changes Fixed getCPUCount to account for cgroups. Added common code to parse CPU ...

**Code Changes:**
```diff
@@ -58,13 +58,20 @@
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+    #include <fstream>
     #if defined __ANDROID__
         #include <sys/sysconf.h>
+        #include <sys/syscall.h>
+        #include <sched.h>
     #elif defined __APPLE__
```

Review comment:
This will not be considered `static initialization` and will be performed each time, so making `cfs_quota` static does not make sense. Same comment applies to several other variables.
**File:** modules/core/src/parallel.cpp
**Change Type:** modified
**Context:** PR #16457: Fixed getCPUCount | Issue #16268 -  #### This pullrequest changes Fixed getCPUCount to account for cgroups. Added common code to parse CPU ...

**Code Changes:**
```diff
@@ -58,13 +58,20 @@
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+    #include <fstream>
     #if defined __ANDROID__
         #include <sys/sysconf.h>
+        #include <sys/syscall.h>
+        #include <sched.h>
     #elif defined __APPLE__
```

Review comment:
Maybe will be better to use `std::string` and `ifstream` instead of mixing C (`fopen`) and C++ (`stringstream`) APIs?
**File:** modules/core/src/parallel.cpp
**Change Type:** modified
**Context:** PR #16457: Fixed getCPUCount | Issue #16268 -  #### This pullrequest changes Fixed getCPUCount to account for cgroups. Added common code to parse CPU ...

**Code Changes:**
```diff
@@ -58,13 +58,20 @@
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+    #include <fstream>
     #if defined __ANDROID__
         #include <sys/sysconf.h>
+        #include <sys/syscall.h>
+        #include <sched.h>
     #elif defined __APPLE__
```

Review comment:
Instead of repeating this long preprocessor check wouldn't it be better to define a new one: ```.cpp #if defined __linux__ || defined __GLIBC__ || defined __HAIKU__ || defined __EMSCRIPTEN__ #define CV_HAVE_CGROUP_V1 #endif ... #ifdef CV_HAVE_CGROUP_V1 ... #endif ```
**File:** modules/core/src/parallel.cpp
**Change Type:** modified
**Context:** PR #16457: Fixed getCPUCount | Issue #16268 -  #### This pullrequest changes Fixed getCPUCount to account for cgroups. Added common code to parse CPU ...
**Review Line:** 797

**Code Changes:**
```diff
@@ -58,13 +58,20 @@
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+    #include <fstream>
     #if defined __ANDROID__
         #include <sys/sysconf.h>
+        #include <sys/syscall.h>
+        #include <sched.h>
     #elif defined __APPLE__
         #include <sys/sysctl.h>
     #endif
 #endif
 
+#if defined CV_CXX11
```

Review comment:
Why was it removed? Perhaps this value can be used if others are absent.
**File:** modules/core/src/parallel.cpp
**Change Type:** modified
**Context:** PR #16457: Fixed getCPUCount | Issue #16268 -  #### This pullrequest changes Fixed getCPUCount to account for cgroups. Added common code to parse CPU ...

**Code Changes:**
```diff
@@ -58,13 +58,20 @@
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+    #include <fstream>
     #if defined __ANDROID__
         #include <sys/sysconf.h>
+        #include <sys/syscall.h>
+        #include <sched.h>
     #elif defined __APPLE__
```

Review comment:
Shouldn't both stringstreams be checked for errors? `cfs_period` value should be checked for correctness too.
**File:** modules/core/src/parallel.cpp
**Change Type:** modified
**Context:** PR #16457: Fixed getCPUCount | Issue #16268 -  #### This pullrequest changes Fixed getCPUCount to account for cgroups. Added common code to parse CPU ...

**Code Changes:**
```diff
@@ -58,13 +58,20 @@
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+    #include <fstream>
     #if defined __ANDROID__
         #include <sys/sysconf.h>
+        #include <sys/syscall.h>
+        #include <sched.h>
     #elif defined __APPLE__
```

Review comment:
Looks like this API is only available on Linux and only in case when `_GNU_SOURCE` is enabled: https://linux.die.net/man/2/sched_getaffinity Function call should be checked for errors. On my platform `std::thread::hardware_concurrency` returns 8, thus affinity check is effectively disabled.
**File:** modules/core/src/parallel.cpp
**Change Type:** modified
**Context:** PR #16457: Fixed getCPUCount | Issue #16268 -  #### This pullrequest changes Fixed getCPUCount to account for cgroups. Added common code to parse CPU ...

**Code Changes:**
```diff
@@ -58,13 +58,20 @@
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+    #include <fstream>
     #if defined __ANDROID__
         #include <sys/sysconf.h>
+        #include <sys/syscall.h>
+        #include <sched.h>
     #elif defined __APPLE__
```

Review comment:
Wouldn't `CV_CXX11` macro work here?
**File:** modules/core/src/parallel.cpp
**Change Type:** modified
**Context:** PR #16457: Fixed getCPUCount | Issue #16268 -  #### This pullrequest changes Fixed getCPUCount to account for cgroups. Added common code to parse CPU ...

**Code Changes:**
```diff
@@ -58,13 +58,20 @@
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+    #include <fstream>
     #if defined __ANDROID__
         #include <sys/sysconf.h>
+        #include <sys/syscall.h>
+        #include <sched.h>
     #elif defined __APPLE__
```

Review comment:
I seem to have missed this, I'll add it
**File:** modules/core/src/parallel.cpp
**Change Type:** modified
**Context:** PR #16457: Fixed getCPUCount | Issue #16268 -  #### This pullrequest changes Fixed getCPUCount to account for cgroups. Added common code to parse CPU ...

**Code Changes:**
```diff
@@ -58,13 +58,20 @@
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+    #include <fstream>
     #if defined __ANDROID__
         #include <sys/sysconf.h>
+        #include <sys/syscall.h>
+        #include <sched.h>
     #elif defined __APPLE__
```

Review comment:
`500 / 1000` should result in thread limit equals to `1` instead of ignoring through `0`.
**File:** modules/core/src/parallel.cpp
**Change Type:** modified
**Context:** PR #16457: Fixed getCPUCount | Issue #16268 -  #### This pullrequest changes Fixed getCPUCount to account for cgroups. Added common code to parse CPU ...

**Code Changes:**
```diff
@@ -58,13 +58,20 @@
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+    #include <fstream>
     #if defined __ANDROID__
         #include <sys/sysconf.h>
+        #include <sys/syscall.h>
+        #include <sched.h>
     #elif defined __APPLE__
```

Review comment:
> return ncpus != 0 ? ncpus : 1; > return ncpus != 0 ? ncpus : 1; > return ncpus != 0 ? ncpus : 1; > return ncpus != 0 ? ncpus : 1; > return concurentThreadsSupported != 0 ? concurentThreadsSupported : 1; There are 5 similar returns above. Please make return once. Rename `concurentThreadsSupported` => `ncpus` to reduce code.
**File:** modules/core/src/parallel.cpp
**Change Type:** modified
**Context:** PR #16457: Fixed getCPUCount | Issue #16268 -  #### This pullrequest changes Fixed getCPUCount to account for cgroups. Added common code to parse CPU ...

**Code Changes:**
```diff
@@ -58,13 +58,20 @@
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+    #include <fstream>
     #if defined __ANDROID__
         #include <sys/sysconf.h>
+        #include <sys/syscall.h>
+        #include <sched.h>
     #elif defined __APPLE__
```

Review comment:
```.diff -std::stringstream +std::istringstream ```
**File:** modules/core/src/parallel.cpp
**Change Type:** modified
**Context:** PR #16457: Fixed getCPUCount | Issue #16268 -  #### This pullrequest changes Fixed getCPUCount to account for cgroups. Added common code to parse CPU ...

**Code Changes:**
```diff
@@ -58,13 +58,20 @@
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+    #include <fstream>
     #if defined __ANDROID__
         #include <sys/sysconf.h>
+        #include <sys/syscall.h>
+        #include <sched.h>
     #elif defined __APPLE__
```

Review comment:
`__EMSCRIPTEN__` doesn't have cgroups.