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
49 commits
Select commit Hold shift + click to select a range
6623c62
Fixed result buffer overflow in intersectConvexConvex_ for non-convex…
asmorkalov Jun 6, 2024
88c6c7d
Handle BGRA sterams in GStreamer backend
asmorkalov May 17, 2024
7ff531b
Merge pull request #25759 from savuor:rv/equalizeHist_tests
savuor Jun 15, 2024
0a12c7d
Merge pull request #25725 from asmorkalov:as/intersectConvexConvex_fix
asmorkalov Jun 16, 2024
4bf95ac
Merge pull request #25602 from asmorkalov:as/gstreamer_alpha_channel
asmorkalov Jun 16, 2024
24907f3
Merge pull request #25757 from dkurt:d.kurtaev/opencv_js_tests_old_emsdk
dkurt Jun 17, 2024
860b688
Enable build with both old and new layouts of IPP
eplankin Jun 17, 2024
b9d2ecb
Remove unused brow variable
FantasqueX Jun 17, 2024
6081997
Svgfig library update to version 1.0.1 as it uses BSD-3 license.
asmorkalov Jun 18, 2024
0fac5d5
Merge pull request #25778 from asmorkalov:as/svgfig_update
asmorkalov Jun 18, 2024
e3884a9
Merge pull request #25771 from fengyuentau:vittrack_black_input
fengyuentau Jun 18, 2024
553c111
Fixed input buffer read overflow in vectorized G-API convertTo implem…
asmorkalov Jun 18, 2024
766f3f5
Merge pull request #25746 from savuor:rv/hwasan_flag_release
savuor Jun 18, 2024
d1b643a
Merge pull request #25780 from asmorkalov:as/gapi_arm_overflow
asmorkalov Jun 19, 2024
e7108f4
Extended bilateralFilter test to cover more branches.
asmorkalov Jun 19, 2024
a102b24
Added LUT for FP16 and accuracy test.
asmorkalov Jun 19, 2024
0cba702
Merge pull request #25787 from asmorkalov:as/lut_fp16
asmorkalov Jun 20, 2024
57984e6
Merge pull request #25788 from asmorkalov:as/bilateralFilter_test
asmorkalov Jun 20, 2024
7ef42d7
Merge pull request #25751 from simonkampe:fix-eigen-rowmajor
simonkampe Jun 20, 2024
5dc1b39
Merge pull request #25791 from ujjayant-kadian:uk/extend-gapi-onnx-pa…
ujjayant-kadian Jun 21, 2024
acd16e3
Merge pull request #25773 from eplankin:eplankin/fix_layout
asmorkalov Jun 21, 2024
3f13ce7
Merge pull request #25779 from fengyuentau:dnn/fix_onnx_depthtospace
fengyuentau Jun 21, 2024
d8c7deb
cmake: support 10+ minor version(10,11,...)
Kumataro Jun 22, 2024
2028998
Merge pull request #25803 from Kumataro/fix25802
asmorkalov Jun 22, 2024
8be2056
Replace use of "eval()" with "getattr()".
TFiFiE Jun 22, 2024
11c69bb
Merge pull request #25775 from richard28039:4.x
richard28039 Jun 24, 2024
76a1d26
Merge pull request #25805 from TFiFiE:patch-1
asmorkalov Jun 25, 2024
2179186
Remove unused variables in rgb2hsv_b simd
FantasqueX Jun 26, 2024
efa4d91
Merge pull request #25661 from itlab-vision:framebuffer
kozinove Jun 26, 2024
204d62a
Merge pull request #25815 from FantasqueX:remove-unused-variable-1
asmorkalov Jun 27, 2024
4450226
Merge pull request #25789 from asmorkalov:as/HAL_meanStdDev_tails
asmorkalov Jun 27, 2024
ee2b0f9
Relax equalizeHist test for some HAL implementations.
asmorkalov Jun 27, 2024
284a794
Merge pull request #25816 from FantasqueX:remove-unused-brow-1
asmorkalov Jun 28, 2024
7867267
Merge pull request #25793 from MaximMilashchenko:hal_rvv
MaximMilashchenko Jun 28, 2024
4500eb9
Drop redundant dependency from download_models.py
asmorkalov Jun 28, 2024
aab7239
Merge pull request #25826 from asmorkalov:as/clean_download_models_deps
asmorkalov Jun 28, 2024
3101694
Exclude cap_ios.h from installation where it's not needed.
asmorkalov Jun 28, 2024
855f6cf
Merge pull request #25827 from asmorkalov:as/exclude_ios_platform_header
asmorkalov Jun 28, 2024
be00247
Merge pull request #25820 from asmorkalov:as/HAL_non_strict_equalizeHist
asmorkalov Jun 28, 2024
b7c9221
Force contributors to define Apache 2.0 license for the new PRs.
asmorkalov Jun 28, 2024
1e5407a
Fix #25833: The correct way to disable top-most state is with HWND_NO…
dan-masek Jun 29, 2024
bbf65a1
Fix file descriptor leak in HDR decoder
tyler92 Jun 30, 2024
ce1d840
Fix: compilation Issue on ARM64 (msys2 clangarm)
thiru31 Jun 29, 2024
996ed0a
Merge pull request #25829 from asmorkalov:as/force_legal_requirements
asmorkalov Jul 1, 2024
25609ef
Merge pull request #25838 from tyler92:fix-fd-leak
asmorkalov Jul 1, 2024
34ed88d
Merge pull request #25836 from dan-masek:fix_win32_topmost_toggle
asmorkalov Jul 1, 2024
930af15
Merge pull request #25834 from thiru31:4.x
asmorkalov Jul 1, 2024
39a7b3d
Merge pull request #25813 from kaingwade:orbbec-astra
kaingwade Jul 1, 2024
3abd9f2
Merge branch 4.x
asmorkalov Jul 1, 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
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [ ] I agree to contribute to the project under Apache 2 License.
- [ ] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [ ] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
Expand Down
4 changes: 4 additions & 0 deletions 3rdparty/carotene/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,9 @@ if(WITH_NEON)
endif()
endif()

