commit
82c477c9f7
71 changed files with 2652 additions and 1386 deletions
@ -1,79 +1,87 @@ |
|||||||
# The script detects Intel(R) Inference Engine installation |
# The script detects Intel(R) Inference Engine installation |
||||||
# |
# |
||||||
# Parameters: |
# Cache variables: |
||||||
# INTEL_CVSDK_DIR - Path to Inference Engine root folder |
# INF_ENGINE_OMP_DIR - directory with OpenMP library to link with (needed by some versions of IE) |
||||||
# IE_PLUGINS_PATH - Path to folder with Inference Engine plugins |
# INF_ENGINE_RELEASE - a number reflecting IE source interface (linked with OpenVINO release) |
||||||
# |
# |
||||||
# On return this will define: |
# Detect parameters: |
||||||
|
# 1. Native cmake IE package: |
||||||
|
# - enironment variable InferenceEngine_DIR is set to location of cmake module |
||||||
|
# 2. Custom location: |
||||||
|
# - INF_ENGINE_INCLUDE_DIRS - headers search location |
||||||
|
# - INF_ENGINE_LIB_DIRS - library search location |
||||||
|
# 3. OpenVINO location: |
||||||
|
# - environment variable INTEL_CVSDK_DIR is set to location of OpenVINO installation dir |
||||||
|
# - INF_ENGINE_PLATFORM - part of name of library directory representing its platform (default ubuntu_16.04) |
||||||
# |
# |
||||||
# HAVE_INF_ENGINE - True if Intel Inference Engine was found |
# Result: |
||||||
# INF_ENGINE_INCLUDE_DIRS - Inference Engine include folder |
# INF_ENGINE_TARGET - set to name of imported library target representing InferenceEngine |
||||||
# INF_ENGINE_LIBRARIES - Inference Engine libraries and it's dependencies |
|
||||||
# |
# |
||||||
macro(ie_fail) |
|
||||||
set(HAVE_INF_ENGINE FALSE) |
|
||||||
return() |
|
||||||
endmacro() |
|
||||||
|
|
||||||
|
|
||||||
find_package(InferenceEngine QUIET) |
if(NOT HAVE_CXX11) |
||||||
if(InferenceEngine_FOUND) |
message(WARNING "DL Inference engine requires C++11. You can turn it on via ENABLE_CXX11=ON CMake flag.") |
||||||
set(INF_ENGINE_LIBRARIES "${InferenceEngine_LIBRARIES}") |
return() |
||||||
set(INF_ENGINE_INCLUDE_DIRS "${InferenceEngine_INCLUDE_DIRS}") |
|
||||||
set(INF_ENGINE_VERSION "${InferenceEngine_VERSION}") |
|
||||||
set(HAVE_INF_ENGINE TRUE) |
|
||||||
return() |
|
||||||
endif() |
endif() |
||||||
|
|
||||||
ocv_check_environment_variables(INTEL_CVSDK_DIR INF_ENGINE_ROOT_DIR IE_PLUGINS_PATH) |
# ======================= |
||||||
|
|
||||||
if(NOT INF_ENGINE_ROOT_DIR OR NOT EXISTS "${INF_ENGINE_ROOT_DIR}/include/inference_engine.hpp") |
function(add_custom_ie_build _inc _lib _lib_rel _lib_dbg _msg) |
||||||
set(ie_root_paths "${INF_ENGINE_ROOT_DIR}") |
if(NOT _inc OR NOT (_lib OR _lib_rel OR _lib_dbg)) |
||||||
if(DEFINED INTEL_CVSDK_DIR) |
return() |
||||||
list(APPEND ie_root_paths "${INTEL_CVSDK_DIR}/") |
endif() |
||||||
list(APPEND ie_root_paths "${INTEL_CVSDK_DIR}/deployment_tools/inference_engine") |
add_library(inference_engine UNKNOWN IMPORTED) |
||||||
endif() |
set_target_properties(inference_engine PROPERTIES |
||||||
|
IMPORTED_LOCATION "${_lib}" |
||||||
|
IMPORTED_IMPLIB_RELEASE "${_lib_rel}" |
||||||
|
IMPORTED_IMPLIB_DEBUG "${_lib_dbg}" |
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${_inc}" |
||||||
|
) |
||||||
|
find_library(omp_lib iomp5 PATHS "${INF_ENGINE_OMP_DIR}" NO_DEFAULT_PATH) |
||||||
|
if(NOT omp_lib) |
||||||
|
message(WARNING "OpenMP for IE have not been found. Set INF_ENGINE_OMP_DIR variable if you experience build errors.") |
||||||
|
else() |
||||||
|
set_target_properties(inference_engine PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES "${omp_lib}") |
||||||
|
endif() |
||||||
|
set(INF_ENGINE_VERSION "Unknown" CACHE STRING "") |
||||||
|
set(INF_ENGINE_TARGET inference_engine PARENT_SCOPE) |
||||||
|
message(STATUS "Detected InferenceEngine: ${_msg}") |
||||||
|
endfunction() |
||||||
|
|
||||||
if(NOT ie_root_paths) |
# ====================== |
||||||
list(APPEND ie_root_paths "/opt/intel/computer_vision_sdk/deployment_tools/inference_engine/") |
|
||||||
endif() |
|
||||||
|
|
||||||
find_path(INF_ENGINE_ROOT_DIR include/inference_engine.hpp PATHS ${ie_root_paths}) |
find_package(InferenceEngine QUIET) |
||||||
if(INF_ENGINE_ROOT_DIR MATCHES "-NOTFOUND$") |
if(InferenceEngine_FOUND) |
||||||
unset(INF_ENGINE_ROOT_DIR CACHE) |
set(INF_ENGINE_TARGET IE::inference_engine) |
||||||
endif() |
set(INF_ENGINE_VERSION "${InferenceEngine_VERSION}" CACHE STRING "") |
||||||
|
message(STATUS "Detected InferenceEngine: cmake package") |
||||||
endif() |
endif() |
||||||
|
|
||||||
set(INF_ENGINE_INCLUDE_DIRS "${INF_ENGINE_ROOT_DIR}/include" CACHE PATH "Path to Inference Engine include directory") |
if(NOT INF_ENGINE_TARGET AND INF_ENGINE_LIB_DIRS AND INF_ENGINE_INCLUDE_DIRS) |
||||||
|
find_path(ie_custom_inc "inference_engine.hpp" PATHS "${INF_ENGINE_INCLUDE_DIRS}" NO_DEFAULT_PATH) |
||||||
if(NOT INF_ENGINE_ROOT_DIR |
find_library(ie_custom_lib "inference_engine" PATHS "${INF_ENGINE_LIB_DIRS}" NO_DEFAULT_PATH) |
||||||
OR NOT EXISTS "${INF_ENGINE_ROOT_DIR}" |
find_library(ie_custom_lib_rel "inference_engine" PATHS "${INF_ENGINE_LIB_DIRS}/Release" NO_DEFAULT_PATH) |
||||||
OR NOT EXISTS "${INF_ENGINE_ROOT_DIR}/include/inference_engine.hpp" |
find_library(ie_custom_lib_dbg "inference_engine" PATHS "${INF_ENGINE_LIB_DIRS}/Debug" NO_DEFAULT_PATH) |
||||||
) |
add_custom_ie_build("${ie_custom_inc}" "${ie_custom_lib}" "${ie_custom_lib_rel}" "${ie_custom_lib_dbg}" "INF_ENGINE_{INCLUDE,LIB}_DIRS") |
||||||
message(WARNING "DL IE: Can't detect INF_ENGINE_ROOT_DIR location.") |
|
||||||
ie_fail() |
|
||||||
endif() |
endif() |
||||||
|
|
||||||
set(INF_ENGINE_LIBRARIES "") |
set(_loc "$ENV{INTEL_CVSDK_DIR}") |
||||||
|
if(NOT INF_ENGINE_TARGET AND _loc) |
||||||
set(ie_lib_list inference_engine) |
set(INF_ENGINE_PLATFORM "ubuntu_16.04" CACHE STRING "InferenceEngine platform (library dir)") |
||||||
|
find_path(ie_custom_env_inc "inference_engine.hpp" PATHS "${_loc}/deployment_tools/inference_engine/include" NO_DEFAULT_PATH) |
||||||
if(NOT IS_ABSOLUTE "${IE_PLUGINS_PATH}") |
find_library(ie_custom_env_lib "inference_engine" PATHS "${_loc}/deployment_tools/inference_engine/lib/${INF_ENGINE_PLATFORM}/intel64" NO_DEFAULT_PATH) |
||||||
set(IE_PLUGINS_PATH "${INF_ENGINE_ROOT_DIR}/${IE_PLUGINS_PATH}") |
find_library(ie_custom_env_lib_rel "inference_engine" PATHS "${_loc}/deployment_tools/inference_engine/lib/intel64/Release" NO_DEFAULT_PATH) |
||||||
|
find_library(ie_custom_env_lib_dbg "inference_engine" PATHS "${_loc}/deployment_tools/inference_engine/lib/intel64/Debug" NO_DEFAULT_PATH) |
||||||
|
add_custom_ie_build("${ie_custom_env_inc}" "${ie_custom_env_lib}" "${ie_custom_env_lib_rel}" "${ie_custom_env_lib_dbg}" "OpenVINO (${_loc})") |
||||||
endif() |
endif() |
||||||
|
|
||||||
link_directories( |
# Add more features to the target |
||||||
${INF_ENGINE_ROOT_DIR}/external/mkltiny_lnx/lib |
|
||||||
${INF_ENGINE_ROOT_DIR}/external/cldnn/lib |
|
||||||
) |
|
||||||
|
|
||||||
foreach(lib ${ie_lib_list}) |
|
||||||
find_library(${lib} NAMES ${lib} HINTS ${IE_PLUGINS_PATH}) |
|
||||||
if(NOT ${lib}) |
|
||||||
message(WARNING "DL IE: Can't find library: '${lib}'") |
|
||||||
ie_fail() |
|
||||||
endif() |
|
||||||
list(APPEND INF_ENGINE_LIBRARIES ${${lib}}) |
|
||||||
endforeach() |
|
||||||
|
|
||||||
set(HAVE_INF_ENGINE TRUE) |
if(INF_ENGINE_TARGET) |
||||||
|
if(NOT INF_ENGINE_RELEASE) |
||||||
|
message(WARNING "InferenceEngine version have not been set, 2018R2 will be used by default. Set INF_ENGINE_RELEASE variable if you experience build errors.") |
||||||
|
endif() |
||||||
|
set(INF_ENGINE_RELEASE "2018020000" CACHE STRING "Force IE version, should be in form YYYYAABBCC (e.g. 2018R2.0.2 -> 2018020002)") |
||||||
|
set_target_properties(${INF_ENGINE_TARGET} PROPERTIES |
||||||
|
INTERFACE_COMPILE_DEFINITIONS "HAVE_INF_ENGINE=1;INF_ENGINE_RELEASE=${INF_ENGINE_RELEASE}" |
||||||
|
) |
||||||
|
endif() |
||||||
|
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 630 B |
After Width: | Height: | Size: 42 KiB |
@ -0,0 +1,112 @@ |
|||||||
|
Out-of-focus Deblur Filter {#tutorial_out_of_focus_deblur_filter} |
||||||
|
========================== |
||||||
|
|
||||||
|
Goal |
||||||
|
---- |
||||||
|
|
||||||
|
In this tutorial you will learn: |
||||||
|
|
||||||
|
- what is a degradation image model |
||||||
|
- what is PSF of out-of-focus image |
||||||
|
- how to restore a blurred image |
||||||
|
- what is Wiener filter |
||||||
|
|
||||||
|
Theory |
||||||
|
------ |
||||||
|
|
||||||
|
@note The explanation is based on the books @cite gonzalez and @cite gruzman. Also, you can refer to Matlab's tutorial [Image Deblurring in Matlab] and an article [SmartDeblur]. |
||||||
|
@note An out-of-focus image on this page is a real world image. An out-of-focus was done manually by camera optics. |
||||||
|
|
||||||
|
### What is a degradation image model? |
||||||
|
|
||||||
|
A mathematical model of the image degradation in frequency domain representation is: |
||||||
|
|
||||||
|
\f[S = H\cdot U + N\f] |
||||||
|
|
||||||
|
where |
||||||
|
\f$S\f$ is a spectrum of blurred (degraded) image, |
||||||
|
\f$U\f$ is a spectrum of original true (undegraded) image, |
||||||
|
\f$H\f$ is frequency response of point spread function (PSF), |
||||||
|
\f$N\f$ is a spectrum of additive noise. |
||||||
|
|
||||||
|
Circular PSF is a good approximation of out-of-focus distortion. Such PSF is specified by only one parameter - radius \f$R\f$. Circular PSF is used in this work. |
||||||
|
|
||||||
|
 |
||||||
|
|
||||||
|
### How to restore an blurred image? |
||||||
|
|
||||||
|
The objective of restoration (deblurring) is to obtain an estimate of the original image. Restoration formula in frequency domain is: |
||||||
|
|
||||||
|
\f[U' = H_w\cdot S\f] |
||||||
|
|
||||||
|
where |
||||||
|
\f$U'\f$ is spectrum of estimation of original image \f$U\f$, |
||||||
|
\f$H_w\f$ is restoration filter, for example, Wiener filter. |
||||||
|
|
||||||
|
### What is Wiener filter? |
||||||
|
|
||||||
|
Wiener filter is a way to restore a blurred image. Let's suppose that PSF is a real and symmetric signal, a power spectrum of the original true image and noise are not known, |
||||||
|
then simplified Wiener formula is: |
||||||
|
|
||||||
|
\f[H_w = \frac{H}{|H|^2+\frac{1}{SNR}} \f] |
||||||
|
|
||||||
|
where |
||||||
|
\f$SNR\f$ is signal-to-noise ratio. |
||||||
|
|
||||||
|
So, in order to recover an out-of-focus image by Wiener filter, it needs to know \f$SNR\f$ and \f$R\f$ of circular PSF. |
||||||
|
|
||||||
|
|
||||||
|
Source code |
||||||
|
----------- |
||||||
|
|
||||||
|
You can find source code in the `samples/cpp/tutorial_code/ImgProc/out_of_focus_deblur_filter/out_of_focus_deblur_filter.cpp` of the OpenCV source code library. |
||||||
|
|
||||||
|
@include cpp/tutorial_code/ImgProc/out_of_focus_deblur_filter/out_of_focus_deblur_filter.cpp |
||||||
|
|
||||||
|
Explanation |
||||||
|
----------- |
||||||
|
|
||||||
|
An out-of-focus image recovering algorithm consists of PSF generation, Wiener filter generation and filtering an blurred image in frequency domain: |
||||||
|
@snippet samples/cpp/tutorial_code/ImgProc/out_of_focus_deblur_filter/out_of_focus_deblur_filter.cpp main |
||||||
|
|
||||||
|
A function calcPSF() forms an circular PSF according to input parameter radius \f$R\f$: |
||||||
|
@snippet samples/cpp/tutorial_code/ImgProc/out_of_focus_deblur_filter/out_of_focus_deblur_filter.cpp calcPSF |
||||||
|
|
||||||
|
A function calcWnrFilter() synthesizes simplified Wiener filter \f$H_w\f$ according to formula described above: |
||||||
|
@snippet samples/cpp/tutorial_code/ImgProc/out_of_focus_deblur_filter/out_of_focus_deblur_filter.cpp calcWnrFilter |
||||||
|
|
||||||
|
A function fftshift() rearranges PSF. This code was just copied from tutorial @ref tutorial_discrete_fourier_transform "Discrete Fourier Transform": |
||||||
|
@snippet samples/cpp/tutorial_code/ImgProc/out_of_focus_deblur_filter/out_of_focus_deblur_filter.cpp fftshift |
||||||
|
|
||||||
|
A function filter2DFreq() filters an blurred image in frequency domain: |
||||||
|
@snippet samples/cpp/tutorial_code/ImgProc/out_of_focus_deblur_filter/out_of_focus_deblur_filter.cpp filter2DFreq |
||||||
|
|
||||||
|
Result |
||||||
|
------ |
||||||
|
|
||||||
|
Below you can see real out-of-focus image: |
||||||
|
 |
||||||
|
|
||||||
|
|
||||||
|
Below result was done by \f$R\f$ = 53 and \f$SNR\f$ = 5200 parameters: |
||||||
|
 |
||||||
|
|
||||||
|
The Wiener filter was used, values of \f$R\f$ and \f$SNR\f$ were selected manually to give the best possible visual result. |
||||||
|
We can see that the result is not perfect, but it gives us a hint to the image content. With some difficulty, the text is readable. |
||||||
|
|
||||||
|
@note The parameter \f$R\f$ is the most important. So you should adjust \f$R\f$ first, then \f$SNR\f$. |
||||||
|
@note Sometimes you can observe the ringing effect in an restored image. This effect can be reduced by several methods. For example, you can taper input image edges. |
||||||
|
|
||||||
|
You can also find a quick video demonstration of this on |
||||||
|
[YouTube](https://youtu.be/0bEcE4B0XP4). |
||||||
|
@youtube{0bEcE4B0XP4} |
||||||
|
|
||||||
|
References |
||||||
|
------ |
||||||
|
- [Image Deblurring in Matlab] - Image Deblurring in Matlab |
||||||
|
- [SmartDeblur] - SmartDeblur site |
||||||
|
|
||||||
|
<!-- invisible references list --> |
||||||
|
[Digital Image Processing]: http://web.ipac.caltech.edu/staff/fmasci/home/astro_refs/Digital_Image_Processing_2ndEd.pdf |
||||||
|
[Image Deblurring in Matlab]: https://www.mathworks.com/help/images/image-deblurring.html |
||||||
|
[SmartDeblur]: http://yuzhikov.com/articles/BlurredImagesRestoration1.htm |
@ -0,0 +1,5 @@ |
|||||||
|
// This file is part of OpenCV project.
|
||||||
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||||
|
// of this distribution and at http://opencv.org/license.html.
|
||||||
|
#include "test_precomp.hpp" |
||||||
|
#include "test_intrin.simd.hpp" |
@ -0,0 +1,296 @@ |
|||||||
|
// This file is part of OpenCV project.
|
||||||
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||||
|
// of this distribution and at http://opencv.org/license.html.
|
||||||
|
#include "test_precomp.hpp" |
||||||
|
#include "test_intrin_utils.hpp" |
||||||
|
|
||||||
|
namespace opencv_test { namespace hal { |
||||||
|
CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN |
||||||
|
|
||||||
|
void test_hal_intrin_uint8(); |
||||||
|
void test_hal_intrin_int8(); |
||||||
|
void test_hal_intrin_uint16(); |
||||||
|
void test_hal_intrin_int16(); |
||||||
|
void test_hal_intrin_uint32(); |
||||||
|
void test_hal_intrin_int32(); |
||||||
|
void test_hal_intrin_uint64(); |
||||||
|
void test_hal_intrin_int64(); |
||||||
|
void test_hal_intrin_float32(); |
||||||
|
void test_hal_intrin_float64(); |
||||||
|
|
||||||
|
#ifndef CV_CPU_OPTIMIZATION_DECLARATIONS_ONLY |
||||||
|
|
||||||
|
//============= 8-bit integer =====================================================================
|
||||||
|
|
||||||
|
void test_hal_intrin_uint8() |
||||||
|
{ |
||||||
|
TheTest<v_uint8>() |
||||||
|
.test_loadstore() |
||||||
|
.test_interleave() |
||||||
|
.test_expand() |
||||||
|
.test_expand_q() |
||||||
|
.test_addsub() |
||||||
|
.test_addsub_wrap() |
||||||
|
.test_cmp() |
||||||
|
.test_logic() |
||||||
|
.test_min_max() |
||||||
|
.test_absdiff() |
||||||
|
.test_mask() |
||||||
|
.test_popcount() |
||||||
|
.test_pack<1>().test_pack<2>().test_pack<3>().test_pack<8>() |
||||||
|
.test_pack_u<1>().test_pack_u<2>().test_pack_u<3>().test_pack_u<8>() |
||||||
|
.test_unpack() |
||||||
|
.test_extract<0>().test_extract<1>().test_extract<8>().test_extract<15>() |
||||||
|
.test_rotate<0>().test_rotate<1>().test_rotate<8>().test_rotate<15>() |
||||||
|
; |
||||||
|
|
||||||
|
#if CV_SIMD256 |
||||||
|
TheTest<v_uint8>() |
||||||
|
.test_pack<9>().test_pack<10>().test_pack<13>().test_pack<15>() |
||||||
|
.test_pack_u<9>().test_pack_u<10>().test_pack_u<13>().test_pack_u<15>() |
||||||
|
.test_extract<16>().test_extract<17>().test_extract<23>().test_extract<31>() |
||||||
|
.test_rotate<16>().test_rotate<17>().test_rotate<23>().test_rotate<31>() |
||||||
|
; |
||||||
|
#endif |
||||||
|
} |
||||||
|
|
||||||
|
void test_hal_intrin_int8() |
||||||
|
{ |
||||||
|
TheTest<v_int8>() |
||||||
|
.test_loadstore() |
||||||
|
.test_interleave() |
||||||
|
.test_expand() |
||||||
|
.test_expand_q() |
||||||
|
.test_addsub() |
||||||
|
.test_addsub_wrap() |
||||||
|
.test_cmp() |
||||||
|
.test_logic() |
||||||
|
.test_min_max() |
||||||
|
.test_absdiff() |
||||||
|
.test_abs() |
||||||
|
.test_mask() |
||||||
|
.test_popcount() |
||||||
|
.test_pack<1>().test_pack<2>().test_pack<3>().test_pack<8>() |
||||||
|
.test_unpack() |
||||||
|
.test_extract<0>().test_extract<1>().test_extract<8>().test_extract<15>() |
||||||
|
.test_rotate<0>().test_rotate<1>().test_rotate<8>().test_rotate<15>() |
||||||
|
; |
||||||
|
} |
||||||
|
|
||||||
|
//============= 16-bit integer =====================================================================
|
||||||
|
|
||||||
|
void test_hal_intrin_uint16() |
||||||
|
{ |
||||||
|
TheTest<v_uint16>() |
||||||
|
.test_loadstore() |
||||||
|
.test_interleave() |
||||||
|
.test_expand() |
||||||
|
.test_addsub() |
||||||
|
.test_addsub_wrap() |
||||||
|
.test_mul() |
||||||
|
.test_mul_expand() |
||||||
|
.test_cmp() |
||||||
|
.test_shift<1>() |
||||||
|
.test_shift<8>() |
||||||
|
.test_logic() |
||||||
|
.test_min_max() |
||||||
|
.test_absdiff() |
||||||
|
.test_reduce() |
||||||
|
.test_mask() |
||||||
|
.test_popcount() |
||||||
|
.test_pack<1>().test_pack<2>().test_pack<7>().test_pack<16>() |
||||||
|
.test_pack_u<1>().test_pack_u<2>().test_pack_u<7>().test_pack_u<16>() |
||||||
|
.test_unpack() |
||||||
|
.test_extract<0>().test_extract<1>().test_extract<4>().test_extract<7>() |
||||||
|
.test_rotate<0>().test_rotate<1>().test_rotate<4>().test_rotate<7>() |
||||||
|
; |
||||||
|
} |
||||||
|
|
||||||
|
void test_hal_intrin_int16() |
||||||
|
{ |
||||||
|
TheTest<v_int16>() |
||||||
|
.test_loadstore() |
||||||
|
.test_interleave() |
||||||
|
.test_expand() |
||||||
|
.test_addsub() |
||||||
|
.test_addsub_wrap() |
||||||
|
.test_mul() |
||||||
|
.test_mul_expand() |
||||||
|
.test_cmp() |
||||||
|
.test_shift<1>() |
||||||
|
.test_shift<8>() |
||||||
|
.test_dot_prod() |
||||||
|
.test_logic() |
||||||
|
.test_min_max() |
||||||
|
.test_absdiff() |
||||||
|
.test_abs() |
||||||
|
.test_reduce() |
||||||
|
.test_mask() |
||||||
|
.test_popcount() |
||||||
|
.test_pack<1>().test_pack<2>().test_pack<7>().test_pack<16>() |
||||||
|
.test_unpack() |
||||||
|
.test_extract<0>().test_extract<1>().test_extract<4>().test_extract<7>() |
||||||
|
.test_rotate<0>().test_rotate<1>().test_rotate<4>().test_rotate<7>() |
||||||
|
; |
||||||
|
} |
||||||
|
|
||||||
|
//============= 32-bit integer =====================================================================
|
||||||
|
|
||||||
|
void test_hal_intrin_uint32() |
||||||
|
{ |
||||||
|
TheTest<v_uint32>() |
||||||
|
.test_loadstore() |
||||||
|
.test_interleave() |
||||||
|
.test_expand() |
||||||
|
.test_addsub() |
||||||
|
.test_mul() |
||||||
|
.test_mul_expand() |
||||||
|
.test_cmp() |
||||||
|
.test_shift<1>() |
||||||
|
.test_shift<8>() |
||||||
|
.test_logic() |
||||||
|
.test_min_max() |
||||||
|
.test_absdiff() |
||||||
|
.test_reduce() |
||||||
|
.test_mask() |
||||||
|
.test_popcount() |
||||||
|
.test_pack<1>().test_pack<2>().test_pack<15>().test_pack<32>() |
||||||
|
.test_unpack() |
||||||
|
.test_extract<0>().test_extract<1>().test_extract<2>().test_extract<3>() |
||||||
|
.test_rotate<0>().test_rotate<1>().test_rotate<2>().test_rotate<3>() |
||||||
|
.test_transpose() |
||||||
|
; |
||||||
|
} |
||||||
|
|
||||||
|
void test_hal_intrin_int32() |
||||||
|
{ |
||||||
|
TheTest<v_int32>() |
||||||
|
.test_loadstore() |
||||||
|
.test_interleave() |
||||||
|
.test_expand() |
||||||
|
.test_addsub() |
||||||
|
.test_mul() |
||||||
|
.test_abs() |
||||||
|
.test_cmp() |
||||||
|
.test_popcount() |
||||||
|
.test_shift<1>().test_shift<8>() |
||||||
|
.test_logic() |
||||||
|
.test_min_max() |
||||||
|
.test_absdiff() |
||||||
|
.test_reduce() |
||||||
|
.test_mask() |
||||||
|
.test_pack<1>().test_pack<2>().test_pack<15>().test_pack<32>() |
||||||
|
.test_unpack() |
||||||
|
.test_extract<0>().test_extract<1>().test_extract<2>().test_extract<3>() |
||||||
|
.test_rotate<0>().test_rotate<1>().test_rotate<2>().test_rotate<3>() |
||||||
|
.test_float_cvt32() |
||||||
|
.test_float_cvt64() |
||||||
|
.test_transpose() |
||||||
|
; |
||||||
|
} |
||||||
|
|
||||||
|
//============= 64-bit integer =====================================================================
|
||||||
|
|
||||||
|
void test_hal_intrin_uint64() |
||||||
|
{ |
||||||
|
TheTest<v_uint64>() |
||||||
|
.test_loadstore() |
||||||
|
.test_addsub() |
||||||
|
.test_shift<1>().test_shift<8>() |
||||||
|
.test_logic() |
||||||
|
.test_extract<0>().test_extract<1>() |
||||||
|
.test_rotate<0>().test_rotate<1>() |
||||||
|
; |
||||||
|
} |
||||||
|
|
||||||
|
void test_hal_intrin_int64() |
||||||
|
{ |
||||||
|
TheTest<v_int64>() |
||||||
|
.test_loadstore() |
||||||
|
.test_addsub() |
||||||
|
.test_shift<1>().test_shift<8>() |
||||||
|
.test_logic() |
||||||
|
.test_extract<0>().test_extract<1>() |
||||||
|
.test_rotate<0>().test_rotate<1>() |
||||||
|
; |
||||||
|
} |
||||||
|
|
||||||
|
//============= Floating point =====================================================================
|
||||||
|
void test_hal_intrin_float32() |
||||||
|
{ |
||||||
|
TheTest<v_float32>() |
||||||
|
.test_loadstore() |
||||||
|
.test_interleave() |
||||||
|
.test_interleave_2channel() |
||||||
|
.test_addsub() |
||||||
|
.test_mul() |
||||||
|
.test_div() |
||||||
|
.test_cmp() |
||||||
|
.test_sqrt_abs() |
||||||
|
.test_min_max() |
||||||
|
.test_float_absdiff() |
||||||
|
.test_reduce() |
||||||
|
.test_mask() |
||||||
|
.test_unpack() |
||||||
|
.test_float_math() |
||||||
|
.test_float_cvt64() |
||||||
|
.test_matmul() |
||||||
|
.test_transpose() |
||||||
|
.test_reduce_sum4() |
||||||
|
.test_extract<0>().test_extract<1>().test_extract<2>().test_extract<3>() |
||||||
|
.test_rotate<0>().test_rotate<1>().test_rotate<2>().test_rotate<3>() |
||||||
|
; |
||||||
|
|
||||||
|
#if CV_SIMD256 |
||||||
|
TheTest<v_float32>() |
||||||
|
.test_extract<4>().test_extract<5>().test_extract<6>().test_extract<7>() |
||||||
|
.test_rotate<4>().test_rotate<5>().test_rotate<6>().test_rotate<7>() |
||||||
|
; |
||||||
|
#endif |
||||||
|
} |
||||||
|
|
||||||
|
void test_hal_intrin_float64() |
||||||
|
{ |
||||||
|
#if CV_SIMD_64F |
||||||
|
TheTest<v_float64>() |
||||||
|
.test_loadstore() |
||||||
|
.test_addsub() |
||||||
|
.test_mul() |
||||||
|
.test_div() |
||||||
|
.test_cmp() |
||||||
|
.test_sqrt_abs() |
||||||
|
.test_min_max() |
||||||
|
.test_float_absdiff() |
||||||
|
.test_mask() |
||||||
|
.test_unpack() |
||||||
|
.test_float_math() |
||||||
|
.test_float_cvt32() |
||||||
|
.test_extract<0>().test_extract<1>() |
||||||
|
.test_rotate<0>().test_rotate<1>() |
||||||
|
; |
||||||
|
|
||||||
|
#if CV_SIMD256 |
||||||
|
TheTest<v_float64>() |
||||||
|
.test_extract<2>().test_extract<3>() |
||||||
|
.test_rotate<2>().test_rotate<3>() |
||||||
|
; |
||||||
|
#endif //CV_SIMD256
|
||||||
|
|
||||||
|
#endif |
||||||
|
} |
||||||
|
|
||||||
|
#if CV_FP16 && CV_SIMD_WIDTH > 16 |
||||||
|
void test_hal_intrin_float16() |
||||||
|
{ |
||||||
|
TheTest<v_float16>() |
||||||
|
.test_loadstore_fp16() |
||||||
|
.test_float_cvt_fp16() |
||||||
|
; |
||||||
|
} |
||||||
|
#endif |
||||||
|
|
||||||
|
#endif //CV_CPU_OPTIMIZATION_DECLARATIONS_ONLY
|
||||||
|
|
||||||
|
CV_CPU_OPTIMIZATION_NAMESPACE_END |
||||||
|
|
||||||
|
}} //namespace
|
Loading…
Reference in new issue