From d8cd1d8fcce7cdcb6ec78eccfe304f8644b57c20 Mon Sep 17 00:00:00 2001 From: Suleyman TURKMEN Date: Fri, 24 Aug 2018 11:11:34 +0300 Subject: [PATCH] Merge pull request #12246 from sturkmen72:move_enums * Update core.hpp * Update imgproc.hpp * Update ImgprocTest.java * Update CameraCalibrator.java * Update OnCameraFrameRender.java * Update FindContoursDemo.java * Update IntroductionToSVMDemo.java * Update NonLinearSVMsDemo.java * Update IntroductionToPCADemo.java * Update Smoothing.java * Update MainActivity.java * Update CalcBackProjectDemo1.java * Update CornerSubPixDemo.java * Update CornerDetectorDemo.java * Update GoodFeaturesToTrackDemo.java --- modules/core/include/opencv2/core.hpp | 21 -------- modules/imgproc/include/opencv2/imgproc.hpp | 52 ++++++++++++++----- .../imgproc/misc/java/test/ImgprocTest.java | 26 +++++----- .../cameracalibration/CameraCalibrator.java | 2 +- .../OnCameraFrameRender.java | 4 +- .../opencv_mobilenet/MainActivity.java | 6 +-- .../back_projection/CalcBackProjectDemo1.java | 2 +- .../ImgProc/Smoothing/Smoothing.java | 2 +- .../find_contours/FindContoursDemo.java | 2 +- .../corner_subpixels/CornerSubPixDemo.java | 2 +- .../CornerDetectorDemo.java | 4 +- .../GoodFeaturesToTrackDemo.java | 2 +- .../IntroductionToPCADemo.java | 6 +-- .../IntroductionToSVMDemo.java | 2 +- .../ml/non_linear_svms/NonLinearSVMsDemo.java | 2 +- 15 files changed, 71 insertions(+), 64 deletions(-) diff --git a/modules/core/include/opencv2/core.hpp b/modules/core/include/opencv2/core.hpp index a13ee6edcb..2abcb98672 100644 --- a/modules/core/include/opencv2/core.hpp +++ b/modules/core/include/opencv2/core.hpp @@ -211,27 +211,6 @@ enum KmeansFlags { KMEANS_USE_INITIAL_LABELS = 1 }; -//! type of line -enum LineTypes { - FILLED = -1, - LINE_4 = 4, //!< 4-connected line - LINE_8 = 8, //!< 8-connected line - LINE_AA = 16 //!< antialiased line -}; - -//! Only a subset of Hershey fonts are supported -enum HersheyFonts { - FONT_HERSHEY_SIMPLEX = 0, //!< normal size sans-serif font - FONT_HERSHEY_PLAIN = 1, //!< small size sans-serif font - FONT_HERSHEY_DUPLEX = 2, //!< normal size sans-serif font (more complex than FONT_HERSHEY_SIMPLEX) - FONT_HERSHEY_COMPLEX = 3, //!< normal size serif font - FONT_HERSHEY_TRIPLEX = 4, //!< normal size serif font (more complex than FONT_HERSHEY_COMPLEX) - FONT_HERSHEY_COMPLEX_SMALL = 5, //!< smaller version of FONT_HERSHEY_COMPLEX - FONT_HERSHEY_SCRIPT_SIMPLEX = 6, //!< hand-writing style font - FONT_HERSHEY_SCRIPT_COMPLEX = 7, //!< more complex variant of FONT_HERSHEY_SCRIPT_SIMPLEX - FONT_ITALIC = 16 //!< flag for italic font -}; - enum ReduceTypes { REDUCE_SUM = 0, //!< the output is the sum of all rows/columns of the matrix. REDUCE_AVG = 1, //!< the output is the mean vector of all rows/columns of the matrix. REDUCE_MAX = 2, //!< the output is the maximum (column/row-wise) of all rows/columns of the matrix. diff --git a/modules/imgproc/include/opencv2/imgproc.hpp b/modules/imgproc/include/opencv2/imgproc.hpp index ab1b788190..893d7671f2 100644 --- a/modules/imgproc/include/opencv2/imgproc.hpp +++ b/modules/imgproc/include/opencv2/imgproc.hpp @@ -788,6 +788,46 @@ enum RectanglesIntersectTypes { INTERSECT_FULL = 2 //!< One of the rectangle is fully enclosed in the other }; + +/** types of line +@ingroup imgproc_draw +*/ +enum LineTypes { + FILLED = -1, + LINE_4 = 4, //!< 4-connected line + LINE_8 = 8, //!< 8-connected line + LINE_AA = 16 //!< antialiased line +}; + +/** Only a subset of Hershey fonts are supported +@ingroup imgproc_draw +*/ +enum HersheyFonts { + FONT_HERSHEY_SIMPLEX = 0, //!< normal size sans-serif font + FONT_HERSHEY_PLAIN = 1, //!< small size sans-serif font + FONT_HERSHEY_DUPLEX = 2, //!< normal size sans-serif font (more complex than FONT_HERSHEY_SIMPLEX) + FONT_HERSHEY_COMPLEX = 3, //!< normal size serif font + FONT_HERSHEY_TRIPLEX = 4, //!< normal size serif font (more complex than FONT_HERSHEY_COMPLEX) + FONT_HERSHEY_COMPLEX_SMALL = 5, //!< smaller version of FONT_HERSHEY_COMPLEX + FONT_HERSHEY_SCRIPT_SIMPLEX = 6, //!< hand-writing style font + FONT_HERSHEY_SCRIPT_COMPLEX = 7, //!< more complex variant of FONT_HERSHEY_SCRIPT_SIMPLEX + FONT_ITALIC = 16 //!< flag for italic font +}; + +/** Possible set of marker types used for the cv::drawMarker function +@ingroup imgproc_draw +*/ +enum MarkerTypes +{ + MARKER_CROSS = 0, //!< A crosshair marker shape + MARKER_TILTED_CROSS = 1, //!< A 45 degree tilted crosshair marker shape + MARKER_STAR = 2, //!< A star marker shape, combination of cross and tilted cross + MARKER_DIAMOND = 3, //!< A diamond marker shape + MARKER_SQUARE = 4, //!< A square marker shape + MARKER_TRIANGLE_UP = 5, //!< An upwards pointing triangle marker shape + MARKER_TRIANGLE_DOWN = 6 //!< A downwards pointing triangle marker shape +}; + //! finds arbitrary template in the grayscale image using Generalized Hough Transform class CV_EXPORTS GeneralizedHough : public Algorithm { @@ -4430,18 +4470,6 @@ CV_EXPORTS_W void ellipse(InputOutputArray img, const RotatedRect& box, const Sc /* ADDING A SET OF PREDEFINED MARKERS WHICH COULD BE USED TO HIGHLIGHT POSITIONS IN AN IMAGE */ /* ----------------------------------------------------------------------------------------- */ -//! Possible set of marker types used for the cv::drawMarker function -enum MarkerTypes -{ - MARKER_CROSS = 0, //!< A crosshair marker shape - MARKER_TILTED_CROSS = 1, //!< A 45 degree tilted crosshair marker shape - MARKER_STAR = 2, //!< A star marker shape, combination of cross and tilted cross - MARKER_DIAMOND = 3, //!< A diamond marker shape - MARKER_SQUARE = 4, //!< A square marker shape - MARKER_TRIANGLE_UP = 5, //!< An upwards pointing triangle marker shape - MARKER_TRIANGLE_DOWN = 6 //!< A downwards pointing triangle marker shape -}; - /** @brief Draws a marker on a predefined position in an image. The function cv::drawMarker draws a marker on a given position in the image. For the moment several diff --git a/modules/imgproc/misc/java/test/ImgprocTest.java b/modules/imgproc/misc/java/test/ImgprocTest.java index ca23ee35b3..fb9dbf6570 100644 --- a/modules/imgproc/misc/java/test/ImgprocTest.java +++ b/modules/imgproc/misc/java/test/ImgprocTest.java @@ -1938,8 +1938,8 @@ public class ImgprocTest extends OpenCVTestCase { int thickness = 3; int baseLine[] = new int[1]; - Imgproc.getTextSize(text, Core.FONT_HERSHEY_SCRIPT_SIMPLEX, fontScale, thickness, null); - Size res = Imgproc.getTextSize(text, Core.FONT_HERSHEY_SCRIPT_SIMPLEX, fontScale, thickness, baseLine); + Imgproc.getTextSize(text, Imgproc.FONT_HERSHEY_SCRIPT_SIMPLEX, fontScale, thickness, null); + Size res = Imgproc.getTextSize(text, Imgproc.FONT_HERSHEY_SCRIPT_SIMPLEX, fontScale, thickness, baseLine); assertEquals(543.0, res.width); assertEquals(44.0, res.height); @@ -1961,7 +1961,7 @@ public class ImgprocTest extends OpenCVTestCase { int radius = Math.min(gray0.cols() / 4, gray0.rows() / 4); Scalar color = new Scalar(128); - Imgproc.circle(gray0, center, radius, color, Core.FILLED); + Imgproc.circle(gray0, center, radius, color, Imgproc.FILLED); assertTrue(0 != Core.countNonZero(gray0)); } @@ -2042,7 +2042,7 @@ public class ImgprocTest extends OpenCVTestCase { Size axes = new Size(2, 2); double angle = 30, startAngle = 60, endAngle = 90; - Imgproc.ellipse(gray0, center, axes, angle, startAngle, endAngle, colorWhite, Core.FILLED); + Imgproc.ellipse(gray0, center, axes, angle, startAngle, endAngle, colorWhite, Imgproc.FILLED); assertTrue(0 != Core.countNonZero(gray0)); } @@ -2054,11 +2054,11 @@ public class ImgprocTest extends OpenCVTestCase { Size axes2 = new Size(4, 4); double angle = 30, startAngle = 0, endAngle = 30; - Imgproc.ellipse(gray0, center, axes, angle, startAngle, endAngle, colorWhite, Core.FILLED, Imgproc.LINE_4, 0); + Imgproc.ellipse(gray0, center, axes, angle, startAngle, endAngle, colorWhite, Imgproc.FILLED, Imgproc.LINE_4, 0); assertTrue(0 != Core.countNonZero(gray0)); - Imgproc.ellipse(gray0, center2, axes2, angle, startAngle, endAngle, colorBlack, Core.FILLED, Imgproc.LINE_4, 1); + Imgproc.ellipse(gray0, center2, axes2, angle, startAngle, endAngle, colorBlack, Imgproc.FILLED, Imgproc.LINE_4, 1); assertEquals(0, Core.countNonZero(gray0)); } @@ -2096,7 +2096,7 @@ public class ImgprocTest extends OpenCVTestCase { Size size = new Size(matSize / 4, matSize / 2); RotatedRect box = new RotatedRect(center, size, 45); - Imgproc.ellipse(gray0, box, new Scalar(1), Core.FILLED); + Imgproc.ellipse(gray0, box, new Scalar(1), Imgproc.FILLED); Imgproc.ellipse(gray0, box, new Scalar(0)); assertTrue(0 < Core.countNonZero(gray0)); @@ -2159,11 +2159,11 @@ public class ImgprocTest extends OpenCVTestCase { Mat img = new Mat(20 + (int) labelSize.height, 20 + (int) labelSize.width, CvType.CV_8U, colorBlack); Point origin = new Point(10, labelSize.height + 10); - Imgproc.putText(img, text, origin, Core.FONT_HERSHEY_SIMPLEX, 1.0, colorWhite); + Imgproc.putText(img, text, origin, Imgproc.FONT_HERSHEY_SIMPLEX, 1.0, colorWhite); assertTrue(Core.countNonZero(img) > 0); // check that border is not corrupted - Imgproc.rectangle(img, new Point(11, 11), new Point(labelSize.width + 10, labelSize.height + 10), colorBlack, Core.FILLED); + Imgproc.rectangle(img, new Point(11, 11), new Point(labelSize.width + 10, labelSize.height + 10), colorBlack, Imgproc.FILLED); assertEquals(0, Core.countNonZero(img)); } @@ -2173,11 +2173,11 @@ public class ImgprocTest extends OpenCVTestCase { Mat img = new Mat(20 + (int) labelSize.height, 20 + (int) labelSize.width, CvType.CV_8U, colorBlack); Point origin = new Point(10, labelSize.height + 10); - Imgproc.putText(img, text, origin, Core.FONT_HERSHEY_SIMPLEX, 1.0, colorWhite, 2); + Imgproc.putText(img, text, origin, Imgproc.FONT_HERSHEY_SIMPLEX, 1.0, colorWhite, 2); assertTrue(Core.countNonZero(img) > 0); // check that border is not corrupted - Imgproc.rectangle(img, new Point(10, 10), new Point(labelSize.width + 10 + 1, labelSize.height + 10 + 1), colorBlack, Core.FILLED); + Imgproc.rectangle(img, new Point(10, 10), new Point(labelSize.width + 10 + 1, labelSize.height + 10 + 1), colorBlack, Imgproc.FILLED); assertEquals(0, Core.countNonZero(img)); } @@ -2188,11 +2188,11 @@ public class ImgprocTest extends OpenCVTestCase { Mat img = new Mat(20 + (int) labelSize.height, 20 + (int) labelSize.width, CvType.CV_8U, colorBlack); Point origin = new Point(10, 10); - Imgproc.putText(img, text, origin, Core.FONT_HERSHEY_SIMPLEX, 1.0, colorWhite, 1, Imgproc.LINE_8, true); + Imgproc.putText(img, text, origin, Imgproc.FONT_HERSHEY_SIMPLEX, 1.0, colorWhite, 1, Imgproc.LINE_8, true); assertTrue(Core.countNonZero(img) > 0); // check that border is not corrupted - Imgproc.rectangle(img, new Point(10, 10), new Point(labelSize.width + 9, labelSize.height + 9), colorBlack, Core.FILLED); + Imgproc.rectangle(img, new Point(10, 10), new Point(labelSize.width + 9, labelSize.height + 9), colorBlack, Imgproc.FILLED); assertEquals(0, Core.countNonZero(img)); } } diff --git a/samples/android/camera-calibration/src/org/opencv/samples/cameracalibration/CameraCalibrator.java b/samples/android/camera-calibration/src/org/opencv/samples/cameracalibration/CameraCalibrator.java index 47ebeb89f5..5927b967d5 100644 --- a/samples/android/camera-calibration/src/org/opencv/samples/cameracalibration/CameraCalibrator.java +++ b/samples/android/camera-calibration/src/org/opencv/samples/cameracalibration/CameraCalibrator.java @@ -141,7 +141,7 @@ public class CameraCalibrator { drawPoints(rgbaFrame); Imgproc.putText(rgbaFrame, "Captured: " + mCornersBuffer.size(), new Point(rgbaFrame.cols() / 3 * 2, rgbaFrame.rows() * 0.1), - Core.FONT_HERSHEY_SIMPLEX, 1.0, new Scalar(255, 255, 0)); + Imgproc.FONT_HERSHEY_SIMPLEX, 1.0, new Scalar(255, 255, 0)); } public Mat getCameraMatrix() { diff --git a/samples/android/camera-calibration/src/org/opencv/samples/cameracalibration/OnCameraFrameRender.java b/samples/android/camera-calibration/src/org/opencv/samples/cameracalibration/OnCameraFrameRender.java index 85a85040c0..311f4d5cae 100644 --- a/samples/android/camera-calibration/src/org/opencv/samples/cameracalibration/OnCameraFrameRender.java +++ b/samples/android/camera-calibration/src/org/opencv/samples/cameracalibration/OnCameraFrameRender.java @@ -83,9 +83,9 @@ class ComparisonFrameRender extends FrameRender { Imgproc.fillPoly(comparisonFrame, border, new Scalar(255, 255, 255)); Imgproc.putText(comparisonFrame, mResources.getString(R.string.original), new Point(mWidth * 0.1, mHeight * 0.1), - Core.FONT_HERSHEY_SIMPLEX, 1.0, new Scalar(255, 255, 0)); + Imgproc.FONT_HERSHEY_SIMPLEX, 1.0, new Scalar(255, 255, 0)); Imgproc.putText(comparisonFrame, mResources.getString(R.string.undistorted), new Point(mWidth * 0.6, mHeight * 0.1), - Core.FONT_HERSHEY_SIMPLEX, 1.0, new Scalar(255, 255, 0)); + Imgproc.FONT_HERSHEY_SIMPLEX, 1.0, new Scalar(255, 255, 0)); return comparisonFrame; } diff --git a/samples/android/mobilenet-objdetect/src/org/opencv/samples/opencv_mobilenet/MainActivity.java b/samples/android/mobilenet-objdetect/src/org/opencv/samples/opencv_mobilenet/MainActivity.java index 31440e2c85..3b62cc1e1a 100644 --- a/samples/android/mobilenet-objdetect/src/org/opencv/samples/opencv_mobilenet/MainActivity.java +++ b/samples/android/mobilenet-objdetect/src/org/opencv/samples/opencv_mobilenet/MainActivity.java @@ -127,16 +127,16 @@ public class MainActivity extends AppCompatActivity implements CvCameraViewListe new Scalar(0, 255, 0)); String label = classNames[classId] + ": " + confidence; int[] baseLine = new int[1]; - Size labelSize = Imgproc.getTextSize(label, Core.FONT_HERSHEY_SIMPLEX, 0.5, 1, baseLine); + Size labelSize = Imgproc.getTextSize(label, Imgproc.FONT_HERSHEY_SIMPLEX, 0.5, 1, baseLine); // Draw background for label. Imgproc.rectangle(subFrame, new Point(xLeftBottom, yLeftBottom - labelSize.height), new Point(xLeftBottom + labelSize.width, yLeftBottom + baseLine[0]), - new Scalar(255, 255, 255), Core.FILLED); + new Scalar(255, 255, 255), Imgproc.FILLED); // Write class name and confidence. Imgproc.putText(subFrame, label, new Point(xLeftBottom, yLeftBottom), - Core.FONT_HERSHEY_SIMPLEX, 0.5, new Scalar(0, 0, 0)); + Imgproc.FONT_HERSHEY_SIMPLEX, 0.5, new Scalar(0, 0, 0)); } } return frame; diff --git a/samples/java/tutorial_code/Histograms_Matching/back_projection/CalcBackProjectDemo1.java b/samples/java/tutorial_code/Histograms_Matching/back_projection/CalcBackProjectDemo1.java index c5b5f8d249..d2e03c88f8 100644 --- a/samples/java/tutorial_code/Histograms_Matching/back_projection/CalcBackProjectDemo1.java +++ b/samples/java/tutorial_code/Histograms_Matching/back_projection/CalcBackProjectDemo1.java @@ -145,7 +145,7 @@ class CalcBackProject1 { hist.get(0, 0, histData); for (int i = 0; i < bins; i++) { Imgproc.rectangle(histImg, new Point(i * binW, h), - new Point((i + 1) * binW, h - Math.round(histData[i] * h / 255.0)), new Scalar(0, 0, 255), Core.FILLED); + new Point((i + 1) * binW, h - Math.round(histData[i] * h / 255.0)), new Scalar(0, 0, 255), Imgproc.FILLED); } Image histImage = HighGui.toBufferedImage(histImg); histImgLabel.setIcon(new ImageIcon(histImage)); diff --git a/samples/java/tutorial_code/ImgProc/Smoothing/Smoothing.java b/samples/java/tutorial_code/ImgProc/Smoothing/Smoothing.java index b4d96307c9..8b5a8330ef 100644 --- a/samples/java/tutorial_code/ImgProc/Smoothing/Smoothing.java +++ b/samples/java/tutorial_code/ImgProc/Smoothing/Smoothing.java @@ -79,7 +79,7 @@ class SmoothingRun { dst = Mat.zeros(src.size(), src.type()); Imgproc.putText(dst, caption, new Point(src.cols() / 4, src.rows() / 2), - Core.FONT_HERSHEY_COMPLEX, 1, new Scalar(255, 255, 255)); + Imgproc.FONT_HERSHEY_COMPLEX, 1, new Scalar(255, 255, 255)); return displayDst(DELAY_CAPTION); } diff --git a/samples/java/tutorial_code/ShapeDescriptors/find_contours/FindContoursDemo.java b/samples/java/tutorial_code/ShapeDescriptors/find_contours/FindContoursDemo.java index 5eec4f878a..af6a1c8b22 100644 --- a/samples/java/tutorial_code/ShapeDescriptors/find_contours/FindContoursDemo.java +++ b/samples/java/tutorial_code/ShapeDescriptors/find_contours/FindContoursDemo.java @@ -112,7 +112,7 @@ class FindContours { Mat drawing = Mat.zeros(cannyOutput.size(), CvType.CV_8UC3); for (int i = 0; i < contours.size(); i++) { Scalar color = new Scalar(rng.nextInt(256), rng.nextInt(256), rng.nextInt(256)); - Imgproc.drawContours(drawing, contours, i, color, 2, Core.LINE_8, hierarchy, 0, new Point()); + Imgproc.drawContours(drawing, contours, i, color, 2, Imgproc.LINE_8, hierarchy, 0, new Point()); } imgContoursLabel.setIcon(new ImageIcon(HighGui.toBufferedImage(drawing))); diff --git a/samples/java/tutorial_code/TrackingMotion/corner_subpixels/CornerSubPixDemo.java b/samples/java/tutorial_code/TrackingMotion/corner_subpixels/CornerSubPixDemo.java index 3be2e58056..cb1888c08a 100644 --- a/samples/java/tutorial_code/TrackingMotion/corner_subpixels/CornerSubPixDemo.java +++ b/samples/java/tutorial_code/TrackingMotion/corner_subpixels/CornerSubPixDemo.java @@ -115,7 +115,7 @@ class CornerSubPix { matCorners.get(0, 0, matCornersData); for (int i = 0; i < corners.rows(); i++) { Imgproc.circle(copy, new Point(cornersData[i * 2], cornersData[i * 2 + 1]), radius, - new Scalar(rng.nextInt(256), rng.nextInt(256), rng.nextInt(256)), Core.FILLED); + new Scalar(rng.nextInt(256), rng.nextInt(256), rng.nextInt(256)), Imgproc.FILLED); matCornersData[i * 2] = cornersData[i * 2]; matCornersData[i * 2 + 1] = cornersData[i * 2 + 1]; } diff --git a/samples/java/tutorial_code/TrackingMotion/generic_corner_detector/CornerDetectorDemo.java b/samples/java/tutorial_code/TrackingMotion/generic_corner_detector/CornerDetectorDemo.java index 30450f8db1..f7743f5d3e 100644 --- a/samples/java/tutorial_code/TrackingMotion/generic_corner_detector/CornerDetectorDemo.java +++ b/samples/java/tutorial_code/TrackingMotion/generic_corner_detector/CornerDetectorDemo.java @@ -147,7 +147,7 @@ class CornerDetector { if (McData[i * srcGray.cols() + j] > harrisMinVal + (harrisMaxVal - harrisMinVal) * qualityLevelVal / MAX_QUALITY_LEVEL) { Imgproc.circle(harrisCopy, new Point(j, i), 4, - new Scalar(rng.nextInt(256), rng.nextInt(256), rng.nextInt(256)), Core.FILLED); + new Scalar(rng.nextInt(256), rng.nextInt(256), rng.nextInt(256)), Imgproc.FILLED); } } } @@ -162,7 +162,7 @@ class CornerDetector { if (shiTomasiData[i * srcGray.cols() + j] > shiTomasiMinVal + (shiTomasiMaxVal - shiTomasiMinVal) * qualityLevelVal / MAX_QUALITY_LEVEL) { Imgproc.circle(shiTomasiCopy, new Point(j, i), 4, - new Scalar(rng.nextInt(256), rng.nextInt(256), rng.nextInt(256)), Core.FILLED); + new Scalar(rng.nextInt(256), rng.nextInt(256), rng.nextInt(256)), Imgproc.FILLED); } } } diff --git a/samples/java/tutorial_code/TrackingMotion/good_features_to_track/GoodFeaturesToTrackDemo.java b/samples/java/tutorial_code/TrackingMotion/good_features_to_track/GoodFeaturesToTrackDemo.java index b5ee732e84..2033cd5727 100644 --- a/samples/java/tutorial_code/TrackingMotion/good_features_to_track/GoodFeaturesToTrackDemo.java +++ b/samples/java/tutorial_code/TrackingMotion/good_features_to_track/GoodFeaturesToTrackDemo.java @@ -109,7 +109,7 @@ class GoodFeaturesToTrack { int radius = 4; for (int i = 0; i < corners.rows(); i++) { Imgproc.circle(copy, new Point(cornersData[i * 2], cornersData[i * 2 + 1]), radius, - new Scalar(rng.nextInt(256), rng.nextInt(256), rng.nextInt(256)), Core.FILLED); + new Scalar(rng.nextInt(256), rng.nextInt(256), rng.nextInt(256)), Imgproc.FILLED); } imgLabel.setIcon(new ImageIcon(HighGui.toBufferedImage(copy))); diff --git a/samples/java/tutorial_code/ml/introduction_to_pca/IntroductionToPCADemo.java b/samples/java/tutorial_code/ml/introduction_to_pca/IntroductionToPCADemo.java index 5dfef53efa..8f07675a68 100644 --- a/samples/java/tutorial_code/ml/introduction_to_pca/IntroductionToPCADemo.java +++ b/samples/java/tutorial_code/ml/introduction_to_pca/IntroductionToPCADemo.java @@ -23,16 +23,16 @@ class IntroductionToPCA { // Here we lengthen the arrow by a factor of scale q.x = (int) (p.x - scale * hypotenuse * Math.cos(angle)); q.y = (int) (p.y - scale * hypotenuse * Math.sin(angle)); - Imgproc.line(img, p, q, colour, 1, Core.LINE_AA, 0); + Imgproc.line(img, p, q, colour, 1, Imgproc.LINE_AA, 0); // create the arrow hooks p.x = (int) (q.x + 9 * Math.cos(angle + Math.PI / 4)); p.y = (int) (q.y + 9 * Math.sin(angle + Math.PI / 4)); - Imgproc.line(img, p, q, colour, 1, Core.LINE_AA, 0); + Imgproc.line(img, p, q, colour, 1, Imgproc.LINE_AA, 0); p.x = (int) (q.x + 9 * Math.cos(angle - Math.PI / 4)); p.y = (int) (q.y + 9 * Math.sin(angle - Math.PI / 4)); - Imgproc.line(img, p, q, colour, 1, Core.LINE_AA, 0); + Imgproc.line(img, p, q, colour, 1, Imgproc.LINE_AA, 0); //! [visualization1] } diff --git a/samples/java/tutorial_code/ml/introduction_to_svm/IntroductionToSVMDemo.java b/samples/java/tutorial_code/ml/introduction_to_svm/IntroductionToSVMDemo.java index c44483f2cf..dcff5ff788 100644 --- a/samples/java/tutorial_code/ml/introduction_to_svm/IntroductionToSVMDemo.java +++ b/samples/java/tutorial_code/ml/introduction_to_svm/IntroductionToSVMDemo.java @@ -71,7 +71,7 @@ public class IntroductionToSVMDemo { // Show the training data //! [show_data] int thickness = -1; - int lineType = Core.LINE_8; + int lineType = Imgproc.LINE_8; Imgproc.circle(image, new Point(501, 10), 5, new Scalar(0, 0, 0), thickness, lineType, 0); Imgproc.circle(image, new Point(255, 10), 5, new Scalar(255, 255, 255), thickness, lineType, 0); Imgproc.circle(image, new Point(501, 255), 5, new Scalar(255, 255, 255), thickness, lineType, 0); diff --git a/samples/java/tutorial_code/ml/non_linear_svms/NonLinearSVMsDemo.java b/samples/java/tutorial_code/ml/non_linear_svms/NonLinearSVMsDemo.java index 798c1fc3ef..b2b40d1513 100644 --- a/samples/java/tutorial_code/ml/non_linear_svms/NonLinearSVMsDemo.java +++ b/samples/java/tutorial_code/ml/non_linear_svms/NonLinearSVMsDemo.java @@ -148,7 +148,7 @@ public class NonLinearSVMsDemo { // ----------------------- 5. Show the training data-------------------------------------------- //! [show_data] int thick = -1; - int lineType = Core.LINE_8; + int lineType = Imgproc.LINE_8; float px, py; // Class 1 float[] trainDataData = new float[(int) (trainData.total() * trainData.channels())];