Skip to content

(5.x) Merge 4.x #1159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 55 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
07b01bf
updated/added regression test data for truetype font support function…
vpisarev Nov 9, 2020
bd4302f
updated/added regression test data for truetype font support function…
vpisarev Nov 9, 2020
57149dc
updated drawing regression tests' data
vpisarev Nov 9, 2020
6f89731
Merge pull request #814 from vpisarev:ttf2_1
vpisarev Nov 11, 2020
ffb83ef
Merge remote-tracking branch 'upstream/master' into merge-4.x
alalek Nov 27, 2020
2e02a98
Merge branch 4.x
alalek Apr 9, 2021
a3d3963
Merge branch 4.x
alalek Jun 4, 2021
3ef4bb9
Merge branch 4.x
alalek Oct 15, 2021
c0aab8c
Merge pull request #942 from savuor:levmarqfromscratch
savuor Dec 27, 2021
807e3ed
Merge branch 4.x
alalek Dec 30, 2021
820fb3b
Merge branch 4.x
alalek Feb 22, 2022
61d8810
Merge branch 4.x
opencv-pushbot Apr 23, 2022
a13afb8
Merge pull request #889 from ibvfteh:pointcloudio
ibvfteh May 16, 2022
ce6014b
warped depth added
savuor Jun 23, 2022
0599c77
+rgb.png
savuor Jun 24, 2022
f7fcd91
warped rgb and depth updated
savuor Jun 26, 2022
ea2479e
generated images fixed
savuor Jun 29, 2022
04b3502
depth generator moved from main repo to extra
savuor Jun 29, 2022
74a7296
Merge pull request #985 from savuor:warpFrameTests
asmorkalov Aug 4, 2022
78cdaef
Merge branch 4.x
alalek Aug 21, 2022
d987d91
Blender-generated normals added + blender scene
savuor Jul 13, 2022
d8a51e7
Merge pull request #991 from savuor:normals_scale_test
asmorkalov Aug 24, 2022
5d8cb49
test data added
savuor Sep 2, 2022
73f1264
Merge pull request #1003 from savuor/levmarq_stereocalib_fix
asmorkalov Sep 6, 2022
7e5d87c
Merge branch 4.x
alalek Jan 8, 2023
fa87b1b
Merge branch 4.x
alalek Jan 18, 2023
0919998
Merge branch 4.x
alalek Jan 28, 2023
dd7957a
Merge branch '4.x' into 5.x-merge-4.x-origin
asmorkalov May 31, 2023
b157e81
Merge branch 4.x
asmorkalov Jul 12, 2023
62df05b
update for testing color IO
starga2er777 Jul 13, 2023
2976f0e
Merge pull request #1075 from starga2er777:5.x
asmorkalov Jul 25, 2023
8c6a0fa
Merge branch 4.x
asmorkalov Jul 27, 2023
fb831c6
first commit
fengyuentau Aug 8, 2023
f48d76b
Merge branch 4.x
asmorkalov Sep 11, 2023
eeae805
Merge branch 4.x
asmorkalov Sep 28, 2023
bbc94be
Merge pull request #1092 from fengyuentau:halide_cleanup_5.x
asmorkalov Oct 13, 2023
261dd8c
Merge branch 4.x
asmorkalov Oct 17, 2023
0f17fd8
Removed torch7 models and files used by Torch7 tests.
Sep 21, 2023
28e3fba
Merge pull request #1097 from alexlyulkov:al/remove-torch7-from-dnn
asmorkalov Oct 26, 2023
8997e98
Remove more Torch7 data
dkurt Oct 27, 2023
6e01d0c
Merge pull request #1114 from dkurt:remove_more_torch_data
asmorkalov Oct 29, 2023
5bc2cd9
Merge branch 4.x
asmorkalov Nov 2, 2023
df83fe2
Merge pull request #1037 from savuor:nanMask
savuor Nov 9, 2023
7d0a5be
Merge branch 4.x
asmorkalov Jan 17, 2024
d0928ee
Merge branch 4.x
asmorkalov Jan 23, 2024
a84f2bd
Merge branch 4.x
asmorkalov Feb 8, 2024
bb16501
Merge pull request #1145 from savuor:rv/ply_mesh
savuor Feb 12, 2024
6c75a23
add rendering data
Jul 26, 2023
680fcd9
Merge branch 4.x
asmorkalov Feb 16, 2024
65b8d80
Merge pull request #1113 from savuor:tri_rasterize
asmorkalov Feb 19, 2024
59823be
Merge branch 4.x
asmorkalov Feb 26, 2024
761dfc5
Removed float indices from dnn tests
Feb 19, 2024
be0138a
Merge pull request #1154 from asmorkalov:al/dnn-type-inference
asmorkalov Mar 4, 2024
af30797
Move objdetect parts to contrib, revised files for test. (#1155)
kaingwade Mar 21, 2024
415d7ea
Merge branch 4.x
asmorkalov Mar 26, 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
Binary file not shown.
12,213 changes: 12,213 additions & 0 deletions testdata/cv/cascadeandhog/cascades/haarcascade_eye.xml

Large diffs are not rendered by default.

Binary file added testdata/cv/rgbd/normals_check/depth.yaml.gz
Binary file not shown.
Binary file added testdata/cv/rgbd/normals_check/normals0.yaml.gz
Binary file not shown.
Binary file added testdata/cv/rgbd/normals_check/normals1.yaml.gz
Binary file not shown.
Binary file added testdata/cv/rgbd/normals_check/normals2.yaml.gz
Binary file not shown.
Binary file not shown.
Binary file added testdata/cv/rgbd/warpedDepth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added testdata/cv/rgbd/warpedRgb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions testdata/cv/rgbd/warped_depth_generator/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
numpy>=1.17.4
scipy>=1.3.3
PIL>=7.0.0
111 changes: 111 additions & 0 deletions testdata/cv/rgbd/warped_depth_generator/warp_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
import numpy as np
from scipy.spatial.transform import Rotation
from PIL import Image
import os

depthFactor = 5000
psize = (640, 480)
fx = 525.0
fy = 525.0
cx = psize[0]/2-0.5
cy = psize[1]/2-0.5
K = np.array([[fx, 0, cx],
[ 0, fy, cy],
[ 0, 0, 1]])

# some random transform
rmat = Rotation.from_rotvec(np.array([0.1, 0.2, 0.3])).as_dcm()
tmat = np.array([[-0.04, 0.05, 0.6]]).T
rtmat = np.vstack((np.hstack((rmat, tmat)), np.array([[0, 0, 0, 1]])))

testDataPath = os.getenv("OPENCV_TEST_DATA_PATH", default=None)
srcDepth = np.asarray(Image.open(testDataPath + "/cv/rgbd/depth.png"))
srcRgb = np.asarray(Image.open(testDataPath + "/cv/rgbd/rgb.png"))

def reproject(image, df, K):
Kinv = np.linalg.inv(K)
xsz, ysz = image.shape[1], image.shape[0]
reprojected = np.zeros((ysz, xsz, 3))
for y in range(ysz):
for x in range(xsz):
z = image[y, x]/df

v = Kinv @ np.array([x*z, y*z, z]).T

#xv = (x - cx)/fx * z
#yv = (y - cy)/fy * z
#zv = z

reprojected[y, x, :] = v[:]
return reprojected

def reprojectRtProject(image, K, depthFactor, rmat, tmat):
Kinv = np.linalg.inv(K)
xsz, ysz = image.shape[1], image.shape[0]
projected = np.zeros((ysz, xsz, 3))
for y in range(ysz):
for x in range(xsz):
z = image[y, x]/depthFactor

v = K @ (rmat @ Kinv @ np.array([x*z, y*z, z]).T + tmat[:, 0])

if z > 0:
projected[y, x, :] = v[:]

return projected

def reprojectRt(image, K, depthFactor, rmat, tmat):
Kinv = np.linalg.inv(K)
xsz, ysz = image.shape[1], image.shape[0]
rotated = np.zeros((ysz, xsz, 3))
for y in range(ysz):
for x in range(xsz):
z = image[y, x]/depthFactor

v = rmat @ Kinv @ np.array([x*z, y*z, z]).T + tmat[:, 0]

rotated[y, x, :] = v[:]

return rotated

# put projected points on a depth map
def splat(projected, maxv, rgb):
xsz, ysz = projected.shape[1], projected.shape[0]
depth = np.full((ysz, xsz), maxv, np.float32)
colors = np.full((ysz, xsz, 3), 0, np.uint8)
for y in range(ysz):
for x in range(xsz):
p = projected[y, x, :]
z = p[2]
if z > 0:
u, v = int(p[0]/z), int(p[1]/z)
okuv = (u >= 0 and v >= 0 and u < xsz and v < ysz)
if okuv and depth[v, u] > z:
depth[v, u] = z
colors[v, u, :] = rgb[y, x, :]
return depth, colors

maxv = depthFactor
dstDepth, dstRgb = splat(reprojectRtProject(srcDepth, K, depthFactor, rmat, tmat), maxv, srcRgb)
dstDepth[dstDepth >= maxv] = 0
dstDepth = (dstDepth*depthFactor).astype(np.uint16)

Image.fromarray(dstDepth).save(testDataPath + "/cv/rgbd/warpedDepth.png")
Image.fromarray(dstRgb ).save(testDataPath + "/cv/rgbd/warpedRgb.png")

# debug
def outFile(path, ptsimg):
f = open(path, "w")
for y in range(ptsimg.shape[0]):
for x in range(ptsimg.shape[1]):
v = ptsimg[y, x, :]
if v[2] > 0:
f.write(f"v {v[0]} {v[1]} {v[2]}\n")
f.close()

outObj = False
if outObj:
objdir = "/path/to/objdir/"
outFile(objdir + "reproj_rot_proj.obj", reproject(dstDepth, depthFactor, K))
outFile(objdir + "rotated.obj", reprojectRt(srcDepth, K, depthFactor, rmat, tmat))

39 changes: 7 additions & 32 deletions testdata/dnn/download_models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env python

from __future__ import print_function
import hashlib
Expand Down Expand Up @@ -252,11 +252,6 @@ def is_archive(self):
url='https://github.com/petewarden/tf_ios_makefile_example/raw/master/data/tensorflow_inception_graph.pb',
sha='c8a5a000ee8d8dd75886f152a50a9c5b53d726a5',
filename='tensorflow_inception_graph.pb'),
Model(
name='Enet', # https://github.com/e-lab/ENet-training
url='https://www.dropbox.com/s/tdde0mawbi5dugq/Enet-model-best.net?dl=1',
sha='b4123a73bf464b9ebe9cfc4ab9c2d5c72b161315',
filename='Enet-model-best.net'),
Model(
name='Fcn',
url='http://dl.caffe.berkeleyvision.org/fcn8s-heavy-pascal.caffemodel',
Expand Down Expand Up @@ -290,11 +285,6 @@ def is_archive(self):
url='https://raw.githubusercontent.com/chuanqi305/MobileNet-SSD/97406996b1eee2d40eb0a00ae567cf41e23369f9/deploy.prototxt',
sha='50cf80235a8fcccc641bf9f8efc803edbf21c615',
filename='MobileNetSSD_deploy_19e3ec3.prototxt'),
Model(
name='OpenFace', # https://github.com/cmusatyalab/openface
url='https://storage.cmusatyalab.org/openface-models/nn4.small2.v1.t7',
sha='ac8161a4376fb5a79ceec55d85bbb57ef81da9fe',
filename='openface_nn4.small2.v1.t7'),
Model(
name='YoloV2voc', # https://pjreddie.com/darknet/yolo/
url='https://pjreddie.com/media/files/yolo-voc.weights',
Expand All @@ -316,21 +306,12 @@ def is_archive(self):
sha='4922099342af5993d9d09f63081c8a392f3c1cc6',
filename='DenseNet_121.prototxt'),
Model(
name='Fast-Neural-Style (starry night)',
url=[
'https://cs.stanford.edu/people/jcjohns/fast-neural-style/models/eccv16/starry_night.t7',
'https://dl.opencv.org/models/fast_neural_style_eccv16_starry_night.t7'
],
sha='5b5e115253197b84d6c6ece1dafe6c15d7105ca6',
filename='fast_neural_style_eccv16_starry_night.t7'),
Model(
name='Fast-Neural-Style (feathers)',
name='Fast-Neural-Style',
url=[
'https://cs.stanford.edu/people/jcjohns/fast-neural-style/models/instance_norm/feathers.t7',
'https://dl.opencv.org/models/fast_neural_style_instance_norm_feathers.t7'
'https://media.githubusercontent.com/media/onnx/models/main/vision/style_transfer/fast_neural_style/model/mosaic-9.onnx',
],
sha='9838007df750d483b5b5e90b92d76e8ada5a31c0',
filename='fast_neural_style_instance_norm_feathers.t7'),
sha='dc3ef19f7f8a5d906c97c84cd4dd2732bb73960a',
filename='mosaic-9.onnx'),
Model(
name='MobileNet-SSD (TensorFlow)',
url='http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_coco_11_06_2017.tar.gz',
Expand Down Expand Up @@ -601,10 +582,7 @@ def is_archive(self):
]),
Model(
name='ResNet-18v1 (ONNX)',
url=[
'https://github.com/onnx/models/raw/69c5d3751dda5349fd3fc53f525395d180420c07/vision/classification/resnet/model/resnet18-v1-7.tar.gz',
'https://dl.opencv.org/models/resnet18v1.tar.gz'
],
url='https://github.com/onnx/models/raw/69c5d3751dda5349fd3fc53f525395d180420c07/vision/classification/resnet/model/resnet18-v1-7.tar.gz',
sha='d132be4857d024de9caa21fd5300dee7c063bc35',
filename='resnet18v1.tar.gz',
sub=[
Expand All @@ -623,10 +601,7 @@ def is_archive(self):
]),
Model(
name='ResNet-50v1 (ONNX)',
url=[
'https://github.com/onnx/models/raw/69c5d3751dda5349fd3fc53f525395d180420c07/vision/classification/resnet/model/resnet50-v1-7.tar.gz',
'https://dl.opencv.org/models/resnet50v1.tar.gz'
],
url='https://github.com/onnx/models/raw/69c5d3751dda5349fd3fc53f525395d180420c07/vision/classification/resnet/model/resnet50-v1-7.tar.gz',
sha='a4ac2da7e0024d61fdb80481496ba966b48b9fea',
filename='resnet50v1.tar.gz',
sub=[
Expand Down
7 changes: 0 additions & 7 deletions testdata/dnn/generate_torch_models.py

This file was deleted.

99 changes: 0 additions & 99 deletions testdata/dnn/halide_scheduler_alexnet.yml

This file was deleted.

Loading