Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
dfd321d
fuzzy: fix memleaks
berak Jun 15, 2021
10d1020
Merge pull request #2972 from Channingss:date_type_fixer
Channingss Jun 15, 2021
173d25c
Merge pull request #2978 from berak:fix_fuzzy_memleak
alalek Jun 15, 2021
7e7fbba
add setIds and make ids field RW in python
rogday Jun 11, 2021
2a04f93
julia - Fix type conversion bug
archit120 Jun 16, 2021
2bef7d7
Merge pull request #2973 from rogday:aruco_ids_rw
alalek Jun 19, 2021
f7b566f
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek Jun 19, 2021
4024870
Merge pull request #2979 from archit120:julia_typepatch
alalek Jun 25, 2021
8a33d68
Do not use = 0 for a cv::Mat.
vrabaud Jun 28, 2021
76dde8f
Merge pull request #2987 from vrabaud:3.4
alalek Jun 29, 2021
bac6ee7
Do not use = 0 for a cv::Mat.
vrabaud Jun 28, 2021
e9e5070
Merge pull request #2937 from scloke:patch-1
scloke Jul 1, 2021
457740f
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek Jul 1, 2021
8bba3b3
Merge pull request #2988 from vrabaud:master
alalek Jul 1, 2021
d5317d6
Merge pull request #2964 from DumDereDum:icp_docs
DumDereDum Jul 4, 2021
1b88234
Add documentation for Julia binaries - GSoC
archit120 Jul 9, 2021
2c5a777
Merge pull request #2999 from cudawarped:fix_cudacodec_stream
cudawarped Jul 9, 2021
6a18431
Merge pull request #3001 from cudawarped:fix_cudacodec_wh
cudawarped Jul 10, 2021
e8ac023
cmake: process modules in the same CMake scope
alalek Jul 25, 2021
66f4ad4
Merge pull request #3010 from alalek:cmake_eliminate_modules_scope
alalek Jul 31, 2021
907efb9
Merge pull request #2994 from archit120:julia_phase1
alalek Aug 5, 2021
68e5549
corrected a typo
pauljurczak Aug 13, 2021
ed199a3
remove executable bit for various files
svenevs Aug 23, 2021
29134ef
Merge pull request #3025 from svenevs:fixperms-3.4
alalek Aug 24, 2021
ec541b7
Merge pull request #3017 from pauljurczak:patch-3
alalek Aug 24, 2021
85a21db
Update detector_params.yml
yossato Aug 24, 2021
b323529
Merge pull request #3026 from yossato:patch-1
alalek Aug 25, 2021
4295bd7
Update detector_params.yml
yossato Aug 26, 2021
b472293
Merge pull request #3027 from yossato:patch-2
alalek Aug 27, 2021
ce196ce
build: eliminate build warnings
alalek Aug 28, 2021
83b04ee
fix: aruco test tries to pass 2d array to std::vector<int>
VadimLevin Aug 28, 2021
e98a240
Merge pull request #3031 from VadimLevin:dev/vlevin/fix-test-aruco-in…
alalek Aug 28, 2021
a81a775
Merge pull request #3030 from alalek:fix_msvc_warnings
alalek Aug 28, 2021
b83d965
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek Aug 28, 2021
78acb19
Merge pull request #2981 from DumDereDum:kinfu_python_demo
DumDereDum Sep 4, 2021
a932d9a
rename the database names in or_mnist.cpp to match that from mnist of…
WN90 Sep 14, 2021
2b16d26
ovis: fix offscreen FSAA target not being resolved
paroj Sep 14, 2021
33b500b
Merge pull request #3039 from paroj:ovis_off_aa
alalek Sep 16, 2021
79e58f9
Merge pull request #3040 from WN90:or_mnist_Segmentation_fault
alalek Sep 16, 2021
a1fe9c8
Merge pull request #3024 from andy-held:charuco-selectAndRefineChessb…
andy-held Sep 17, 2021
28771e2
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek Sep 25, 2021
07a9245
Update perf_video.cpp
sturkmen72 Sep 25, 2021
9358d75
Merge pull request #3011 from gokberkgul:wrapper-drawCharucoDiamond
gokberkgul Sep 26, 2021
9278ed8
Merge pull request #3049 from sturkmen72:clean_up_test_data
alalek Sep 29, 2021
c3de0d3
Merge pull request #3009 from archit120:julia_21-phase2
archit120 Sep 29, 2021
f5368a9
[moved from opencv] suppress GaussianBlur to generate empty images
tomoaki0705 Oct 1, 2021
6d40472
Revert "line_descriptor: remove code with conflict license"
sturkmen72 Oct 2, 2021
99ecbc1
Merge moved code from opencv/3.4
alalek Oct 2, 2021
9d2989f
Fix CV_FOURCC identifier not found while compiling
kuloPo Oct 4, 2021
d78296c
Merge pull request #3051 from sturkmen72:restore-removed-code
alalek Oct 4, 2021
08634b2
Merge pull request #3052 from kuloPo-com:fix-cudacodec-perf_video.cpp
alalek Oct 4, 2021
73fc8ee
Update annf.hpp
shah-scalpel Sep 19, 2021
88c82fa
Merge pull request #3043 from shah-scalpel:patch-1
alalek Oct 4, 2021
31f96a1
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek Oct 4, 2021
1b39461
cleanup old c
sturkmen72 Oct 7, 2021
a36a67d
Update run_length_morphology.cpp
sturkmen72 Oct 7, 2021
02c2b56
Merge pull request #3058 from sturkmen72:cleanup-old-c
alalek Oct 8, 2021
5e5609c
Merge pull request #3059 from sturkmen72:patch-2
alalek Oct 8, 2021
2bc3e1a
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek Oct 8, 2021
a7b3801
Update README.md
sturkmen72 Oct 9, 2021
ae23e0c
Update tutorial.markdown
sturkmen72 Oct 10, 2021
7a91688
tolerate the rounding error
tomoaki0705 Oct 11, 2021
3ef73fc
Merge pull request #3067 from tomoaki0705:fixManySmallCircles
alalek Oct 11, 2021
496ea61
Do not use = 0 for a cv::Mat.
vrabaud Oct 12, 2021
fe23364
Merge pull request #3068 from vrabaud:3.4
alalek Oct 12, 2021
31f9813
update structured forests tutorial
sturkmen72 Oct 10, 2021
edcca75
Merge pull request #3065 from sturkmen72:patch-3
alalek Oct 13, 2021
4ed2c37
Merge pull request #3064 from sturkmen72:patch-2
alalek Oct 13, 2021
bcd47ed
Merge pull request #3066 from sturkmen72:update-StructuredEdgeDetection
alalek Oct 14, 2021
012fb23
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
alalek Oct 15, 2021
fe4221e
Merge branch 4.x
alalek Oct 15, 2021
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
28 changes: 26 additions & 2 deletions modules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ $ cmake -D OPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules -D BUILD_opencv_<r

