fix:make zerocolor edge

This commit is contained in:
lennlouisgeek
2026-02-04 03:18:20 +08:00
parent ca3545b8b0
commit 001685b633
157 changed files with 31832 additions and 32681 deletions

View File

@@ -263,72 +263,8 @@ enum DftFlags {
DCT_ROWS = DFT_ROWS
};
/*! Various border types, image boundaries are denoted with the `|` character in the table below, when describing each method.
The following examples show the result of the @ref copyMakeBorder call according to different methods.
Input image is `6x4` (width x height) size and the @ref copyMakeBorder function is used with a border size of 2 pixels
in each direction, giving a resulting image of `10x8` resolution.
@code
Input image:
[[ 0 1 2 3 4 5]
[ 6 7 8 9 10 11]
[12 13 14 15 16 17]
[18 19 20 21 22 23]]
Border type: BORDER_CONSTANT (a constant value of 255 is used)
[[255 255 255 255 255 255 255 255 255 255]
[255 255 255 255 255 255 255 255 255 255]
[255 255 0 1 2 3 4 5 255 255]
[255 255 6 7 8 9 10 11 255 255]
[255 255 12 13 14 15 16 17 255 255]
[255 255 18 19 20 21 22 23 255 255]
[255 255 255 255 255 255 255 255 255 255]
[255 255 255 255 255 255 255 255 255 255]]
Border type: BORDER_REPLICATE
[[ 0 0 0 1 2 3 4 5 5 5]
[ 0 0 0 1 2 3 4 5 5 5]
[ 0 0 0 1 2 3 4 5 5 5]
[ 6 6 6 7 8 9 10 11 11 11]
[12 12 12 13 14 15 16 17 17 17]
[18 18 18 19 20 21 22 23 23 23]
[18 18 18 19 20 21 22 23 23 23]
[18 18 18 19 20 21 22 23 23 23]]
Border type: BORDER_REFLECT
[[ 7 6 6 7 8 9 10 11 11 10]
[ 1 0 0 1 2 3 4 5 5 4]
[ 1 0 0 1 2 3 4 5 5 4]
[ 7 6 6 7 8 9 10 11 11 10]
[13 12 12 13 14 15 16 17 17 16]
[19 18 18 19 20 21 22 23 23 22]
[19 18 18 19 20 21 22 23 23 22]
[13 12 12 13 14 15 16 17 17 16]]
Border type: BORDER_WRAP
[[16 17 12 13 14 15 16 17 12 13]
[22 23 18 19 20 21 22 23 18 19]
[ 4 5 0 1 2 3 4 5 0 1]
[10 11 6 7 8 9 10 11 6 7]
[16 17 12 13 14 15 16 17 12 13]
[22 23 18 19 20 21 22 23 18 19]
[ 4 5 0 1 2 3 4 5 0 1]
[10 11 6 7 8 9 10 11 6 7]]
Border type: BORDER_REFLECT_101
[[14 13 12 13 14 15 16 17 16 15]
[ 8 7 6 7 8 9 10 11 10 9]
[ 2 1 0 1 2 3 4 5 4 3]
[ 8 7 6 7 8 9 10 11 10 9]
[14 13 12 13 14 15 16 17 16 15]
[20 19 18 19 20 21 22 23 22 21]
[14 13 12 13 14 15 16 17 16 15]
[ 8 7 6 7 8 9 10 11 10 9]]
@endcode
@see borderInterpolate, copyMakeBorder
*/
//! Various border types, image boundaries are denoted with `|`
//! @see borderInterpolate, copyMakeBorder
enum BorderTypes {
BORDER_CONSTANT = 0, //!< `iiiiii|abcdefgh|iiiiiii` with some specified `i`
BORDER_REPLICATE = 1, //!< `aaaaaa|abcdefgh|hhhhhhh`
@@ -352,29 +288,14 @@ enum BorderTypes {
By default the function prints information about the error to stderr,
then it either stops if setBreakOnError() had been called before or raises the exception.
It is possible to alternate error processing by using redirectError().
@param code - error code (Error::Code)
@param err - error description
@param func - function name. Available only when the compiler supports getting it
@param file - source file name where the error has occurred
@param line - line number in the source file where the error has occurred
@param _code - error code (Error::Code)
@param _err - error description
@param _func - function name. Available only when the compiler supports getting it
@param _file - source file name where the error has occurred
@param _line - line number in the source file where the error has occurred
@see CV_Error, CV_Error_, CV_Assert, CV_DbgAssert
*/
CV_EXPORTS CV_NORETURN void error(int code, const String& err, const char* func, const char* file, int line);
/*! @brief Signals an error and terminate application.
By default the function prints information about the error to stderr, then it terminates application
with std::terminate. The function is designed for invariants check in functions and methods with
noexcept attribute.
@param code - error code (Error::Code)
@param err - error description
@param func - function name. Available only when the compiler supports getting it
@param file - source file name where the error has occurred
@param line - line number in the source file where the error has occurred
@see CV_AssertTerminate
*/
CV_EXPORTS CV_NORETURN void terminate(int code, const String& err, const char* func, const char* file, int line) CV_NOEXCEPT;
CV_EXPORTS CV_NORETURN void error(int _code, const String& _err, const char* _func, const char* _file, int _line);
#ifdef CV_STATIC_ANALYSIS
@@ -417,11 +338,8 @@ for example:
The macros CV_Assert (and CV_DbgAssert(expr)) evaluate the specified expression. If it is 0, the macros
raise an error (see cv::error). The macro CV_Assert checks the condition in both Debug and Release
configurations while CV_DbgAssert is only retained in the Debug configuration.
CV_AssertTerminate is analog of CV_Assert for invariants check in functions with noexcept attribute.
It does not throw exception, but terminates the application.
*/
#define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
#define CV_AssertTerminate( expr ) do { if(!!(expr)) ; else cv::terminate( #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
#endif // CV_STATIC_ANALYSIS
@@ -450,7 +368,7 @@ It does not throw exception, but terminates the application.
//! @endcond
#if !defined(NDEBUG) || defined(CV_STATIC_ANALYSIS)
#if defined _DEBUG || defined CV_STATIC_ANALYSIS
# define CV_DbgAssert(expr) CV_Assert(expr)
#else
/** replaced with CV_Assert(expr) in Debug configuration */
@@ -698,7 +616,6 @@ namespace ogl
namespace cuda
{
class CV_EXPORTS GpuMat;
class CV_EXPORTS GpuMatND;
class CV_EXPORTS HostMem;
class CV_EXPORTS Stream;
class CV_EXPORTS Event;