1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

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
This commit is contained in:
Suleyman TURKMEN
2018-08-24 11:11:34 +03:00
committed by Alexander Alekhin
parent 6356403964
commit d8cd1d8fcc
15 changed files with 71 additions and 64 deletions
-21
View File
@@ -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 <https://en.wikipedia.org/wiki/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.
+40 -12
View File
@@ -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 <https://en.wikipedia.org/wiki/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
+13 -13
View File
@@ -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));
}
}