- **aruco**: ArUco and ChArUco Markers -- Augmented reality ArUco marker and "ChARUco" markers where ArUco markers embedded inside the white areas of the checker board.

- **barcode**: Barcode detecting and decoding methods.

- **bgsegm**: Background segmentation algorithm combining statistical background image estimation and per-pixel Bayesian segmentation.

- **bioinspired**: Biological Vision -- Biologically inspired vision model: minimize noise and luminance variance, transient event segmentation, high dynamic range tone mapping methods.
Expand Down Expand Up @@ -40,6 +42,12 @@ $ cmake -D OPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules -D BUILD_opencv_<r

- **hdf**: Hierarchical Data Storage -- This module contains I/O routines for Hierarchical Data Format: https://en.m.wikipedia.org/wiki/Hierarchical_Data_Format meant to store large amounts of data.

- **hfs**: Hierarchical Feature Selection for Efficient Image Segmentation -- This module contains an efficient algorithm to segment an image.

- **img_hash**: This module contains algorithms to extract hash of an image allowing to efficiently estimate similarity between images.

- **intensity_transform**: The module brings implementations of intensity transformation algorithms to adjust image contrast.

- **julia**: Julia language wrappers with samples and tests.

- **line_descriptor**: Line Segment Extract and Match -- Methods of extracting, describing and matching line segments using binary descriptors.
Expand All @@ -52,8 +60,14 @@ $ cmake -D OPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules -D BUILD_opencv_<r

- **ovis**: OGRE 3D Visualiser -- allows you to render 3D data using the OGRE 3D engine.

