Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
7fe1664
Use initial quads corners in ChessBoardDetector::findQuadNeighbors
MaximSmolskiy Mar 10, 2024
99cacaa
Merge pull request #25195 from MaximSmolskiy:use-initial-quads-corner…
asmorkalov Apr 2, 2024
13c95ef
Merge pull request #25312 from dkurt:dnn_hotfix_tflite
dkurt Apr 3, 2024
45587f2
Update highgui+HighGui.java
sepperliu Apr 3, 2024
2d864c3
Export TIFF compression options as API and git rid of tiff.h.
asmorkalov Apr 3, 2024
d81cd13
Use cvtColor() for Bayer image color demosaicing and for V4L2_PIX_FMT…
catree Mar 28, 2024
55d7e3f
Merge pull request #1165 from fengyuentau:gold_yolo
fengyuentau Apr 3, 2024
df627e1
Resolve valgrind issue at QRCode detector
dkurt Apr 3, 2024
bd819f9
Merge pull request #25327 from dkurt:uninit_jump_qrcode
asmorkalov Apr 4, 2024
bf7208e
Merge pull request #25322 from sepperliu:patch-1
asmorkalov Apr 4, 2024
e665d2d
Merge pull request #25325 from asmorkalov:as/tiff_flags
asmorkalov Apr 4, 2024
2b1c8aa
Merge pull request #25287 from catree:feat_V4L2_PIX_FMT_SGRBG8_use_cv…
asmorkalov Apr 4, 2024
89b91fc
Added option to dump v4l2 test frame from virtual camera.
asmorkalov Apr 4, 2024
e0b7f04
Merge pull request #25333 from asmorkalov:as/dump_v4l2_test_frame
asmorkalov Apr 5, 2024
e1ed422
HALL interface for transpose2d.
asmorkalov Apr 5, 2024
e17b8ae
typo in env_reference.markdown
LaurentBerger Apr 6, 2024
5121a1b
Merge pull request #25353 from LaurentBerger:typotutoenvref
alalek Apr 6, 2024
5be158a
Further optimize fastDepthwiseConv for RVV.
hanliutong Apr 7, 2024
5528e70
remove floating point literal
UnaNancyOwen Apr 8, 2024
e805008
Merge pull request #25368 from UnaNancyOwen:fix_double
asmorkalov Apr 8, 2024
30889f4
Added tests for adaptiveThreshold and sepFilter2D
Apr 8, 2024
e63690a
Add a shape checker for tflite models
CNOCycle Apr 6, 2024
8ed52cb
Merge pull request #25356 from Kumataro:fix25345
Kumataro Apr 8, 2024
e55cf44
Merge pull request #25372 from CNOCycle:tflite/ShapeChecker
asmorkalov Apr 8, 2024
e5d530a
Merge pull request #25342 from asmorkalov:as/HAL_transpose
asmorkalov Apr 9, 2024
a251329
Merge pull request #25146 from mshabunin:cpp-contours
mshabunin Apr 9, 2024
b0d9058
Merge pull request #25371 from alexlyulkov:al/adaptive-threshold-tests
asmorkalov Apr 9, 2024
4221ae1
Supress build warnings on Win32 for ARM.
asmorkalov Apr 9, 2024
e4677fb
Merge pull request #25361 from hanliutong:rvv-f32
asmorkalov Apr 9, 2024
953581a
Merge pull request #25357 from cabelo:yolov8m
cabelo Apr 9, 2024
f379247
Merge pull request #25364 from mshabunin:fix-unaligned-filter
mshabunin Apr 9, 2024
cb339ac
Fixing code example on
gmatheu Apr 9, 2024
148b2ec
calib3d: increased AP3P test threshold for RISC-V platform
mshabunin Apr 9, 2024
b3e863f
Merge pull request #25380 from mshabunin:fix-calib-tests
asmorkalov Apr 10, 2024
9ced486
Merge pull request #25381 from gmatheu:v4.x_js_markdown_typo
asmorkalov Apr 10, 2024
3697601
Merge pull request #25375 from asmorkalov:as/win32_arm_warning
asmorkalov Apr 10, 2024
282c762
Merge branch 4.x
asmorkalov Apr 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ cv.cvtColor(dst, dst, cv.COLOR_***2RGBA);

Then, new an ImageData obj from dst:
@code{.js}
let imgData = new ImageData(new Uint8ClampedArray(dst.data, dst.cols, dst.rows);
let imgData = new ImageData(new Uint8ClampedArray(dst.data), dst.cols, dst.rows);
@endcode

Finally, display it:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Some modules have multiple available backends, following variables allow choosin
| OPENCV_PARALLEL_PRIORITY_LIST | string, `,`-separated | | list of backends in priority order |
| OPENCV_UI_BACKEND | string | | choose highgui backend for window rendering (one of `GTK`, `GTK3`, `GTK2`, `QT`, `WIN32`) |
| OPENCV_UI_PRIORITY_${NAME} | num | | set highgui backend priority, default is 1000 |
| OPENCV_UI_PRIORITY_LIST | string, `,`-separated | | list of hioghgui backends in priority order |
| OPENCV_UI_PRIORITY_LIST | string, `,`-separated | | list of highgui backends in priority order |
| OPENCV_VIDEOIO_PRIORITY_${NAME} | num | | set videoio backend priority, default is 1000 |
| OPENCV_VIDEOIO_PRIORITY_LIST | string, `,`-separated | | list of videoio backends in priority order |

Expand Down
20 changes: 11 additions & 9 deletions modules/calib/src/calibinit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1641,10 +1641,11 @@ void ChessBoardDetector::findQuadNeighbors()
continue;

float min_dist = FLT_MAX;
int closest_neighbor_idx = -1;
int closest_corner_idx = -1;
ChessBoardQuad *closest_quad = 0;

Point2f pt = cur_quad.corners[i]->pt;
Point2f pt = all_quads_pts[(idx << 2) + i];

// find the closest corner in all other quadrangles
std::vector<float> query = Mat(pt);
Expand All @@ -1664,7 +1665,7 @@ void ChessBoardDetector::findQuadNeighbors()
if (q_k.neighbors[j])
continue;

const float dist = normL2Sqr<float>(pt - q_k.corners[j]->pt);
const float dist = normL2Sqr<float>(pt - all_quads_pts[neighbor_idx]);
if (dist < min_dist &&
dist <= cur_quad.edge_len * thresh_scale &&
dist <= q_k.edge_len * thresh_scale)
Expand All @@ -1679,14 +1680,15 @@ void ChessBoardDetector::findQuadNeighbors()
DPRINTF("Incompatible edge lengths");
continue;
}
closest_neighbor_idx = neighbor_idx;
closest_corner_idx = j;
closest_quad = &q_k;
min_dist = dist;
}
}

// we found a matching corner point?
if (closest_corner_idx >= 0 && min_dist < FLT_MAX)
if (closest_neighbor_idx >= 0 && closest_corner_idx >= 0 && min_dist < FLT_MAX)
{
CV_Assert(closest_quad);

Expand All @@ -1698,14 +1700,15 @@ void ChessBoardDetector::findQuadNeighbors()
// This is necessary to support small squares where otherwise the wrong
// corner will get matched to closest_quad;
ChessBoardCorner& closest_corner = *closest_quad->corners[closest_corner_idx];
cv::Point2f closest_corner_pt = all_quads_pts[closest_neighbor_idx];

int j = 0;
for (; j < 4; j++)
{
if (cur_quad.neighbors[j] == closest_quad)
break;

if (normL2Sqr<float>(closest_corner.pt - cur_quad.corners[j]->pt) < min_dist)
if (normL2Sqr<float>(closest_corner_pt - all_quads_pts[(idx << 2) + j]) < min_dist)
break;
}
if (j < 4)
Expand All @@ -1720,9 +1723,8 @@ void ChessBoardDetector::findQuadNeighbors()
if (j < 4)
continue;

// check whether the closest corner to closest_corner
// is different from cur_quad->corners[i]->pt
query = Mat(closest_corner.pt);
// check whether the closest corner to closest_corner is different from pt
query = Mat(closest_corner_pt);
radius = min_dist + 1;
neighbors_count = all_quads_pts_index.radiusSearch(query, neighbors_indices, neighbors_dists, radius, search_params);

Expand All @@ -1740,14 +1742,14 @@ void ChessBoardDetector::findQuadNeighbors()
CV_DbgAssert(q);
if (!q->neighbors[k])
{
if (normL2Sqr<float>(closest_corner.pt - q->corners[k]->pt) < min_dist)
if (normL2Sqr<float>(closest_corner_pt - all_quads_pts[neighbor_idx]) < min_dist)
break;
}
}
if (neighbor_idx_idx < neighbors_count)
continue;

