Commit Graph

575 Commits

Author SHA1 Message Date
Tiago De Gaspari
3cf4375387
Merge pull request #19842 from gasparitiago:3.4
Update rotatedRectangleIntersection function to calculate near to origin

* Change type used in points function from RotatedRect

In the function that sets the points of a RotatedRect, the types

should be double in order to keep the precision when dealing with
RotatedRects that are defined far from the origin.

This commit solves the problem in some assertions from
rotatedRectangleIntersection when dealing with rectangles far from
origin.

* added proper type casts

* Update rotatedRectangleIntersection function to calculate near to origin

This commit changes the rotatedRectangleIntersection function in order
to calculate the intersection of two rectangles considering that they
are shifted near the coordinates origin (0, 0).

This commit solves the problem in some assertions from
rotatedRectangleIntersection when dealing with rectangles far from
origin.

* Revert type changes in types.cpp and adequate code to c++98

* Revert unnecessary casts on types.cpp

Co-authored-by: Vadim Pisarevsky <vadim.pisarevsky@gmail.com>
2021-06-12 23:28:54 +03:00
Xinguang Bian
7499a15c92 fix data overflow problem in GaussianBlur 2021-05-21 15:17:20 +08:00
thezane
c0162a64d1
Merge pull request #20103 from thezane:make-div-spectrums-public
* Make divSpectrums public

* Add unit test
2021-05-19 12:14:11 +03:00
Alexander Alekhin
55aa1d4852 Merge pull request #19975 from danielenricocahall:fix-template-matcher-sqdiff 2021-04-26 22:52:13 +00:00
danielenricocahall
402bce1a31 address template matching sqdiff bug 2021-04-25 22:17:07 -04:00
Stefano Allegretti
1b64851fa8
Merge pull request #19951 from stal12:3.4
* Fix #4363 - wrong hierarchy (CV_RETR_TREE) in findContours

* Add regression test for findContours

* use C++11 => C++98 on 3.4 branch
2021-04-22 18:20:12 +00:00
Aaron Greig
f3f46096d6 Relax accuracy requirements in the OpenCL sqrt perf arithmetic test.
Also bring perf_imgproc CornerMinEigenVal accuracy requirements in line with
the test_imgproc accuracy requirements on that test and fix indentation on
the latter.

Partially addresses issue #9821
2021-04-06 17:32:48 +01:00
Aaron Greig
53652a6194 Relax accuracy requirement on OpenCL MinEigenVal corner kernel test.
The MinEigenVal path through the corner.cl kernel makes use of native_sqrt,
a math builtin function which has implementation defined accuracy.

Partially addresses issue #9821
2021-03-29 12:06:02 +01:00
Federico Bolelli
9695165877
Merge pull request #19631 from prittt:sota-ccl
* Add Spaghetti algorithm for CCL

* Add stat tests for new and old algorithms

* Switch license header to short version
2021-02-27 17:27:24 +00:00
Alexander Alekhin
fadb25baf8 imgproc(warpAffine): avoid buffer indexes overflow in SIMD code 2021-02-25 20:16:50 +00:00
Alexander Alekhin
17faee5d81 imgproc: add rotatedRectangleIntersection empty input handling 2020-12-20 02:06:50 +00:00
Alexander Alekhin
3e5d7e1718 imgproc: fix minAreaRect() 2020-12-10 08:57:58 +00:00
Alexander Alekhin
da2978f607 ts: cvtest::debugLevel / --test_debug=<N> option 2020-11-28 13:13:28 +00:00
Gil Shotan
1612db5f91 Fix signed integer overflow in connected components 2020-09-13 11:20:42 +00:00
Yosshi999
698b2bf729
Merge pull request #18167 from Yosshi999:bit-exact-gaussian
Bit exact gaussian blur for 16bit unsigned int

* bit-exact gaussian kernel for CV_16U

* SIMD optimization

* template GaussianBlurFixedPoint

* remove template specialization

* simd support for h3N121 uint16

* test for u16 gaussian blur

* remove unnecessary comments

* fix return type of raw()

* add typedef of native internal type in fixedpoint

* update return type of raw()
2020-09-01 10:28:25 +00:00
Yosshi999
7495a4722f
Merge pull request #18053 from Yosshi999:bit-exact-resizeNN
Bit-exact Nearest Neighbor Resizing

* bit exact resizeNN

* change the value of method enum

* add bitexact-nn to ResizeExactTest

* test to compare with non-exact version

* add perf for bit-exact resizenn

* use cvFloor-equivalent

* 1/3 scaling is not stable for floating calculation

* stricter test

* bugfix: broken data in case of 6 or 12bytes elements

* bugfix: broken data in default pix_size

* stricter threshold

* use raw() for floor

* use double instead of int

* follow code reviews

* fewer cases in perf test