- **phase_unwrapping**: Quality-guided phase unwrapping.

- **plot**: Plotting -- The plot module allows you to easily plot data in 1D or 2D.

- **quality**: Image Quality Analysis (IQA) API.

- **rapid**: Silhouette based 3D object tracking.

- **reg**: Image Registration -- Pixels based image registration for precise alignment. Follows the paper "Image Alignment and Stitching: A Tutorial", by Richard Szeliski.

- **rgbd**: RGB-Depth Processing module -- Linemod 3D object recognition; Fast surface normals and 3D plane finding. 3D visual odometry. 3d reconstruction using KinectFusion.
Expand All @@ -62,15 +76,25 @@ $ cmake -D OPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules -D BUILD_opencv_<r

- **sfm**: Structure from Motion -- This module contains algorithms to perform 3d reconstruction from 2d images. The core of the module is a light version of Libmv.

- **shape**: Shape Distance and Matching

- **stereo**: Stereo Correspondence -- Stereo matching done with different descriptors: Census / CS-Census / MCT / BRIEF / MV and dense stereo correspondence using Quasi Dense Stereo method.

- **structured_light**: Structured Light Use -- How to generate and project gray code patterns and use them to find dense depth in a scene.

- **superres**: Super Resolution

- **surface_matching**: Point Pair Features -- Implements 3d object detection and localization using multimodal point pair features.

- **text**: Visual Text Matching -- In a visual scene, detect text, segment words and recognise the text.
- **text**: Scene Text Detection and Recognition -- This module contains algorithms to perform text detection, words segmentation and text recognition in a visual scene.

- **tracking**: Vision Based Object Tracking -- Use and/or evaluate different visual object tracking techniques.

- **videostab**: Video Stabilization

- **viz**: 3D Visualizer

- **tracking**: Vision Based Object Tracking -- Use and/or evaluate one of 5 different visual object tracking techniques.
- **wechat_qrcode**: WeChat QR code detector for detecting and parsing QR code.

- **xfeatures2d**: Features2D extra -- Extra 2D Features Framework containing experimental and non-free 2D feature detector/descriptor algorithms. SURF, BRIEF, Censure, Freak, LUCID, Daisy, Self-similar.

