Commit a4ab6092 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #13195 from alalek:legacy_constants

parents 22dbcf98 a574788e
......@@ -106,7 +106,7 @@ FILE_PATTERNS =
RECURSIVE = YES
EXCLUDE = @CMAKE_DOXYGEN_EXCLUDE_LIST@
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = *.inl.hpp *.impl.hpp *_detail.hpp */cudev/**/detail/*.hpp *.m */opencl/runtime/*
EXCLUDE_PATTERNS = *.inl.hpp *.impl.hpp *_detail.hpp */cudev/**/detail/*.hpp *.m */opencl/runtime/* */legacy/* *_c.h @DOXYGEN_EXCLUDE_PATTERNS@
EXCLUDE_SYMBOLS = cv::DataType<*> cv::traits::* int void CV__* T __CV*
EXAMPLE_PATH = @CMAKE_DOXYGEN_EXAMPLE_PATH@
EXAMPLE_PATTERNS = *
......
......@@ -92,7 +92,7 @@ public class Features2dTest extends OpenCVTestCase {
writeFile(extractorCfgFile, extractorCfg);
extractor.read(extractorCfgFile);
Mat imgTrain = Imgcodecs.imread(OpenCVTestRunner.LENA_PATH, Imgcodecs.CV_LOAD_IMAGE_GRAYSCALE);
Mat imgTrain = Imgcodecs.imread(OpenCVTestRunner.LENA_PATH, Imgcodecs.IMREAD_GRAYSCALE);
Mat imgQuery = imgTrain.submat(new Range(0, imgTrain.rows() - 100), Range.all());
MatOfKeyPoint trainKeypoints = new MatOfKeyPoint();
......
......@@ -443,7 +443,7 @@ calculate the derivative. When \f$\texttt{ksize = 1}\f$, the \f$3 \times 1\f$ or
kernel is used (that is, no Gaussian smoothing is done). `ksize = 1` can only be used for the first
or the second x- or y- derivatives.
There is also the special value `ksize = CV_SCHARR (-1)` that corresponds to the \f$3\times3\f$ Scharr
There is also the special value `ksize = FILTER_SCHARR (-1)` that corresponds to the \f$3\times3\f$ Scharr
filter that may give more accurate results than the \f$3\times3\f$ Sobel. The Scharr aperture is
\f[\vecthreethree{-3}{0}{3}{-10}{0}{10}{-3}{0}{3}\f]
......
......@@ -783,9 +783,9 @@ GAPI_FLUID_KERNEL(GFluidSobel, cv::gapi::imgproc::GSobel, true)
Buffer& scratch)
{
// TODO: support kernel height 3, 5, 7, 9, ...
GAPI_Assert(ksize == 3 || ksize == CV_SCHARR);
GAPI_Assert(ksize == 3 || ksize == FILTER_SCHARR);
int ksz = (ksize == CV_SCHARR)? 3: ksize;
int ksz = (ksize == FILTER_SCHARR)? 3: ksize;
auto *kx = scratch.OutLine<float>();
auto *ky = kx + ksz;
......@@ -827,8 +827,8 @@ GAPI_FLUID_KERNEL(GFluidSobel, cv::gapi::imgproc::GSobel, true)
Buffer & scratch)
{
// TODO: support kernel height 3, 5, 7, 9, ...
GAPI_Assert(ksize == 3 || ksize == CV_SCHARR);
int ksz = (ksize == CV_SCHARR) ? 3 : ksize;
GAPI_Assert(ksize == 3 || ksize == FILTER_SCHARR);
int ksz = (ksize == FILTER_SCHARR) ? 3 : ksize;
int width = in.size.width;
int chan = in.chan;
......
......@@ -53,52 +53,6 @@
@}
*/
/* duplicate of "ImreadModes" enumeration for better compatibility with OpenCV 3.x */
enum
{
/* 8bit, color or not */
CV_LOAD_IMAGE_UNCHANGED =-1,
/* 8bit, gray */
CV_LOAD_IMAGE_GRAYSCALE =0,
/* ?, color */
CV_LOAD_IMAGE_COLOR =1,
/* any depth, ? */
CV_LOAD_IMAGE_ANYDEPTH =2,
/* ?, any color */
CV_LOAD_IMAGE_ANYCOLOR =4,
/* ?, no rotate */
CV_LOAD_IMAGE_IGNORE_ORIENTATION =128
};
/* duplicate of "ImwriteFlags" enumeration for better compatibility with OpenCV 3.x */
enum
{
CV_IMWRITE_JPEG_QUALITY =1,
CV_IMWRITE_JPEG_PROGRESSIVE =2,
CV_IMWRITE_JPEG_OPTIMIZE =3,
CV_IMWRITE_JPEG_RST_INTERVAL =4,
CV_IMWRITE_JPEG_LUMA_QUALITY =5,
CV_IMWRITE_JPEG_CHROMA_QUALITY =6,
CV_IMWRITE_PNG_COMPRESSION =16,
CV_IMWRITE_PNG_STRATEGY =17,
CV_IMWRITE_PNG_BILEVEL =18,
CV_IMWRITE_PNG_STRATEGY_DEFAULT =0,
CV_IMWRITE_PNG_STRATEGY_FILTERED =1,
CV_IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY =2,
CV_IMWRITE_PNG_STRATEGY_RLE =3,
CV_IMWRITE_PNG_STRATEGY_FIXED =4,
CV_IMWRITE_PXM_BINARY =32,
CV_IMWRITE_EXR_TYPE = 48,
CV_IMWRITE_WEBP_QUALITY =64,
CV_IMWRITE_PAM_TUPLETYPE = 128,
CV_IMWRITE_PAM_FORMAT_NULL = 0,
CV_IMWRITE_PAM_FORMAT_BLACKANDWHITE = 1,
CV_IMWRITE_PAM_FORMAT_GRAYSCALE = 2,
CV_IMWRITE_PAM_FORMAT_GRAYSCALE_ALPHA = 3,
CV_IMWRITE_PAM_FORMAT_RGB = 4,
CV_IMWRITE_PAM_FORMAT_RGB_ALPHA = 5,
};
//////////////////////////////// image codec ////////////////////////////////
namespace cv
{
......
#error "This header with legacy C API declarations has been removed from OpenCV. Legacy contants are available from legacy/constants_c.h file."
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
#ifndef OPENCV_IMGCODECS_LEGACY_CONSTANTS_H
#define OPENCV_IMGCODECS_LEGACY_CONSTANTS_H
/* duplicate of "ImreadModes" enumeration for better compatibility with OpenCV 3.x */
enum
{
/* 8bit, color or not */
CV_LOAD_IMAGE_UNCHANGED =-1,
/* 8bit, gray */
CV_LOAD_IMAGE_GRAYSCALE =0,
/* ?, color */
CV_LOAD_IMAGE_COLOR =1,
/* any depth, ? */
CV_LOAD_IMAGE_ANYDEPTH =2,
/* ?, any color */
CV_LOAD_IMAGE_ANYCOLOR =4,
/* ?, no rotate */
CV_LOAD_IMAGE_IGNORE_ORIENTATION =128
};
/* duplicate of "ImwriteFlags" enumeration for better compatibility with OpenCV 3.x */
enum
{
CV_IMWRITE_JPEG_QUALITY =1,
CV_IMWRITE_JPEG_PROGRESSIVE =2,
CV_IMWRITE_JPEG_OPTIMIZE =3,
CV_IMWRITE_JPEG_RST_INTERVAL =4,
CV_IMWRITE_JPEG_LUMA_QUALITY =5,
CV_IMWRITE_JPEG_CHROMA_QUALITY =6,
CV_IMWRITE_PNG_COMPRESSION =16,
CV_IMWRITE_PNG_STRATEGY =17,
CV_IMWRITE_PNG_BILEVEL =18,
CV_IMWRITE_PNG_STRATEGY_DEFAULT =0,
CV_IMWRITE_PNG_STRATEGY_FILTERED =1,
CV_IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY =2,
CV_IMWRITE_PNG_STRATEGY_RLE =3,
CV_IMWRITE_PNG_STRATEGY_FIXED =4,
CV_IMWRITE_PXM_BINARY =32,
CV_IMWRITE_EXR_TYPE = 48,
CV_IMWRITE_WEBP_QUALITY =64,
CV_IMWRITE_PAM_TUPLETYPE = 128,
CV_IMWRITE_PAM_FORMAT_NULL = 0,
CV_IMWRITE_PAM_FORMAT_BLACKANDWHITE = 1,
CV_IMWRITE_PAM_FORMAT_GRAYSCALE = 2,
CV_IMWRITE_PAM_FORMAT_GRAYSCALE_ALPHA = 3,
CV_IMWRITE_PAM_FORMAT_RGB = 4,
CV_IMWRITE_PAM_FORMAT_RGB_ALPHA = 5,
};
#endif // OPENCV_IMGCODECS_LEGACY_CONSTANTS_H
......@@ -43,6 +43,7 @@
#define __IMGCODECS_H_
#include "opencv2/imgcodecs.hpp"
#include "opencv2/imgcodecs/legacy/constants_c.h"
#include "opencv2/core/utility.hpp"
#include "opencv2/core/private.hpp"
......
......@@ -204,6 +204,10 @@ namespace cv
//! @addtogroup imgproc_filter
//! @{
enum SpecialFilter {
FILTER_SCHARR = -1
};
//! type of morphological operation
enum MorphTypes{
MORPH_ERODE = 0, //!< see #erode
......@@ -1349,14 +1353,14 @@ CV_EXPORTS_W Mat getGaussianKernel( int ksize, double sigma, int ktype = CV_64F
/** @brief Returns filter coefficients for computing spatial image derivatives.
The function computes and returns the filter coefficients for spatial image derivatives. When
`ksize=CV_SCHARR`, the Scharr \f$3 \times 3\f$ kernels are generated (see #Scharr). Otherwise, Sobel
`ksize=FILTER_SCHARR`, the Scharr \f$3 \times 3\f$ kernels are generated (see #Scharr). Otherwise, Sobel
kernels are generated (see #Sobel). The filters are normally passed to #sepFilter2D or to
@param kx Output matrix of row filter coefficients. It has the type ktype .
@param ky Output matrix of column filter coefficients. It has the type ktype .
@param dx Derivative order in respect of x.
@param dy Derivative order in respect of y.
@param ksize Aperture size. It can be CV_SCHARR, 1, 3, 5, or 7.
@param ksize Aperture size. It can be FILTER_SCHARR, 1, 3, 5, or 7.
@param normalize Flag indicating whether to normalize (scale down) the filter coefficients or not.
Theoretically, the coefficients should have the denominator \f$=2^{ksize*2-dx-dy-2}\f$. If you are
going to filter floating-point images, you are likely to use the normalized kernels. But if you
......@@ -1623,7 +1627,7 @@ calculate the derivative. When \f$\texttt{ksize = 1}\f$, the \f$3 \times 1\f$ or
kernel is used (that is, no Gaussian smoothing is done). `ksize = 1` can only be used for the first
or the second x- or y- derivatives.
There is also the special value `ksize = #CV_SCHARR (-1)` that corresponds to the \f$3\times3\f$ Scharr
There is also the special value `ksize = #FILTER_SCHARR (-1)` that corresponds to the \f$3\times3\f$ Scharr
filter that may give more accurate results than the \f$3\times3\f$ Sobel. The Scharr aperture is
\f[\vecthreethree{-3}{0}{3}{-10}{0}{10}{-3}{0}{3}\f]
......@@ -1694,7 +1698,7 @@ call
is equivalent to
\f[\texttt{Sobel(src, dst, ddepth, dx, dy, CV_SCHARR, scale, delta, borderType)} .\f]
\f[\texttt{Sobel(src, dst, ddepth, dx, dy, FILTER_SCHARR, scale, delta, borderType)} .\f]
@param src input image.
@param dst output image of the same size and the same number of channels as src.
......
......@@ -1182,7 +1182,7 @@ if __name__ == "__main__":
with open(srcfiles_fname) as f:
srcfiles = [os.path.join(module_location, str(l).strip()) for l in f.readlines() if str(l).strip()]
else:
re_bad = re.compile(r'(private|.inl.hpp$|_inl.hpp$|.details.hpp$|_winrt.hpp$|/cuda/)')
re_bad = re.compile(r'(private|.inl.hpp$|_inl.hpp$|.details.hpp$|_winrt.hpp$|/cuda/|/legacy/)')
# .h files before .hpp
h_files = []
hpp_files = []
......
......@@ -61,12 +61,6 @@ camera calibration with multiple exposures and exposure fusion.
@}
*/
enum InpaintingModes
{
CV_INPAINT_NS =0,
CV_INPAINT_TELEA =1
};
namespace cv
{
......
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
#ifndef OPENCV_PHOTO_LEGACY_CONSTANTS_H
#define OPENCV_PHOTO_LEGACY_CONSTANTS_H
enum InpaintingModes
{
CV_INPAINT_NS =0,
CV_INPAINT_TELEA =1
};
#endif // OPENCV_PHOTO_LEGACY_CONSTANTS_H
......@@ -47,6 +47,7 @@
#include "precomp.hpp"
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/photo/legacy/constants_c.h"
#undef CV_MAT_ELEM_PTR_FAST
#define CV_MAT_ELEM_PTR_FAST( mat, row, col, pix_size ) \
......
......@@ -43,6 +43,7 @@ ocv_list_filterout(opencv_hdrs "modules/.*_inl\\\\.h*")
ocv_list_filterout(opencv_hdrs "modules/.*\\\\.details\\\\.h*")
ocv_list_filterout(opencv_hdrs "modules/.*\\\\.private\\\\.h*")
ocv_list_filterout(opencv_hdrs "modules/.*/private\\\\.h*")
ocv_list_filterout(opencv_hdrs "modules/.*/legacy/.*")
ocv_list_filterout(opencv_hdrs "modules/.*/detection_based_tracker\\\\.hpp") # Conditional compilation
if(NOT HAVE_CUDA)
ocv_list_filterout(opencv_hdrs "modules/cuda.*")
......
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
#ifndef OPENCV_VIDEO_LEGACY_CONSTANTS_H
#define OPENCV_VIDEO_LEGACY_CONSTANTS_H
enum
{
CV_LKFLOW_PYR_A_READY = 1,
CV_LKFLOW_PYR_B_READY = 2,
CV_LKFLOW_INITIAL_GUESSES = 4,
CV_LKFLOW_GET_MIN_EIGENVALS = 8
};
#endif // OPENCV_VIDEO_LEGACY_CONSTANTS_H
......@@ -47,14 +47,6 @@
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
enum
{
CV_LKFLOW_PYR_A_READY = 1,
CV_LKFLOW_PYR_B_READY = 2,
CV_LKFLOW_INITIAL_GUESSES = 4,
CV_LKFLOW_GET_MIN_EIGENVALS = 8
};
namespace cv
{
......
This diff is collapsed.
......@@ -1005,7 +1005,7 @@ void DigitalCameraCapture::readFrameFromFile(CameraFile * file, OutputArray outp
Mat buf = Mat(1, size, CV_8UC1, (void *) data);
if(!buf.empty())
{
frame = imdecode(buf, CV_LOAD_IMAGE_UNCHANGED);
frame = imdecode(buf, IMREAD_UNCHANGED);
}
frame.copyTo(outputFrame);
}
......
......@@ -133,7 +133,7 @@ bool CvCapture_Images::grabFrame()
return !frame.empty();
}
frame = imread(str, CV_LOAD_IMAGE_UNCHANGED);
frame = imread(str, IMREAD_UNCHANGED);
if( !frame.empty() )
currentframe++;
......
......@@ -164,7 +164,7 @@ bool MotionJpegCapture::retrieveFrame(int, OutputArray output_frame)
if(data.size())
{
m_current_frame = imdecode(data, CV_LOAD_IMAGE_ANYDEPTH | CV_LOAD_IMAGE_COLOR | IMREAD_IGNORE_ORIENTATION);
m_current_frame = imdecode(data, IMREAD_ANYDEPTH | IMREAD_COLOR | IMREAD_IGNORE_ORIENTATION);
}
m_current_frame.copyTo(output_frame);
......
......@@ -43,6 +43,7 @@
#define __VIDEOIO_H_
#include "opencv2/videoio.hpp"
#include "opencv2/videoio/legacy/constants_c.h"
#include "opencv2/core/utility.hpp"
#include "opencv2/core/private.hpp"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment