summaryrefslogtreecommitdiffstats
path: root/recipes-support/opencv
diff options
context:
space:
mode:
authorTom Hochstein <tom.hochstein@nxp.com>2021-05-03 16:47:59 -0500
committerOtavio Salvador <otavio@ossystems.com.br>2021-05-04 14:06:25 -0300
commita5fc68872680f82e1e4b12d0ffd4be7b9046d372 (patch)
treef101736e04552d6c5c02024a098b968825b0a764 /recipes-support/opencv
parent0eebdde9e551e0e82684b347416d598c317e5d0a (diff)
downloadmeta-freescale-a5fc68872680f82e1e4b12d0ffd4be7b9046d372.tar.gz
opencv: Adapt patch for upgrade to 4.5.2.imx
The patch file OpenCV_DNN_examples.patch is broken after upgrading opencv to 4.5.2.imx. Fix the patch. Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
Diffstat (limited to 'recipes-support/opencv')
-rw-r--r--recipes-support/opencv/opencv/OpenCV_DNN_examples.patch45
1 files changed, 18 insertions, 27 deletions
diff --git a/recipes-support/opencv/opencv/OpenCV_DNN_examples.patch b/recipes-support/opencv/opencv/OpenCV_DNN_examples.patch
index 569d5b02..0e83e994 100644
--- a/recipes-support/opencv/opencv/OpenCV_DNN_examples.patch
+++ b/recipes-support/opencv/opencv/OpenCV_DNN_examples.patch
@@ -18,7 +18,7 @@ Index: git/samples/cpp/logistic_regression.cpp
18=================================================================== 18===================================================================
19--- git.orig/samples/cpp/logistic_regression.cpp 19--- git.orig/samples/cpp/logistic_regression.cpp
20+++ git/samples/cpp/logistic_regression.cpp 20+++ git/samples/cpp/logistic_regression.cpp
21@@ -83,7 +83,7 @@ static float calculateAccuracyPercent(co 21@@ -28,7 +28,7 @@ static float calculateAccuracyPercent(co
22 22
23 int main() 23 int main()
24 { 24 {
@@ -32,14 +32,14 @@ Index: git/samples/dnn/classification.cpp
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@@ -11,6 +11,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 }"
38+ "{ device | 0 | camera device number. }" 38+ "{ device | 0 | camera device number. }"
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 "{ framework f | | Optional name of an origin framework of the model. Detect it automatically if it does not set. }" 40 "{ initial_width | 0 | Preprocess input image by initial resizing to a specific width.}"
41 "{ classes | | Optional path to a text file with names of classes. }" 41 "{ initial_height | 0 | Preprocess input image by initial resizing to a specific height.}"
42@@ -94,7 +95,7 @@ int main(int argc, char** argv) 42@@ -102,7 +103,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,7 +48,7 @@ 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@@ -131,13 +132,13 @@ int main(int argc, char** argv) 51@@ -151,13 +152,13 @@ int main(int argc, char** argv)
52 double freq = getTickFrequency() / 1000; 52 double freq = getTickFrequency() / 1000;
53 double t = net.getPerfProfile(layersTimes) / freq; 53 double t = net.getPerfProfile(layersTimes) / freq;
54 std::string label = format("Inference time: %.2f ms", t); 54 std::string label = format("Inference time: %.2f ms", t);
@@ -120,15 +120,15 @@ Index: git/samples/dnn/text_detection.cpp
120=================================================================== 120===================================================================
121--- git.orig/samples/dnn/text_detection.cpp 121--- git.orig/samples/dnn/text_detection.cpp
122+++ git/samples/dnn/text_detection.cpp 122+++ git/samples/dnn/text_detection.cpp
123@@ -25,6 +25,7 @@ using namespace cv::dnn; 123@@ -30,6 +30,7 @@ using namespace cv::dnn;
124 const char* keys = 124 const char* keys =
125 "{ help h | | Print help message. }" 125 "{ help h | | Print help message. }"
126 "{ input i | | Path to input image or video file. Skip this argument to capture frames from a camera.}" 126 "{ input i | | Path to input image or video file. Skip this argument to capture frames from a camera.}"
127+ "{ device | 0 | camera device number. }" 127+ "{ device | 0 | camera device number. }"
128 "{ model m | | Path to a binary .pb file contains trained detector network.}" 128 "{ detModel dmp | | Path to a binary .pb file contains trained detector network.}"
129 "{ ocr | | Path to a binary .pb or .onnx file contains trained recognition network.}" 129 "{ width | 320 | Preprocess input image by resizing to a specific width. It should be multiple by 32. }"
130 "{ width | 320 | Preprocess input image by resizing to a specific width. It should be multiple by 32. }" 130 "{ height | 320 | Preprocess input image by resizing to a specific height. It should be multiple by 32. }"
131@@ -75,7 +76,7 @@ int main(int argc, char** argv) 131@@ -106,7 +107,7 @@ int main(int argc, char** argv)
132 132
133 // Open a video file or an image file or a camera stream. 133 // Open a video file or an image file or a camera stream.
134 VideoCapture cap; 134 VideoCapture cap;
@@ -137,12 +137,3 @@ Index: git/samples/dnn/text_detection.cpp
137 CV_Assert(openSuccess); 137 CV_Assert(openSuccess);
138 138
139 static const std::string kWinName = "EAST: An Efficient and Accurate Scene Text Detector"; 139 static const std::string kWinName = "EAST: An Efficient and Accurate Scene Text Detector";
140@@ -156,7 +157,7 @@ int main(int argc, char** argv)
141
142 // Put efficiency information.
143 std::string label = format("Inference time: %.2f ms", tickMeter.getTimeMilli());
144- putText(frame, label, Point(0, 15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0));
145+ putText(frame, label, Point(0, 20), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false);
146
147 imshow(kWinName, frame);
148