Expand Down
4 changes: 2 additions & 2 deletions modules/alphamat/src/cm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ void lle(my_vector_of_vectors_t& indm, my_vector_of_vectors_t& samples, float ep
Mat ptDotN(20, 1, DataType<float>::type), imd(20, 1, DataType<float>::type);
Mat Cones(20, 1, DataType<float>::type), Cinv(20, 1, DataType<float>::type);
float alpha, beta, lagrangeMult;
Cones = 1;
Cones.setTo(cv::Scalar::all(1));

C = 0;
C.setTo(cv::Scalar::all(0));
rhs = 1;

int i, ind = 0;
Expand Down
2 changes: 1 addition & 1 deletion modules/aruco/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ ArUco markers are easy to detect pattern grids that yield up to 1024 different p

**ChArUco**

ArUco markers were improved by interspersing them inside a checkerboard called ChArUco. Checkerboard corner intersectionsa provide more stable corners because the edge location bias on one square is countered by the opposite edge orientation in the connecting square. By interspersing ArUco markers inside the checkerboard, each checkerboard corner gets a label which enables it to be used in complex calibration or pose scenarios where you cannot see all the corners of the checkerboard.
ArUco markers were improved by interspersing them inside a checkerboard called ChArUco. Checkerboard corner intersections provide more stable corners because the edge location bias on one square is countered by the opposite edge orientation in the connecting square. By interspersing ArUco markers inside the checkerboard, each checkerboard corner gets a label which enables it to be used in complex calibration or pose scenarios where you cannot see all the corners of the checkerboard.

The smallest ChArUco board is 5 checkers and 4 markers called a "Diamond Marker".
14 changes: 13 additions & 1 deletion modules/aruco/include/opencv2/aruco.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,18 @@ class CV_EXPORTS_W Board {
*
*/
CV_WRAP static Ptr<Board> create(InputArrayOfArrays objPoints, const Ptr<Dictionary> &dictionary, InputArray ids);

/**
* @brief Set ids vector
*
* @param ids vector of the identifiers of the markers in the board (should be the same size
* as objPoints)
*
* Recommended way to set ids vector, which will fail if the size of ids does not match size
* of objPoints.
*/
CV_WRAP void setIds(InputArray ids);

/// array of object points of all the marker corners in the board
/// each marker include its 4 corners in CCW order. For M markers, the size is Mx4.
CV_PROP std::vector< std::vector< Point3f > > objPoints;
Expand All @@ -290,7 +302,7 @@ class CV_EXPORTS_W Board {

/// vector of the identifiers of the markers in the board (same size than objPoints)
/// The identifiers refers to the board dictionary
CV_PROP std::vector< int > ids;
CV_PROP_RW std::vector< int > ids;
};


Expand Down
3 changes: 1 addition & 2 deletions modules/aruco/include/opencv2/aruco/charuco.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,7 @@ CV_EXPORTS_W void drawDetectedDiamonds(InputOutputArray image, InputArrayOfArray
*
* This function return the image of a ChArUco marker, ready to be printed.
*/
// TODO cannot be exported yet; conversion from/to Vec4i is not wrapped in core
CV_EXPORTS void drawCharucoDiamond(const Ptr<Dictionary> &dictionary, Vec4i ids, int squareLength,
CV_EXPORTS_W void drawCharucoDiamond(const Ptr<Dictionary> &dictionary, Vec4i ids, int squareLength,
int markerLength, OutputArray img, int marginSize = 0,
int borderBits = 1);

Expand Down
5 changes: 5 additions & 0 deletions modules/aruco/misc/objc/gen_dict.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@
"*" : [ "\"aruco.hpp\"" ],
"CharucoBoard" : [ "\"aruco/charuco.hpp\"" ],
"Dictionary" : [ "\"aruco/dictionary.hpp\"" ]
},
"func_arg_fix" : {
"Board" : {
"(void)setIds:(Mat*)ids" : { "setIds" : {"name" : "setIdsMat"} }
}
}
}
39 changes: 39 additions & 0 deletions modules/aruco/misc/python/test/test_aruco.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env python

# Python 2/3 compatibility
from __future__ import print_function

import os, numpy as np

import cv2 as cv

from tests_common import NewOpenCVTests

class aruco_test(NewOpenCVTests):

def test_idsAccessibility(self):

ids = np.arange(17)
rev_ids = ids[::-1]

aruco_dict = cv.aruco.Dictionary_get(cv.aruco.DICT_5X5_250)
board = cv.aruco.CharucoBoard_create(7, 5, 1, 0.5, aruco_dict)

np.testing.assert_array_equal(board.ids.squeeze(), ids)

board.ids = rev_ids
np.testing.assert_array_equal(board.ids.squeeze(), rev_ids)

board.setIds(ids)
np.testing.assert_array_equal(board.ids.squeeze(), ids)

with self.assertRaises(cv.error):
board.setIds(np.array([0]))

def test_drawCharucoDiamond(self):
aruco_dict = cv.aruco.Dictionary_get(cv.aruco.DICT_4X4_50)
img = cv.aruco.drawCharucoDiamond(aruco_dict, np.array([0, 1, 2, 3]), 100, 80)
self.assertTrue(img is not None)

if __name__ == '__main__':
NewOpenCVTests.bootstrap()
2 changes: 1 addition & 1 deletion modules/aruco/samples/detector_params.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ adaptiveThreshConstant: 7
minMarkerPerimeterRate: 0.03
maxMarkerPerimeterRate: 4.0
polygonalApproxAccuracyRate: 0.05
minCornerDistance: 10.0
minCornerDistanceRate: 0.05
minDistanceToBorder: 3
minMarkerDistance: 10.0
minMarkerDistanceRate: 0.05
Expand Down
7 changes: 7 additions & 0 deletions modules/aruco/src/aruco.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1497,6 +1497,13 @@ Ptr<Board> Board::create(InputArrayOfArrays objPoints, const Ptr<Dictionary> &di
return res;
}

/**
*/
void Board::setIds(InputArray ids_) {
CV_Assert(objPoints.size() == ids_.total());
ids_.copyTo(this->ids);
}

/**
*/
Ptr<GridBoard> GridBoard::create(int markersX, int markersY, float markerLength, float markerSeparation,
Expand Down
4 changes: 2 additions & 2 deletions modules/aruco/src/charuco.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ static int _selectAndRefineChessboardCorners(InputArray _allCorners, InputArray

for (int i = begin; i < end; i++) {
vector<Point2f> in;
in.push_back(filteredChessboardImgPoints[i]);
in.push_back(filteredChessboardImgPoints[i] - Point2f(0.5, 0.5)); // adjust sub-pixel coordinates for cornerSubPix
Size winSize = filteredWinSizes[i];
if (winSize.height == -1 || winSize.width == -1)
winSize = Size(params->cornerRefinementWinSize, params->cornerRefinementWinSize);
Expand All @@ -326,7 +326,7 @@ static int _selectAndRefineChessboardCorners(InputArray _allCorners, InputArray
params->cornerRefinementMaxIterations,
params->cornerRefinementMinAccuracy));

filteredChessboardImgPoints[i] = in[0];
filteredChessboardImgPoints[i] = in[0] + Point2f(0.5, 0.5);
}
});

Expand Down
56 changes: 56 additions & 0 deletions modules/aruco/test/test_charucodetection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,4 +677,60 @@ TEST(Charuco, testCharucoCornersCollinear_false)
EXPECT_FALSE(result);
}

