1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

Merge branch 4.x

This commit is contained in:
Alexander Smorkalov
2024-08-27 18:31:36 +03:00
108 changed files with 1241 additions and 646 deletions
+95
View File
@@ -0,0 +1,95 @@
{
"whitelist":
{
"": [
"Canny",
"GaussianBlur",
"Laplacian",
"HoughLines",
"HoughLinesP",
"HoughCircles",
"Scharr",
"Sobel",
"adaptiveThreshold",
"approxPolyDP",
"arcLength",
"bilateralFilter",
"blur",
"boundingRect",
"boxFilter",
"calcBackProject",
"calcHist",
"circle",
"compareHist",
"connectedComponents",
"connectedComponentsWithStats",
"contourArea",
"convexHull",
"convexityDefects",
"cornerHarris",
"cornerMinEigenVal",
"createCLAHE",
"createLineSegmentDetector",
"cvtColor",
"demosaicing",
"dilate",
"distanceTransform",
"distanceTransformWithLabels",
"drawContours",
"ellipse",
"ellipse2Poly",
"equalizeHist",
"erode",
"filter2D",
"findContours",
"fitEllipse",
"fitLine",
"floodFill",
"getAffineTransform",
"getPerspectiveTransform",
"getRotationMatrix2D",
"getStructuringElement",
"goodFeaturesToTrack",
"grabCut",
"integral",
"integral2",
"isContourConvex",
"line",
"matchShapes",
"matchTemplate",
"medianBlur",
"minAreaRect",
"minEnclosingCircle",
"moments",
"morphologyEx",
"pointPolygonTest",
"putText",
"pyrDown",
"pyrUp",
"rectangle",
"remap",
"resize",
"sepFilter2D",
"threshold",
"warpAffine",
"warpPerspective",
"warpPolar",
"watershed",
"fillPoly",
"fillConvexPoly",
"polylines"
],
"CLAHE": ["apply", "collectGarbage", "getClipLimit", "getTilesGridSize", "setClipLimit", "setTilesGridSize"],
"segmentation_IntelligentScissorsMB": [
"IntelligentScissorsMB",
"setWeights",
"setGradientMagnitudeMaxLimit",
"setEdgeFeatureZeroCrossingParameters",
"setEdgeFeatureCannyParameters",
"applyImage",
"applyImageFeatures",
"buildMap",
"getContour"
]
}
}
@@ -0,0 +1,30 @@
#!/usr/bin/env python
from __future__ import print_function
import numpy as np
import cv2 as cv
from tests_common import NewOpenCVTests
class Imgproc_Tests(NewOpenCVTests):
def test_python_986(self):
cntls = []
img = np.zeros((100,100,3), dtype=np.uint8)
color = (0,0,0)
cnts = np.array(cntls, dtype=np.int32).reshape((1, -1, 2))
try:
cv.fillPoly(img, cnts, color)
assert False
except:
assert True
def test_filter2d(self):
img = self.get_sample('samples/data/lena.jpg', 1)
eps = 0.001
# compare 2 ways of computing 3x3 blur using the same function
kernel = np.array([[1, 1, 1], [1, 1, 1], [1, 1, 1]], dtype='float32')
img_blur0 = cv.filter2D(img, cv.CV_32F, kernel*(1./9))
img_blur1 = cv.filter2Dp(img, kernel, ddepth=cv.CV_32F, scale=1./9)
self.assertLess(cv.norm(img_blur0 - img_blur1, cv.NORM_INF), eps)