if(MINGW)
target_compile_definitions(carotene_objs PRIVATE "-D_USE_MATH_DEFINES=1")
endif()

# we add dummy file to fix XCode build
add_library(carotene STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} "$<TARGET_OBJECTS:carotene_objs>" "${CAROTENE_SOURCE_DIR}/dummy.cpp")
2 changes: 0 additions & 2 deletions 3rdparty/hal_rvv/hal_rvv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#ifndef OPENCV_HAL_RVV_HPP_INCLUDED
#define OPENCV_HAL_RVV_HPP_INCLUDED

#include <riscv_vector.h>

#include "opencv2/core/hal/interface.h"

#ifndef CV_HAL_RVV_071_ENABLED
Expand Down
2 changes: 2 additions & 0 deletions 3rdparty/hal_rvv/version/hal_rvv_071.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef OPENCV_HAL_RVV_071_HPP_INCLUDED
#define OPENCV_HAL_RVV_071_HPP_INCLUDED

#include <riscv_vector.h>

#include <limits>

namespace cv { namespace cv_hal_rvv {
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/ippicv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if(HAVE_IPP_ICV)
add_definitions(-DICV_BASE)
endif()

file(GLOB lib_srcs ${IPP_IW_PATH}/src/*.c)
file(GLOB lib_srcs ${IPP_IW_PATH}/src/*.c ${IPP_IW_PATH}/src/*.cpp)
file(GLOB lib_hdrs ${IPP_IW_PATH}/include/*.h ${IPP_IW_PATH}/include/iw/*.h ${IPP_IW_PATH}/include/iw++/*.hpp)

# ----------------------------------------------------------------------------------
Expand Down
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@ OCV_OPTION(WITH_GTK "Include GTK support" ON
OCV_OPTION(WITH_GTK_2_X "Use GTK version 2" OFF
VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID
VERIFY HAVE_GTK AND NOT HAVE_GTK3)
OCV_OPTION(WITH_FRAMEBUFFER "Include framebuffer support" OFF
VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID)
OCV_OPTION(WITH_FRAMEBUFFER_XVFB "Include virtual framebuffer support" OFF
VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID)
OCV_OPTION(WITH_WAYLAND "Include Wayland support" OFF
VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID
VERIFY HAVE_WAYLAND)
Expand Down Expand Up @@ -1019,9 +1023,13 @@ foreach(hal ${OpenCV_HAL})
message(STATUS "NDSRVP: Andes GNU Toolchain DSP extension is not open, disabling ndsrvp...")
endif()
elseif(hal STREQUAL "halrvv")
if(";${CPU_BASELINE_FINAL};" MATCHES ";RVV;")
add_subdirectory(3rdparty/hal_rvv/)
ocv_hal_register(RVV_HAL_LIBRARIES RVV_HAL_HEADERS RVV_HAL_INCLUDE_DIRS)
list(APPEND OpenCV_USED_HAL "HAL RVV (ver ${RVV_HAL_VERSION})")
else()
message(STATUS "HAL RVV: RVV is not available, disabling halrvv...")
endif()
else()
ocv_debug_message(STATUS "OpenCV HAL: ${hal} ...")
ocv_clear_vars(OpenCV_HAL_LIBRARIES OpenCV_HAL_HEADERS OpenCV_HAL_INCLUDE_DIRS)
Expand Down Expand Up @@ -1444,6 +1452,13 @@ if(WITH_GTK OR HAVE_GTK)
endif()
endif()

if(WITH_FRAMEBUFFER OR HAVE_FRAMEBUFFER)
status(" Framebuffer UI:" HAVE_FRAMEBUFFER THEN YES ELSE NO)
if(WITH_FRAMEBUFFER_XVFB OR HAVE_FRAMEBUFFER_XVFB)
status(" Virtual framebuffer UI:" HAVE_FRAMEBUFFER_XVFB THEN YES ELSE NO)
endif()
endif()

if(WITH_OPENGL OR HAVE_OPENGL)
status(" OpenGL support:" HAVE_OPENGL THEN "YES (${OPENGL_LIBRARIES})" ELSE NO)
endif()
Expand Down
19 changes: 16 additions & 3 deletions cmake/OpenCVFindIPP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,14 @@ macro(ipp_detect_version)
get_filename_component(IPP_INCLUDE_DIRS ${IPP_VERSION_FILE} PATH)

set(__msg)
set(IPP_NEW_LAYOUT 0)
if(EXISTS ${IPP_ROOT_DIR}/include/ippicv_redefs.h)
set(__msg " (ICV version)")
set(HAVE_IPP_ICV 1)
elseif(EXISTS ${IPP_ROOT_DIR}/include/ipp/ipp.h)
set(IPP_NEW_LAYOUT 1)
# workaround to enable both layouts
add_definitions(-DIPP_PRESERVE_OLD_LAYOUT)
elseif(EXISTS ${IPP_ROOT_DIR}/include/ipp.h)
# nothing
else()
Expand Down Expand Up @@ -117,10 +122,18 @@ macro(ipp_detect_version)

if(APPLE AND NOT HAVE_IPP_ICV)
_ipp_set_library_dir(${IPP_ROOT_DIR}/lib)
elseif(IPP_X64)
_ipp_set_library_dir(${IPP_ROOT_DIR}/lib/intel64)
elseif (IPP_NEW_LAYOUT)
if(IPP_X64)
_ipp_set_library_dir(${IPP_ROOT_DIR}/lib)
else()
_ipp_set_library_dir(${IPP_ROOT_DIR}/lib32)
endif()
else()
_ipp_set_library_dir(${IPP_ROOT_DIR}/lib/ia32)
if(IPP_X64)
_ipp_set_library_dir(${IPP_ROOT_DIR}/lib/intel64)
else()
_ipp_set_library_dir(${IPP_ROOT_DIR}/lib/ia32)
endif()
endif()

macro(_ipp_add_library name)
Expand Down
2 changes: 1 addition & 1 deletion cmake/OpenCVUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1992,7 +1992,7 @@ macro(ocv_git_describe var_name path)
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT GIT_RESULT EQUAL 0)
execute_process(COMMAND "${GIT_EXECUTABLE}" describe --tags --always --dirty --match "[0-9].[0-9].[0-9]*" --exclude "[^-]*-cvsdk"
execute_process(COMMAND "${GIT_EXECUTABLE}" describe --tags --always --dirty --match "[0-9].[0-9]*.[0-9]*" --exclude "[^-]*-cvsdk"
WORKING_DIRECTORY "${path}"
OUTPUT_VARIABLE ${var_name}
RESULT_VARIABLE GIT_RESULT
Expand Down
9 changes: 9 additions & 0 deletions cmake/checks/framebuffer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <X11/XWDFile.h>
#include <X11/X.h>

int main(void)
{
XWDFileHeader *xwd_header;
XWDColor *xwd_colors;
return 0;
}
75 changes: 49 additions & 26 deletions doc/pattern_tools/svgfig.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
# svgfig.py copyright (C) 2008 Jim Pivarski <[email protected]>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
# Full licence is in the file COPYING and at http://www.gnu.org/copyleft/gpl.html
# BSD 3-Clause License

# Copyright (c) 2022, Jim Pivarski
# All rights reserved.

# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:

# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.

# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.

# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.

# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import re, codecs, os, platform, copy, itertools, math, cmath, random, sys, copy
_epsilon = 1e-5
Expand All @@ -29,16 +41,24 @@
except NameError:
unicode = lambda s: str(s)

try:
xrange # Python 2
except NameError:
xrange = range # Python 3
if re.search("windows", platform.system(), re.I):
try:
import _winreg
_default_directory = _winreg.QueryValueEx(_winreg.OpenKey(_winreg.HKEY_CURRENT_USER,
r"Software\Microsoft\Windows\Current Version\Explorer\Shell Folders"), "Desktop")[0]
# tmpdir = _winreg.QueryValueEx(_winreg.OpenKey(_winreg.HKEY_CURRENT_USER, "Environment"), "TEMP")[0]
# if tmpdir[0:13] != "%USERPROFILE%":
# tmpdir = os.path.expanduser("~") + tmpdir[13:]
except:
_default_directory = os.path.expanduser("~") + os.sep + "Desktop"

_default_fileName = "tmp.svg"

_hacks = {}
_hacks["inkscape-text-vertical-shift"] = False

__version__ = "1.0.1"


def rgb(r, g, b, maximum=1.):
"""Create an SVG color string "#xxyyzz" from r, g, and b.
Expand Down Expand Up @@ -437,9 +457,12 @@ def __standalone_xml(self, indent, newl):

return output

@staticmethod
def interpret_fileName(fileName=None):
return fileName or _default_fileName
def interpret_fileName(self, fileName=None):
if fileName is None:
fileName = _default_fileName
if re.search("windows", platform.system(), re.I) and not os.path.isabs(fileName):
fileName = _default_directory + os.sep + fileName
return fileName

def save(self, fileName=None, encoding="utf-8", compresslevel=None):
"""Save to a file for viewing. Note that svg.save() overwrites the file named _default_fileName.
Expand Down Expand Up @@ -591,7 +614,7 @@ def template(fileName, svg, replaceme="REPLACEME"):

def load(fileName):
"""Loads an SVG image from a file."""
return load_stream(open(fileName))
return load_stream(file(fileName))

def load_stream(stream):
"""Loads an SVG image from a stream (can be a string or a file object)."""
Expand Down Expand Up @@ -1848,7 +1871,7 @@ class Poly:
piecewise-linear segments joining the (x,y) points
"bezier"/"B" d=[(x, y, c1x, c1y, c2x, c2y), ...]
Bezier curve with two control points (control points
precede (x,y), as in SVG paths). If (c1x,c1y) and
preceed (x,y), as in SVG paths). If (c1x,c1y) and
(c2x,c2y) both equal (x,y), you get a linear
interpolation ("lines")
"velocity"/"V" d=[(x, y, vx, vy), ...]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ assert template is not None, "file could not be read, check with os.path.exists(
w, h = template.shape[::-1]

# All the 6 methods for comparison in a list
methods = ['cv.TM_CCOEFF', 'cv.TM_CCOEFF_NORMED', 'cv.TM_CCORR',
'cv.TM_CCORR_NORMED', 'cv.TM_SQDIFF', 'cv.TM_SQDIFF_NORMED']
methods = ['TM_CCOEFF', 'TM_CCOEFF_NORMED', 'TM_CCORR',
'TM_CCORR_NORMED', 'TM_SQDIFF', 'TM_SQDIFF_NORMED']

for meth in methods:
img = img2.copy()
method = eval(meth)
method = getattr(cv, meth)

# Apply template Matching
res = cv.matchTemplate(img,template,method)
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/app/intelperc.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Using Creative Senz3D and other Intel RealSense SDK compatible depth sensors {#t

@tableofcontents

@prev_tutorial{tutorial_orbbec_astra}
@prev_tutorial{tutorial_orbbec_astra_openni}
@next_tutorial{tutorial_wayland_ubuntu}

![hardwares](images/realsense.jpg)
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/app/kinect_openni.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Using Kinect and other OpenNI compatible depth sensors {#tutorial_kinect_openni}
@tableofcontents

@prev_tutorial{tutorial_video_write}
@next_tutorial{tutorial_orbbec_astra}
@next_tutorial{tutorial_orbbec_astra_openni}


Depth sensors compatible with OpenNI (Kinect, XtionPRO, ...) are supported through VideoCapture
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Using Orbbec Astra 3D cameras {#tutorial_orbbec_astra}
Using Orbbec Astra 3D cameras {#tutorial_orbbec_astra_openni}
======================================================

@tableofcontents
Expand All @@ -9,7 +9,7 @@ Using Orbbec Astra 3D cameras {#tutorial_orbbec_astra}

### Introduction

This tutorial is devoted to the Astra Series of Orbbec 3D cameras (https://orbbec3d.com/index/Product/info.html?cate=38&id=36).
This tutorial is devoted to the Astra Series of Orbbec 3D cameras (https://www.orbbec.com/products/structured-light-camera/astra-series/).
That cameras have a depth sensor in addition to a common color sensor. The depth sensors can be read using
the open source OpenNI API with @ref cv::VideoCapture class. The video stream is provided through the regular
camera interface.
Expand All @@ -18,7 +18,7 @@ camera interface.

In order to use the Astra camera's depth sensor with OpenCV you should do the following steps:

-# Download the latest version of Orbbec OpenNI SDK (from here <https://orbbec3d.com/index/download.html>).
-# Download the latest version of Orbbec OpenNI SDK (from here <https://www.orbbec.com/developers/openni-sdk/>).
Unzip the archive, choose the build according to your operating system and follow installation
steps provided in the Readme file.

Expand Down Expand Up @@ -70,6 +70,12 @@ In order to use the Astra camera's depth sensor with OpenCV you should do the fo
echo "exit"
@endcode

@note The last tried version `2.3.0.86_202210111154_4c8f5aa4_beta6` does not work correctly with
modern Linux, even after libusb rebuild as recommended by the instruction. The last know good
configuration is version 2.3.0.63 (tested with Ubuntu 18.04 amd64). It's not provided officialy
with the downloading page, but published by Orbbec technical suport on Orbbec community forum
[here](https://3dclub.orbbec3d.com/t/universal-download-thread-for-astra-series-cameras/622).

-# Now you can configure OpenCV with OpenNI support enabled by setting the `WITH_OPENNI2` flag in CMake.
You may also like to enable the `BUILD_EXAMPLES` flag to get a code sample working with your Astra camera.
Run the following commands in the directory containing OpenCV source code to enable OpenNI support:
Expand Down Expand Up @@ -106,7 +112,7 @@ can be read using the OpenNI interface with @ref cv::VideoCapture class. The vid
not available through OpenNI API and is only provided via the regular camera interface.
So, to get both depth and color frames, two @ref cv::VideoCapture objects should be created:

@snippetlineno samples/cpp/tutorial_code/videoio/orbbec_astra/orbbec_astra.cpp Open streams
@snippetlineno samples/cpp/tutorial_code/videoio/openni_orbbec_astra/openni_orbbec_astra.cpp Open streams

The first object will use the OpenNI2 API to retrieve depth data. The second one uses the
Video4Linux2 interface to access the color sensor. Note that the example above assumes that
Expand All @@ -119,12 +125,12 @@ For this example, we’ll configure width and height of both streams to VGA reso
the maximum resolution available for both sensors, and we’d like both stream parameters to be the
same for easier color-to-depth data registration:

@snippetlineno samples/cpp/tutorial_code/videoio/orbbec_astra/orbbec_astra.cpp Setup streams
@snippetlineno samples/cpp/tutorial_code/videoio/openni_orbbec_astra/openni_orbbec_astra.cpp Setup streams

For setting and retrieving some property of sensor data generators use @ref cv::VideoCapture::set and
@ref cv::VideoCapture::get methods respectively, e.g. :

@snippetlineno samples/cpp/tutorial_code/videoio/orbbec_astra/orbbec_astra.cpp Get properties
@snippetlineno samples/cpp/tutorial_code/videoio/openni_orbbec_astra/openni_orbbec_astra.cpp Get properties

The following properties of cameras available through OpenNI interface are supported for the depth
generator:
Expand Down Expand Up @@ -156,7 +162,7 @@ As there are two video sources that should be read simultaneously, it’s necess
threads to avoid blocking. Example implementation that gets frames from each sensor in a new thread
and stores them in a list along with their timestamps:

@snippetlineno samples/cpp/tutorial_code/videoio/orbbec_astra/orbbec_astra.cpp Read streams
@snippetlineno samples/cpp/tutorial_code/videoio/openni_orbbec_astra/openni_orbbec_astra.cpp Read streams

VideoCapture can retrieve the following data:

Expand All @@ -177,7 +183,7 @@ two video streams may become out of sync even when both streams are set up for t
A post-synchronization procedure can be applied to the streams to combine depth and color frames into
pairs. The sample code below demonstrates this procedure:

@snippetlineno samples/cpp/tutorial_code/videoio/orbbec_astra/orbbec_astra.cpp Pair frames
@snippetlineno samples/cpp/tutorial_code/videoio/openni_orbbec_astra/openni_orbbec_astra.cpp Pair frames

In the code snippet above the execution is blocked until there are some frames in both frame lists.
When there are new frames, their timestamps are being checked -- if they differ more than a half of
Expand All @@ -194,5 +200,5 @@ but the depth data makes it easy.
![Depth frame](images/astra_depth.png)

The complete implementation can be found in
[orbbec_astra.cpp](https://github.com/opencv/opencv/tree/5.x/samples/cpp/tutorial_code/videoio/orbbec_astra/orbbec_astra.cpp)
[openni_orbbec_astra.cpp](https://github.com/opencv/opencv/tree/5.x/samples/cpp/tutorial_code/videoio/openni_orbbec_astra/openni_orbbec_astra.cpp)
in `samples/cpp/tutorial_code/videoio` directory.
2 changes: 1 addition & 1 deletion doc/tutorials/app/table_of_content_app.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ Application utils (highgui, imgcodecs, videoio modules) {#tutorial_table_of_cont
- @subpage tutorial_video_input_psnr_ssim
- @subpage tutorial_video_write
- @subpage tutorial_kinect_openni
- @subpage tutorial_orbbec_astra
- @subpage tutorial_orbbec_astra_openni
- @subpage tutorial_intelperc
- @subpage tutorial_wayland_ubuntu
Loading