// test that ChArUco board detection is subpixel accurate
TEST(Charuco, testBoardSubpixelCoords)
{
cv::Size res{500, 500};
cv::Mat K = (cv::Mat_<double>(3,3) <<
0.5*res.width, 0, 0.5*res.width,
0, 0.5*res.height, 0.5*res.height,
0, 0, 1);

// load board image with corners at round values
cv::String testImagePath = cvtest::TS::ptr()->get_data_path() + "aruco/" + "trivial_board_detection.png";
Mat img = imread(testImagePath);
cv::Mat expected_corners = (cv::Mat_<float>(9,2) <<
200, 300,
250, 300,
300, 300,
200, 250,
250, 250,
300, 250,
200, 200,
250, 200,
300, 200
);

cv::Mat gray;
cv::cvtColor(img, gray, cv::COLOR_BGR2GRAY);

auto dict = cv::aruco::getPredefinedDictionary(cv::aruco::DICT_APRILTAG_36h11);
auto board = cv::aruco::CharucoBoard::create(4, 4, 1.f, .8f, dict);

auto params = cv::aruco::DetectorParameters::create();
params->cornerRefinementMethod = cv::aruco::CORNER_REFINE_APRILTAG;

std::vector<int> ids;
std::vector<std::vector<cv::Point2f>> corners, rejected;

cv::aruco::detectMarkers(gray, dict, corners, ids, params, rejected, K);

ASSERT_EQ(ids.size(), size_t(8));

cv::Mat c_ids, c_corners;
cv::aruco::interpolateCornersCharuco(corners, ids, gray, board, c_corners, c_ids, K);
cv::Mat corners_reshaped = c_corners.reshape(1);

ASSERT_EQ(c_corners.rows, expected_corners.rows);
EXPECT_NEAR(0, cvtest::norm(expected_corners, c_corners.reshape(1), NORM_INF), 1e-3);

c_ids = cv::Mat();
c_corners = cv::Mat();
cv::aruco::interpolateCornersCharuco(corners, ids, gray, board, c_corners, c_ids);
corners_reshaped = c_corners.reshape(1);

ASSERT_EQ(c_corners.rows, expected_corners.rows);
EXPECT_NEAR(0, cvtest::norm(expected_corners, c_corners.reshape(1), NORM_INF), 1e-3);
}

}} // namespace
Empty file modified modules/aruco/tutorials/aruco_detection/images/markers.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion modules/bgsegm/src/synthetic_seq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ void SyntheticSequenceGenerator::getNextFrame(OutputArray _frame, OutputArray _g

_gtMask.create(sz, CV_8U);
Mat gtMask = _gtMask.getMat();
gtMask = 0;
gtMask.setTo(cv::Scalar::all(0));
gtMask(Rect(Point2i(pos), objSz)) = 255;

pos += dir * objspeed;
Expand Down
Empty file.
Empty file modified modules/cnn_3dobj/CMakeLists.txt
100755 → 100644
Empty file.
Empty file modified modules/cnn_3dobj/FindCaffe.cmake
100755 → 100644
Empty file.
Empty file modified modules/cnn_3dobj/FindGlog.cmake
100755 → 100644
Empty file.
Empty file modified modules/cnn_3dobj/README.md
100755 → 100644
Empty file.
Empty file modified modules/cnn_3dobj/doc/cnn_3dobj.bib
100755 → 100644
Empty file.
Empty file modified modules/cnn_3dobj/include/opencv2/cnn_3dobj.hpp
100755 → 100644
Empty file.
Empty file modified modules/cnn_3dobj/samples/classify.cpp
100755 → 100644
Empty file.
Empty file modified modules/cnn_3dobj/samples/data/3Dmodel/ant.ply
100755 → 100644
Empty file.
Empty file modified modules/cnn_3dobj/samples/data/3Dmodel/ape.ply
100755 → 100644
Empty file.
Empty file modified modules/cnn_3dobj/samples/data/3Dmodel/bunny.ply
100755 → 100644
Empty file.
Empty file modified modules/cnn_3dobj/samples/data/3Dmodel/cow.ply
100755 → 100644
Empty file.
Empty file modified modules/cnn_3dobj/samples/data/3Dmodel/horse.ply
100755 → 100644
Empty file.
Empty file modified modules/cnn_3dobj/samples/data/3Dmodel/plane.ply
100755 → 100644
Empty file.
Empty file.
Empty file modified modules/cnn_3dobj/samples/data/label_all.txt
100755 → 100644
Empty file.
Empty file modified modules/cnn_3dobj/samples/model_analysis.cpp
100755 → 100644
Empty file.
Empty file modified modules/cnn_3dobj/samples/sphereview_data.cpp
100755 → 100644
Empty file.
Empty file modified modules/cnn_3dobj/samples/video.cpp
100755 → 100644
Empty file.
Empty file modified modules/cnn_3dobj/src/cnn_feature.cpp
100755 → 100644
Empty file.
Empty file modified modules/cnn_3dobj/src/cnn_sphereview.cpp
100755 → 100644
Empty file.
Empty file modified modules/cnn_3dobj/src/precomp.hpp
100755 → 100644
Empty file.
Empty file modified modules/cnn_3dobj/test/test_cnn_3dobj_feature_extract.cpp
100755 → 100644
Empty file.
Empty file modified modules/cnn_3dobj/test/test_main.cpp
100755 → 100644
Empty file.
Empty file modified modules/cnn_3dobj/test/test_precomp.hpp
100755 → 100644
Empty file.
Empty file modified modules/cnn_3dobj/testdata/cv/3d_triplet_iter_30000.caffemodel
100755 → 100644
Empty file.
Empty file modified modules/cnn_3dobj/testdata/cv/3d_triplet_testIMG.prototxt
100755 → 100644
Empty file.
Empty file modified modules/cnn_3dobj/testdata/cv/4_78.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified modules/cnn_3dobj/testdata/cv/caffemodel_list.txt
100755 → 100644
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified modules/cnn_3dobj/tutorials/table_of_content_cnn_3dobj.markdown
100755 → 100644
Empty file.
6 changes: 3 additions & 3 deletions modules/cudabgsegm/perf/perf_bgsegm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace opencv_test { namespace {
DEF_PARAM_TEST(Video_Cn_LearningRate, string, MatCn, double);

PERF_TEST_P(Video_Cn_LearningRate, MOG,
Combine(Values("gpu/video/768x576.avi", "gpu/video/1920x1080.avi"),
Combine(Values("cv/video/768x576.avi", "cv/video/1920x1080.avi"),
CUDA_CHANNELS_1_3_4,
Values(0.0, 0.01)))
{
Expand Down Expand Up @@ -157,7 +157,7 @@ PERF_TEST_P(Video_Cn_LearningRate, MOG,
DEF_PARAM_TEST(Video_Cn, string, int);

PERF_TEST_P(Video_Cn, DISABLED_MOG2,
Combine(Values("gpu/video/768x576.avi", "gpu/video/1920x1080.avi"),
Combine(Values("cv/video/768x576.avi", "cv/video/1920x1080.avi"),
CUDA_CHANNELS_1_3_4))
{
const int numIters = 10;
Expand Down Expand Up @@ -312,7 +312,7 @@ PERF_TEST_P(Video_Cn, DISABLED_MOG2,
#ifdef HAVE_VIDEO_INPUT

PERF_TEST_P(Video_Cn, MOG2GetBackgroundImage,
Combine(Values("gpu/video/768x576.avi", "gpu/video/1920x1080.avi"),
Combine(Values("cv/video/768x576.avi", "cv/video/1920x1080.avi"),
CUDA_CHANNELS_1_3_4))
{
const string inputFile = perf::TestBase::getDataPath(GET_PARAM(0));
Expand Down
12 changes: 9 additions & 3 deletions modules/cudacodec/include/opencv2/cudacodec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,11 @@ struct FormatInfo
{
Codec codec;
ChromaFormat chromaFormat;
int nBitDepthMinus8;
int width;
int height;
int nBitDepthMinus8 = -1;
int width = 0;//!< Width of the decoded frame returned by nextFrame(frame)
int height = 0;//!< Height of the decoded frame returned by nextFrame(frame)
Rect displayArea;//!< ROI inside the decoded frame returned by nextFrame(frame), containing the useable video frame.
bool valid = false;
};

/** @brief Video reader interface.
Expand Down Expand Up @@ -329,6 +331,10 @@ class CV_EXPORTS_W RawVideoSource
/** @brief Returns information about video file format.
*/
virtual FormatInfo format() const = 0;

/** @brief Updates the coded width and height inside format.
*/
virtual void updateFormat(const int codedWidth, const int codedHeight) = 0;
};

/** @brief Creates video reader.
Expand Down
11 changes: 5 additions & 6 deletions modules/cudacodec/perf/perf_video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,17 @@
//M*/

#include "perf_precomp.hpp"
#include "opencv2/highgui/highgui_c.h"
#include "opencv2/videoio/videoio_c.h"
#include "opencv2/videoio.hpp"

namespace opencv_test { namespace {

#if defined(HAVE_NVCUVID)

#if defined(HAVE_FFMPEG_WRAPPER) // should this be set in preprocessor or in cvconfig.h
#define VIDEO_SRC Values("gpu/video/768x576.avi", "gpu/video/1920x1080.avi")
#define VIDEO_SRC Values("cv/video/768x576.avi", "cv/video/1920x1080.avi")
#else
// CUDA demuxer has to fall back to ffmpeg to process "gpu/video/768x576.avi"
#define VIDEO_SRC Values( "gpu/video/1920x1080.avi")
// CUDA demuxer has to fall back to ffmpeg to process "cv/video/768x576.avi"
#define VIDEO_SRC Values( "cv/video/1920x1080.avi")
#endif

DEF_PARAM_TEST_1(FileName, string);
Expand Down Expand Up @@ -141,7 +140,7 @@ PERF_TEST_P(FileName, VideoWriter, VIDEO_SRC)
ASSERT_FALSE(frame.empty());

if (!writer.isOpened())
writer.open(outputFile, CV_FOURCC('X', 'V', 'I', 'D'), FPS, frame.size());
writer.open(outputFile, VideoWriter::fourcc('X', 'V', 'I', 'D'), FPS, frame.size());

startTimer(); next();
writer.write(frame);
Expand Down
9 changes: 9 additions & 0 deletions modules/cudacodec/src/cuvid_video_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ cv::cudacodec::detail::CuvidVideoSource::CuvidVideoSource(const String& fname)
format_.nBitDepthMinus8 = vidfmt.bit_depth_luma_minus8;
format_.width = vidfmt.coded_width;
format_.height = vidfmt.coded_height;
format_.displayArea = Rect(Point(vidfmt.display_area.left, vidfmt.display_area.top), Point(vidfmt.display_area.right, vidfmt.display_area.bottom));
format_.valid = true;
}

cv::cudacodec::detail::CuvidVideoSource::~CuvidVideoSource()
Expand All @@ -86,6 +88,13 @@ FormatInfo cv::cudacodec::detail::CuvidVideoSource::format() const
return format_;
}

void cv::cudacodec::detail::CuvidVideoSource::updateFormat(const int codedWidth, const int codedHeight)
{
format_.width = codedWidth;
format_.height = codedHeight;
format_.valid = true;
}

void cv::cudacodec::detail::CuvidVideoSource::start()
{
cuSafeCall( cuvidSetVideoSourceState(videoSource_, cudaVideoState_Started) );
Expand Down
Loading