closest_corner.pt = (pt + closest_corner.pt) * 0.5f;
closest_corner.pt = (pt + closest_corner_pt) * 0.5f;

// We've found one more corner - remember it
cur_quad.count++;
Expand Down
86 changes: 58 additions & 28 deletions modules/core/include/opencv2/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ CV_EXPORTS void swap( UMat& a, UMat& b );
The function computes and returns the coordinate of a donor pixel corresponding to the specified
extrapolated pixel when using the specified extrapolation border mode. For example, if you use
cv::BORDER_WRAP mode in the horizontal direction, cv::BORDER_REFLECT_101 in the vertical direction and
want to compute value of the "virtual" pixel Point(-5, 100) in a floating-point image img , it
want to compute value of the "virtual" pixel Point(-5, 100) in a floating-point image img, it
looks like:
@code{.cpp}
float val = img.at<float>(borderInterpolate(100, img.rows, cv::BORDER_REFLECT_101),
Expand All @@ -259,7 +259,7 @@ copyMakeBorder.
@param p 0-based coordinate of the extrapolated pixel along one of the axes, likely \<0 or \>= len
@param len Length of the array along the corresponding axis.
@param borderType Border type, one of the #BorderTypes, except for #BORDER_TRANSPARENT and
#BORDER_ISOLATED . When borderType==#BORDER_CONSTANT , the function always returns -1, regardless
#BORDER_ISOLATED. When borderType==#BORDER_CONSTANT, the function always returns -1, regardless
of p and len.

@sa copyMakeBorder
Expand Down Expand Up @@ -586,19 +586,39 @@ CV_EXPORTS_AS(sumElems) Scalar sum(InputArray src);
/** @brief Checks for the presence of at least one non-zero array element.

The function returns whether there are non-zero elements in src
@note CV_16F/CV_16BF/CV_Bool/CV_64U/CV_64S/CV_32U are not supported for src.

The function do not work with multi-channel arrays. If you need to check non-zero array
elements across all the channels, use Mat::reshape first to reinterpret the array as
single-channel. Or you may extract the particular channel using either extractImageCOI, or
mixChannels, or split.

@note
- CV_16F/CV_16BF/CV_Bool/CV_64U/CV_64S/CV_32U are not supported for src.
- If the location of non-zero array elements is important, @ref findNonZero is helpful.
- If the count of non-zero array elements is important, @ref countNonZero is helpful.
@param src single-channel array.
@sa mean, meanStdDev, norm, minMaxLoc, calcCovarMatrix
@sa findNonZero, countNonZero
*/
CV_EXPORTS_W bool hasNonZero( InputArray src );

/** @brief Counts non-zero array elements.

The function returns the number of non-zero elements in src :
\f[\sum _{I: \; \texttt{src} (I) \ne0 } 1\f]
@note CV_16F/CV_16BF/CV_Bool/CV_64U/CV_64S/CV_32U are not supported for src.

The function do not work with multi-channel arrays. If you need to count non-zero array
elements across all the channels, use Mat::reshape first to reinterpret the array as
single-channel. Or you may extract the particular channel using either extractImageCOI, or
mixChannels, or split.

@note
- CV_16F/CV_16BF/CV_Bool/CV_64U/CV_64S/CV_32U are not supported for src.
- If only whether there are non-zero elements is important, @ref hasNonZero is helpful.
- If the location of non-zero array elements is important, @ref findNonZero is helpful.
@param src single-channel array.
@sa mean, meanStdDev, norm, minMaxLoc, calcCovarMatrix
@sa findNonZero, hasNonZero
*/
CV_EXPORTS_W int countNonZero( InputArray src );

Expand All @@ -625,9 +645,19 @@ or
// access pixel coordinates
Point pnt = locations[i];
@endcode
@note CV_16F/CV_16BF/CV_Bool/CV_64U/CV_64S/CV_32U are not supported for src.

The function do not work with multi-channel arrays. If you need to find non-zero
elements across all the channels, use Mat::reshape first to reinterpret the array as
single-channel. Or you may extract the particular channel using either extractImageCOI, or
mixChannels, or split.

@note
- CV_16F/CV_16BF/CV_Bool/CV_64U/CV_64S/CV_32U are not supported for src.
- If only count of non-zero array elements is important, @ref countNonZero is helpful.
- If only whether there are non-zero elements is important, @ref hasNonZero is helpful.
@param src single-channel array
@param idx the output array, type of cv::Mat or std::vector<Point>, corresponding to non-zero indices in the input
@sa countNonZero, hasNonZero
*/
CV_EXPORTS_W void findNonZero( InputArray src, OutputArray idx );

Expand Down Expand Up @@ -834,8 +864,8 @@ array region.

The function do not work with multi-channel arrays. If you need to find minimum or maximum
elements across all the channels, use Mat::reshape first to reinterpret the array as
single-channel. Or you may extract the particular channel using either extractImageCOI , or
mixChannels , or split .
single-channel. Or you may extract the particular channel using either extractImageCOI, or
mixChannels, or split.
@note CV_16F/CV_16BF/CV_Bool/CV_64U/CV_64S/CV_32U are not supported for src.
@param src input single-channel array.
@param minVal pointer to the returned minimum value; NULL is used if not required.
Expand Down Expand Up @@ -889,8 +919,8 @@ The function cv::minMaxIdx finds the minimum and maximum element values and thei
extremums are searched across the whole array or, if mask is not an empty array, in the specified
array region. The function does not work with multi-channel arrays. If you need to find minimum or
maximum elements across all the channels, use Mat::reshape first to reinterpret the array as
single-channel. Or you may extract the particular channel using either extractImageCOI , or
mixChannels , or split . In case of a sparse matrix, the minimum is found among non-zero elements
single-channel. Or you may extract the particular channel using either extractImageCOI, or
mixChannels, or split. In case of a sparse matrix, the minimum is found among non-zero elements
only.
@note When minIdx is not NULL, it must have at least 2 elements (as well as maxIdx), even if src is
a single-row or single-column matrix. In OpenCV (following MATLAB) each array has at least 2
Expand Down Expand Up @@ -927,8 +957,8 @@ CV_EXPORTS void minMaxLoc(const SparseMat& a, double* minVal,
The function #reduce reduces the matrix to a vector by treating the matrix rows/columns as a set of
1D vectors and performing the specified operation on the vectors until a single row/column is
obtained. For example, the function can be used to compute horizontal and vertical projections of a
raster image. In case of #REDUCE_MAX and #REDUCE_MIN , the output image should have the same type as the source one.
In case of #REDUCE_SUM, #REDUCE_SUM2 and #REDUCE_AVG , the output may have a larger element bit-depth to preserve accuracy.
raster image. In case of #REDUCE_MAX and #REDUCE_MIN, the output image should have the same type as the source one.
In case of #REDUCE_SUM, #REDUCE_SUM2 and #REDUCE_AVG, the output may have a larger element bit-depth to preserve accuracy.
And multi-channel arrays are also supported in these two reduction modes.

The following code demonstrates its usage for a single channel matrix.
Expand Down Expand Up @@ -982,7 +1012,7 @@ CV_EXPORTS_W void merge(InputArrayOfArrays mv, OutputArray dst);
The function cv::split splits a multi-channel array into separate single-channel arrays:
\f[\texttt{mv} [c](I) = \texttt{src} (I)_c\f]
If you need to extract a single channel or do some other sophisticated channel permutation, use
mixChannels .
mixChannels.

The following example demonstrates how to split a 3-channel matrix into 3 single channel matrices.
@snippet snippets/core_split.cpp example
Expand Down Expand Up @@ -1123,7 +1153,7 @@ The example scenarios of using the function are the following:
flipping around the x-axis and positive value (for example, 1) means
flipping around y-axis. Negative value (for example, -1) means flipping
around both axes.
@sa transpose , repeat , completeSymm
@sa transpose, repeat, completeSymm
*/
CV_EXPORTS_W void flip(InputArray src, OutputArray dst, int flipCode);

Expand Down Expand Up @@ -1155,7 +1185,7 @@ The function cv::rotate rotates the array in one of three different ways:
@param dst output array of the same type as src. The size is the same with ROTATE_180,
and the rows and cols are switched for ROTATE_90_CLOCKWISE and ROTATE_90_COUNTERCLOCKWISE.
@param rotateCode an enum to specify how to rotate the array; see the enum #RotateFlags
@sa transpose , repeat , completeSymm, flip, RotateFlags
@sa transpose, repeat, completeSymm, flip, RotateFlags
*/
CV_EXPORTS_W void rotate(InputArray src, OutputArray dst, int rotateCode);

Expand Down Expand Up @@ -1589,7 +1619,7 @@ converts denormalized values to zeros on output. Special values (NaN,
Inf) are not handled.
@param src input array.
@param dst output array of the same size and type as src.
@sa log , cartToPolar , polarToCart , phase , pow , sqrt , magnitude
@sa log, cartToPolar, polarToCart, phase, pow, sqrt, magnitude
*/
CV_EXPORTS_W void exp(InputArray src, OutputArray dst);

Expand Down Expand Up @@ -1742,7 +1772,7 @@ should have the same type as src1 and src2.
@param dst output matrix; it has the proper size and the same type as
input matrices.
@param flags operation flags (cv::GemmFlags)
@sa mulTransposed , transform
@sa mulTransposed, transform
*/
CV_EXPORTS_W void gemm(InputArray src1, InputArray src2, double alpha,
InputArray src3, double beta, OutputArray dst, int flags = 0);
Expand All @@ -1752,7 +1782,7 @@ CV_EXPORTS_W void gemm(InputArray src1, InputArray src2, double alpha,
The function cv::mulTransposed calculates the product of src and its
transposition:
\f[\texttt{dst} = \texttt{scale} ( \texttt{src} - \texttt{delta} )^T ( \texttt{src} - \texttt{delta} )\f]
if aTa=true , and
if aTa=true, and
\f[\texttt{dst} = \texttt{scale} ( \texttt{src} - \texttt{delta} ) ( \texttt{src} - \texttt{delta} )^T\f]
otherwise. The function is used to calculate the covariance matrix. With
zero delta, it can be used as a faster substitute for general matrix
Expand All @@ -1765,7 +1795,7 @@ description below.
@param delta Optional delta matrix subtracted from src before the
multiplication. When the matrix is empty ( delta=noArray() ), it is
assumed to be zero, that is, nothing is subtracted. If it has the same
size as src , it is simply subtracted. Otherwise, it is "repeated" (see
size as src, it is simply subtracted. Otherwise, it is "repeated" (see
repeat ) to cover the full src and then subtracted. Type of the delta
matrix, when it is not empty, must be the same as the type of created
output matrix. See the dtype parameter description below.
Expand Down Expand Up @@ -2039,7 +2069,7 @@ in the descending order.
@param eigenvectors output matrix of eigenvectors; it has the same size and type as src; the
eigenvectors are stored as subsequent matrix rows, in the same order as the corresponding
eigenvalues.
@sa eigenNonSymmetric, completeSymm , PCA
@sa eigenNonSymmetric, completeSymm, PCA
*/
CV_EXPORTS_W bool eigen(InputArray src, OutputArray eigenvalues,
OutputArray eigenvectors = noArray());
Expand Down Expand Up @@ -2179,7 +2209,7 @@ So, the function chooses an operation mode depending on the flags and size of th

If #DFT_SCALE is set, the scaling is done after the transformation.

Unlike dct , the function supports arrays of arbitrary size. But only those arrays are processed
Unlike dct, the function supports arrays of arbitrary size. But only those arrays are processed
efficiently, whose sizes can be factorized in a product of small prime numbers (2, 3, and 5 in the
current implementation). Such an efficient DFT size can be calculated using the getOptimalDFTSize
method.
Expand Down Expand Up @@ -2262,8 +2292,8 @@ nonzeroRows rows of the input array (#DFT_INVERSE is not set) or only the first
output array (#DFT_INVERSE is set) contain non-zeros, thus, the function can handle the rest of the
rows more efficiently and save some time; this technique is very useful for calculating array
cross-correlation or convolution using DFT.
@sa dct , getOptimalDFTSize , mulSpectrums, filter2D , matchTemplate , flip , cartToPolar ,
magnitude , phase
@sa dct, getOptimalDFTSize, mulSpectrums, filter2D, matchTemplate, flip, cartToPolar,
magnitude, phase
*/
CV_EXPORTS_W void dft(InputArray src, OutputArray dst, int flags = 0, int nonzeroRows = 0);

Expand Down Expand Up @@ -2300,9 +2330,9 @@ floating-point array:
\f[X = \left (C^{(N)} \right )^T \cdot X \cdot C^{(N)}\f]

The function chooses the mode of operation by looking at the flags and size of the input array:
- If (flags & #DCT_INVERSE) == 0 , the function does a forward 1D or 2D transform. Otherwise, it
- If (flags & #DCT_INVERSE) == 0, the function does a forward 1D or 2D transform. Otherwise, it
is an inverse 1D or 2D transform.
- If (flags & #DCT_ROWS) != 0 , the function performs a 1D transform of each row.
- If (flags & #DCT_ROWS) != 0, the function performs a 1D transform of each row.
- If the array is a single column or a single row, the function performs a 1D transform.
- If none of the above is true, the function performs a 2D transform.

Expand All @@ -2318,7 +2348,7 @@ of a vector of size N/2 . Thus, the optimal DCT size N1 \>= N can be calculated
@param src input floating-point array.
@param dst output array of the same size and type as src .
@param flags transformation flags as a combination of cv::DftFlags (DCT_*)
@sa dft , getOptimalDFTSize , idct
@sa dft, getOptimalDFTSize, idct
*/
CV_EXPORTS_W void dct(InputArray src, OutputArray dst, int flags = 0);

Expand All @@ -2337,7 +2367,7 @@ CV_EXPORTS_W void idct(InputArray src, OutputArray dst, int flags = 0);
The function cv::mulSpectrums performs the per-element multiplication of the two CCS-packed or complex
matrices that are results of a real or complex Fourier transform.

The function, together with dft and idft , may be used to calculate convolution (pass conjB=false )
The function, together with dft and idft, may be used to calculate convolution (pass conjB=false )
or correlation (pass conjB=true ) of two arrays rapidly. When the arrays are complex, they are
simply multiplied (per element) with an optional conjugation of the second-array elements. When the
arrays are real, they are assumed to be CCS-packed (see dft for details).
Expand Down Expand Up @@ -2371,7 +2401,7 @@ While the function cannot be used directly to estimate the optimal vector size f
(since the current DCT implementation supports only even-size vectors), it can be easily processed
as getOptimalDFTSize((vecsize+1)/2)\*2.
@param vecsize vector size.
@sa dft , dct , idft , idct , mulSpectrums
@sa dft, dct, idft, idct, mulSpectrums
*/
CV_EXPORTS_W int getOptimalDFTSize(int vecsize);

Expand Down Expand Up @@ -2923,7 +2953,7 @@ class CV_EXPORTS RNG

The methods transform the state using the MWC algorithm and return the
next random number. The first form is equivalent to RNG::next . The
second form returns the random number modulo N , which means that the
second form returns the random number modulo N, which means that the
result is in the range [0, N) .
*/
unsigned operator ()();
Expand Down
Loading