diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2022-11-25 16:46:24 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-25 16:46:24 -0300 |
commit | 2375425cd54f9ac293ccd60ed9350f9b4c6db20e (patch) | |
tree | 5b916f4ec1d6355299d992fdec880afea6ef6b18 /recipes-support/opencv/opencv/OpenCV_DNN_examples.patch | |
parent | f1da32b14f595446242422cea762aa9a81261917 (diff) | |
parent | 5554647fa199375fb8e1aef657d5ff74ac115022 (diff) | |
download | meta-freescale-2375425cd54f9ac293ccd60ed9350f9b4c6db20e.tar.gz |
Merge pull request #1310 from MaxKrummenacher/master
Upgrade Multimedia Packages to lf5.15.52_2.1.0
Diffstat (limited to 'recipes-support/opencv/opencv/OpenCV_DNN_examples.patch')
-rw-r--r-- | recipes-support/opencv/opencv/OpenCV_DNN_examples.patch | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/recipes-support/opencv/opencv/OpenCV_DNN_examples.patch b/recipes-support/opencv/opencv/OpenCV_DNN_examples.patch index 0e83e994..ef7831a5 100644 --- a/recipes-support/opencv/opencv/OpenCV_DNN_examples.patch +++ b/recipes-support/opencv/opencv/OpenCV_DNN_examples.patch | |||
@@ -31,7 +31,7 @@ Index: git/samples/dnn/classification.cpp | |||
31 | =================================================================== | 31 | =================================================================== |
32 | --- git.orig/samples/dnn/classification.cpp | 32 | --- git.orig/samples/dnn/classification.cpp |
33 | +++ git/samples/dnn/classification.cpp | 33 | +++ git/samples/dnn/classification.cpp |
34 | @@ -11,6 +11,7 @@ std::string keys = | 34 | @@ -12,6 +12,7 @@ std::string keys = |
35 | "{ help h | | Print help message. }" | 35 | "{ help h | | Print help message. }" |
36 | "{ @alias | | An alias name of model to extract preprocessing parameters from models.yml file. }" | 36 | "{ @alias | | An alias name of model to extract preprocessing parameters from models.yml file. }" |
37 | "{ zoo | models.yml | An optional path to file with preprocessing parameters }" | 37 | "{ zoo | models.yml | An optional path to file with preprocessing parameters }" |
@@ -39,7 +39,7 @@ Index: git/samples/dnn/classification.cpp | |||
39 | "{ input i | | Path to input image or video file. Skip this argument to capture frames from a camera.}" | 39 | "{ input i | | Path to input image or video file. Skip this argument to capture frames from a camera.}" |
40 | "{ initial_width | 0 | Preprocess input image by initial resizing to a specific width.}" | 40 | "{ initial_width | 0 | Preprocess input image by initial resizing to a specific width.}" |
41 | "{ initial_height | 0 | Preprocess input image by initial resizing to a specific height.}" | 41 | "{ initial_height | 0 | Preprocess input image by initial resizing to a specific height.}" |
42 | @@ -102,7 +103,7 @@ int main(int argc, char** argv) | 42 | @@ -113,7 +114,7 @@ int main(int argc, char** argv) |
43 | if (parser.has("input")) | 43 | if (parser.has("input")) |
44 | cap.open(parser.get<String>("input")); | 44 | cap.open(parser.get<String>("input")); |
45 | else | 45 | else |
@@ -48,19 +48,21 @@ Index: git/samples/dnn/classification.cpp | |||
48 | //! [Open a video file or an image file or a camera stream] | 48 | //! [Open a video file or an image file or a camera stream] |
49 | 49 | ||
50 | // Process frames. | 50 | // Process frames. |
51 | @@ -151,13 +152,13 @@ int main(int argc, char** argv) | 51 | @@ -195,14 +196,14 @@ int main(int argc, char** argv) |
52 | double freq = getTickFrequency() / 1000; | 52 | } |
53 | double t = net.getPerfProfile(layersTimes) / freq; | 53 | std::string label = format("Inference time of 1 round: %.2f ms", t1); |
54 | std::string label = format("Inference time: %.2f ms", t); | 54 | std::string label2 = format("Average time of 200 rounds: %.2f ms", timeRecorder.getTimeMilli()/200); |
55 | - putText(frame, label, Point(0, 15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0)); | 55 | - putText(frame, label, Point(0, 15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0)); |
56 | - putText(frame, label2, Point(0, 35), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0)); | ||
56 | + putText(frame, label, Point(0, 20), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false); | 57 | + putText(frame, label, Point(0, 20), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false); |
58 | + putText(frame, label2, Point(0, 45), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false); | ||
57 | 59 | ||
58 | // Print predicted class. | 60 | // Print predicted class. |
59 | label = format("%s: %.4f", (classes.empty() ? format("Class #%d", classId).c_str() : | 61 | label = format("%s: %.4f", (classes.empty() ? format("Class #%d", classId).c_str() : |
60 | classes[classId].c_str()), | 62 | classes[classId].c_str()), |
61 | confidence); | 63 | confidence); |
62 | - putText(frame, label, Point(0, 40), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0)); | 64 | - putText(frame, label, Point(0, 55), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0)); |
63 | + putText(frame, label, Point(0, 45), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false); | 65 | + putText(frame, label, Point(0, 70), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false); |
64 | 66 | ||
65 | imshow(kWinName, frame); | 67 | imshow(kWinName, frame); |
66 | } | 68 | } |
@@ -68,7 +70,7 @@ Index: git/samples/dnn/object_detection.cpp | |||
68 | =================================================================== | 70 | =================================================================== |
69 | --- git.orig/samples/dnn/object_detection.cpp | 71 | --- git.orig/samples/dnn/object_detection.cpp |
70 | +++ git/samples/dnn/object_detection.cpp | 72 | +++ git/samples/dnn/object_detection.cpp |
71 | @@ -251,13 +251,13 @@ int main(int argc, char** argv) | 73 | @@ -260,13 +260,13 @@ int main(int argc, char** argv) |
72 | if (predictionsQueue.counter > 1) | 74 | if (predictionsQueue.counter > 1) |
73 | { | 75 | { |
74 | std::string label = format("Camera: %.2f FPS", framesQueue.getFPS()); | 76 | std::string label = format("Camera: %.2f FPS", framesQueue.getFPS()); |
@@ -85,7 +87,7 @@ Index: git/samples/dnn/object_detection.cpp | |||
85 | } | 87 | } |
86 | imshow(kWinName, frame); | 88 | imshow(kWinName, frame); |
87 | } | 89 | } |
88 | @@ -293,7 +293,7 @@ int main(int argc, char** argv) | 90 | @@ -302,7 +302,7 @@ int main(int argc, char** argv) |
89 | double freq = getTickFrequency() / 1000; | 91 | double freq = getTickFrequency() / 1000; |
90 | double t = net.getPerfProfile(layersTimes) / freq; | 92 | double t = net.getPerfProfile(layersTimes) / freq; |
91 | std::string label = format("Inference time: %.2f ms", t); | 93 | std::string label = format("Inference time: %.2f ms", t); |
@@ -94,7 +96,7 @@ Index: git/samples/dnn/object_detection.cpp | |||
94 | 96 | ||
95 | imshow(kWinName, frame); | 97 | imshow(kWinName, frame); |
96 | } | 98 | } |
97 | @@ -462,7 +462,7 @@ void drawPred(int classId, float conf, i | 99 | @@ -471,7 +471,7 @@ void drawPred(int classId, float conf, i |
98 | top = max(top, labelSize.height); | 100 | top = max(top, labelSize.height); |
99 | rectangle(frame, Point(left, top - labelSize.height), | 101 | rectangle(frame, Point(left, top - labelSize.height), |
100 | Point(left + labelSize.width, top + baseLine), Scalar::all(255), FILLED); | 102 | Point(left + labelSize.width, top + baseLine), Scalar::all(255), FILLED); |
@@ -107,7 +109,7 @@ Index: git/samples/dnn/segmentation.cpp | |||
107 | =================================================================== | 109 | =================================================================== |
108 | --- git.orig/samples/dnn/segmentation.cpp | 110 | --- git.orig/samples/dnn/segmentation.cpp |
109 | +++ git/samples/dnn/segmentation.cpp | 111 | +++ git/samples/dnn/segmentation.cpp |
110 | @@ -157,7 +157,7 @@ int main(int argc, char** argv) | 112 | @@ -162,7 +162,7 @@ int main(int argc, char** argv) |
111 | double freq = getTickFrequency() / 1000; | 113 | double freq = getTickFrequency() / 1000; |
112 | double t = net.getPerfProfile(layersTimes) / freq; | 114 | double t = net.getPerfProfile(layersTimes) / freq; |
113 | std::string label = format("Inference time: %.2f ms", t); | 115 | std::string label = format("Inference time: %.2f ms", t); |