* center pixel convention
2020-08-28 21:20:05 +03:00
Alexander Alekhin
83e6813345 imgproc: add missing check into cvtColorTwoPlane() 2020-07-16 20:01:44 +00:00
Alexander Alekhin
2fed41dfa5 imgproc(test): test bitExact cases in OCL/sepFilter2D 2020-07-08 10:14:56 +00:00
Vadim Pisarevsky
8abb312c20
Merge pull request #17417 from vpisarev:fix_fitellipse
* improved fitEllipse and fitEllipseDirect accuracy in singular or close-to-singular cases (see issue #9923)

* scale points using double precision

* added normalization to fitEllipseAMS as well; fixed Java test case by raising the tolerance (it's unclear what is the correct result in this case).

* improved point perturbation a bit. make the code a little bit more clear

* trying to fix Java fitEllipseTest by slightly raising the tolerance threshold

* synchronized C++ version of Java's fitEllipse test

* removed trailing whitespaces
2020-06-01 18:01:20 +00:00
Vadim Pisarevsky
80037dc6de fixed fillPoly, the overloaded variant with InputArrayOfArrays parameter (single or multiple polygons) 2020-05-28 21:36:28 +03:00
Alexander Alekhin
99d29c9d39 Merge pull request #16982 from tomoaki0705:houghLinesOCL 2020-04-06 14:35:14 +00:00
Tomoaki Teshima
07c3aae315 let the test pass on Mali G52 (ODROID-N2) 2020-04-05 01:39:47 +09:00
Alexander Alekhin
be17f532e1 imgproc(resize): fix resizeNNInvoker handling of generic pixel size 2020-03-29 02:41:41 +00:00
Alexander Alekhin
0fb4f2cc9c imgproc: add src.empty() checks in filter operations 2020-03-20 21:04:29 +00:00
Vadim Pisarevsky
8f3867756c
Merge pull request #16594 from vpisarev:hull_ordering_fix
fixed the ordering of contour convex hull points

* partially fixed the issue #4539

* fixed warnings and test failures

* fixed integer overflow (issue #14521)

* added comment to force buildbot to re-run

* extended the test for the issue 4539. Check the expected behaviour on the original contour as well

* added comment; fixed typo, renamed another variable for a little better clarity

* added yet another part to the test for issue #4539, where we run convexHull and convexityDetects on the original contour, without any manipulations. the rest of the test stays the same
2020-02-21 18:18:24 +03:00
Vadim Pisarevsky
07b475062f
Merge pull request #16608 from vpisarev:fix_mac_ocl_tests
* fixed several problems when running tests on Mac:
* OCL_pyrUp
* OCL_flip
* some basic UMat tests
* histogram badarg test (out of range access)

* retained the storepix fix in ocl_flip only for 16U/16S datatype, where the OpenCL compiler on Mac generates incorrect code

* moved deletion of ACCESS_FAST flag to non-SVM branch (where SVM is shared virtual memory (in OpenCL 2.x), not support vector machine)

* force OpenCL to use read/write for GPU<=>CPU memory transfers on machines with discrete video only on Macs. On Windows/Linux the drivers are seemingly smart enough to implement map/unmap properly (and maybe more efficiently than explicit read/write)
2020-02-21 16:13:41 +03:00
Alexander Alekhin
3a546aa380 imgproc: revert resize changes from PR 16497 2020-02-17 15:23:59 +03:00
keeper121
d84360e7f3
Merge pull request #16497 from keeper121:master
* Fix NN resize with dimentions > 4

* add test check for nn resize with channels > 4

* Change types from float to double

* Del unnecessary test file. Move nn test to test_imgwarp. Add 5 channels test only.
2020-02-16 19:33:25 +03:00
Vadim Pisarevsky
e50acb923e
Merge pull request #16495 from vpisarev:drawing_aa_border_fix
* fixed antialiased line rendering to process image border correctly

* fixed warning on Windows

* imgproc(test): circle drawing regression
2020-02-04 19:37:33 +03:00
Arnaud Brejeon
ecbba852cf
Merge pull request #16415 from arnaudbrejeon:bug_fix_16410
* Fix bug 16410 and add test

* imgproc(connectedcomponents): avoid manual uninitialized allocations

* imgproc(connectedcomponents): force 'odd' chunk range size

* imgproc(connectedcomponents): reuse stripeFirstLabel{4/8}Connectivity

* imgproc(connectedcomponents): extend fix from PR14964
2020-01-29 23:55:43 +03:00
Brian Wignall
f9c514b391 Fix spelling typos
backport commit 659ffaddb4
2019-12-27 12:46:53 +00:00
Alexander Alekhin
4733a19bab
Merge pull request #16194 from alalek:fix_16192
* imgproc(test): resize(LANCZOS4) reproducer 16192

* imgproc: fix resize LANCZOS4 coefficients generation
2019-12-19 13:20:42 +03:00
mcellis33
5d15c65e48 Merge pull request #16136 from mcellis33:mec-nan
* Handle det == 0 in findCircle3pts.

Issue 16051 shows a case where findCircle3pts returns NaN for the
center coordinates and radius due to dividing by a determinant of 0. In
this case, the points are colinear, so the longest distance between any
2 points is the diameter of the minimum enclosing circle.

* imgproc(test): update test checks for minEnclosingCircle()

* imgproc: fix handling of special cases in minEnclosingCircle()
2019-12-18 17:25:59 +03:00
Maksim Shabunin
435c97c7a2 imgproc: add parameter checks in calcHist and calcBackProj 2019-12-10 16:10:19 +03:00
RAJKIRAN NATARAJAN
b9435b9e38 Merge pull request #16094 from saskatchewancatch:issue-16053
* Add eps error checking for approxPolyDP to allow sensible values only
for epsilon value of Douglas-Peucker algorithm.

* Review changes for PR
2019-12-09 22:24:35 +03:00
Alexander Alekhin
734de34b7a
Merge pull request #16085 from alalek:imgproc_threshold_to_zero_ipp_bug
* imgproc(IPP): wrong result from threshold(THRESH_TOZERO)

* imgproc(IPP): disable IPP code to pass THRESH_TOZERO test
2019-12-09 14:51:02 +03:00
Brian Wignall
af997529a1 Fix some typos 2019-11-26 18:41:19 +03:00
Alexander Alekhin
f4d55d512f
imgproc: fix bit-exact GaussianBlur() / sepFilter2D() (#15855)
* imgproc: fix bit-exact GaussianBlur() / sepFilter2D()

- avoid kernels with bad approximation
- GaussiabBlur - apply error-diffusion approximation for kernel (8-bit fraction)

* java(test): update features2d ref data

* test: update test_facedetect
2019-11-18 01:39:27 +03:00
Alexander Alekhin
4748aca61f
Merge pull request #15642 from alalek:issue_15597 2019-10-08 00:33:20 +03:00
Alexander Alekhin
a007220c52 imgproc: update histogram test 2019-10-07 15:06:43 +03:00
Alexander Alekhin
c69245da1f imgproc: fix fitLine() implementation
- update optimal solutions on each iteration
2019-10-03 21:23:52 +00:00
luz.paz
fcc7d8dd4e Fix modules/ typos
Found using `codespell -q 3 -S ./3rdparty -L activ,amin,ang,atleast,childs,dof,endwhile,halfs,hist,iff,nd,od,uint`

backporting of commit: ec43292e1e
2019-08-16 17:34:29 +03:00
Vitaly Tuzov
894ad33bf4 Fix pixel value evaluation overflow in bit-exact GaussianBlur implementation 2019-07-12 18:11:51 +03:00
Alexander Alekhin
39a975cb29 Merge pull request #14983 from tomoaki0705:fixOclCvtColorMRGBA 2019-07-05 09:31:08 +00:00
Tomoaki Teshima
594a95839c fix test failure of OCL_ImgProc/CvtColor8u.mRGBA2RGBA 2019-07-05 11:22:22 +09:00
arnaudbrejeon
a37201abee Fix crash, add assert and test 2019-07-02 09:56:31 -07:00
Alexander Alekhin
0a461e7922 Merge pull request #13252 from take1014:filter2d_13179 2019-06-26 13:34:10 +00:00
Rostislav Vasilikhin
e90e0ef9aa Merge pull request #14106 from savuor:lab_wide
Lab, Luv and XYZ conversions rewritten to wide intrinsics (#14106)

* rgb2xyz<float> re-vectorized

* rgb2xyz_i vectorized for ushort and uchar

* xyz2rgb<float> vectorized

* xyz2rgb_i vectorized for both uchar and ushort

* intermediate conversions (int->float) rewritten

* packed rgb2luv rewritten

* (some) float conversions rewritten

* burnt volatile int _3 and similar

* RGB2Lab_b rewritten

* tests: logging made better

* RGB2Lab_f (LRGB path) rewritten

* Lab2RGBfloat rewritten

* Lab2RGBinteger and Lab2RGB_b rewritten to wide universal intrinsics

* Luv2RGBinteger wide vectorized

* RGB2Lab_b fixed: v_sub_wrap instead of saturated sub

* warnings fixed

* trying to fix compilation on older compilers

* using 16x8 registers for 8-element dot product

* cleanup added

* splineInterpolate: loop unrolled, perf fix for f32x4

* Lab2RGBfloat: grab 2x more data to process on f32x4

* nrepeats for Luv2RGBfloat, +20% perf

* minor

* nrepeats to RGB2Lab_f

* Lab2RGBinteger: no tab for linear BGR

* nrepeats for RGB2Luvfloat

* Luv2RGBinteger: no tab for linear RGB

* +10% more to perf of Luv2RGBfloat

* nrepeats for 256-simd for Lab2RGBfloat

* less warnings

* BOM removed

* CV_SIMD_WIDTH used for lanes number checking

* trilinearPackedInterpolate: 128-bit specialization added

* fix build; no vx_cleanup(), instrumentation instead
2019-05-20 21:10:20 +03:00
Thang Tran
1aff378ae8 imgproc: fixed bug from intersectConvexConvex
Added checks for all of vertices from each contour instead of checking
only for the first vertex.
2019-05-01 11:06:30 +02:00
take1014
e0b664f390 fix dftFilter2D 2019-03-13 00:27:56 +09:00