mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 07:43:03 +04:00
Backport C-API cleanup (imgproc) from 5.x
This commit is contained in:
@@ -64,7 +64,7 @@ public class Puzzle15Processor {
|
||||
}
|
||||
|
||||
for (int i = 0; i < GRID_AREA; i++) {
|
||||
Size s = Imgproc.getTextSize(Integer.toString(i + 1), 3/* CV_FONT_HERSHEY_COMPLEX */, 1, 2, null);
|
||||
Size s = Imgproc.getTextSize(Integer.toString(i + 1), Imgproc.FONT_HERSHEY_COMPLEX, 1, 2, null);
|
||||
mTextHeights[i] = (int) s.height;
|
||||
mTextWidths[i] = (int) s.width;
|
||||
}
|
||||
@@ -100,7 +100,7 @@ public class Puzzle15Processor {
|
||||
cells[idx].copyTo(mCells15[i]);
|
||||
if (mShowTileNumbers) {
|
||||
Imgproc.putText(mCells15[i], Integer.toString(1 + idx), new Point((cols / GRID_SIZE - mTextWidths[idx]) / 2,
|
||||
(rows / GRID_SIZE + mTextHeights[idx]) / 2), 3/* CV_FONT_HERSHEY_COMPLEX */, 1, new Scalar(255, 0, 0, 255), 2);
|
||||
(rows / GRID_SIZE + mTextHeights[idx]) / 2), Imgproc.FONT_HERSHEY_COMPLEX, 1, new Scalar(255, 0, 0, 255), 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ int main( int argc, const char** argv )
|
||||
return -1;
|
||||
}
|
||||
|
||||
int method = parser.get<int>("cm"); // default 3 (CV_TM_CCORR_NORMED)
|
||||
int method = parser.get<int>("cm"); // default 3 (cv::TM_CCORR_NORMED)
|
||||
matchTemplate(img, tmpl, res, method, mask);
|
||||
|
||||
double minVal, maxVal;
|
||||
|
||||
@@ -28,7 +28,7 @@ public class MorphologyDemo1 {
|
||||
private static final int MAX_KERNEL_SIZE = 21;
|
||||
private Mat matImgSrc;
|
||||
private Mat matImgDst = new Mat();
|
||||
private int elementType = Imgproc.CV_SHAPE_RECT;
|
||||
private int elementType = Imgproc.MORPH_RECT;
|
||||
private int kernelSize = 0;
|
||||
private boolean doErosion = true;
|
||||
private JFrame frame;
|
||||
@@ -74,11 +74,11 @@ public class MorphologyDemo1 {
|
||||
@SuppressWarnings("unchecked")
|
||||
JComboBox<String> cb = (JComboBox<String>)e.getSource();
|
||||
if (cb.getSelectedIndex() == 0) {
|
||||
elementType = Imgproc.CV_SHAPE_RECT;
|
||||
elementType = Imgproc.MORPH_RECT;
|
||||
} else if (cb.getSelectedIndex() == 1) {
|
||||
elementType = Imgproc.CV_SHAPE_CROSS;
|
||||
elementType = Imgproc.MORPH_CROSS;
|
||||
} else if (cb.getSelectedIndex() == 2) {
|
||||
elementType = Imgproc.CV_SHAPE_ELLIPSE;
|
||||
elementType = Imgproc.MORPH_ELLIPSE;
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user