├── .gitignore ├── AutoMatting.pro ├── LICENSE ├── README.md ├── RemoveBGConn.cpp ├── RemoveBGConn.h ├── ScaleAndMix.cpp ├── ScaleAndMix.h ├── icon.ico ├── main.cpp ├── opencv └── include │ └── opencv2 │ ├── aruco.hpp │ ├── aruco │ ├── charuco.hpp │ └── dictionary.hpp │ ├── bgsegm.hpp │ ├── bioinspired.hpp │ ├── bioinspired │ ├── bioinspired.hpp │ ├── retina.hpp │ ├── retinafasttonemapping.hpp │ └── transientareassegmentationmodule.hpp │ ├── calib3d.hpp │ ├── calib3d │ ├── calib3d.hpp │ └── calib3d_c.h │ ├── ccalib.hpp │ ├── ccalib │ ├── multicalib.hpp │ ├── omnidir.hpp │ └── randpattern.hpp │ ├── core.hpp │ ├── core │ ├── affine.hpp │ ├── async.hpp │ ├── base.hpp │ ├── bindings_utils.hpp │ ├── bufferpool.hpp │ ├── check.hpp │ ├── core.hpp │ ├── core_c.h │ ├── cuda.hpp │ ├── cuda.inl.hpp │ ├── cuda │ │ ├── block.hpp │ │ ├── border_interpolate.hpp │ │ ├── color.hpp │ │ ├── common.hpp │ │ ├── datamov_utils.hpp │ │ ├── detail │ │ │ ├── color_detail.hpp │ │ │ ├── reduce.hpp │ │ │ ├── reduce_key_val.hpp │ │ │ ├── transform_detail.hpp │ │ │ ├── type_traits_detail.hpp │ │ │ └── vec_distance_detail.hpp │ │ ├── dynamic_smem.hpp │ │ ├── emulation.hpp │ │ ├── filters.hpp │ │ ├── funcattrib.hpp │ │ ├── functional.hpp │ │ ├── limits.hpp │ │ ├── reduce.hpp │ │ ├── saturate_cast.hpp │ │ ├── scan.hpp │ │ ├── simd_functions.hpp │ │ ├── transform.hpp │ │ ├── type_traits.hpp │ │ ├── utility.hpp │ │ ├── vec_distance.hpp │ │ ├── vec_math.hpp │ │ ├── vec_traits.hpp │ │ ├── warp.hpp │ │ ├── warp_reduce.hpp │ │ └── warp_shuffle.hpp │ ├── cuda_stream_accessor.hpp │ ├── cuda_types.hpp │ ├── cv_cpu_dispatch.h │ ├── cv_cpu_helper.h │ ├── cvdef.h │ ├── cvstd.hpp │ ├── cvstd.inl.hpp │ ├── cvstd_wrapper.hpp │ ├── detail │ │ ├── async_promise.hpp │ │ └── exception_ptr.hpp │ ├── directx.hpp │ ├── eigen.hpp │ ├── fast_math.hpp │ ├── hal │ │ ├── hal.hpp │ │ ├── interface.h │ │ ├── intrin.hpp │ │ ├── intrin_avx.hpp │ │ ├── intrin_avx512.hpp │ │ ├── intrin_cpp.hpp │ │ ├── intrin_forward.hpp │ │ ├── intrin_msa.hpp │ │ ├── intrin_neon.hpp │ │ ├── intrin_sse.hpp │ │ ├── intrin_sse_em.hpp │ │ ├── intrin_vsx.hpp │ │ ├── intrin_wasm.hpp │ │ ├── msa_macros.h │ │ └── simd_utils.impl.hpp │ ├── mat.hpp │ ├── mat.inl.hpp │ ├── matx.hpp │ ├── neon_utils.hpp │ ├── ocl.hpp │ ├── ocl_genbase.hpp │ ├── opencl │ │ ├── ocl_defs.hpp │ │ ├── opencl_info.hpp │ │ ├── opencl_svm.hpp │ │ └── runtime │ │ │ ├── autogenerated │ │ │ ├── opencl_clamdblas.hpp │ │ │ ├── opencl_clamdfft.hpp │ │ │ ├── opencl_core.hpp │ │ │ ├── opencl_core_wrappers.hpp │ │ │ ├── opencl_gl.hpp │ │ │ └── opencl_gl_wrappers.hpp │ │ │ ├── opencl_clamdblas.hpp │ │ │ ├── opencl_clamdfft.hpp │ │ │ ├── opencl_core.hpp │ │ │ ├── opencl_core_wrappers.hpp │ │ │ ├── opencl_gl.hpp │ │ │ ├── opencl_gl_wrappers.hpp │ │ │ ├── opencl_svm_20.hpp │ │ │ ├── opencl_svm_definitions.hpp │ │ │ └── opencl_svm_hsa_extension.hpp │ ├── opengl.hpp │ ├── operations.hpp │ ├── optim.hpp │ ├── ovx.hpp │ ├── persistence.hpp │ ├── saturate.hpp │ ├── simd_intrinsics.hpp │ ├── softfloat.hpp │ ├── sse_utils.hpp │ ├── traits.hpp │ ├── types.hpp │ ├── types_c.h │ ├── utility.hpp │ ├── utils │ │ ├── allocator_stats.hpp │ │ ├── allocator_stats.impl.hpp │ │ ├── filesystem.hpp │ │ ├── instrumentation.hpp │ │ ├── logger.defines.hpp │ │ ├── logger.hpp │ │ ├── logtag.hpp │ │ ├── tls.hpp │ │ └── trace.hpp │ ├── va_intel.hpp │ ├── version.hpp │ └── vsx_utils.hpp │ ├── core_detect.hpp │ ├── cvconfig.h │ ├── datasets │ ├── ar_hmdb.hpp │ ├── ar_sports.hpp │ ├── dataset.hpp │ ├── fr_adience.hpp │ ├── fr_lfw.hpp │ ├── gr_chalearn.hpp │ ├── gr_skig.hpp │ ├── hpe_humaneva.hpp │ ├── hpe_parse.hpp │ ├── ir_affine.hpp │ ├── ir_robot.hpp │ ├── is_bsds.hpp │ ├── is_weizmann.hpp │ ├── msm_epfl.hpp │ ├── msm_middlebury.hpp │ ├── or_imagenet.hpp │ ├── or_mnist.hpp │ ├── or_pascal.hpp │ ├── or_sun.hpp │ ├── pd_caltech.hpp │ ├── pd_inria.hpp │ ├── slam_kitti.hpp │ ├── slam_tumindoor.hpp │ ├── sr_bsds.hpp │ ├── sr_div2k.hpp │ ├── sr_general100.hpp │ ├── tr_chars.hpp │ ├── tr_icdar.hpp │ ├── tr_svt.hpp │ ├── track_alov.hpp │ ├── track_vot.hpp │ └── util.hpp │ ├── dnn.hpp │ ├── dnn │ ├── all_layers.hpp │ ├── dict.hpp │ ├── dnn.hpp │ ├── dnn.inl.hpp │ ├── layer.details.hpp │ ├── layer.hpp │ ├── shape_utils.hpp │ ├── utils │ │ └── inference_engine.hpp │ └── version.hpp │ ├── dnn_superres.hpp │ ├── dpm.hpp │ ├── face.hpp │ ├── face │ ├── bif.hpp │ ├── face_alignment.hpp │ ├── facemark.hpp │ ├── facemarkAAM.hpp │ ├── facemarkLBF.hpp │ ├── facemark_train.hpp │ ├── facerec.hpp │ ├── mace.hpp │ └── predict_collector.hpp │ ├── features2d.hpp │ ├── features2d │ ├── features2d.hpp │ └── hal │ │ └── interface.h │ ├── flann.hpp │ ├── flann │ ├── all_indices.h │ ├── allocator.h │ ├── any.h │ ├── autotuned_index.h │ ├── composite_index.h │ ├── config.h │ ├── defines.h │ ├── dist.h │ ├── dummy.h │ ├── dynamic_bitset.h │ ├── flann.hpp │ ├── flann_base.hpp │ ├── general.h │ ├── ground_truth.h │ ├── hdf5.h │ ├── heap.h │ ├── hierarchical_clustering_index.h │ ├── index_testing.h │ ├── kdtree_index.h │ ├── kdtree_single_index.h │ ├── kmeans_index.h │ ├── linear_index.h │ ├── logger.h │ ├── lsh_index.h │ ├── lsh_table.h │ ├── matrix.h │ ├── miniflann.hpp │ ├── nn_index.h │ ├── object_factory.h │ ├── params.h │ ├── random.h │ ├── result_set.h │ ├── sampling.h │ ├── saving.h │ ├── simplex_downhill.h │ └── timer.h │ ├── fuzzy.hpp │ ├── fuzzy │ ├── fuzzy_F0_math.hpp │ ├── fuzzy_F1_math.hpp │ ├── fuzzy_image.hpp │ └── types.hpp │ ├── gapi.hpp │ ├── gapi │ ├── core.hpp │ ├── cpu │ │ ├── core.hpp │ │ ├── gcpukernel.hpp │ │ ├── imgproc.hpp │ │ └── video.hpp │ ├── fluid │ │ ├── core.hpp │ │ ├── gfluidbuffer.hpp │ │ ├── gfluidkernel.hpp │ │ └── imgproc.hpp │ ├── garg.hpp │ ├── garray.hpp │ ├── gasync_context.hpp │ ├── gcall.hpp │ ├── gcommon.hpp │ ├── gcompiled.hpp │ ├── gcompiled_async.hpp │ ├── gcompoundkernel.hpp │ ├── gcomputation.hpp │ ├── gcomputation_async.hpp │ ├── gkernel.hpp │ ├── gmat.hpp │ ├── gmetaarg.hpp │ ├── gopaque.hpp │ ├── gproto.hpp │ ├── gpu │ │ ├── core.hpp │ │ ├── ggpukernel.hpp │ │ └── imgproc.hpp │ ├── gscalar.hpp │ ├── gstreaming.hpp │ ├── gtransform.hpp │ ├── gtype_traits.hpp │ ├── gtyped.hpp │ ├── imgproc.hpp │ ├── infer.hpp │ ├── infer │ │ └── ie.hpp │ ├── ocl │ │ ├── core.hpp │ │ ├── goclkernel.hpp │ │ └── imgproc.hpp │ ├── opencv_includes.hpp │ ├── operators.hpp │ ├── own │ │ ├── assert.hpp │ │ ├── convert.hpp │ │ ├── cvdefs.hpp │ │ ├── exports.hpp │ │ ├── mat.hpp │ │ ├── saturate.hpp │ │ ├── scalar.hpp │ │ └── types.hpp │ ├── plaidml │ │ ├── core.hpp │ │ ├── gplaidmlkernel.hpp │ │ └── plaidml.hpp │ ├── render.hpp │ ├── render │ │ └── render.hpp │ ├── s11n.hpp │ ├── streaming │ │ ├── cap.hpp │ │ └── source.hpp │ ├── util │ │ ├── any.hpp │ │ ├── compiler_hints.hpp │ │ ├── optional.hpp │ │ ├── throw.hpp │ │ ├── type_traits.hpp │ │ ├── util.hpp │ │ └── variant.hpp │ └── video.hpp │ ├── hfs.hpp │ ├── highgui.hpp │ ├── highgui │ ├── highgui.hpp │ └── highgui_c.h │ ├── img_hash.hpp │ ├── img_hash │ ├── average_hash.hpp │ ├── block_mean_hash.hpp │ ├── color_moment_hash.hpp │ ├── img_hash_base.hpp │ ├── marr_hildreth_hash.hpp │ ├── phash.hpp │ └── radial_variance_hash.hpp │ ├── imgcodecs.hpp │ ├── imgcodecs │ ├── imgcodecs.hpp │ ├── imgcodecs_c.h │ ├── ios.h │ └── legacy │ │ └── constants_c.h │ ├── imgproc.hpp │ ├── imgproc │ ├── detail │ │ └── gcgraph.hpp │ ├── hal │ │ ├── hal.hpp │ │ └── interface.h │ ├── imgproc.hpp │ ├── imgproc_c.h │ └── types_c.h │ ├── intensity_transform.hpp │ ├── line_descriptor.hpp │ ├── line_descriptor │ └── descriptor.hpp │ ├── ml.hpp │ ├── ml │ ├── ml.hpp │ └── ml.inl.hpp │ ├── objdetect.hpp │ ├── objdetect │ ├── detection_based_tracker.hpp │ └── objdetect.hpp │ ├── opencv.hpp │ ├── opencv_modules.hpp │ ├── optflow.hpp │ ├── optflow │ ├── motempl.hpp │ ├── pcaflow.hpp │ ├── rlofflow.hpp │ └── sparse_matching_gpc.hpp │ ├── phase_unwrapping.hpp │ ├── phase_unwrapping │ ├── histogramphaseunwrapping.hpp │ └── phase_unwrapping.hpp │ ├── photo.hpp │ ├── photo │ ├── cuda.hpp │ ├── legacy │ │ └── constants_c.h │ └── photo.hpp │ ├── plot.hpp │ ├── quality.hpp │ ├── quality │ ├── quality_utils.hpp │ ├── qualitybase.hpp │ ├── qualitybrisque.hpp │ ├── qualitygmsd.hpp │ ├── qualitymse.hpp │ ├── qualitypsnr.hpp │ └── qualityssim.hpp │ ├── rapid.hpp │ ├── reg │ ├── map.hpp │ ├── mapaffine.hpp │ ├── mapper.hpp │ ├── mappergradaffine.hpp │ ├── mappergradeuclid.hpp │ ├── mappergradproj.hpp │ ├── mappergradshift.hpp │ ├── mappergradsimilar.hpp │ ├── mapperpyramid.hpp │ ├── mapprojec.hpp │ └── mapshift.hpp │ ├── rgbd.hpp │ ├── rgbd │ ├── depth.hpp │ ├── dynafu.hpp │ ├── intrinsics.hpp │ ├── kinfu.hpp │ ├── linemod.hpp │ └── volume.hpp │ ├── saliency.hpp │ ├── saliency │ ├── saliencyBaseClasses.hpp │ └── saliencySpecializedClasses.hpp │ ├── shape.hpp │ ├── shape │ ├── emdL1.hpp │ ├── hist_cost.hpp │ ├── shape.hpp │ ├── shape_distance.hpp │ └── shape_transformer.hpp │ ├── stereo.hpp │ ├── stereo │ ├── descriptor.hpp │ ├── quasi_dense_stereo.hpp │ └── stereo.hpp │ ├── stitching.hpp │ ├── stitching │ ├── detail │ │ ├── autocalib.hpp │ │ ├── blenders.hpp │ │ ├── camera.hpp │ │ ├── exposure_compensate.hpp │ │ ├── matchers.hpp │ │ ├── motion_estimators.hpp │ │ ├── seam_finders.hpp │ │ ├── timelapsers.hpp │ │ ├── util.hpp │ │ ├── util_inl.hpp │ │ ├── warpers.hpp │ │ └── warpers_inl.hpp │ └── warpers.hpp │ ├── structured_light.hpp │ ├── structured_light │ ├── graycodepattern.hpp │ ├── sinusoidalpattern.hpp │ └── structured_light.hpp │ ├── superres.hpp │ ├── superres │ └── optical_flow.hpp │ ├── surface_matching.hpp │ ├── surface_matching │ ├── icp.hpp │ ├── pose_3d.hpp │ ├── ppf_helpers.hpp │ ├── ppf_match_3d.hpp │ └── t_hash_int.hpp │ ├── text.hpp │ ├── text │ ├── erfilter.hpp │ ├── ocr.hpp │ ├── swt_text_detection.hpp │ └── textDetector.hpp │ ├── tracking.hpp │ ├── tracking │ ├── feature.hpp │ ├── kalman_filters.hpp │ ├── onlineBoosting.hpp │ ├── onlineMIL.hpp │ ├── tldDataset.hpp │ ├── tracker.hpp │ ├── tracking.hpp │ └── tracking_by_matching.hpp │ ├── video.hpp │ ├── video │ ├── background_segm.hpp │ ├── legacy │ │ └── constants_c.h │ ├── tracking.hpp │ └── video.hpp │ ├── videoio.hpp │ ├── videoio │ ├── cap_ios.h │ ├── legacy │ │ └── constants_c.h │ ├── registry.hpp │ ├── videoio.hpp │ └── videoio_c.h │ ├── videostab.hpp │ ├── videostab │ ├── deblurring.hpp │ ├── fast_marching.hpp │ ├── fast_marching_inl.hpp │ ├── frame_source.hpp │ ├── global_motion.hpp │ ├── inpainting.hpp │ ├── log.hpp │ ├── motion_core.hpp │ ├── motion_stabilizing.hpp │ ├── optical_flow.hpp │ ├── outlier_rejection.hpp │ ├── ring_buffer.hpp │ ├── stabilizer.hpp │ └── wobble_suppression.hpp │ ├── xfeatures2d.hpp │ ├── xfeatures2d │ ├── cuda.hpp │ └── nonfree.hpp │ ├── ximgproc.hpp │ ├── ximgproc │ ├── brightedges.hpp │ ├── color_match.hpp │ ├── deriche_filter.hpp │ ├── disparity_filter.hpp │ ├── edge_filter.hpp │ ├── edgeboxes.hpp │ ├── edgepreserving_filter.hpp │ ├── estimated_covariance.hpp │ ├── fast_hough_transform.hpp │ ├── fast_line_detector.hpp │ ├── fourier_descriptors.hpp │ ├── lsc.hpp │ ├── paillou_filter.hpp │ ├── peilin.hpp │ ├── ridgefilter.hpp │ ├── run_length_morphology.hpp │ ├── seeds.hpp │ ├── segmentation.hpp │ ├── slic.hpp │ ├── sparse_match_interpolator.hpp │ ├── structured_edge_detection.hpp │ └── weighted_median_filter.hpp │ ├── xobjdetect.hpp │ ├── xphoto.hpp │ └── xphoto │ ├── bm3d_image_denoising.hpp │ ├── dct_image_denoising.hpp │ ├── inpainting.hpp │ ├── oilpainting.hpp │ ├── tonemap.hpp │ └── white_balance.hpp ├── widget.cpp ├── widget.h └── widget.ui /.gitignore: -------------------------------------------------------------------------------- 1 | # C++ objects and libs 2 | *.slo 3 | *.lo 4 | *.o 5 | *.a 6 | *.la 7 | *.lai 8 | *.so 9 | *.so.* 10 | *.dll 11 | *.dylib 12 | 13 | # Qt-es 14 | object_script.*.Release 15 | object_script.*.Debug 16 | *_plugin_import.cpp 17 | /.qmake.cache 18 | /.qmake.stash 19 | *.pro.user 20 | *.pro.user.* 21 | *.qbs.user 22 | *.qbs.user.* 23 | *.moc 24 | moc_*.cpp 25 | moc_*.h 26 | qrc_*.cpp 27 | ui_*.h 28 | *.qmlc 29 | *.jsc 30 | Makefile* 31 | *build-* 32 | *.qm 33 | *.prl 34 | 35 | # Qt unit tests 36 | target_wrapper.* 37 | 38 | # QtCreator 39 | *.autosave 40 | 41 | # QtCreator Qml 42 | *.qmlproject.user 43 | *.qmlproject.user.* 44 | 45 | # QtCreator CMake 46 | CMakeLists.txt.user* 47 | 48 | # QtCreator 4.8< compilation database 49 | compile_commands.json 50 | 51 | # QtCreator local machine specific files for imported projects 52 | *creator.user* 53 | -------------------------------------------------------------------------------- /AutoMatting.pro: -------------------------------------------------------------------------------- 1 | QT += core gui network 2 | 3 | RC_ICONS = icon.ico 4 | 5 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 6 | 7 | CONFIG += c++11 8 | 9 | # The following define makes your compiler emit warnings if you use 10 | # any Qt feature that has been marked deprecated (the exact warnings 11 | # depend on your compiler). Please consult the documentation of the 12 | # deprecated API in order to know how to port your code away from it. 13 | DEFINES += QT_DEPRECATED_WARNINGS 14 | 15 | # You can also make your code fail to compile if it uses deprecated APIs. 16 | # In order to do so, uncomment the following line. 17 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 18 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 19 | 20 | SOURCES += \ 21 | RemoveBGConn.cpp \ 22 | ScaleAndMix.cpp \ 23 | main.cpp \ 24 | widget.cpp 25 | 26 | HEADERS += \ 27 | RemoveBGConn.h \ 28 | ScaleAndMix.h \ 29 | widget.h 30 | 31 | FORMS += \ 32 | widget.ui 33 | 34 | # Default rules for deployment. 35 | qnx: target.path = /tmp/$${TARGET}/bin 36 | else: unix:!android: target.path = /opt/$${TARGET}/bin 37 | !isEmpty(target.path): INSTALLS += target 38 | 39 | INCLUDEPATH += opencv/include 40 | LIBS += $$PWD/opencv/bin/libopencv_*.dll 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AutoMatting 2 | 用Qt+OpenCV写的自动抠图的软件,使用**removebg**提供的api接口,可生成高清图 3 | 4 | 软件安装包下载地址:[蓝奏云(Win)](https://huanghaozi.lanzous.com/i6iWrg51umj) [蓝奏云(Mac)](https://huanghaozi.lanzous.com/iKg59g9zdxg) 5 | 6 | 软件过程介绍:[博客](https://huanghaozi.cn/index.php/archives/245/) 7 | 8 | - 支持格式:**jpg/png/JPG/PNG** 9 | - 支持**单文件**/**文件夹批量**抠图 10 | - 需要在removebg官网注册账号,将其api-key填入软件的token输入框中,每个key每月有50次使用机会 11 | - (可在网上搜索“临时邮箱”,使用临时邮箱批量注册账号获取api-key) 12 | - 整了一些api-key如下,填入token就能用了: 13 | 14 | kPFsVb8ajqaeegnLRwHQg5wg 15 | 16 | pxvvF152FPs2G47reAjdSQFv 17 | 18 | dMvFs2L8PWTjcMjbDo6jiQDb 19 | 20 | ggY6xY9yGE2frQAGst7M7FtS 21 | 22 | KhJUHr65KhauFvkRrUvXEUYm 23 | 24 | Ue1rcGF6pG1Fbnuq83a8jX6U 25 | 26 | YJBUt3pTq9A1G22553Kpcm95 27 | 28 | 3Jh2rJSFNHk4Fg31zYAaYHnY 29 | 30 | cn5C3F8xb628aKKX2DEQJs5q 31 | 32 | FCcqMzi9w95p499DNifnyqtc 33 | 34 | k6niQBfpxXsD1EfyQ8AagPRx 35 | 36 | eSt8w3vwT41B1KSMcAZ88dbp 37 | 38 | FPRKfddyw6QtX2GAzQHfGXzY 39 | 40 | EQrFePowinNS5Q7TeDnRFLse 41 | 42 | LKvvZDGYwcakJkFR6HHkf2J7 43 | 44 | 8jSsx7iWVvwy4M49CMTYNwfX 45 | 46 | LiM4rfc1rr8FdWqikronMbdm 47 | 48 | W2Vz6osKSR4z2o7V7qVHFJzg 49 | 50 | 6oQcwGozeFyPS7NZPiRAKdw2 51 | 52 | 1psMbURiL3nCBrnsWMhHmkNJ 53 | -------------------------------------------------------------------------------- /RemoveBGConn.cpp: -------------------------------------------------------------------------------- 1 | #include "RemoveBGConn.h" 2 | 3 | RemoveBGConn::RemoveBGConn() 4 | { 5 | //qDebug() << QSslSocket::supportsSsl() << QSslSocket::sslLibraryBuildVersionString() << QSslSocket::sslLibraryVersionString(); 6 | } 7 | 8 | void RemoveBGConn::postData(QString filepath, QString token, bool start) 9 | { 10 | this->filepath.push_back(filepath); 11 | this->token.push_back(token); 12 | if(start) 13 | { 14 | i = 0; 15 | postDataReal(); 16 | } 17 | } 18 | 19 | bool RemoveBGConn::postDataReal() 20 | { 21 | emit connectInfo(""); 22 | emit connectInfo(filepath[i]); 23 | file = new QFile(filepath[i]); 24 | file->open(QIODevice::ReadOnly); 25 | 26 | QByteArray ba; 27 | ba.append("size=auto&"); 28 | ba.append("image_file_b64="); 29 | ba.append(file->readAll().toBase64(QByteArray::Base64UrlEncoding)); 30 | 31 | QUrl url("https://api.remove.bg/v1.0/removebg"); 32 | QNetworkRequest request(url); 33 | request.setRawHeader("X-Api-Key", token[i].toUtf8()); 34 | request.setHeader(QNetworkRequest::KnownHeaders::ContentTypeHeader, QVariant("application/x-www-form-urlencoded")); 35 | 36 | reply = accessManager->post(request, ba); 37 | emit connectInfo("正在发送..."); 38 | 39 | QObject::connect(reply, &QNetworkReply::finished, this, &RemoveBGConn::solveReply); 40 | return true; 41 | } 42 | 43 | void RemoveBGConn::solveReply() 44 | { 45 | emit connectInfo("发送完成!正在接收..."); 46 | if(reply->error() == QNetworkReply::NoError) 47 | { 48 | emit connectInfo("接收完成!"); 49 | emit receivedData(reply->readAll(), filepath[i]); 50 | } 51 | else 52 | { 53 | emit connectError(reply->errorString()); 54 | } 55 | i++; 56 | if(i 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | class RemoveBGConn : public QObject 14 | { 15 | Q_OBJECT 16 | public: 17 | RemoveBGConn(); 18 | 19 | signals: 20 | void receivedData(QByteArray d, QString filePath); 21 | void connectError(QString e); 22 | void connectInfo(QString info); 23 | 24 | public slots: 25 | void postData(QString filepath, QString token, bool start); 26 | bool postDataReal(); 27 | void solveReply(); 28 | void clearData(); 29 | 30 | private: 31 | QNetworkAccessManager *accessManager = new QNetworkAccessManager(); 32 | QNetworkReply* reply; 33 | QFile *file; 34 | std::vector filepath; 35 | std::vector token; 36 | int i = 0; 37 | }; 38 | 39 | #endif // REMOVEBGCONN_H 40 | -------------------------------------------------------------------------------- /ScaleAndMix.cpp: -------------------------------------------------------------------------------- 1 | #include "ScaleAndMix.h" 2 | 3 | ScaleAndMix::ScaleAndMix(QObject *parent) : QObject(parent) 4 | { 5 | 6 | } 7 | 8 | void ScaleAndMix::toBigPic(QString originFile, QString targetFile) 9 | { 10 | Mat originImg = imread(originFile.toLocal8Bit().toStdString()); 11 | Mat mattedSmall = imread(targetFile.toLocal8Bit().toStdString(), IMREAD_UNCHANGED); 12 | Mat mattedBig; 13 | Mat background(originImg.size(), originImg.type(), Scalar(255, 255, 255)); 14 | Mat rgbaMatted[4], outputMat[4]; 15 | if(originImg.data != NULL && mattedSmall.data != NULL) 16 | { 17 | resize(mattedSmall, mattedBig, Size(originImg.cols, originImg.rows), 0, 0, INTER_LANCZOS4); 18 | split(mattedBig, rgbaMatted); 19 | split(originImg, outputMat); 20 | outputMat[3] = rgbaMatted[3]; 21 | merge(outputMat, 4, mattedBig); 22 | imwrite(targetFile.toLocal8Bit().toStdString(), mattedBig); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /ScaleAndMix.h: -------------------------------------------------------------------------------- 1 | #ifndef SCALEANDMIX_H 2 | #define SCALEANDMIX_H 3 | 4 | #include 5 | #include 6 | using namespace cv; 7 | 8 | class ScaleAndMix : public QObject 9 | { 10 | Q_OBJECT 11 | public: 12 | explicit ScaleAndMix(QObject *parent = nullptr); 13 | 14 | public slots: 15 | void toBigPic(QString originFile, QString targetFile); 16 | 17 | signals: 18 | 19 | }; 20 | 21 | #endif // SCALEANDMIX_H 22 | -------------------------------------------------------------------------------- /icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huanghaozi/AutoMatting/a0152b3ec52383100628e34c006925e60c78e76e/icon.ico -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | QApplication::setStyle("Fusion"); 9 | Widget w; 10 | w.show(); 11 | return a.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /opencv/include/opencv2/bioinspired/bioinspired.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/bioinspired.hpp" 49 | -------------------------------------------------------------------------------- /opencv/include/opencv2/calib3d/calib3d.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/calib3d.hpp" 49 | -------------------------------------------------------------------------------- /opencv/include/opencv2/core/bindings_utils.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_CORE_BINDINGS_UTILS_HPP 6 | #define OPENCV_CORE_BINDINGS_UTILS_HPP 7 | 8 | #include 9 | #include 10 | 11 | namespace cv { namespace utils { 12 | //! @addtogroup core_utils 13 | //! @{ 14 | 15 | CV_EXPORTS_W String dumpInputArray(InputArray argument); 16 | 17 | CV_EXPORTS_W String dumpInputArrayOfArrays(InputArrayOfArrays argument); 18 | 19 | CV_EXPORTS_W String dumpInputOutputArray(InputOutputArray argument); 20 | 21 | CV_EXPORTS_W String dumpInputOutputArrayOfArrays(InputOutputArrayOfArrays argument); 22 | 23 | CV_WRAP static inline 24 | String dumpBool(bool argument) 25 | { 26 | return (argument) ? String("Bool: True") : String("Bool: False"); 27 | } 28 | 29 | CV_WRAP static inline 30 | String dumpInt(int argument) 31 | { 32 | return cv::format("Int: %d", argument); 33 | } 34 | 35 | CV_WRAP static inline 36 | String dumpSizeT(size_t argument) 37 | { 38 | std::ostringstream oss("size_t: ", std::ios::ate); 39 | oss << argument; 40 | return oss.str(); 41 | } 42 | 43 | CV_WRAP static inline 44 | String dumpFloat(float argument) 45 | { 46 | return cv::format("Float: %.2f", argument); 47 | } 48 | 49 | CV_WRAP static inline 50 | String dumpDouble(double argument) 51 | { 52 | return cv::format("Double: %.2f", argument); 53 | } 54 | 55 | CV_WRAP static inline 56 | String dumpCString(const char* argument) 57 | { 58 | return cv::format("String: %s", argument); 59 | } 60 | 61 | CV_WRAP static inline 62 | AsyncArray testAsyncArray(InputArray argument) 63 | { 64 | AsyncPromise p; 65 | p.setValue(argument); 66 | return p.getArrayResult(); 67 | } 68 | 69 | CV_WRAP static inline 70 | AsyncArray testAsyncException() 71 | { 72 | AsyncPromise p; 73 | try 74 | { 75 | CV_Error(Error::StsOk, "Test: Generated async error"); 76 | } 77 | catch (const cv::Exception& e) 78 | { 79 | p.setException(e); 80 | } 81 | return p.getArrayResult(); 82 | } 83 | 84 | //! @} 85 | }} // namespace 86 | 87 | #endif // OPENCV_CORE_BINDINGS_UTILS_HPP 88 | -------------------------------------------------------------------------------- /opencv/include/opencv2/core/bufferpool.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2014, Advanced Micro Devices, Inc., all rights reserved. 6 | 7 | #ifndef OPENCV_CORE_BUFFER_POOL_HPP 8 | #define OPENCV_CORE_BUFFER_POOL_HPP 9 | 10 | #ifdef _MSC_VER 11 | #pragma warning(push) 12 | #pragma warning(disable: 4265) 13 | #endif 14 | 15 | namespace cv 16 | { 17 | 18 | //! @addtogroup core 19 | //! @{ 20 | 21 | class BufferPoolController 22 | { 23 | protected: 24 | ~BufferPoolController() { } 25 | public: 26 | virtual size_t getReservedSize() const = 0; 27 | virtual size_t getMaxReservedSize() const = 0; 28 | virtual void setMaxReservedSize(size_t size) = 0; 29 | virtual void freeAllReservedBuffers() = 0; 30 | }; 31 | 32 | //! @} 33 | 34 | } 35 | 36 | #ifdef _MSC_VER 37 | #pragma warning(pop) 38 | #endif 39 | 40 | #endif // OPENCV_CORE_BUFFER_POOL_HPP 41 | -------------------------------------------------------------------------------- /opencv/include/opencv2/core/core.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/core.hpp" 49 | -------------------------------------------------------------------------------- /opencv/include/opencv2/core/detail/async_promise.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_CORE_ASYNC_PROMISE_HPP 6 | #define OPENCV_CORE_ASYNC_PROMISE_HPP 7 | 8 | #include "../async.hpp" 9 | 10 | #include "exception_ptr.hpp" 11 | 12 | namespace cv { 13 | 14 | /** @addtogroup core_async 15 | @{ 16 | */ 17 | 18 | 19 | /** @brief Provides result of asynchronous operations 20 | 21 | */ 22 | class CV_EXPORTS AsyncPromise 23 | { 24 | public: 25 | ~AsyncPromise() CV_NOEXCEPT; 26 | AsyncPromise() CV_NOEXCEPT; 27 | explicit AsyncPromise(const AsyncPromise& o) CV_NOEXCEPT; 28 | AsyncPromise& operator=(const AsyncPromise& o) CV_NOEXCEPT; 29 | void release() CV_NOEXCEPT; 30 | 31 | /** Returns associated AsyncArray 32 | @note Can be called once 33 | */ 34 | AsyncArray getArrayResult(); 35 | 36 | /** Stores asynchronous result. 37 | @param[in] value result 38 | */ 39 | void setValue(InputArray value); 40 | 41 | // TODO "move" setters 42 | 43 | #if CV__EXCEPTION_PTR 44 | /** Stores exception. 45 | @param[in] exception exception to be raised in AsyncArray 46 | */ 47 | void setException(std::exception_ptr exception); 48 | #endif 49 | 50 | /** Stores exception. 51 | @param[in] exception exception to be raised in AsyncArray 52 | */ 53 | void setException(const cv::Exception& exception); 54 | 55 | #ifdef CV_CXX11 56 | explicit AsyncPromise(AsyncPromise&& o) { p = o.p; o.p = NULL; } 57 | AsyncPromise& operator=(AsyncPromise&& o) CV_NOEXCEPT { std::swap(p, o.p); return *this; } 58 | #endif 59 | 60 | 61 | // PImpl 62 | typedef struct AsyncArray::Impl Impl; friend struct AsyncArray::Impl; 63 | inline void* _getImpl() const CV_NOEXCEPT { return p; } 64 | protected: 65 | Impl* p; 66 | }; 67 | 68 | 69 | //! @} 70 | } // namespace 71 | #endif // OPENCV_CORE_ASYNC_PROMISE_HPP 72 | -------------------------------------------------------------------------------- /opencv/include/opencv2/core/detail/exception_ptr.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_CORE_DETAILS_EXCEPTION_PTR_H 6 | #define OPENCV_CORE_DETAILS_EXCEPTION_PTR_H 7 | 8 | #ifndef CV__EXCEPTION_PTR 9 | # if defined(__ANDROID__) && defined(ATOMIC_INT_LOCK_FREE) && ATOMIC_INT_LOCK_FREE < 2 10 | # define CV__EXCEPTION_PTR 0 // Not supported, details: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58938 11 | # elif defined(CV_CXX11) 12 | # define CV__EXCEPTION_PTR 1 13 | # elif defined(_MSC_VER) 14 | # define CV__EXCEPTION_PTR (_MSC_VER >= 1600) 15 | # elif defined(__clang__) 16 | # define CV__EXCEPTION_PTR 0 // C++11 only (see above) 17 | # elif defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__) 18 | # define CV__EXCEPTION_PTR (__GXX_EXPERIMENTAL_CXX0X__ > 0) 19 | # endif 20 | #endif 21 | #ifndef CV__EXCEPTION_PTR 22 | # define CV__EXCEPTION_PTR 0 23 | #elif CV__EXCEPTION_PTR 24 | # include // std::exception_ptr 25 | #endif 26 | 27 | #endif // OPENCV_CORE_DETAILS_EXCEPTION_PTR_H 28 | -------------------------------------------------------------------------------- /opencv/include/opencv2/core/ocl_genbase.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of the copyright holders may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the OpenCV Foundation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef OPENCV_OPENCL_GENBASE_HPP 43 | #define OPENCV_OPENCL_GENBASE_HPP 44 | 45 | //! @cond IGNORED 46 | 47 | namespace cv { 48 | namespace ocl { 49 | 50 | class ProgramSource; 51 | 52 | namespace internal { 53 | 54 | struct CV_EXPORTS ProgramEntry 55 | { 56 | const char* module; 57 | const char* name; 58 | const char* programCode; 59 | const char* programHash; 60 | ProgramSource* pProgramSource; 61 | 62 | operator ProgramSource& () const; 63 | }; 64 | 65 | } } } // namespace 66 | 67 | //! @endcond 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /opencv/include/opencv2/core/opencl/runtime/opencl_clamdblas.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of the copyright holders may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the OpenCV Foundation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef OPENCV_CORE_OCL_RUNTIME_CLAMDBLAS_HPP 43 | #define OPENCV_CORE_OCL_RUNTIME_CLAMDBLAS_HPP 44 | 45 | #ifdef HAVE_CLAMDBLAS 46 | 47 | #include "opencl_core.hpp" 48 | 49 | #include "autogenerated/opencl_clamdblas.hpp" 50 | 51 | #endif // HAVE_CLAMDBLAS 52 | 53 | #endif // OPENCV_CORE_OCL_RUNTIME_CLAMDBLAS_HPP 54 | -------------------------------------------------------------------------------- /opencv/include/opencv2/core/opencl/runtime/opencl_clamdfft.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of the copyright holders may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the OpenCV Foundation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef OPENCV_CORE_OCL_RUNTIME_CLAMDFFT_HPP 43 | #define OPENCV_CORE_OCL_RUNTIME_CLAMDFFT_HPP 44 | 45 | #ifdef HAVE_CLAMDFFT 46 | 47 | #include "opencl_core.hpp" 48 | 49 | #include "autogenerated/opencl_clamdfft.hpp" 50 | 51 | #endif // HAVE_CLAMDFFT 52 | 53 | #endif // OPENCV_CORE_OCL_RUNTIME_CLAMDFFT_HPP 54 | -------------------------------------------------------------------------------- /opencv/include/opencv2/core/opencl/runtime/opencl_core_wrappers.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of the copyright holders may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the OpenCV Foundation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef OPENCV_CORE_OCL_RUNTIME_OPENCL_WRAPPERS_HPP 43 | #define OPENCV_CORE_OCL_RUNTIME_OPENCL_WRAPPERS_HPP 44 | 45 | #include "autogenerated/opencl_core_wrappers.hpp" 46 | 47 | #endif // OPENCV_CORE_OCL_RUNTIME_OPENCL_WRAPPERS_HPP 48 | -------------------------------------------------------------------------------- /opencv/include/opencv2/core/opencl/runtime/opencl_gl.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of the copyright holders may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the OpenCV Foundation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_HPP 43 | #define OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_HPP 44 | 45 | #if defined HAVE_OPENCL && defined HAVE_OPENGL 46 | 47 | #include "opencl_core.hpp" 48 | 49 | #include "autogenerated/opencl_gl.hpp" 50 | 51 | #endif // defined HAVE_OPENCL && defined HAVE_OPENGL 52 | 53 | #endif // OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_HPP 54 | -------------------------------------------------------------------------------- /opencv/include/opencv2/core/opencl/runtime/opencl_gl_wrappers.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of the copyright holders may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the OpenCV Foundation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_WRAPPERS_HPP 43 | #define OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_WRAPPERS_HPP 44 | 45 | #include "autogenerated/opencl_gl_wrappers.hpp" 46 | 47 | #endif // OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_WRAPPERS_HPP 48 | -------------------------------------------------------------------------------- /opencv/include/opencv2/core/opencl/runtime/opencl_svm_definitions.hpp: -------------------------------------------------------------------------------- 1 | /* See LICENSE file in the root OpenCV directory */ 2 | 3 | #ifndef OPENCV_CORE_OCL_RUNTIME_OPENCL_SVM_DEFINITIONS_HPP 4 | #define OPENCV_CORE_OCL_RUNTIME_OPENCL_SVM_DEFINITIONS_HPP 5 | 6 | #if defined(HAVE_OPENCL_SVM) 7 | #if defined(CL_VERSION_2_0) 8 | 9 | // OpenCL 2.0 contains SVM definitions 10 | 11 | #else 12 | 13 | typedef cl_bitfield cl_device_svm_capabilities; 14 | typedef cl_bitfield cl_svm_mem_flags; 15 | typedef cl_uint cl_kernel_exec_info; 16 | 17 | // 18 | // TODO Add real values after OpenCL 2.0 release 19 | // 20 | 21 | #ifndef CL_DEVICE_SVM_CAPABILITIES 22 | #define CL_DEVICE_SVM_CAPABILITIES 0x1053 23 | 24 | #define CL_DEVICE_SVM_COARSE_GRAIN_BUFFER (1 << 0) 25 | #define CL_DEVICE_SVM_FINE_GRAIN_BUFFER (1 << 1) 26 | #define CL_DEVICE_SVM_FINE_GRAIN_SYSTEM (1 << 2) 27 | #define CL_DEVICE_SVM_ATOMICS (1 << 3) 28 | #endif 29 | 30 | #ifndef CL_MEM_SVM_FINE_GRAIN_BUFFER 31 | #define CL_MEM_SVM_FINE_GRAIN_BUFFER (1 << 10) 32 | #endif 33 | 34 | #ifndef CL_MEM_SVM_ATOMICS 35 | #define CL_MEM_SVM_ATOMICS (1 << 11) 36 | #endif 37 | 38 | 39 | #endif // CL_VERSION_2_0 40 | #endif // HAVE_OPENCL_SVM 41 | 42 | #endif // OPENCV_CORE_OCL_RUNTIME_OPENCL_SVM_DEFINITIONS_HPP 43 | -------------------------------------------------------------------------------- /opencv/include/opencv2/core/ovx.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | // Copyright (C) 2016, Intel Corporation, all rights reserved. 6 | // Third party copyrights are property of their respective owners. 7 | 8 | // OpenVX related definitions and declarations 9 | 10 | #pragma once 11 | #ifndef OPENCV_OVX_HPP 12 | #define OPENCV_OVX_HPP 13 | 14 | #include "cvdef.h" 15 | 16 | namespace cv 17 | { 18 | /// Check if use of OpenVX is possible 19 | CV_EXPORTS_W bool haveOpenVX(); 20 | 21 | /// Check if use of OpenVX is enabled 22 | CV_EXPORTS_W bool useOpenVX(); 23 | 24 | /// Enable/disable use of OpenVX 25 | CV_EXPORTS_W void setUseOpenVX(bool flag); 26 | } // namespace cv 27 | 28 | #endif // OPENCV_OVX_HPP 29 | -------------------------------------------------------------------------------- /opencv/include/opencv2/core/utils/allocator_stats.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_CORE_ALLOCATOR_STATS_HPP 6 | #define OPENCV_CORE_ALLOCATOR_STATS_HPP 7 | 8 | #include "../cvdef.h" 9 | 10 | namespace cv { namespace utils { 11 | 12 | class AllocatorStatisticsInterface 13 | { 14 | protected: 15 | AllocatorStatisticsInterface() {} 16 | virtual ~AllocatorStatisticsInterface() {} 17 | public: 18 | virtual uint64_t getCurrentUsage() const = 0; 19 | virtual uint64_t getTotalUsage() const = 0; 20 | virtual uint64_t getNumberOfAllocations() const = 0; 21 | virtual uint64_t getPeakUsage() const = 0; 22 | 23 | /** set peak usage = current usage */ 24 | virtual void resetPeakUsage() = 0; 25 | }; 26 | 27 | }} // namespace 28 | 29 | #endif // OPENCV_CORE_ALLOCATOR_STATS_HPP 30 | -------------------------------------------------------------------------------- /opencv/include/opencv2/core/utils/logger.defines.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_LOGGER_DEFINES_HPP 6 | #define OPENCV_LOGGER_DEFINES_HPP 7 | 8 | //! @addtogroup core_logging 9 | //! @{ 10 | 11 | // Supported logging levels and their semantic 12 | #define CV_LOG_LEVEL_SILENT 0 //!< for using in setLogLevel() call 13 | #define CV_LOG_LEVEL_FATAL 1 //!< Fatal (critical) error (unrecoverable internal error) 14 | #define CV_LOG_LEVEL_ERROR 2 //!< Error message 15 | #define CV_LOG_LEVEL_WARN 3 //!< Warning message 16 | #define CV_LOG_LEVEL_INFO 4 //!< Info message 17 | #define CV_LOG_LEVEL_DEBUG 5 //!< Debug message. Disabled in the "Release" build. 18 | #define CV_LOG_LEVEL_VERBOSE 6 //!< Verbose (trace) messages. Requires verbosity level. Disabled in the "Release" build. 19 | 20 | namespace cv { 21 | namespace utils { 22 | namespace logging { 23 | 24 | //! Supported logging levels and their semantic 25 | enum LogLevel { 26 | LOG_LEVEL_SILENT = 0, //!< for using in setLogVevel() call 27 | LOG_LEVEL_FATAL = 1, //!< Fatal (critical) error (unrecoverable internal error) 28 | LOG_LEVEL_ERROR = 2, //!< Error message 29 | LOG_LEVEL_WARNING = 3, //!< Warning message 30 | LOG_LEVEL_INFO = 4, //!< Info message 31 | LOG_LEVEL_DEBUG = 5, //!< Debug message. Disabled in the "Release" build. 32 | LOG_LEVEL_VERBOSE = 6, //!< Verbose (trace) messages. Requires verbosity level. Disabled in the "Release" build. 33 | #ifndef CV_DOXYGEN 34 | ENUM_LOG_LEVEL_FORCE_INT = INT_MAX 35 | #endif 36 | }; 37 | 38 | }}} // namespace 39 | 40 | //! @} 41 | 42 | #endif // OPENCV_LOGGER_DEFINES_HPP 43 | -------------------------------------------------------------------------------- /opencv/include/opencv2/core/utils/logtag.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_CORE_LOGTAG_HPP 6 | #define OPENCV_CORE_LOGTAG_HPP 7 | 8 | #include "opencv2/core/cvstd.hpp" 9 | #include "logger.defines.hpp" 10 | 11 | namespace cv { 12 | namespace utils { 13 | namespace logging { 14 | 15 | struct LogTag 16 | { 17 | const char* name; 18 | LogLevel level; 19 | 20 | inline LogTag(const char* _name, LogLevel _level) 21 | : name(_name) 22 | , level(_level) 23 | {} 24 | }; 25 | 26 | }}} 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /opencv/include/opencv2/core/version.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_VERSION_HPP 6 | #define OPENCV_VERSION_HPP 7 | 8 | #define CV_VERSION_MAJOR 4 9 | #define CV_VERSION_MINOR 4 10 | #define CV_VERSION_REVISION 0 11 | #define CV_VERSION_STATUS "" 12 | 13 | #define CVAUX_STR_EXP(__A) #__A 14 | #define CVAUX_STR(__A) CVAUX_STR_EXP(__A) 15 | 16 | #define CVAUX_STRW_EXP(__A) L ## #__A 17 | #define CVAUX_STRW(__A) CVAUX_STRW_EXP(__A) 18 | 19 | #define CV_VERSION CVAUX_STR(CV_VERSION_MAJOR) "." CVAUX_STR(CV_VERSION_MINOR) "." CVAUX_STR(CV_VERSION_REVISION) CV_VERSION_STATUS 20 | 21 | /* old style version constants*/ 22 | #define CV_MAJOR_VERSION CV_VERSION_MAJOR 23 | #define CV_MINOR_VERSION CV_VERSION_MINOR 24 | #define CV_SUBMINOR_VERSION CV_VERSION_REVISION 25 | 26 | #endif // OPENCV_VERSION_HPP 27 | -------------------------------------------------------------------------------- /opencv/include/opencv2/datasets/fr_lfw.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2014, Itseez Inc, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of the copyright holders may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the Itseez Inc or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef OPENCV_DATASETS_FR_LFW_HPP 43 | #define OPENCV_DATASETS_FR_LFW_HPP 44 | 45 | #include 46 | #include 47 | 48 | #include "opencv2/datasets/dataset.hpp" 49 | 50 | #include 51 | 52 | namespace cv 53 | { 54 | namespace datasets 55 | { 56 | 57 | //! @addtogroup datasets_fr 58 | //! @{ 59 | 60 | struct FR_lfwObj : public Object 61 | { 62 | std::string image1, image2; 63 | bool same; 64 | }; 65 | 66 | class CV_EXPORTS FR_lfw : public Dataset 67 | { 68 | public: 69 | virtual void load(const std::string &path) CV_OVERRIDE = 0; 70 | 71 | static Ptr create(); 72 | }; 73 | 74 | //! @} 75 | 76 | } 77 | } 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /opencv/include/opencv2/datasets/hpe_parse.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2014, Itseez Inc, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of the copyright holders may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the Itseez Inc or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef OPENCV_DATASETS_HPE_PARSE_HPP 43 | #define OPENCV_DATASETS_HPE_PARSE_HPP 44 | 45 | #include 46 | #include 47 | 48 | #include "opencv2/datasets/dataset.hpp" 49 | 50 | #include 51 | 52 | namespace cv 53 | { 54 | namespace datasets 55 | { 56 | 57 | //! @addtogroup datasets_hpe 58 | //! @{ 59 | 60 | struct HPE_parseObj : public Object 61 | { 62 | std::string name; 63 | }; 64 | 65 | class CV_EXPORTS HPE_parse : public Dataset 66 | { 67 | public: 68 | virtual void load(const std::string &path) CV_OVERRIDE = 0; 69 | 70 | static Ptr create(); 71 | }; 72 | 73 | //! @} 74 | 75 | } 76 | } 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /opencv/include/opencv2/datasets/is_bsds.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2014, Itseez Inc, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of the copyright holders may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the Itseez Inc or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef OPENCV_DATASETS_IS_BSDS_HPP 43 | #define OPENCV_DATASETS_IS_BSDS_HPP 44 | 45 | #include 46 | #include 47 | 48 | #include "opencv2/datasets/dataset.hpp" 49 | 50 | #include 51 | 52 | namespace cv 53 | { 54 | namespace datasets 55 | { 56 | 57 | //! @addtogroup datasets_is 58 | //! @{ 59 | 60 | struct IS_bsdsObj : public Object 61 | { 62 | std::string name; 63 | }; 64 | 65 | class CV_EXPORTS IS_bsds : public Dataset 66 | { 67 | public: 68 | virtual void load(const std::string &path) CV_OVERRIDE = 0; 69 | 70 | static Ptr create(); 71 | }; 72 | 73 | //! @} 74 | 75 | } 76 | } 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /opencv/include/opencv2/datasets/sr_bsds.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_DATASETS_SR_BSDS_HPP 6 | #define OPENCV_DATASETS_SR_BSDS_HPP 7 | 8 | #include 9 | #include 10 | 11 | #include "opencv2/datasets/dataset.hpp" 12 | 13 | #include 14 | 15 | namespace cv 16 | { 17 | namespace datasets 18 | { 19 | 20 | //! @addtogroup datasets_sr 21 | //! @{ 22 | 23 | struct SR_bsdsObj : public Object 24 | { 25 | std::string imageName; 26 | }; 27 | 28 | class CV_EXPORTS SR_bsds : public Dataset 29 | { 30 | public: 31 | virtual void load(const std::string &path) CV_OVERRIDE = 0; 32 | 33 | static Ptr create(); 34 | }; 35 | 36 | //! @} 37 | 38 | } 39 | } 40 | 41 | #endif -------------------------------------------------------------------------------- /opencv/include/opencv2/datasets/sr_div2k.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_DATASETS_SR_DIV2K_HPP 6 | #define OPENCV_DATASETS_SR_DIV2K_HPP 7 | 8 | #include 9 | #include 10 | 11 | #include "opencv2/datasets/dataset.hpp" 12 | 13 | #include 14 | 15 | namespace cv 16 | { 17 | namespace datasets 18 | { 19 | 20 | //! @addtogroup datasets_sr 21 | //! @{ 22 | 23 | struct SR_div2kObj : public Object 24 | { 25 | std::string imageName; 26 | }; 27 | 28 | class CV_EXPORTS SR_div2k : public Dataset 29 | { 30 | public: 31 | virtual void load(const std::string &path) CV_OVERRIDE = 0; 32 | 33 | static Ptr create(); 34 | }; 35 | 36 | //! @} 37 | 38 | } 39 | } 40 | 41 | #endif -------------------------------------------------------------------------------- /opencv/include/opencv2/datasets/sr_general100.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_DATASETS_SR_GENERAL100_HPP 6 | #define OPENCV_DATASETS_SR_GENERAL100_HPP 7 | 8 | #include 9 | #include 10 | 11 | #include "opencv2/datasets/dataset.hpp" 12 | 13 | #include 14 | 15 | namespace cv 16 | { 17 | namespace datasets 18 | { 19 | 20 | //! @addtogroup datasets_sr 21 | //! @{ 22 | 23 | struct SR_general100Obj : public Object 24 | { 25 | std::string imageName; 26 | }; 27 | 28 | class CV_EXPORTS SR_general100 : public Dataset 29 | { 30 | public: 31 | virtual void load(const std::string &path) CV_OVERRIDE = 0; 32 | 33 | static Ptr create(); 34 | }; 35 | 36 | //! @} 37 | 38 | } 39 | } 40 | 41 | #endif -------------------------------------------------------------------------------- /opencv/include/opencv2/datasets/tr_chars.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2014, Itseez Inc, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of the copyright holders may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the Itseez Inc or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef OPENCV_DATASETS_TR_CHARS_HPP 43 | #define OPENCV_DATASETS_TR_CHARS_HPP 44 | 45 | #include 46 | #include 47 | 48 | #include "opencv2/datasets/dataset.hpp" 49 | 50 | #include 51 | 52 | namespace cv 53 | { 54 | namespace datasets 55 | { 56 | 57 | //! @addtogroup datasets_tr 58 | //! @{ 59 | 60 | struct TR_charsObj : public Object 61 | { 62 | std::string imgName; 63 | int label; 64 | }; 65 | 66 | class CV_EXPORTS TR_chars : public Dataset 67 | { 68 | public: 69 | virtual void load(const std::string &path) CV_OVERRIDE = 0; 70 | 71 | static Ptr create(); 72 | }; 73 | 74 | //! @} 75 | 76 | } 77 | } 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /opencv/include/opencv2/datasets/util.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2014, Itseez Inc, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of the copyright holders may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the Itseez Inc or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef OPENCV_DATASETS_UTIL_HPP 43 | #define OPENCV_DATASETS_UTIL_HPP 44 | 45 | #include 46 | #include 47 | 48 | #include 49 | #include // atoi, atof 50 | 51 | #include 52 | 53 | #include 54 | 55 | namespace cv 56 | { 57 | namespace datasets 58 | { 59 | 60 | //! @addtogroup datasets 61 | //! @{ 62 | 63 | void CV_EXPORTS split(const std::string &s, std::vector &elems, char delim); 64 | 65 | void CV_EXPORTS createDirectory(const std::string &path); 66 | 67 | void CV_EXPORTS getDirList(const std::string &dirName, std::vector &fileNames); 68 | 69 | //! @} 70 | 71 | } 72 | } 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /opencv/include/opencv2/dnn/utils/inference_engine.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2018-2019, Intel Corporation, all rights reserved. 6 | // Third party copyrights are property of their respective owners. 7 | 8 | #ifndef OPENCV_DNN_UTILS_INF_ENGINE_HPP 9 | #define OPENCV_DNN_UTILS_INF_ENGINE_HPP 10 | 11 | #include "../dnn.hpp" 12 | 13 | namespace cv { namespace dnn { 14 | CV__DNN_INLINE_NS_BEGIN 15 | 16 | 17 | /* Values for 'OPENCV_DNN_BACKEND_INFERENCE_ENGINE_TYPE' parameter */ 18 | #define CV_DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_API "NN_BUILDER" 19 | #define CV_DNN_BACKEND_INFERENCE_ENGINE_NGRAPH "NGRAPH" 20 | 21 | /** @brief Returns Inference Engine internal backend API. 22 | * 23 | * See values of `CV_DNN_BACKEND_INFERENCE_ENGINE_*` macros. 24 | * 25 | * Default value is controlled through `OPENCV_DNN_BACKEND_INFERENCE_ENGINE_TYPE` runtime parameter (environment variable). 26 | */ 27 | CV_EXPORTS_W cv::String getInferenceEngineBackendType(); 28 | 29 | /** @brief Specify Inference Engine internal backend API. 30 | * 31 | * See values of `CV_DNN_BACKEND_INFERENCE_ENGINE_*` macros. 32 | * 33 | * @returns previous value of internal backend API 34 | */ 35 | CV_EXPORTS_W cv::String setInferenceEngineBackendType(const cv::String& newBackendType); 36 | 37 | 38 | /** @brief Release a Myriad device (binded by OpenCV). 39 | * 40 | * Single Myriad device cannot be shared across multiple processes which uses 41 | * Inference Engine's Myriad plugin. 42 | */ 43 | CV_EXPORTS_W void resetMyriadDevice(); 44 | 45 | 46 | /* Values for 'OPENCV_DNN_IE_VPU_TYPE' parameter */ 47 | #define CV_DNN_INFERENCE_ENGINE_VPU_TYPE_UNSPECIFIED "" 48 | /// Intel(R) Movidius(TM) Neural Compute Stick, NCS (USB 03e7:2150), Myriad2 (https://software.intel.com/en-us/movidius-ncs) 49 | #define CV_DNN_INFERENCE_ENGINE_VPU_TYPE_MYRIAD_2 "Myriad2" 50 | /// Intel(R) Neural Compute Stick 2, NCS2 (USB 03e7:2485), MyriadX (https://software.intel.com/ru-ru/neural-compute-stick) 51 | #define CV_DNN_INFERENCE_ENGINE_VPU_TYPE_MYRIAD_X "MyriadX" 52 | 53 | 54 | /** @brief Returns Inference Engine VPU type. 55 | * 56 | * See values of `CV_DNN_INFERENCE_ENGINE_VPU_TYPE_*` macros. 57 | */ 58 | CV_EXPORTS_W cv::String getInferenceEngineVPUType(); 59 | 60 | 61 | CV__DNN_INLINE_NS_END 62 | }} // namespace 63 | 64 | #endif // OPENCV_DNN_UTILS_INF_ENGINE_HPP 65 | -------------------------------------------------------------------------------- /opencv/include/opencv2/dnn/version.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_DNN_VERSION_HPP 6 | #define OPENCV_DNN_VERSION_HPP 7 | 8 | /// Use with major OpenCV version only. 9 | #define OPENCV_DNN_API_VERSION 20200609 10 | 11 | #if !defined CV_DOXYGEN && !defined CV_STATIC_ANALYSIS && !defined CV_DNN_DONT_ADD_INLINE_NS 12 | #define CV__DNN_INLINE_NS __CV_CAT(dnn4_v, OPENCV_DNN_API_VERSION) 13 | #define CV__DNN_INLINE_NS_BEGIN namespace CV__DNN_INLINE_NS { 14 | #define CV__DNN_INLINE_NS_END } 15 | namespace cv { namespace dnn { namespace CV__DNN_INLINE_NS { } using namespace CV__DNN_INLINE_NS; }} 16 | #else 17 | #define CV__DNN_INLINE_NS_BEGIN 18 | #define CV__DNN_INLINE_NS_END 19 | #endif 20 | 21 | #endif // OPENCV_DNN_VERSION_HPP 22 | -------------------------------------------------------------------------------- /opencv/include/opencv2/features2d/features2d.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/features2d.hpp" 49 | -------------------------------------------------------------------------------- /opencv/include/opencv2/features2d/hal/interface.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENCV_FEATURE2D_HAL_INTERFACE_H 2 | #define OPENCV_FEATURE2D_HAL_INTERFACE_H 3 | 4 | #include "opencv2/core/cvdef.h" 5 | //! @addtogroup features2d_hal_interface 6 | //! @{ 7 | 8 | //! @name Fast feature detector types 9 | //! @sa cv::FastFeatureDetector 10 | //! @{ 11 | #define CV_HAL_TYPE_5_8 0 12 | #define CV_HAL_TYPE_7_12 1 13 | #define CV_HAL_TYPE_9_16 2 14 | //! @} 15 | 16 | //! @name Key point 17 | //! @sa cv::KeyPoint 18 | //! @{ 19 | struct CV_EXPORTS cvhalKeyPoint 20 | { 21 | float x; 22 | float y; 23 | float size; 24 | float angle; 25 | float response; 26 | int octave; 27 | int class_id; 28 | }; 29 | //! @} 30 | 31 | //! @} 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /opencv/include/opencv2/flann/config.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #ifndef OPENCV_FLANN_CONFIG_H_ 31 | #define OPENCV_FLANN_CONFIG_H_ 32 | 33 | //! @cond IGNORED 34 | 35 | #ifdef FLANN_VERSION_ 36 | #undef FLANN_VERSION_ 37 | #endif 38 | #define FLANN_VERSION_ "1.6.10" 39 | 40 | //! @endcond 41 | 42 | #endif /* OPENCV_FLANN_CONFIG_H_ */ 43 | -------------------------------------------------------------------------------- /opencv/include/opencv2/flann/dummy.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef OPENCV_FLANN_DUMMY_H_ 3 | #define OPENCV_FLANN_DUMMY_H_ 4 | 5 | //! @cond IGNORED 6 | 7 | namespace cvflann 8 | { 9 | 10 | CV_DEPRECATED inline void dummyfunc() {} 11 | 12 | } 13 | 14 | //! @endcond 15 | 16 | #endif /* OPENCV_FLANN_DUMMY_H_ */ 17 | -------------------------------------------------------------------------------- /opencv/include/opencv2/flann/flann.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/flann.hpp" 49 | -------------------------------------------------------------------------------- /opencv/include/opencv2/flann/general.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_GENERAL_H_ 32 | #define OPENCV_FLANN_GENERAL_H_ 33 | 34 | //! @cond IGNORED 35 | 36 | #include "opencv2/core.hpp" 37 | 38 | namespace cvflann 39 | { 40 | 41 | class FLANNException : public cv::Exception 42 | { 43 | public: 44 | FLANNException(const char* message) : cv::Exception(0, message, "", __FILE__, __LINE__) { } 45 | 46 | FLANNException(const cv::String& message) : cv::Exception(0, message, "", __FILE__, __LINE__) { } 47 | }; 48 | 49 | } 50 | 51 | //! @endcond 52 | 53 | #endif /* OPENCV_FLANN_GENERAL_H_ */ 54 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2018 Intel Corporation 6 | 7 | 8 | #ifndef OPENCV_GAPI_HPP 9 | #define OPENCV_GAPI_HPP 10 | 11 | #include 12 | 13 | /** \defgroup gapi G-API framework 14 | @{ 15 | @defgroup gapi_main_classes G-API Main Classes 16 | @defgroup gapi_data_objects G-API Data Types 17 | @{ 18 | @defgroup gapi_meta_args G-API Metadata Descriptors 19 | @} 20 | @defgroup gapi_std_backends G-API Standard Backends 21 | @defgroup gapi_compile_args G-API Graph Compilation Arguments 22 | @} 23 | */ 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | #endif // OPENCV_GAPI_HPP 34 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/cpu/core.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2018 Intel Corporation 6 | 7 | 8 | #ifndef OPENCV_GAPI_CPU_CORE_API_HPP 9 | #define OPENCV_GAPI_CPU_CORE_API_HPP 10 | 11 | #include // GKernelPackage 12 | #include // GAPI_EXPORTS 13 | 14 | namespace cv { 15 | namespace gapi { 16 | namespace core { 17 | namespace cpu { 18 | 19 | GAPI_EXPORTS GKernelPackage kernels(); 20 | 21 | } // namespace cpu 22 | } // namespace core 23 | } // namespace gapi 24 | } // namespace cv 25 | 26 | 27 | #endif // OPENCV_GAPI_CPU_CORE_API_HPP 28 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/cpu/imgproc.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2018 Intel Corporation 6 | 7 | 8 | #ifndef OPENCV_GAPI_CPU_IMGPROC_API_HPP 9 | #define OPENCV_GAPI_CPU_IMGPROC_API_HPP 10 | 11 | #include // GAPI_EXPORTS 12 | #include // GKernelPackage 13 | 14 | namespace cv { 15 | namespace gapi { 16 | namespace imgproc { 17 | namespace cpu { 18 | 19 | GAPI_EXPORTS GKernelPackage kernels(); 20 | 21 | } // namespace cpu 22 | } // namespace imgproc 23 | } // namespace gapi 24 | } // namespace cv 25 | 26 | 27 | #endif // OPENCV_GAPI_CPU_IMGPROC_API_HPP 28 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/cpu/video.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2020 Intel Corporation 6 | 7 | #ifndef OPENCV_GAPI_CPU_VIDEO_API_HPP 8 | #define OPENCV_GAPI_CPU_VIDEO_API_HPP 9 | 10 | #include // GKernelPackage 11 | 12 | namespace cv { 13 | namespace gapi { 14 | namespace video { 15 | namespace cpu { 16 | 17 | GAPI_EXPORTS GKernelPackage kernels(); 18 | 19 | } // namespace cpu 20 | } // namespace video 21 | } // namespace gapi 22 | } // namespace cv 23 | 24 | 25 | #endif // OPENCV_GAPI_CPU_VIDEO_API_HPP 26 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/fluid/core.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2018 Intel Corporation 6 | 7 | 8 | #ifndef OPENCV_GAPI_FLUID_CORE_HPP 9 | #define OPENCV_GAPI_FLUID_CORE_HPP 10 | 11 | #include // GKernelPackage 12 | #include // GAPI_EXPORTS 13 | 14 | namespace cv { namespace gapi { namespace core { namespace fluid { 15 | 16 | GAPI_EXPORTS GKernelPackage kernels(); 17 | 18 | }}}} 19 | 20 | #endif // OPENCV_GAPI_FLUID_CORE_HPP 21 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/fluid/imgproc.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2018 Intel Corporation 6 | 7 | 8 | #ifndef OPENCV_GAPI_FLUID_IMGPROC_HPP 9 | #define OPENCV_GAPI_FLUID_IMGPROC_HPP 10 | 11 | #include // GKernelPackage 12 | #include // GAPI_EXPORTS 13 | 14 | namespace cv { namespace gapi { namespace imgproc { namespace fluid { 15 | 16 | GAPI_EXPORTS GKernelPackage kernels(); 17 | 18 | }}}} 19 | 20 | #endif // OPENCV_GAPI_FLUID_IMGPROC_HPP 21 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/gasync_context.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2019 Intel Corporation 6 | 7 | #ifndef OPENCV_GAPI_GASYNC_CONTEXT_HPP 8 | #define OPENCV_GAPI_GASYNC_CONTEXT_HPP 9 | 10 | #if !defined(GAPI_STANDALONE) 11 | # include 12 | #else // Without OpenCV 13 | # include 14 | #endif // !defined(GAPI_STANDALONE) 15 | 16 | #include 17 | 18 | namespace cv { 19 | namespace gapi{ 20 | namespace wip { 21 | 22 | /** 23 | * @brief A class to group async requests to cancel them in a single shot. 24 | * 25 | * GAsyncContext is passed as an argument to async() and async_apply() functions 26 | */ 27 | 28 | class GAPI_EXPORTS GAsyncContext{ 29 | std::atomic cancelation_requested = {false}; 30 | public: 31 | /** 32 | * @brief Start cancellation process for an associated request. 33 | * 34 | * User still has to wait for each individual request (either via callback or according std::future object) to make sure it actually canceled. 35 | * 36 | * @return true if it was a first request to cancel the context 37 | */ 38 | bool cancel(); 39 | 40 | /** 41 | * @brief Returns true if cancellation was requested for this context. 42 | * 43 | * @return true if cancellation was requested for this context 44 | */ 45 | bool isCanceled() const; 46 | }; 47 | 48 | class GAPI_EXPORTS GAsyncCanceled : public std::exception { 49 | public: 50 | virtual const char* what() const noexcept CV_OVERRIDE; 51 | }; 52 | } // namespace wip 53 | } // namespace gapi 54 | } // namespace cv 55 | 56 | #endif //OPENCV_GAPI_GASYNC_CONTEXT_HPP 57 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/gcall.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2018 Intel Corporation 6 | 7 | 8 | #ifndef OPENCV_GAPI_GCALL_HPP 9 | #define OPENCV_GAPI_GCALL_HPP 10 | 11 | #include // GArg 12 | #include // GMat 13 | #include // GScalar 14 | #include // GArray 15 | #include // GOpaque 16 | 17 | namespace cv { 18 | 19 | struct GKernel; 20 | 21 | // The whole idea of this class is to represent an operation 22 | // which is applied to arguments. This is part of public API, 23 | // since it is what users should use to define kernel interfaces. 24 | 25 | class GAPI_EXPORTS GCall final 26 | { 27 | public: 28 | class Priv; 29 | 30 | explicit GCall(const GKernel &k); 31 | ~GCall(); 32 | 33 | template 34 | GCall& pass(Ts&&... args) 35 | { 36 | setArgs({cv::GArg(std::move(args))...}); 37 | return *this; 38 | } 39 | 40 | // A generic yield method - obtain a link to operator's particular GMat output 41 | GMat yield (int output = 0); 42 | GMatP yieldP (int output = 0); 43 | GScalar yieldScalar(int output = 0); 44 | 45 | template GArray yieldArray(int output = 0) 46 | { 47 | return GArray(yieldArray(output)); 48 | } 49 | 50 | template GOpaque yieldOpaque(int output = 0) 51 | { 52 | return GOpaque(yieldOpaque(output)); 53 | } 54 | 55 | // Internal use only 56 | Priv& priv(); 57 | const Priv& priv() const; 58 | 59 | protected: 60 | std::shared_ptr m_priv; 61 | 62 | void setArgs(std::vector &&args); 63 | 64 | // Public versions return a typed array or opaque, those are implementation details 65 | detail::GArrayU yieldArray(int output = 0); 66 | detail::GOpaqueU yieldOpaque(int output = 0); 67 | }; 68 | 69 | } // namespace cv 70 | 71 | #endif // OPENCV_GAPI_GCALL_HPP 72 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/gpu/core.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2018 Intel Corporation 6 | 7 | 8 | #ifndef OPENCV_GAPI_GPU_CORE_API_HPP 9 | #define OPENCV_GAPI_GPU_CORE_API_HPP 10 | /** @file 11 | * @deprecated Use instead. 12 | */ 13 | 14 | #include 15 | 16 | namespace cv { 17 | namespace gapi { 18 | namespace core { 19 | namespace gpu { 20 | using namespace ocl; 21 | } // namespace gpu 22 | } // namespace core 23 | } // namespace gapi 24 | } // namespace cv 25 | 26 | 27 | #endif // OPENCV_GAPI_GPU_CORE_API_HPP 28 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/gpu/ggpukernel.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2018 Intel Corporation 6 | 7 | 8 | #ifndef OPENCV_GAPI_GGPUKERNEL_HPP 9 | #define OPENCV_GAPI_GGPUKERNEL_HPP 10 | /** @file 11 | * @deprecated Use instead. 12 | */ 13 | 14 | #include 15 | #define GAPI_GPU_KERNEL GAPI_OCL_KERNEL 16 | 17 | 18 | #endif // OPENCV_GAPI_GGPUKERNEL_HPP 19 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/gpu/imgproc.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2018 Intel Corporation 6 | 7 | 8 | #ifndef OPENCV_GAPI_GPU_IMGPROC_API_HPP 9 | #define OPENCV_GAPI_GPU_IMGPROC_API_HPP 10 | /** @file 11 | * @deprecated Use instead. 12 | */ 13 | 14 | #include 15 | 16 | 17 | namespace cv { 18 | namespace gapi { 19 | namespace imgproc { 20 | namespace gpu { 21 | using namespace ocl; 22 | } // namespace gpu 23 | } // namespace imgproc 24 | } // namespace gapi 25 | } // namespace cv 26 | 27 | 28 | #endif // OPENCV_GAPI_GPU_IMGPROC_API_HPP 29 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/gscalar.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | 3 | // It is subject to the license terms in the LICENSE file found in the top-level directory 4 | // of this distribution and at http://opencv.org/license.html. 5 | // 6 | // Copyright (C) 2018 Intel Corporation 7 | 8 | 9 | #ifndef OPENCV_GAPI_GSCALAR_HPP 10 | #define OPENCV_GAPI_GSCALAR_HPP 11 | 12 | #include 13 | 14 | #include 15 | #include // GShape 16 | #include 17 | 18 | namespace cv 19 | { 20 | // Forward declaration; GNode and GOrigin are an internal 21 | // (user-inaccessible) classes. 22 | class GNode; 23 | struct GOrigin; 24 | 25 | /** \addtogroup gapi_data_objects 26 | * @{ 27 | */ 28 | 29 | class GAPI_EXPORTS GScalar 30 | { 31 | public: 32 | GScalar(); // Empty constructor 33 | explicit GScalar(const cv::Scalar& s); // Constant value constructor from cv::Scalar 34 | explicit GScalar(cv::Scalar&& s); // Constant value move-constructor from cv::Scalar 35 | 36 | GScalar(double v0); // Constant value constructor from double 37 | GScalar(const GNode &n, std::size_t out); // Operation result constructor 38 | 39 | GOrigin& priv(); // Internal use only 40 | const GOrigin& priv() const; // Internal use only 41 | 42 | private: 43 | std::shared_ptr m_priv; 44 | }; 45 | 46 | /** @} */ 47 | 48 | /** 49 | * \addtogroup gapi_meta_args 50 | * @{ 51 | */ 52 | struct GScalarDesc 53 | { 54 | // NB.: right now it is empty 55 | 56 | inline bool operator== (const GScalarDesc &) const 57 | { 58 | return true; // NB: implement this method if GScalar meta appears 59 | } 60 | 61 | inline bool operator!= (const GScalarDesc &rhs) const 62 | { 63 | return !(*this == rhs); 64 | } 65 | }; 66 | 67 | static inline GScalarDesc empty_scalar_desc() { return GScalarDesc(); } 68 | 69 | GAPI_EXPORTS GScalarDesc descr_of(const cv::Scalar &scalar); 70 | 71 | std::ostream& operator<<(std::ostream& os, const cv::GScalarDesc &desc); 72 | 73 | } // namespace cv 74 | 75 | #endif // OPENCV_GAPI_GSCALAR_HPP 76 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/ocl/core.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2018 Intel Corporation 6 | 7 | 8 | #ifndef OPENCV_GAPI_OCL_CORE_API_HPP 9 | #define OPENCV_GAPI_OCL_CORE_API_HPP 10 | 11 | #include // GAPI_EXPORTS 12 | #include // GKernelPackage 13 | 14 | namespace cv { 15 | namespace gapi { 16 | namespace core { 17 | namespace ocl { 18 | 19 | GAPI_EXPORTS GKernelPackage kernels(); 20 | 21 | } // namespace ocl 22 | } // namespace core 23 | } // namespace gapi 24 | } // namespace cv 25 | 26 | 27 | #endif // OPENCV_GAPI_OCL_CORE_API_HPP 28 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/ocl/imgproc.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2018 Intel Corporation 6 | 7 | 8 | #ifndef OPENCV_GAPI_OCL_IMGPROC_API_HPP 9 | #define OPENCV_GAPI_OCL_IMGPROC_API_HPP 10 | 11 | #include // GAPI_EXPORTS 12 | #include // GKernelPackage 13 | 14 | namespace cv { 15 | namespace gapi { 16 | namespace imgproc { 17 | namespace ocl { 18 | 19 | GAPI_EXPORTS GKernelPackage kernels(); 20 | 21 | } // namespace ocl 22 | } // namespace imgproc 23 | } // namespace gapi 24 | } // namespace cv 25 | 26 | 27 | #endif // OPENCV_GAPI_OCL_IMGPROC_API_HPP 28 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/opencv_includes.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | 3 | // It is subject to the license terms in the LICENSE file found in the top-level directory 4 | // of this distribution and at http://opencv.org/license.html. 5 | // 6 | // Copyright (C) 2018 Intel Corporation 7 | 8 | 9 | #ifndef OPENCV_GAPI_OPENCV_INCLUDES_HPP 10 | #define OPENCV_GAPI_OPENCV_INCLUDES_HPP 11 | 12 | #if !defined(GAPI_STANDALONE) 13 | # include 14 | # include 15 | # include 16 | # include 17 | #else // Without OpenCV 18 | # include 19 | # include // cv::gapi::own::Rect/Size/Point 20 | # include // cv::gapi::own::Scalar 21 | # include 22 | // replacement of cv's structures: 23 | namespace cv { 24 | using Rect = gapi::own::Rect; 25 | using Size = gapi::own::Size; 26 | using Point = gapi::own::Point; 27 | using Scalar = gapi::own::Scalar; 28 | using Mat = gapi::own::Mat; 29 | } // namespace cv 30 | #endif // !defined(GAPI_STANDALONE) 31 | 32 | #endif // OPENCV_GAPI_OPENCV_INCLUDES_HPP 33 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/own/assert.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2018 Intel Corporation 6 | 7 | 8 | #ifndef OPENCV_GAPI_OWN_ASSERT_HPP 9 | #define OPENCV_GAPI_OWN_ASSERT_HPP 10 | 11 | #if !defined(GAPI_STANDALONE) 12 | #include 13 | #define GAPI_Assert CV_Assert 14 | #define GAPI_DbgAssert CV_DbgAssert 15 | 16 | #else 17 | #include 18 | #include 19 | #include 20 | 21 | namespace detail 22 | { 23 | [[noreturn]] inline void assert_abort(const char* str, int line, const char* file, const char* func) 24 | { 25 | std::stringstream ss; 26 | ss << file << ":" << line << ": Assertion " << str << " in function " << func << " failed\n"; 27 | cv::util::throw_error(std::logic_error(ss.str())); 28 | } 29 | } 30 | 31 | #define GAPI_Assert(expr) \ 32 | { if (!(expr)) ::detail::assert_abort(#expr, __LINE__, __FILE__, __func__); } 33 | 34 | 35 | #ifdef NDEBUG 36 | # define GAPI_DbgAssert(expr) 37 | #else 38 | # define GAPI_DbgAssert(expr) GAPI_Assert(expr) 39 | #endif 40 | 41 | #endif // GAPI_STANDALONE 42 | 43 | #endif // OPENCV_GAPI_OWN_ASSERT_HPP 44 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/own/convert.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2018 Intel Corporation 6 | 7 | 8 | #ifndef OPENCV_GAPI_OWN_CONVERT_HPP 9 | #define OPENCV_GAPI_OWN_CONVERT_HPP 10 | 11 | #if !defined(GAPI_STANDALONE) 12 | 13 | #include 14 | #include 15 | 16 | namespace cv 17 | { 18 | template 19 | std::vector to_own(const cv::MatSize &sz) { 20 | std::vector result(sz.dims()); 21 | for (int i = 0; i < sz.dims(); i++) { 22 | // Note: cv::MatSize is not iterable 23 | result[i] = static_cast(sz[i]); 24 | } 25 | return result; 26 | } 27 | 28 | cv::gapi::own::Mat to_own(Mat&&) = delete; 29 | 30 | inline cv::gapi::own::Mat to_own(Mat const& m) { 31 | return (m.dims == 2) 32 | ? cv::gapi::own::Mat{m.rows, m.cols, m.type(), m.data, m.step} 33 | : cv::gapi::own::Mat{to_own(m.size), m.type(), m.data}; 34 | }; 35 | 36 | namespace gapi 37 | { 38 | namespace own 39 | { 40 | 41 | inline cv::Mat to_ocv(Mat const& m) { 42 | return m.dims.empty() 43 | ? cv::Mat{m.rows, m.cols, m.type(), m.data, m.step} 44 | : cv::Mat{m.dims, m.type(), m.data}; 45 | } 46 | 47 | cv::Mat to_ocv(Mat&&) = delete; 48 | 49 | } // namespace own 50 | } // namespace gapi 51 | } // namespace cv 52 | 53 | #endif // !defined(GAPI_STANDALONE) 54 | 55 | #endif // OPENCV_GAPI_OWN_CONVERT_HPP 56 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/own/exports.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2018 Intel Corporation 6 | 7 | 8 | #ifndef OPENCV_GAPI_OWN_TYPES_HPP 9 | #define OPENCV_GAPI_OWN_TYPES_HPP 10 | 11 | # if defined(__OPENCV_BUILD) 12 | # include 13 | # define GAPI_EXPORTS CV_EXPORTS 14 | # else 15 | # define GAPI_EXPORTS 16 | 17 | #if 0 // Note: the following version currently is not needed for non-OpenCV build 18 | # if defined _WIN32 19 | # define GAPI_EXPORTS __declspec(dllexport) 20 | # elif defined __GNUC__ && __GNUC__ >= 4 21 | # define GAPI_EXPORTS __attribute__ ((visibility ("default"))) 22 | # endif 23 | 24 | # ifndef GAPI_EXPORTS 25 | # define GAPI_EXPORTS 26 | # endif 27 | #endif 28 | 29 | # endif 30 | 31 | #endif // OPENCV_GAPI_OWN_TYPES_HPP 32 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/own/scalar.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2018 Intel Corporation 6 | 7 | 8 | #ifndef OPENCV_GAPI_GAPI_OWN_SCALAR_HPP 9 | #define OPENCV_GAPI_GAPI_OWN_SCALAR_HPP 10 | 11 | #include 12 | 13 | namespace cv 14 | { 15 | namespace gapi 16 | { 17 | namespace own 18 | { 19 | 20 | class GAPI_EXPORTS Scalar 21 | { 22 | public: 23 | Scalar() = default; 24 | explicit Scalar(double v0) { val[0] = v0; }; 25 | Scalar(double v0, double v1, double v2 = 0, double v3 = 0) 26 | : val{v0, v1, v2, v3} 27 | { 28 | } 29 | 30 | const double& operator[](int i) const { return val[i]; } 31 | double& operator[](int i) { return val[i]; } 32 | 33 | static Scalar all(double v0) { return Scalar(v0, v0, v0, v0); } 34 | 35 | double val[4] = {0}; 36 | }; 37 | 38 | inline bool operator==(const Scalar& lhs, const Scalar& rhs) 39 | { 40 | return std::equal(std::begin(lhs.val), std::end(lhs.val), std::begin(rhs.val)); 41 | } 42 | 43 | } // namespace own 44 | } // namespace gapi 45 | } // namespace cv 46 | 47 | #endif // OPENCV_GAPI_GAPI_OWN_SCALAR_HPP 48 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/plaidml/core.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2019 Intel Corporation 6 | 7 | 8 | #ifndef OPENCV_GAPI_PLAIDML_CORE_HPP 9 | #define OPENCV_GAPI_PLAIDML_CORE_HPP 10 | 11 | #include // GKernelPackage 12 | #include // GAPI_EXPORTS 13 | 14 | namespace cv { namespace gapi { namespace core { namespace plaidml { 15 | 16 | GAPI_EXPORTS GKernelPackage kernels(); 17 | 18 | }}}} 19 | 20 | #endif // OPENCV_GAPI_PLAIDML_CORE_HPP 21 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/plaidml/plaidml.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2019 Intel Corporation 6 | 7 | 8 | #ifndef OPENCV_GAPI_PLAIDML_PLAIDML_HPP 9 | #define OPENCV_GAPI_PLAIDML_PLAIDML_HPP 10 | 11 | #include 12 | #include // CompileArgTag 13 | 14 | namespace cv 15 | { 16 | namespace gapi 17 | { 18 | namespace plaidml 19 | { 20 | 21 | /** \addtogroup gapi_compile_args 22 | * @{ 23 | */ 24 | /** 25 | * @brief This structure represents the basic parameters for the experimental 26 | * PlaidML backend. 27 | */ 28 | struct config 29 | { 30 | std::string dev_id; //!< Device ID. Refer to PlaidML documentation for details. 31 | std::string trg_id; //!< Target ID. Refer to PlaidML documentation for details. 32 | }; 33 | /** @} gapi_compile_args */ 34 | 35 | } // namespace plaidml 36 | } // namespace gapi 37 | 38 | namespace detail 39 | { 40 | template<> struct CompileArgTag 41 | { 42 | static const char* tag() { return "gapi.plaidml.config"; } 43 | }; 44 | } // namespace detail 45 | 46 | } // namespace cv 47 | 48 | #endif // OPENCV_GAPI_PLAIDML_PLAIDML_HPP 49 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/render.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2019 Intel Corporation 6 | 7 | #ifndef OPENCV_GAPI_RENDER_ROOT_HPP 8 | #define OPENCV_GAPI_RENDER_ROOT_HPP 9 | 10 | // This file is just a shortcut to render/render.hpp 11 | 12 | #include 13 | 14 | #endif // OPENCV_GAPI_RENDER_ROOT_HPP 15 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/s11n.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2020 Intel Corporation 6 | 7 | #ifndef OPENCV_GAPI_S11N_HPP 8 | #define OPENCV_GAPI_S11N_HPP 9 | 10 | #include 11 | #include 12 | 13 | namespace cv { 14 | namespace gapi { 15 | 16 | namespace detail { 17 | GAPI_EXPORTS cv::GComputation getGraph(const std::vector &p); 18 | } // namespace detail 19 | 20 | namespace detail { 21 | GAPI_EXPORTS cv::GMetaArgs getMetaArgs(const std::vector &p); 22 | } // namespace detail 23 | 24 | namespace detail { 25 | GAPI_EXPORTS cv::GRunArgs getRunArgs(const std::vector &p); 26 | } // namespace detail 27 | 28 | GAPI_EXPORTS std::vector serialize(const cv::GComputation &c); 29 | //namespace{ 30 | 31 | template static inline 32 | T deserialize(const std::vector &p); 33 | 34 | //} //ananymous namespace 35 | 36 | GAPI_EXPORTS std::vector serialize(const cv::GMetaArgs&); 37 | GAPI_EXPORTS std::vector serialize(const cv::GRunArgs&); 38 | 39 | template<> inline 40 | cv::GComputation deserialize(const std::vector &p) { 41 | return detail::getGraph(p); 42 | } 43 | 44 | template<> inline 45 | cv::GMetaArgs deserialize(const std::vector &p) { 46 | return detail::getMetaArgs(p); 47 | } 48 | 49 | template<> inline 50 | cv::GRunArgs deserialize(const std::vector &p) { 51 | return detail::getRunArgs(p); 52 | } 53 | 54 | 55 | } // namespace gapi 56 | } // namespace cv 57 | 58 | #endif // OPENCV_GAPI_S11N_HPP 59 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/streaming/source.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2019 Intel Corporation 6 | 7 | #ifndef OPENCV_GAPI_STREAMING_SOURCE_HPP 8 | #define OPENCV_GAPI_STREAMING_SOURCE_HPP 9 | 10 | #include // shared_ptr 11 | #include // is_base_of 12 | 13 | #include // GMetaArg 14 | 15 | 16 | namespace cv { 17 | namespace gapi { 18 | namespace wip { 19 | struct Data; // "forward-declaration" of GRunArg 20 | 21 | /** 22 | * @brief Abstract streaming pipeline source. 23 | * 24 | * Implement this interface if you want customize the way how data is 25 | * streaming into GStreamingCompiled. 26 | * 27 | * Objects implementing this interface can be passed to 28 | * GStreamingCompiled using setSource() with cv::gin(). Regular 29 | * compiled graphs (GCompiled) don't support input objects of this 30 | * type. 31 | * 32 | * Default cv::VideoCapture-based implementation is available, see 33 | * cv::gapi::wip::GCaptureSource. 34 | * 35 | * @note stream sources are passed to G-API via shared pointers, so 36 | * please use ptr() when passing a IStreamSource implementation to 37 | * cv::gin(). 38 | */ 39 | class IStreamSource: public std::enable_shared_from_this 40 | { 41 | public: 42 | using Ptr = std::shared_ptr; 43 | Ptr ptr() { return shared_from_this(); } 44 | virtual bool pull(Data &data) = 0; 45 | virtual GMetaArg descr_of() const = 0; 46 | virtual ~IStreamSource() = default; 47 | }; 48 | 49 | template 50 | IStreamSource::Ptr inline make_src(Args&&... args) 51 | { 52 | static_assert(std::is_base_of::value, 53 | "T must implement the cv::gapi::IStreamSource interface!"); 54 | auto src_ptr = std::make_shared(std::forward(args)...); 55 | return src_ptr->ptr(); 56 | } 57 | 58 | } // namespace wip 59 | } // namespace gapi 60 | } // namespace cv 61 | 62 | #endif // OPENCV_GAPI_STREAMING_SOURCE_HPP 63 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/util/compiler_hints.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2018 Intel Corporation 6 | 7 | #ifndef OPENCV_GAPI_UTIL_COMPILER_HINTS_HPP 8 | #define OPENCV_GAPI_UTIL_COMPILER_HINTS_HPP 9 | 10 | namespace cv 11 | { 12 | namespace util 13 | { 14 | //! Utility template function to prevent "unused" warnings by various compilers. 15 | template void suppress_unused_warning( const T& ) {} 16 | } // namespace util 17 | } // namespace cv 18 | 19 | #endif /* OPENCV_GAPI_UTIL_COMPILER_HINTS_HPP */ 20 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/util/throw.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2018 Intel Corporation 6 | 7 | 8 | #ifndef OPENCV_GAPI_UTIL_THROW_HPP 9 | #define OPENCV_GAPI_UTIL_THROW_HPP 10 | 11 | #include // std::forward 12 | 13 | #if !defined(__EXCEPTIONS) 14 | #include 15 | #include 16 | #endif 17 | 18 | namespace cv 19 | { 20 | namespace util 21 | { 22 | template 23 | [[noreturn]] void throw_error(ExceptionType &&e) 24 | { 25 | #if defined(__EXCEPTIONS) || defined(_CPPUNWIND) 26 | throw std::forward(e); 27 | #else 28 | fprintf(stderr, "An exception thrown! %s\n" , e.what()); 29 | fflush(stderr); 30 | abort(); 31 | #endif 32 | } 33 | } // namespace util 34 | } // namespace cv 35 | 36 | #endif // OPENCV_GAPI_UTIL_THROW_HPP 37 | -------------------------------------------------------------------------------- /opencv/include/opencv2/gapi/util/type_traits.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2020 Intel Corporation 6 | 7 | 8 | #ifndef OPENCV_GAPI_UTIL_TYPE_TRAITS_HPP 9 | #define OPENCV_GAPI_UTIL_TYPE_TRAITS_HPP 10 | 11 | #include 12 | 13 | namespace cv 14 | { 15 | namespace util 16 | { 17 | //these are C++14 parts of type_traits : 18 | template< bool B, class T = void > 19 | using enable_if_t = typename std::enable_if::type; 20 | 21 | template 22 | using decay_t = typename std::decay::type; 23 | 24 | //this is not part of C++14 but still, of pretty common usage 25 | template 26 | using are_different_t = enable_if_t< !std::is_same, decay_t>::value, V>; 27 | 28 | } // namespace cv 29 | } // namespace util 30 | 31 | #endif // OPENCV_GAPI_UTIL_TYPE_TRAITS_HPP 32 | -------------------------------------------------------------------------------- /opencv/include/opencv2/highgui/highgui.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/highgui.hpp" 49 | -------------------------------------------------------------------------------- /opencv/include/opencv2/img_hash/average_hash.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_AVERAGE_HASH_HPP 6 | #define OPENCV_AVERAGE_HASH_HPP 7 | 8 | #include "img_hash_base.hpp" 9 | 10 | namespace cv { 11 | namespace img_hash { 12 | 13 | //! @addtogroup img_hash 14 | //! @{ 15 | 16 | /** @brief Computes average hash value of the input image 17 | 18 | This is a fast image hashing algorithm, but only work on simple case. For more details, please 19 | refer to @cite lookslikeit 20 | */ 21 | class CV_EXPORTS_W AverageHash : public ImgHashBase 22 | { 23 | public: 24 | CV_WRAP static Ptr create(); 25 | protected: 26 | AverageHash() {} 27 | }; 28 | 29 | /** @brief Calculates img_hash::AverageHash in one call 30 | @param inputArr input image want to compute hash value, type should be CV_8UC4, CV_8UC3 or CV_8UC1. 31 | @param outputArr Hash value of input, it will contain 16 hex decimal number, return type is CV_8U 32 | */ 33 | CV_EXPORTS_W void averageHash(cv::InputArray inputArr, cv::OutputArray outputArr); 34 | 35 | //! @} 36 | 37 | }} // cv::img_hash:: 38 | 39 | #endif // OPENCV_AVERAGE_HASH_HPP 40 | -------------------------------------------------------------------------------- /opencv/include/opencv2/img_hash/block_mean_hash.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_BLOCK_MEAN_HASH_HPP 6 | #define OPENCV_BLOCK_MEAN_HASH_HPP 7 | 8 | #include "img_hash_base.hpp" 9 | 10 | namespace cv { 11 | namespace img_hash { 12 | 13 | //! @addtogroup img_hash 14 | //! @{ 15 | 16 | enum BlockMeanHashMode 17 | { 18 | BLOCK_MEAN_HASH_MODE_0 = 0, //!< use fewer block and generate 16*16/8 uchar hash value 19 | BLOCK_MEAN_HASH_MODE_1 = 1, //!< use block blocks(step sizes/2), generate 31*31/8 + 1 uchar hash value 20 | }; 21 | 22 | /** @brief Image hash based on block mean. 23 | 24 | See @cite zauner2010implementation for details. 25 | */ 26 | class CV_EXPORTS_W BlockMeanHash : public ImgHashBase 27 | { 28 | public: 29 | /** @brief Create BlockMeanHash object 30 | @param mode the mode 31 | */ 32 | CV_WRAP void setMode(int mode); 33 | CV_WRAP std::vector getMean() const; 34 | CV_WRAP static Ptr create(int mode = BLOCK_MEAN_HASH_MODE_0); 35 | protected: 36 | BlockMeanHash() {} 37 | }; 38 | 39 | /** @brief Computes block mean hash of the input image 40 | @param inputArr input image want to compute hash value, type should be CV_8UC4, CV_8UC3 or CV_8UC1. 41 | @param outputArr Hash value of input, it will contain 16 hex decimal number, return type is CV_8U 42 | @param mode the mode 43 | */ 44 | CV_EXPORTS_W void blockMeanHash(cv::InputArray inputArr, 45 | cv::OutputArray outputArr, 46 | int mode = BLOCK_MEAN_HASH_MODE_0); 47 | 48 | //! @} 49 | 50 | }} // cv::img_hash:: 51 | 52 | #endif // OPENCV_BLOCK_MEAN_HASH_HPP 53 | -------------------------------------------------------------------------------- /opencv/include/opencv2/img_hash/color_moment_hash.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_COLOR_MOMENT_HASH_HPP 6 | #define OPENCV_COLOR_MOMENT_HASH_HPP 7 | 8 | #include "img_hash_base.hpp" 9 | 10 | namespace cv { 11 | namespace img_hash { 12 | 13 | //! @addtogroup img_hash 14 | //! @{ 15 | 16 | /** @brief Image hash based on color moments. 17 | 18 | See @cite tang2012perceptual for details. 19 | */ 20 | class CV_EXPORTS_W ColorMomentHash : public ImgHashBase 21 | { 22 | public: 23 | CV_WRAP static Ptr create(); 24 | protected: 25 | ColorMomentHash() {} 26 | }; 27 | 28 | /** @brief Computes color moment hash of the input, the algorithm 29 | is come from the paper "Perceptual Hashing for Color Images 30 | Using Invariant Moments" 31 | @param inputArr input image want to compute hash value, 32 | type should be CV_8UC4, CV_8UC3 or CV_8UC1. 33 | @param outputArr 42 hash values with type CV_64F(double) 34 | */ 35 | CV_EXPORTS_W void colorMomentHash(cv::InputArray inputArr, cv::OutputArray outputArr); 36 | 37 | //! @} 38 | 39 | }} // cv::img_hash:: 40 | 41 | #endif // OPENCV_COLOR_MOMENT_HASH_HPP 42 | -------------------------------------------------------------------------------- /opencv/include/opencv2/img_hash/img_hash_base.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_IMG_HASH_BASE_HPP 6 | #define OPENCV_IMG_HASH_BASE_HPP 7 | 8 | #include "opencv2/core.hpp" 9 | 10 | namespace cv { 11 | namespace img_hash { 12 | 13 | //! @addtogroup img_hash 14 | //! @{ 15 | 16 | /** @brief The base class for image hash algorithms 17 | */ 18 | class CV_EXPORTS_W ImgHashBase : public Algorithm 19 | { 20 | public: 21 | class ImgHashImpl; 22 | 23 | ~ImgHashBase(); 24 | /** @brief Computes hash of the input image 25 | @param inputArr input image want to compute hash value 26 | @param outputArr hash of the image 27 | */ 28 | CV_WRAP void compute(cv::InputArray inputArr, cv::OutputArray outputArr); 29 | /** @brief Compare the hash value between inOne and inTwo 30 | @param hashOne Hash value one 31 | @param hashTwo Hash value two 32 | @return value indicate similarity between inOne and inTwo, the meaning 33 | of the value vary from algorithms to algorithms 34 | */ 35 | CV_WRAP double compare(cv::InputArray hashOne, cv::InputArray hashTwo) const; 36 | protected: 37 | ImgHashBase(); 38 | protected: 39 | Ptr pImpl; 40 | }; 41 | 42 | //! @} 43 | 44 | } } // cv::img_hash:: 45 | 46 | #endif // OPENCV_IMG_HASH_BASE_HPP 47 | -------------------------------------------------------------------------------- /opencv/include/opencv2/img_hash/marr_hildreth_hash.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_MARR_HILDRETH_HASH_HPP 6 | #define OPENCV_MARR_HILDRETH_HASH_HPP 7 | 8 | #include "img_hash_base.hpp" 9 | 10 | namespace cv { 11 | namespace img_hash { 12 | 13 | //! @addtogroup img_hash 14 | //! @{ 15 | 16 | /** @brief Marr-Hildreth Operator Based Hash, slowest but more discriminative. 17 | 18 | See @cite zauner2010implementation for details. 19 | */ 20 | class CV_EXPORTS_W MarrHildrethHash : public ImgHashBase 21 | { 22 | public: 23 | /** 24 | * @brief self explain 25 | */ 26 | CV_WRAP float getAlpha() const; 27 | 28 | /** 29 | * @brief self explain 30 | */ 31 | CV_WRAP float getScale() const; 32 | 33 | /** @brief Set Mh kernel parameters 34 | @param alpha int scale factor for marr wavelet (default=2). 35 | @param scale int level of scale factor (default = 1) 36 | */ 37 | CV_WRAP void setKernelParam(float alpha, float scale); 38 | 39 | /** 40 | @param alpha int scale factor for marr wavelet (default=2). 41 | @param scale int level of scale factor (default = 1) 42 | */ 43 | CV_WRAP static Ptr create(float alpha = 2.0f, float scale = 1.0f); 44 | protected: 45 | MarrHildrethHash() {} 46 | }; 47 | 48 | /** @brief Computes average hash value of the input image 49 | @param inputArr input image want to compute hash value, 50 | type should be CV_8UC4, CV_8UC3, CV_8UC1. 51 | @param outputArr Hash value of input, it will contain 16 hex 52 | decimal number, return type is CV_8U 53 | @param alpha int scale factor for marr wavelet (default=2). 54 | @param scale int level of scale factor (default = 1) 55 | */ 56 | CV_EXPORTS_W void marrHildrethHash(cv::InputArray inputArr, 57 | cv::OutputArray outputArr, 58 | float alpha = 2.0f, float scale = 1.0f); 59 | 60 | //! @} 61 | 62 | }} // cv::img_hash:: 63 | 64 | #endif // OPENCV_MARR_HILDRETH_HASH_HPP 65 | -------------------------------------------------------------------------------- /opencv/include/opencv2/img_hash/phash.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_PHASH_HPP 6 | #define OPENCV_PHASH_HPP 7 | 8 | #include "img_hash_base.hpp" 9 | 10 | namespace cv { 11 | namespace img_hash { 12 | 13 | //! @addtogroup img_hash 14 | //! @{ 15 | 16 | /** @brief pHash 17 | 18 | Slower than average_hash, but tolerant of minor modifications 19 | 20 | This algorithm can combat more variation than averageHash, for more details please refer to @cite lookslikeit 21 | */ 22 | class CV_EXPORTS_W PHash : public ImgHashBase 23 | { 24 | public: 25 | CV_WRAP static Ptr create(); 26 | protected: 27 | PHash() {} 28 | }; 29 | 30 | /** @brief Computes pHash value of the input image 31 | @param inputArr input image want to compute hash value, 32 | type should be CV_8UC4, CV_8UC3, CV_8UC1. 33 | @param outputArr Hash value of input, it will contain 8 uchar value 34 | */ 35 | CV_EXPORTS_W void pHash(cv::InputArray inputArr, cv::OutputArray outputArr); 36 | 37 | //! @} 38 | 39 | } } // cv::img_hash:: 40 | 41 | #endif // OPENCV_PHASH_HPP 42 | -------------------------------------------------------------------------------- /opencv/include/opencv2/img_hash/radial_variance_hash.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_RADIAL_VARIANCE_HASH_HPP 6 | #define OPENCV_RADIAL_VARIANCE_HASH_HPP 7 | 8 | #include "img_hash_base.hpp" 9 | 10 | namespace cv { 11 | namespace img_hash { 12 | 13 | //! @addtogroup img_hash 14 | //! @{ 15 | 16 | 17 | /** @brief Image hash based on Radon transform. 18 | 19 | See @cite tang2012perceptual for details. 20 | */ 21 | class CV_EXPORTS_W RadialVarianceHash : public ImgHashBase 22 | { 23 | public: 24 | CV_WRAP static Ptr create(double sigma = 1, int numOfAngleLine = 180); 25 | 26 | CV_WRAP int getNumOfAngleLine() const; 27 | CV_WRAP double getSigma() const; 28 | 29 | CV_WRAP void setNumOfAngleLine(int value); 30 | CV_WRAP void setSigma(double value); 31 | 32 | // internals 33 | std::vector getFeatures(); 34 | cv::Mat getHash(); 35 | Mat getPixPerLine(Mat const &input); 36 | Mat getProjection(); 37 | protected: 38 | RadialVarianceHash() {} 39 | }; 40 | 41 | /** @brief Computes radial variance hash of the input image 42 | @param inputArr input image want to compute hash value, 43 | type should be CV_8UC4, CV_8UC3, CV_8UC1. 44 | @param outputArr Hash value of input 45 | @param sigma Gaussian kernel standard deviation 46 | @param numOfAngleLine The number of angles to consider 47 | */ 48 | CV_EXPORTS_W void radialVarianceHash(cv::InputArray inputArr, 49 | cv::OutputArray outputArr, 50 | double sigma = 1, 51 | int numOfAngleLine = 180); 52 | 53 | 54 | //! @} 55 | 56 | }} // cv::img_hash:: 57 | 58 | #endif // OPENCV_RADIAL_VARIANCE_HASH_HPP 59 | -------------------------------------------------------------------------------- /opencv/include/opencv2/imgcodecs/imgcodecs.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/imgcodecs.hpp" 49 | -------------------------------------------------------------------------------- /opencv/include/opencv2/imgcodecs/imgcodecs_c.h: -------------------------------------------------------------------------------- 1 | #error "This header with legacy C API declarations has been removed from OpenCV. Legacy constants are available from legacy/constants_c.h file." 2 | -------------------------------------------------------------------------------- /opencv/include/opencv2/imgcodecs/ios.h: -------------------------------------------------------------------------------- 1 | 2 | /*M/////////////////////////////////////////////////////////////////////////////////////// 3 | // 4 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 5 | // 6 | // By downloading, copying, installing or using the software you agree to this license. 7 | // If you do not agree to this license, do not download, install, 8 | // copy or use the software. 9 | // 10 | // 11 | // License Agreement 12 | // For Open Source Computer Vision Library 13 | // 14 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 15 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #import 45 | #import 46 | #import 47 | #import 48 | #include "opencv2/core.hpp" 49 | 50 | //! @addtogroup imgcodecs_ios 51 | //! @{ 52 | 53 | CV_EXPORTS UIImage* MatToUIImage(const cv::Mat& image); 54 | CV_EXPORTS void UIImageToMat(const UIImage* image, 55 | cv::Mat& m, bool alphaExist = false); 56 | 57 | //! @} 58 | -------------------------------------------------------------------------------- /opencv/include/opencv2/imgcodecs/legacy/constants_c.h: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_IMGCODECS_LEGACY_CONSTANTS_H 6 | #define OPENCV_IMGCODECS_LEGACY_CONSTANTS_H 7 | 8 | /* duplicate of "ImreadModes" enumeration for better compatibility with OpenCV 3.x */ 9 | enum 10 | { 11 | /* 8bit, color or not */ 12 | CV_LOAD_IMAGE_UNCHANGED =-1, 13 | /* 8bit, gray */ 14 | CV_LOAD_IMAGE_GRAYSCALE =0, 15 | /* ?, color */ 16 | CV_LOAD_IMAGE_COLOR =1, 17 | /* any depth, ? */ 18 | CV_LOAD_IMAGE_ANYDEPTH =2, 19 | /* ?, any color */ 20 | CV_LOAD_IMAGE_ANYCOLOR =4, 21 | /* ?, no rotate */ 22 | CV_LOAD_IMAGE_IGNORE_ORIENTATION =128 23 | }; 24 | 25 | /* duplicate of "ImwriteFlags" enumeration for better compatibility with OpenCV 3.x */ 26 | enum 27 | { 28 | CV_IMWRITE_JPEG_QUALITY =1, 29 | CV_IMWRITE_JPEG_PROGRESSIVE =2, 30 | CV_IMWRITE_JPEG_OPTIMIZE =3, 31 | CV_IMWRITE_JPEG_RST_INTERVAL =4, 32 | CV_IMWRITE_JPEG_LUMA_QUALITY =5, 33 | CV_IMWRITE_JPEG_CHROMA_QUALITY =6, 34 | CV_IMWRITE_PNG_COMPRESSION =16, 35 | CV_IMWRITE_PNG_STRATEGY =17, 36 | CV_IMWRITE_PNG_BILEVEL =18, 37 | CV_IMWRITE_PNG_STRATEGY_DEFAULT =0, 38 | CV_IMWRITE_PNG_STRATEGY_FILTERED =1, 39 | CV_IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY =2, 40 | CV_IMWRITE_PNG_STRATEGY_RLE =3, 41 | CV_IMWRITE_PNG_STRATEGY_FIXED =4, 42 | CV_IMWRITE_PXM_BINARY =32, 43 | CV_IMWRITE_EXR_TYPE = 48, 44 | CV_IMWRITE_WEBP_QUALITY =64, 45 | CV_IMWRITE_PAM_TUPLETYPE = 128, 46 | CV_IMWRITE_PAM_FORMAT_NULL = 0, 47 | CV_IMWRITE_PAM_FORMAT_BLACKANDWHITE = 1, 48 | CV_IMWRITE_PAM_FORMAT_GRAYSCALE = 2, 49 | CV_IMWRITE_PAM_FORMAT_GRAYSCALE_ALPHA = 3, 50 | CV_IMWRITE_PAM_FORMAT_RGB = 4, 51 | CV_IMWRITE_PAM_FORMAT_RGB_ALPHA = 5, 52 | }; 53 | 54 | #endif // OPENCV_IMGCODECS_LEGACY_CONSTANTS_H 55 | -------------------------------------------------------------------------------- /opencv/include/opencv2/imgproc/hal/interface.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENCV_IMGPROC_HAL_INTERFACE_H 2 | #define OPENCV_IMGPROC_HAL_INTERFACE_H 3 | 4 | //! @addtogroup imgproc_hal_interface 5 | //! @{ 6 | 7 | //! @name Interpolation modes 8 | //! @sa cv::InterpolationFlags 9 | //! @{ 10 | #define CV_HAL_INTER_NEAREST 0 11 | #define CV_HAL_INTER_LINEAR 1 12 | #define CV_HAL_INTER_CUBIC 2 13 | #define CV_HAL_INTER_AREA 3 14 | #define CV_HAL_INTER_LANCZOS4 4 15 | //! @} 16 | 17 | //! @name Morphology operations 18 | //! @sa cv::MorphTypes 19 | //! @{ 20 | #define CV_HAL_MORPH_ERODE 0 21 | #define CV_HAL_MORPH_DILATE 1 22 | //! @} 23 | 24 | //! @name Threshold types 25 | //! @sa cv::ThresholdTypes 26 | //! @{ 27 | #define CV_HAL_THRESH_BINARY 0 28 | #define CV_HAL_THRESH_BINARY_INV 1 29 | #define CV_HAL_THRESH_TRUNC 2 30 | #define CV_HAL_THRESH_TOZERO 3 31 | #define CV_HAL_THRESH_TOZERO_INV 4 32 | #define CV_HAL_THRESH_MASK 7 33 | #define CV_HAL_THRESH_OTSU 8 34 | #define CV_HAL_THRESH_TRIANGLE 16 35 | //! @} 36 | 37 | //! @name Adaptive threshold algorithm 38 | //! @sa cv::AdaptiveThresholdTypes 39 | //! @{ 40 | #define CV_HAL_ADAPTIVE_THRESH_MEAN_C 0 41 | #define CV_HAL_ADAPTIVE_THRESH_GAUSSIAN_C 1 42 | //! @} 43 | 44 | //! @} 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /opencv/include/opencv2/imgproc/imgproc.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/imgproc.hpp" 49 | -------------------------------------------------------------------------------- /opencv/include/opencv2/ml/ml.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/ml.hpp" 49 | -------------------------------------------------------------------------------- /opencv/include/opencv2/ml/ml.inl.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_ML_INL_HPP 6 | #define OPENCV_ML_INL_HPP 7 | 8 | namespace cv { namespace ml { 9 | 10 | // declared in ml.hpp 11 | template 12 | int simulatedAnnealingSolver(SimulatedAnnealingSolverSystem& solverSystem, 13 | double initialTemperature, double finalTemperature, double coolingRatio, 14 | size_t iterationsPerStep, 15 | CV_OUT double* lastTemperature, 16 | cv::RNG& rngEnergy 17 | ) 18 | { 19 | CV_Assert(finalTemperature > 0); 20 | CV_Assert(initialTemperature > finalTemperature); 21 | CV_Assert(iterationsPerStep > 0); 22 | CV_Assert(coolingRatio < 1.0f); 23 | double Ti = initialTemperature; 24 | double previousEnergy = solverSystem.energy(); 25 | int exchange = 0; 26 | while (Ti > finalTemperature) 27 | { 28 | for (size_t i = 0; i < iterationsPerStep; i++) 29 | { 30 | solverSystem.changeState(); 31 | double newEnergy = solverSystem.energy(); 32 | if (newEnergy < previousEnergy) 33 | { 34 | previousEnergy = newEnergy; 35 | exchange++; 36 | } 37 | else 38 | { 39 | double r = rngEnergy.uniform(0.0, 1.0); 40 | if (r < std::exp(-(newEnergy - previousEnergy) / Ti)) 41 | { 42 | previousEnergy = newEnergy; 43 | exchange++; 44 | } 45 | else 46 | { 47 | solverSystem.reverseState(); 48 | } 49 | } 50 | } 51 | Ti *= coolingRatio; 52 | } 53 | if (lastTemperature) 54 | *lastTemperature = Ti; 55 | return exchange; 56 | } 57 | 58 | }} //namespace 59 | 60 | #endif // OPENCV_ML_INL_HPP 61 | -------------------------------------------------------------------------------- /opencv/include/opencv2/objdetect/objdetect.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/objdetect.hpp" 49 | -------------------------------------------------------------------------------- /opencv/include/opencv2/opencv_modules.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ** File generated automatically, do not modify ** 3 | * 4 | * This file defines the list of modules available in current build configuration 5 | * 6 | * 7 | */ 8 | 9 | // This definition means that OpenCV is built with enabled non-free code. 10 | // For example, patented algorithms for non-profit/non-commercial use only. 11 | /* #undef OPENCV_ENABLE_NONFREE */ 12 | 13 | #define HAVE_OPENCV_ARUCO 14 | #define HAVE_OPENCV_BGSEGM 15 | #define HAVE_OPENCV_BIOINSPIRED 16 | #define HAVE_OPENCV_CALIB3D 17 | #define HAVE_OPENCV_CCALIB 18 | #define HAVE_OPENCV_CORE 19 | #define HAVE_OPENCV_DATASETS 20 | #define HAVE_OPENCV_DNN 21 | #define HAVE_OPENCV_DNN_OBJDETECT 22 | #define HAVE_OPENCV_DNN_SUPERRES 23 | #define HAVE_OPENCV_DPM 24 | #define HAVE_OPENCV_FACE 25 | #define HAVE_OPENCV_FEATURES2D 26 | #define HAVE_OPENCV_FLANN 27 | #define HAVE_OPENCV_FUZZY 28 | #define HAVE_OPENCV_GAPI 29 | #define HAVE_OPENCV_HFS 30 | #define HAVE_OPENCV_HIGHGUI 31 | #define HAVE_OPENCV_IMG_HASH 32 | #define HAVE_OPENCV_IMGCODECS 33 | #define HAVE_OPENCV_IMGPROC 34 | #define HAVE_OPENCV_INTENSITY_TRANSFORM 35 | #define HAVE_OPENCV_LINE_DESCRIPTOR 36 | #define HAVE_OPENCV_ML 37 | #define HAVE_OPENCV_OBJDETECT 38 | #define HAVE_OPENCV_OPTFLOW 39 | #define HAVE_OPENCV_PHASE_UNWRAPPING 40 | #define HAVE_OPENCV_PHOTO 41 | #define HAVE_OPENCV_PLOT 42 | #define HAVE_OPENCV_QUALITY 43 | #define HAVE_OPENCV_RAPID 44 | #define HAVE_OPENCV_REG 45 | #define HAVE_OPENCV_RGBD 46 | #define HAVE_OPENCV_SALIENCY 47 | #define HAVE_OPENCV_SHAPE 48 | #define HAVE_OPENCV_STEREO 49 | #define HAVE_OPENCV_STITCHING 50 | #define HAVE_OPENCV_STRUCTURED_LIGHT 51 | #define HAVE_OPENCV_SUPERRES 52 | #define HAVE_OPENCV_SURFACE_MATCHING 53 | #define HAVE_OPENCV_TEXT 54 | #define HAVE_OPENCV_TRACKING 55 | #define HAVE_OPENCV_VIDEO 56 | #define HAVE_OPENCV_VIDEOIO 57 | #define HAVE_OPENCV_VIDEOSTAB 58 | #define HAVE_OPENCV_XFEATURES2D 59 | #define HAVE_OPENCV_XIMGPROC 60 | #define HAVE_OPENCV_XOBJDETECT 61 | #define HAVE_OPENCV_XPHOTO 62 | 63 | 64 | -------------------------------------------------------------------------------- /opencv/include/opencv2/photo/legacy/constants_c.h: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_PHOTO_LEGACY_CONSTANTS_H 6 | #define OPENCV_PHOTO_LEGACY_CONSTANTS_H 7 | 8 | enum InpaintingModes 9 | { 10 | CV_INPAINT_NS =0, 11 | CV_INPAINT_TELEA =1 12 | }; 13 | 14 | #endif // OPENCV_PHOTO_LEGACY_CONSTANTS_H 15 | -------------------------------------------------------------------------------- /opencv/include/opencv2/photo/photo.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/photo.hpp" 49 | -------------------------------------------------------------------------------- /opencv/include/opencv2/quality.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_QUALITY_HPP 6 | #define OPENCV_QUALITY_HPP 7 | 8 | #include "quality/qualitybase.hpp" 9 | #include "quality/qualitymse.hpp" 10 | #include "quality/qualitypsnr.hpp" 11 | #include "quality/qualityssim.hpp" 12 | #include "quality/qualitygmsd.hpp" 13 | #include "quality/qualitybrisque.hpp" 14 | 15 | #endif -------------------------------------------------------------------------------- /opencv/include/opencv2/quality/qualitybase.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_QUALITYBASE_HPP 6 | #define OPENCV_QUALITYBASE_HPP 7 | 8 | #include 9 | 10 | /** 11 | @defgroup quality Image Quality Analysis (IQA) API 12 | */ 13 | 14 | namespace cv 15 | { 16 | namespace quality 17 | { 18 | 19 | //! @addtogroup quality 20 | //! @{ 21 | 22 | /************************************ Quality Base Class ************************************/ 23 | class CV_EXPORTS_W QualityBase 24 | : public virtual Algorithm 25 | { 26 | public: 27 | 28 | /** @brief Destructor */ 29 | virtual ~QualityBase() = default; 30 | 31 | /** 32 | @brief Compute quality score per channel with the per-channel score in each element of the resulting cv::Scalar. See specific algorithm for interpreting result scores 33 | @param img comparison image, or image to evalute for no-reference quality algorithms 34 | */ 35 | virtual CV_WRAP cv::Scalar compute( InputArray img ) = 0; 36 | 37 | /** @brief Returns output quality map that was generated during computation, if supported by the algorithm */ 38 | virtual CV_WRAP void getQualityMap(OutputArray dst) const 39 | { 40 | if (!dst.needed() || _qualityMap.empty() ) 41 | return; 42 | dst.assign(_qualityMap); 43 | } 44 | 45 | /** @brief Implements Algorithm::clear() */ 46 | CV_WRAP void clear() CV_OVERRIDE { _qualityMap = _mat_type(); Algorithm::clear(); } 47 | 48 | /** @brief Implements Algorithm::empty() */ 49 | CV_WRAP bool empty() const CV_OVERRIDE { return _qualityMap.empty(); } 50 | 51 | protected: 52 | 53 | /** @brief internal mat type default */ 54 | using _mat_type = cv::UMat; 55 | 56 | /** @brief Output quality maps if generated by algorithm */ 57 | _mat_type _qualityMap; 58 | 59 | }; // QualityBase 60 | //! @} 61 | } // quality 62 | } // cv 63 | #endif -------------------------------------------------------------------------------- /opencv/include/opencv2/quality/qualitymse.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_QUALITY_QUALITYMSE_HPP 6 | #define OPENCV_QUALITY_QUALITYMSE_HPP 7 | 8 | #include "qualitybase.hpp" 9 | 10 | namespace cv 11 | { 12 | namespace quality 13 | { 14 | 15 | /** 16 | @brief Full reference mean square error algorithm https://en.wikipedia.org/wiki/Mean_squared_error 17 | */ 18 | class CV_EXPORTS_W QualityMSE : public QualityBase { 19 | public: 20 | 21 | /** @brief Computes MSE for reference images supplied in class constructor and provided comparison images 22 | @param cmpImgs Comparison image(s) 23 | @returns cv::Scalar with per-channel quality values. Values range from 0 (best) to potentially max float (worst) 24 | */ 25 | CV_WRAP cv::Scalar compute( InputArrayOfArrays cmpImgs ) CV_OVERRIDE; 26 | 27 | /** @brief Implements Algorithm::empty() */ 28 | CV_WRAP bool empty() const CV_OVERRIDE { return _ref.empty() && QualityBase::empty(); } 29 | 30 | /** @brief Implements Algorithm::clear() */ 31 | CV_WRAP void clear() CV_OVERRIDE { _ref = _mat_type(); QualityBase::clear(); } 32 | 33 | /** 34 | @brief Create an object which calculates quality 35 | @param ref input image to use as the reference for comparison 36 | */ 37 | CV_WRAP static Ptr create(InputArray ref); 38 | 39 | /** 40 | @brief static method for computing quality 41 | @param ref reference image 42 | @param cmp comparison image= 43 | @param qualityMap output quality map, or cv::noArray() 44 | @returns cv::Scalar with per-channel quality values. Values range from 0 (best) to max float (worst) 45 | */ 46 | CV_WRAP static cv::Scalar compute( InputArray ref, InputArray cmp, OutputArray qualityMap ); 47 | 48 | protected: 49 | 50 | /** @brief Reference image, converted to internal mat type */ 51 | QualityBase::_mat_type _ref; 52 | 53 | /** 54 | @brief Constructor 55 | @param ref reference image, converted to internal type 56 | */ 57 | QualityMSE(QualityBase::_mat_type ref) 58 | : _ref(std::move(ref)) 59 | {} 60 | 61 | }; // QualityMSE 62 | } // quality 63 | } // cv 64 | #endif -------------------------------------------------------------------------------- /opencv/include/opencv2/reg/mappergradaffine.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // Copyright (C) 2013, Alfonso Sanchez-Beato, all rights reserved. 10 | // Third party copyrights are property of their respective owners. 11 | // 12 | // Redistribution and use in source and binary forms, with or without modification, 13 | // are permitted provided that the following conditions are met: 14 | // 15 | // * Redistribution's of source code must retain the above copyright notice, 16 | // this list of conditions and the following disclaimer. 17 | // 18 | // * Redistribution's in binary form must reproduce the above copyright notice, 19 | // this list of conditions and the following disclaimer in the documentation 20 | // and/or other materials provided with the distribution. 21 | // 22 | // * The name of the copyright holders may not be used to endorse or promote products 23 | // derived from this software without specific prior written permission. 24 | // 25 | // This software is provided by the copyright holders and contributors "as is" and 26 | // any express or implied warranties, including, but not limited to, the implied 27 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 28 | // In no event shall the contributors be liable for any direct, 29 | // indirect, incidental, special, exemplary, or consequential damages 30 | // (including, but not limited to, procurement of substitute goods or services; 31 | // loss of use, data, or profits; or business interruption) however caused 32 | // and on any theory of liability, whether in contract, strict liability, 33 | // or tort (including negligence or otherwise) arising in any way out of 34 | // the use of this software, even if advised of the possibility of such damage. 35 | // 36 | //M*/ 37 | 38 | #ifndef MAPPERGRADAFFINE_H_ 39 | #define MAPPERGRADAFFINE_H_ 40 | 41 | #include "mapper.hpp" 42 | 43 | namespace cv { 44 | namespace reg { 45 | 46 | //! @addtogroup reg 47 | //! @{ 48 | 49 | /*! 50 | * Mapper for affine motion 51 | */ 52 | class CV_EXPORTS_W MapperGradAffine: public Mapper 53 | { 54 | public: 55 | CV_WRAP MapperGradAffine(); 56 | ~MapperGradAffine(void); 57 | 58 | CV_WRAP virtual cv::Ptr calculate(InputArray img1, InputArray img2, cv::Ptr init = cv::Ptr()) const CV_OVERRIDE; 59 | 60 | CV_WRAP cv::Ptr getMap() const CV_OVERRIDE; 61 | }; 62 | 63 | //! @} 64 | 65 | }} // namespace cv::reg 66 | 67 | #endif // MAPPERGRADAFFINE_H_ 68 | -------------------------------------------------------------------------------- /opencv/include/opencv2/reg/mappergradeuclid.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // Copyright (C) 2013, Alfonso Sanchez-Beato, all rights reserved. 10 | // Third party copyrights are property of their respective owners. 11 | // 12 | // Redistribution and use in source and binary forms, with or without modification, 13 | // are permitted provided that the following conditions are met: 14 | // 15 | // * Redistribution's of source code must retain the above copyright notice, 16 | // this list of conditions and the following disclaimer. 17 | // 18 | // * Redistribution's in binary form must reproduce the above copyright notice, 19 | // this list of conditions and the following disclaimer in the documentation 20 | // and/or other materials provided with the distribution. 21 | // 22 | // * The name of the copyright holders may not be used to endorse or promote products 23 | // derived from this software without specific prior written permission. 24 | // 25 | // This software is provided by the copyright holders and contributors "as is" and 26 | // any express or implied warranties, including, but not limited to, the implied 27 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 28 | // In no event shall the contributors be liable for any direct, 29 | // indirect, incidental, special, exemplary, or consequential damages 30 | // (including, but not limited to, procurement of substitute goods or services; 31 | // loss of use, data, or profits; or business interruption) however caused 32 | // and on any theory of liability, whether in contract, strict liability, 33 | // or tort (including negligence or otherwise) arising in any way out of 34 | // the use of this software, even if advised of the possibility of such damage. 35 | // 36 | //M*/ 37 | 38 | #ifndef MAPPERGRADEUCLID_H_ 39 | #define MAPPERGRADEUCLID_H_ 40 | 41 | #include "mapper.hpp" 42 | 43 | namespace cv { 44 | namespace reg { 45 | 46 | //! @addtogroup reg 47 | //! @{ 48 | 49 | /*! 50 | * Mapper for euclidean motion: rotation plus shift 51 | */ 52 | class CV_EXPORTS_W MapperGradEuclid: public Mapper 53 | { 54 | public: 55 | CV_WRAP MapperGradEuclid(); 56 | ~MapperGradEuclid(); 57 | 58 | CV_WRAP virtual cv::Ptr calculate(InputArray img1, InputArray img2, cv::Ptr init = cv::Ptr()) const CV_OVERRIDE; 59 | 60 | CV_WRAP cv::Ptr getMap() const CV_OVERRIDE; 61 | }; 62 | 63 | //! @} 64 | 65 | }} // namespace cv::reg 66 | 67 | #endif // MAPPERGRADEUCLID_H_ 68 | -------------------------------------------------------------------------------- /opencv/include/opencv2/reg/mappergradproj.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // Copyright (C) 2013, Alfonso Sanchez-Beato, all rights reserved. 10 | // Third party copyrights are property of their respective owners. 11 | // 12 | // Redistribution and use in source and binary forms, with or without modification, 13 | // are permitted provided that the following conditions are met: 14 | // 15 | // * Redistribution's of source code must retain the above copyright notice, 16 | // this list of conditions and the following disclaimer. 17 | // 18 | // * Redistribution's in binary form must reproduce the above copyright notice, 19 | // this list of conditions and the following disclaimer in the documentation 20 | // and/or other materials provided with the distribution. 21 | // 22 | // * The name of the copyright holders may not be used to endorse or promote products 23 | // derived from this software without specific prior written permission. 24 | // 25 | // This software is provided by the copyright holders and contributors "as is" and 26 | // any express or implied warranties, including, but not limited to, the implied 27 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 28 | // In no event shall the contributors be liable for any direct, 29 | // indirect, incidental, special, exemplary, or consequential damages 30 | // (including, but not limited to, procurement of substitute goods or services; 31 | // loss of use, data, or profits; or business interruption) however caused 32 | // and on any theory of liability, whether in contract, strict liability, 33 | // or tort (including negligence or otherwise) arising in any way out of 34 | // the use of this software, even if advised of the possibility of such damage. 35 | // 36 | //M*/ 37 | 38 | #ifndef MAPPERGRADPROJ_H_ 39 | #define MAPPERGRADPROJ_H_ 40 | 41 | #include "mapper.hpp" 42 | 43 | namespace cv { 44 | namespace reg { 45 | 46 | //! @addtogroup reg 47 | //! @{ 48 | 49 | /*! 50 | * Gradient mapper for a projective transformation 51 | */ 52 | class CV_EXPORTS_W MapperGradProj: public Mapper 53 | { 54 | public: 55 | CV_WRAP MapperGradProj(); 56 | ~MapperGradProj(); 57 | 58 | CV_WRAP virtual cv::Ptr calculate(InputArray img1, InputArray img2, cv::Ptr init = cv::Ptr()) const CV_OVERRIDE; 59 | 60 | CV_WRAP cv::Ptr getMap() const CV_OVERRIDE; 61 | }; 62 | 63 | //! @} 64 | 65 | }} // namespace cv::reg 66 | 67 | #endif // MAPPERGRADPROJ_H_ 68 | -------------------------------------------------------------------------------- /opencv/include/opencv2/reg/mappergradshift.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // Copyright (C) 2013, Alfonso Sanchez-Beato, all rights reserved. 10 | // Third party copyrights are property of their respective owners. 11 | // 12 | // Redistribution and use in source and binary forms, with or without modification, 13 | // are permitted provided that the following conditions are met: 14 | // 15 | // * Redistribution's of source code must retain the above copyright notice, 16 | // this list of conditions and the following disclaimer. 17 | // 18 | // * Redistribution's in binary form must reproduce the above copyright notice, 19 | // this list of conditions and the following disclaimer in the documentation 20 | // and/or other materials provided with the distribution. 21 | // 22 | // * The name of the copyright holders may not be used to endorse or promote products 23 | // derived from this software without specific prior written permission. 24 | // 25 | // This software is provided by the copyright holders and contributors "as is" and 26 | // any express or implied warranties, including, but not limited to, the implied 27 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 28 | // In no event shall the contributors be liable for any direct, 29 | // indirect, incidental, special, exemplary, or consequential damages 30 | // (including, but not limited to, procurement of substitute goods or services; 31 | // loss of use, data, or profits; or business interruption) however caused 32 | // and on any theory of liability, whether in contract, strict liability, 33 | // or tort (including negligence or otherwise) arising in any way out of 34 | // the use of this software, even if advised of the possibility of such damage. 35 | // 36 | //M*/ 37 | 38 | #ifndef MAPPERGRADSHIFT_H_ 39 | #define MAPPERGRADSHIFT_H_ 40 | 41 | #include "mapper.hpp" 42 | 43 | namespace cv { 44 | namespace reg { 45 | 46 | //! @addtogroup reg 47 | //! @{ 48 | 49 | /*! 50 | * Gradient mapper for a translation 51 | */ 52 | class CV_EXPORTS_W MapperGradShift: public Mapper 53 | { 54 | public: 55 | CV_WRAP MapperGradShift(); 56 | virtual ~MapperGradShift(); 57 | 58 | CV_WRAP virtual cv::Ptr calculate(InputArray img1, InputArray img2, cv::Ptr init = cv::Ptr()) const CV_OVERRIDE; 59 | 60 | CV_WRAP cv::Ptr getMap() const CV_OVERRIDE; 61 | }; 62 | 63 | //! @} 64 | 65 | }} // namespace cv::reg 66 | 67 | #endif // MAPPERGRADSHIFT_H_ 68 | -------------------------------------------------------------------------------- /opencv/include/opencv2/reg/mappergradsimilar.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // Copyright (C) 2013, Alfonso Sanchez-Beato, all rights reserved. 10 | // Third party copyrights are property of their respective owners. 11 | // 12 | // Redistribution and use in source and binary forms, with or without modification, 13 | // are permitted provided that the following conditions are met: 14 | // 15 | // * Redistribution's of source code must retain the above copyright notice, 16 | // this list of conditions and the following disclaimer. 17 | // 18 | // * Redistribution's in binary form must reproduce the above copyright notice, 19 | // this list of conditions and the following disclaimer in the documentation 20 | // and/or other materials provided with the distribution. 21 | // 22 | // * The name of the copyright holders may not be used to endorse or promote products 23 | // derived from this software without specific prior written permission. 24 | // 25 | // This software is provided by the copyright holders and contributors "as is" and 26 | // any express or implied warranties, including, but not limited to, the implied 27 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 28 | // In no event shall the contributors be liable for any direct, 29 | // indirect, incidental, special, exemplary, or consequential damages 30 | // (including, but not limited to, procurement of substitute goods or services; 31 | // loss of use, data, or profits; or business interruption) however caused 32 | // and on any theory of liability, whether in contract, strict liability, 33 | // or tort (including negligence or otherwise) arising in any way out of 34 | // the use of this software, even if advised of the possibility of such damage. 35 | // 36 | //M*/ 37 | 38 | #ifndef MAPPERGRADSIMILAR_H_ 39 | #define MAPPERGRADSIMILAR_H_ 40 | 41 | #include "mapper.hpp" 42 | 43 | namespace cv { 44 | namespace reg { 45 | 46 | //! @addtogroup reg 47 | //! @{ 48 | 49 | /*! 50 | * Calculates a similarity transformation between to images (scale, rotation, and shift) 51 | */ 52 | class CV_EXPORTS_W MapperGradSimilar: public Mapper 53 | { 54 | public: 55 | CV_WRAP MapperGradSimilar(); 56 | ~MapperGradSimilar(); 57 | 58 | CV_WRAP virtual cv::Ptr calculate(InputArray img1, InputArray img2, cv::Ptr init = cv::Ptr()) const CV_OVERRIDE; 59 | 60 | CV_WRAP cv::Ptr getMap() const CV_OVERRIDE; 61 | }; 62 | 63 | //! @} 64 | 65 | }} // namespace cv::reg 66 | 67 | #endif // MAPPERGRADSIMILAR_H_ 68 | -------------------------------------------------------------------------------- /opencv/include/opencv2/rgbd.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html 4 | 5 | // This code is also subject to the license terms in the LICENSE_KinectFusion.md file found in this module's directory 6 | 7 | // This code is also subject to the license terms in the LICENSE_WillowGarage.md file found in this module's directory 8 | 9 | #ifndef __OPENCV_RGBD_HPP__ 10 | #define __OPENCV_RGBD_HPP__ 11 | 12 | #include "opencv2/rgbd/linemod.hpp" 13 | #include "opencv2/rgbd/depth.hpp" 14 | #include "opencv2/rgbd/kinfu.hpp" 15 | #include "opencv2/rgbd/dynafu.hpp" 16 | 17 | 18 | /** @defgroup rgbd RGB-Depth Processing 19 | */ 20 | 21 | #endif 22 | 23 | /* End of file. */ 24 | -------------------------------------------------------------------------------- /opencv/include/opencv2/rgbd/intrinsics.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html 4 | 5 | #ifndef __OPENCV_RGBD_INTRINSICS_HPP__ 6 | #define __OPENCV_RGBD_INTRINSICS_HPP__ 7 | 8 | #include "opencv2/core/matx.hpp" 9 | 10 | namespace cv 11 | { 12 | namespace kinfu 13 | { 14 | 15 | struct Intr 16 | { 17 | /** @brief Camera intrinsics */ 18 | /** Reprojects screen point to camera space given z coord. */ 19 | struct Reprojector 20 | { 21 | Reprojector() {} 22 | inline Reprojector(Intr intr) 23 | { 24 | fxinv = 1.f/intr.fx, fyinv = 1.f/intr.fy; 25 | cx = intr.cx, cy = intr.cy; 26 | } 27 | template 28 | inline cv::Point3_ operator()(cv::Point3_ p) const 29 | { 30 | T x = p.z * (p.x - cx) * fxinv; 31 | T y = p.z * (p.y - cy) * fyinv; 32 | return cv::Point3_(x, y, p.z); 33 | } 34 | 35 | float fxinv, fyinv, cx, cy; 36 | }; 37 | 38 | /** Projects camera space vector onto screen */ 39 | struct Projector 40 | { 41 | inline Projector(Intr intr) : fx(intr.fx), fy(intr.fy), cx(intr.cx), cy(intr.cy) { } 42 | template 43 | inline cv::Point_ operator()(cv::Point3_ p) const 44 | { 45 | T invz = T(1)/p.z; 46 | T x = fx*(p.x*invz) + cx; 47 | T y = fy*(p.y*invz) + cy; 48 | return cv::Point_(x, y); 49 | } 50 | template 51 | inline cv::Point_ operator()(cv::Point3_ p, cv::Point3_& pixVec) const 52 | { 53 | T invz = T(1)/p.z; 54 | pixVec = cv::Point3_(p.x*invz, p.y*invz, 1); 55 | T x = fx*pixVec.x + cx; 56 | T y = fy*pixVec.y + cy; 57 | return cv::Point_(x, y); 58 | } 59 | float fx, fy, cx, cy; 60 | }; 61 | Intr() : fx(), fy(), cx(), cy() { } 62 | Intr(float _fx, float _fy, float _cx, float _cy) : fx(_fx), fy(_fy), cx(_cx), cy(_cy) { } 63 | Intr(cv::Matx33f m) : fx(m(0, 0)), fy(m(1, 1)), cx(m(0, 2)), cy(m(1, 2)) { } 64 | // scale intrinsics to pyramid level 65 | inline Intr scale(int pyr) const 66 | { 67 | float factor = (1.f /(1 << pyr)); 68 | return Intr(fx*factor, fy*factor, cx*factor, cy*factor); 69 | } 70 | inline Reprojector makeReprojector() const { return Reprojector(*this); } 71 | inline Projector makeProjector() const { return Projector(*this); } 72 | 73 | inline cv::Matx33f getMat() const { return Matx33f(fx, 0, cx, 0, fy, cy, 0, 0, 1); } 74 | 75 | float fx, fy, cx, cy; 76 | }; 77 | 78 | } // namespace rgbd 79 | } // namespace cv 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /opencv/include/opencv2/rgbd/volume.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html 4 | 5 | // This code is also subject to the license terms in the LICENSE_KinectFusion.md file found in this 6 | // module's directory 7 | 8 | #ifndef __OPENCV_RGBD_VOLUME_H__ 9 | #define __OPENCV_RGBD_VOLUME_H__ 10 | 11 | #include "intrinsics.hpp" 12 | #include "opencv2/core/affine.hpp" 13 | 14 | namespace cv 15 | { 16 | namespace kinfu 17 | { 18 | class Volume 19 | { 20 | public: 21 | Volume(float _voxelSize, cv::Affine3f _pose, float _raycastStepFactor) 22 | : voxelSize(_voxelSize), 23 | voxelSizeInv(1.0f / voxelSize), 24 | pose(_pose), 25 | raycastStepFactor(_raycastStepFactor) 26 | { 27 | } 28 | 29 | virtual ~Volume(){}; 30 | 31 | virtual void integrate(InputArray _depth, float depthFactor, const cv::Affine3f& cameraPose, 32 | const cv::kinfu::Intr& intrinsics) = 0; 33 | virtual void raycast(const cv::Affine3f& cameraPose, const cv::kinfu::Intr& intrinsics, 34 | cv::Size frameSize, cv::OutputArray points, 35 | cv::OutputArray normals) const = 0; 36 | virtual void fetchNormals(cv::InputArray points, cv::OutputArray _normals) const = 0; 37 | virtual void fetchPointsNormals(cv::OutputArray points, cv::OutputArray normals) const = 0; 38 | virtual void reset() = 0; 39 | 40 | public: 41 | const float voxelSize; 42 | const float voxelSizeInv; 43 | const cv::Affine3f pose; 44 | const float raycastStepFactor; 45 | }; 46 | 47 | enum class VolumeType 48 | { 49 | TSDF = 0, 50 | HASHTSDF = 1 51 | }; 52 | 53 | cv::Ptr makeVolume(VolumeType _volumeType, float _voxelSize, cv::Affine3f _pose, 54 | float _raycastStepFactor, float _truncDist, int _maxWeight, 55 | float _truncateThreshold, Point3i _resolution); 56 | } // namespace kinfu 57 | } // namespace cv 58 | #endif 59 | -------------------------------------------------------------------------------- /opencv/include/opencv2/shape.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2012, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef OPENCV_SHAPE_HPP 44 | #define OPENCV_SHAPE_HPP 45 | 46 | #include "opencv2/shape/emdL1.hpp" 47 | #include "opencv2/shape/shape_transformer.hpp" 48 | #include "opencv2/shape/hist_cost.hpp" 49 | #include "opencv2/shape/shape_distance.hpp" 50 | 51 | /** 52 | @defgroup shape Shape Distance and Matching 53 | */ 54 | 55 | #endif 56 | 57 | /* End of file. */ 58 | -------------------------------------------------------------------------------- /opencv/include/opencv2/shape/shape.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/shape.hpp" 49 | -------------------------------------------------------------------------------- /opencv/include/opencv2/stereo/descriptor.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef _OPENCV_STEREO_DESCRIPTOR_HPP_ 6 | #define _OPENCV_STEREO_DESCRIPTOR_HPP_ 7 | 8 | namespace cv { namespace stereo { 9 | 10 | // FIXIT deprecate and remove CV_ prefix 11 | /// types of supported kernels 12 | enum { 13 | CV_DENSE_CENSUS, CV_SPARSE_CENSUS, 14 | CV_CS_CENSUS, CV_MODIFIED_CS_CENSUS, CV_MODIFIED_CENSUS_TRANSFORM, 15 | CV_MEAN_VARIATION, CV_STAR_KERNEL 16 | }; 17 | 18 | /** 19 | Two variations of census applied on input images 20 | Implementation of a census transform which is taking into account just the some pixels from the census kernel thus allowing for larger block sizes 21 | **/ 22 | CV_EXPORTS void censusTransform(const Mat &image1, const Mat &image2, int kernelSize, Mat &dist1, Mat &dist2, const int type); 23 | /// single image census transform 24 | CV_EXPORTS void censusTransform(const Mat &image1, int kernelSize, Mat &dist1, const int type); 25 | /** 26 | STANDARD_MCT - Modified census which is memorizing for each pixel 2 bits and includes a tolerance to the pixel comparison 27 | MCT_MEAN_VARIATION - Implementation of a modified census transform which is also taking into account the variation to the mean of the window not just the center pixel 28 | **/ 29 | CV_EXPORTS void modifiedCensusTransform(const Mat &img1, const Mat &img2, int kernelSize, Mat &dist1, Mat &dist2, const int type, int t = 0, const Mat &integralImage1 = Mat(), const Mat &integralImage2 = Mat()); 30 | ///single version of modified census transform descriptor 31 | CV_EXPORTS void modifiedCensusTransform(const Mat &img1, int kernelSize, Mat &dist, const int type, int t = 0, const Mat &integralImage = Mat()); 32 | /**The classical center symetric census 33 | A modified version of cs census which is comparing a pixel with its correspondent after the center 34 | **/ 35 | CV_EXPORTS void symetricCensusTransform(const Mat &img1, const Mat &img2, int kernelSize, Mat &dist1, Mat &dist2, const int type); 36 | ///single version of census transform 37 | CV_EXPORTS void symetricCensusTransform(const Mat &img1, int kernelSize, Mat &dist1, const int type); 38 | ///in a 9x9 kernel only certain positions are choosen 39 | CV_EXPORTS void starCensusTransform(const Mat &img1, const Mat &img2, int kernelSize, Mat &dist1, Mat &dist2); 40 | ///single image version of star kernel 41 | CV_EXPORTS void starCensusTransform(const Mat &img1, int kernelSize, Mat &dist); 42 | 43 | }} // namespace 44 | #endif 45 | -------------------------------------------------------------------------------- /opencv/include/opencv2/stereo/stereo.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/stereo.hpp" 49 | 50 | -------------------------------------------------------------------------------- /opencv/include/opencv2/text/swt_text_detection.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef __OPENCV_TEXT_SWTTEXTDETECTOR_HPP__ 6 | #define __OPENCV_TEXT_SWTTEXTDETECTOR_HPP__ 7 | 8 | #include 9 | #include 10 | 11 | namespace cv { 12 | namespace text { 13 | /** @brief Applies the Stroke Width Transform operator followed by filtering of connected components of similar Stroke Widths to return letter candidates. It also chain them by proximity and size, saving the result in chainBBs. 14 | @param input the input image with 3 channels. 15 | @param result a vector of resulting bounding boxes where probability of finding text is high 16 | @param dark_on_light a boolean value signifying whether the text is darker or lighter than the background, it is observed to reverse the gradient obtained from Scharr operator, and significantly affect the result. 17 | @param draw an optional Mat of type CV_8UC3 which visualises the detected letters using bounding boxes. 18 | @param chainBBs an optional parameter which chains the letter candidates according to heuristics in the paper and returns all possible regions where text is likely to occur. 19 | */ 20 | CV_EXPORTS_W void detectTextSWT (InputArray input, CV_OUT std::vector& result, bool dark_on_light, OutputArray& draw=noArray(), OutputArray & chainBBs =noArray()); 21 | } 22 | } 23 | 24 | #endif -------------------------------------------------------------------------------- /opencv/include/opencv2/tracking/tldDataset.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of the copyright holders may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the Intel Corporation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef OPENCV_TLD_DATASET 43 | #define OPENCV_TLD_DATASET 44 | 45 | #include "opencv2/core.hpp" 46 | 47 | namespace cv 48 | { 49 | namespace tld 50 | { 51 | CV_EXPORTS cv::Rect2d tld_InitDataset(int videoInd, const char* rootPath = "TLD_dataset", int datasetInd = 0); 52 | CV_EXPORTS cv::String tld_getNextDatasetFrame(); 53 | } 54 | } 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /opencv/include/opencv2/tracking/tracking.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of the copyright holders may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the Intel Corporation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifdef __OPENCV_BUILD 43 | #error this is a compatibility header which should not be used inside the OpenCV library 44 | #endif 45 | 46 | #include "opencv2/tracking.hpp" 47 | -------------------------------------------------------------------------------- /opencv/include/opencv2/video.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifndef OPENCV_VIDEO_HPP 45 | #define OPENCV_VIDEO_HPP 46 | 47 | /** 48 | @defgroup video Video Analysis 49 | @{ 50 | @defgroup video_motion Motion Analysis 51 | @defgroup video_track Object Tracking 52 | @defgroup video_c C API 53 | @} 54 | */ 55 | 56 | #include "opencv2/video/tracking.hpp" 57 | #include "opencv2/video/background_segm.hpp" 58 | 59 | #endif //OPENCV_VIDEO_HPP 60 | -------------------------------------------------------------------------------- /opencv/include/opencv2/video/legacy/constants_c.h: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_VIDEO_LEGACY_CONSTANTS_H 6 | #define OPENCV_VIDEO_LEGACY_CONSTANTS_H 7 | 8 | enum 9 | { 10 | CV_LKFLOW_PYR_A_READY = 1, 11 | CV_LKFLOW_PYR_B_READY = 2, 12 | CV_LKFLOW_INITIAL_GUESSES = 4, 13 | CV_LKFLOW_GET_MIN_EIGENVALS = 8 14 | }; 15 | 16 | #endif // OPENCV_VIDEO_LEGACY_CONSTANTS_H 17 | -------------------------------------------------------------------------------- /opencv/include/opencv2/video/video.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/video.hpp" 49 | -------------------------------------------------------------------------------- /opencv/include/opencv2/videoio/registry.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_VIDEOIO_REGISTRY_HPP 6 | #define OPENCV_VIDEOIO_REGISTRY_HPP 7 | 8 | #include 9 | 10 | namespace cv { namespace videoio_registry { 11 | /** @addtogroup videoio_registry 12 | This section contains API description how to query/configure available Video I/O backends. 13 | 14 | Runtime configuration options: 15 | - enable debug mode: `OPENCV_VIDEOIO_DEBUG=1` 16 | - change backend priority: `OPENCV_VIDEOIO_PRIORITY_=9999` 17 | - disable backend: `OPENCV_VIDEOIO_PRIORITY_=0` 18 | - specify list of backends with high priority (>100000): `OPENCV_VIDEOIO_PRIORITY_LIST=FFMPEG,GSTREAMER` 19 | 20 | @{ 21 | */ 22 | 23 | 24 | /** @brief Returns backend API name or "UnknownVideoAPI(xxx)" 25 | @param api backend ID (#VideoCaptureAPIs) 26 | */ 27 | CV_EXPORTS_W cv::String getBackendName(VideoCaptureAPIs api); 28 | 29 | /** @brief Returns list of all available backends */ 30 | CV_EXPORTS_W std::vector getBackends(); 31 | 32 | /** @brief Returns list of available backends which works via `cv::VideoCapture(int index)` */ 33 | CV_EXPORTS_W std::vector getCameraBackends(); 34 | 35 | /** @brief Returns list of available backends which works via `cv::VideoCapture(filename)` */ 36 | CV_EXPORTS_W std::vector getStreamBackends(); 37 | 38 | /** @brief Returns list of available backends which works via `cv::VideoWriter()` */ 39 | CV_EXPORTS_W std::vector getWriterBackends(); 40 | 41 | /** @brief Returns true if backend is available */ 42 | CV_EXPORTS bool hasBackend(VideoCaptureAPIs api); 43 | 44 | //! @} 45 | }} // namespace 46 | 47 | #endif // OPENCV_VIDEOIO_REGISTRY_HPP 48 | -------------------------------------------------------------------------------- /opencv/include/opencv2/videoio/videoio.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/videoio.hpp" 49 | -------------------------------------------------------------------------------- /opencv/include/opencv2/ximgproc/brightedges.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2017, IBM Corporation, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // @Authors 17 | // Marc Fiammante marc.fiammante@fr.ibm.com 18 | // 19 | // Redistribution and use in source and binary forms, with or without modification, 20 | // are permitted provided that the following conditions are met: 21 | // 22 | // * Redistribution's of source code must retain the above copyright notice, 23 | // this list of conditions and the following disclaimer. 24 | // 25 | // * Redistribution's in binary form must reproduce the above copyright notice, 26 | // this list of conditions and the following disclaimer in the documentation 27 | // and/or other materials provided with the distribution. 28 | // 29 | // * The name of OpenCV Foundation or contributors may not be used to endorse or promote products 30 | // derived from this software without specific prior written permission. 31 | // 32 | // This software is provided by the copyright holders and contributors "as is" and 33 | // any express or implied warranties, including, but not limited to, the implied 34 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 35 | // In no event shall the OpenCV Foundation or contributors be liable for any direct, 36 | // indirect, incidental, special, exemplary, or consequential damages 37 | // (including, but not limited to, procurement of substitute goods or services; 38 | // loss of use, data, or profits; or business interruption) however caused 39 | // and on any theory of liability, whether in contract, strict liability, 40 | // or tort (including negligence or otherwise) arising in any way out of 41 | // the use of this software, even if advised of the possibility of such damage. 42 | // 43 | //M*/ 44 | #include "opencv2/core.hpp" 45 | namespace cv 46 | { 47 | namespace ximgproc { 48 | CV_EXPORTS_W void BrightEdges(Mat &_original, Mat &_edgeview, int contrast = 1, int shortrange = 3, int longrange = 9); 49 | } 50 | } -------------------------------------------------------------------------------- /opencv/include/opencv2/ximgproc/color_match.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef __OPENCV_COLOR_MATCH_HPP__ 6 | #define __OPENCV_COLOR_MATCH_HPP__ 7 | 8 | #include 9 | 10 | namespace cv { 11 | namespace ximgproc { 12 | 13 | //! @addtogroup ximgproc_filters 14 | //! @{ 15 | 16 | /** 17 | * @brief creates a quaternion image. 18 | * 19 | * @param img Source 8-bit, 32-bit or 64-bit image, with 3-channel image. 20 | * @param qimg result CV_64FC4 a quaternion image( 4 chanels zero channel and B,G,R). 21 | */ 22 | CV_EXPORTS_W void createQuaternionImage(InputArray img, OutputArray qimg); 23 | 24 | /** 25 | * @brief calculates conjugate of a quaternion image. 26 | * 27 | * @param qimg quaternion image. 28 | * @param qcimg conjugate of qimg 29 | */ 30 | CV_EXPORTS_W void qconj(InputArray qimg, OutputArray qcimg); 31 | /** 32 | * @brief divides each element by its modulus. 33 | * 34 | * @param qimg quaternion image. 35 | * @param qnimg conjugate of qimg 36 | */ 37 | CV_EXPORTS_W void qunitary(InputArray qimg, OutputArray qnimg); 38 | /** 39 | * @brief Calculates the per-element quaternion product of two arrays 40 | * 41 | * @param src1 quaternion image. 42 | * @param src2 quaternion image. 43 | * @param dst product dst(I)=src1(I) . src2(I) 44 | */ 45 | CV_EXPORTS_W void qmultiply(InputArray src1, InputArray src2, OutputArray dst); 46 | /** 47 | * @brief Performs a forward or inverse Discrete quaternion Fourier transform of a 2D quaternion array. 48 | * 49 | * @param img quaternion image. 50 | * @param qimg quaternion image in dual space. 51 | * @param flags quaternion image in dual space. only DFT_INVERSE flags is supported 52 | * @param sideLeft true the hypercomplex exponential is to be multiplied on the left (false on the right ). 53 | */ 54 | CV_EXPORTS_W void qdft(InputArray img, OutputArray qimg, int flags, bool sideLeft); 55 | /** 56 | * @brief Compares a color template against overlapped color image regions. 57 | * 58 | * @param img Image where the search is running. It must be 3 channels image 59 | * @param templ Searched template. It must be not greater than the source image and have 3 channels 60 | * @param result Map of comparison results. It must be single-channel 64-bit floating-point 61 | */ 62 | CV_EXPORTS_W void colorMatchTemplate(InputArray img, InputArray templ, OutputArray result); 63 | 64 | } 65 | } 66 | #endif 67 | -------------------------------------------------------------------------------- /opencv/include/opencv2/ximgproc/edgepreserving_filter.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef __OPENCV_EDGEPRESERVINGFILTER_HPP__ 6 | #define __OPENCV_EDGEPRESERVINGFILTER_HPP__ 7 | 8 | #include 9 | 10 | namespace cv { namespace ximgproc { 11 | 12 | //! @addtogroup ximgproc 13 | //! @{ 14 | 15 | /** 16 | * @brief Smoothes an image using the Edge-Preserving filter. 17 | * 18 | * The function smoothes Gaussian noise as well as salt & pepper noise. 19 | * For more details about this implementation, please see 20 | * [ReiWoe18] Reich, S. and Wörgötter, F. and Dellen, B. (2018). A Real-Time Edge-Preserving Denoising Filter. Proceedings of the 13th International Joint Conference on Computer Vision, Imaging and Computer Graphics Theory and Applications (VISIGRAPP): Visapp, 85-94, 4. DOI: 10.5220/0006509000850094. 21 | * 22 | * @param src Source 8-bit 3-channel image. 23 | * @param dst Destination image of the same size and type as src. 24 | * @param d Diameter of each pixel neighborhood that is used during filtering. Must be greater or equal 3. 25 | * @param threshold Threshold, which distinguishes between noise, outliers, and data. 26 | */ 27 | CV_EXPORTS_W void edgePreservingFilter( InputArray src, OutputArray dst, int d, double threshold ); 28 | 29 | }} // namespace 30 | 31 | //! @} 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /opencv/include/opencv2/ximgproc/paillou_filter.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * By downloading, copying, installing or using the software you agree to this license. 3 | * If you do not agree to this license, do not download, install, 4 | * copy or use the software. 5 | * 6 | * 7 | * License Agreement 8 | * For Open Source Computer Vision Library 9 | * (3 - clause BSD License) 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met : 13 | * 14 | * * Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 17 | * * Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and / or other materials provided with the distribution. 20 | * 21 | * * Neither the names of the copyright holders nor the names of the contributors 22 | * may be used to endorse or promote products derived from this software 23 | * without specific prior written permission. 24 | * 25 | * This software is provided by the copyright holders and contributors "as is" and 26 | * any express or implied warranties, including, but not limited to, the implied 27 | * warranties of merchantability and fitness for a particular purpose are disclaimed. 28 | * In no event shall copyright holders or contributors be liable for any direct, 29 | * indirect, incidental, special, exemplary, or consequential damages 30 | * (including, but not limited to, procurement of substitute goods or services; 31 | * loss of use, data, or profits; or business interruption) however caused 32 | * and on any theory of liability, whether in contract, strict liability, 33 | * or tort(including negligence or otherwise) arising in any way out of 34 | * the use of this software, even if advised of the possibility of such damage. 35 | */ 36 | 37 | #ifndef __OPENCV_PAILLOUFILTER_HPP__ 38 | #define __OPENCV_PAILLOUFILTER_HPP__ 39 | #ifdef __cplusplus 40 | 41 | #include 42 | 43 | namespace cv { 44 | namespace ximgproc { 45 | 46 | //! @addtogroup ximgproc_filters 47 | //! @{ 48 | 49 | /** 50 | * @brief Applies Paillou filter to an image. 51 | * 52 | * For more details about this implementation, please see @cite paillou1997detecting 53 | * 54 | * @param op Source CV_8U(S) or CV_16U(S), 1-channel or 3-channels image. 55 | * @param _dst result CV_32F image with same number of channel than op. 56 | * @param omega double see paper 57 | * @param alpha double see paper 58 | * 59 | * @sa GradientPaillouX, GradientPaillouY 60 | */ 61 | CV_EXPORTS void GradientPaillouY(InputArray op, OutputArray _dst, double alpha, double omega); 62 | CV_EXPORTS void GradientPaillouX(InputArray op, OutputArray _dst, double alpha, double omega); 63 | 64 | } 65 | } 66 | #endif 67 | #endif 68 | -------------------------------------------------------------------------------- /opencv/include/opencv2/ximgproc/peilin.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef __OPENCV_PEILIN_HPP__ 6 | #define __OPENCV_PEILIN_HPP__ 7 | 8 | #include 9 | 10 | namespace cv { namespace ximgproc { 11 | 12 | //! @addtogroup ximgproc 13 | //! @{ 14 | 15 | /** 16 | * @brief Calculates an affine transformation that normalize given image using Pei&Lin Normalization. 17 | * 18 | * Assume given image \f$I=T(\bar{I})\f$ where \f$\bar{I}\f$ is a normalized image and \f$T\f$ is an affine transformation distorting this image by translation, rotation, scaling and skew. 19 | * The function returns an affine transformation matrix corresponding to the transformation \f$T^{-1}\f$ described in [PeiLin95]. 20 | * For more details about this implementation, please see 21 | * [PeiLin95] Soo-Chang Pei and Chao-Nan Lin. Image normalization for pattern recognition. Image and Vision Computing, Vol. 13, N.10, pp. 711-723, 1995. 22 | * 23 | * @param I Given transformed image. 24 | * @return Transformation matrix corresponding to inversed image transformation 25 | */ 26 | CV_EXPORTS Matx23d PeiLinNormalization ( InputArray I ); 27 | /** @overload */ 28 | CV_EXPORTS_W void PeiLinNormalization ( InputArray I, OutputArray T ); 29 | 30 | }} // namespace 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /opencv/include/opencv2/ximgproc/ridgefilter.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | /* 6 | Ridge Detection Filter. 7 | OpenCV port by : Kushal Vyas (@kushalvyas), Venkatesh Vijaykumar(@venkateshvijaykumar) 8 | Adapted from Niki Estner's explanation of RidgeFilter. 9 | */ 10 | 11 | #ifndef __OPENCV_XIMGPROC_RIDGEFILTER_HPP__ 12 | #define __OPENCV_XIMGPROC_RIDGEFILTER_HPP__ 13 | 14 | #include 15 | 16 | namespace cv { namespace ximgproc { 17 | 18 | //! @addtogroup ximgproc_filters 19 | //! @{ 20 | 21 | /** @brief Applies Ridge Detection Filter to an input image. 22 | Implements Ridge detection similar to the one in [Mathematica](http://reference.wolfram.com/language/ref/RidgeFilter.html) 23 | using the eigen values from the Hessian Matrix of the input image using Sobel Derivatives. 24 | Additional refinement can be done using Skeletonization and Binarization. Adapted from @cite segleafvein and @cite M_RF 25 | 26 | */ 27 | class CV_EXPORTS_W RidgeDetectionFilter : public Algorithm 28 | { 29 | public: 30 | /** 31 | @brief Create pointer to the Ridge detection filter. 32 | @param ddepth Specifies output image depth. Defualt is CV_32FC1 33 | @param dx Order of derivative x, default is 1 34 | @param dy Order of derivative y, default is 1 35 | @param ksize Sobel kernel size , default is 3 36 | @param out_dtype Converted format for output, default is CV_8UC1 37 | @param scale Optional scale value for derivative values, default is 1 38 | @param delta Optional bias added to output, default is 0 39 | @param borderType Pixel extrapolation method, default is BORDER_DEFAULT 40 | @see Sobel, threshold, getStructuringElement, morphologyEx.( for additional refinement) 41 | */ 42 | CV_WRAP static Ptr create(int ddepth = CV_32FC1, int dx=1, int dy=1, int ksize = 3, int out_dtype=CV_8UC1, double scale = 1, double delta = 0, int borderType = BORDER_DEFAULT); 43 | /** 44 | @brief Apply Ridge detection filter on input image. 45 | @param _img InputArray as supported by Sobel. img can be 1-Channel or 3-Channels. 46 | @param out OutputAray of structure as RidgeDetectionFilter::ddepth. Output image with ridges. 47 | */ 48 | CV_WRAP virtual void getRidgeFilteredImage(InputArray _img, OutputArray out) = 0; 49 | }; 50 | 51 | //! @} 52 | }} // namespace 53 | #endif 54 | -------------------------------------------------------------------------------- /opencv/include/opencv2/xphoto.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_XPHOTO_HPP__ 44 | #define __OPENCV_XPHOTO_HPP__ 45 | 46 | /** @defgroup xphoto Additional photo processing algorithms 47 | */ 48 | 49 | #include "xphoto/inpainting.hpp" 50 | #include "xphoto/white_balance.hpp" 51 | #include "xphoto/dct_image_denoising.hpp" 52 | #include "xphoto/bm3d_image_denoising.hpp" 53 | #include "xphoto/oilpainting.hpp" 54 | #include "xphoto/tonemap.hpp" 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /opencv/include/opencv2/xphoto/oilpainting.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | 6 | #ifndef __OPENCV_OIL_PAINTING_HPP__ 7 | #define __OPENCV_OIL_PAINTING_HPP__ 8 | 9 | #include 10 | #include 11 | 12 | namespace cv 13 | { 14 | namespace xphoto 15 | { 16 | 17 | //! @addtogroup xphoto 18 | //! @{ 19 | 20 | /** @brief oilPainting 21 | See the book @cite Holzmann1988 for details. 22 | @param src Input three-channel or one channel image (either CV_8UC3 or CV_8UC1) 23 | @param dst Output image of the same size and type as src. 24 | @param size neighbouring size is 2-size+1 25 | @param dynRatio image is divided by dynRatio before histogram processing 26 | @param code color space conversion code(see ColorConversionCodes). Histogram will used only first plane 27 | */ 28 | CV_EXPORTS_W void oilPainting(InputArray src, OutputArray dst, int size, int dynRatio, int code); 29 | /** @brief oilPainting 30 | See the book @cite Holzmann1988 for details. 31 | @param src Input three-channel or one channel image (either CV_8UC3 or CV_8UC1) 32 | @param dst Output image of the same size and type as src. 33 | @param size neighbouring size is 2-size+1 34 | @param dynRatio image is divided by dynRatio before histogram processing 35 | */ 36 | CV_EXPORTS_W void oilPainting(InputArray src, OutputArray dst, int size, int dynRatio); 37 | //! @} 38 | } 39 | } 40 | 41 | #endif // __OPENCV_OIL_PAINTING_HPP__ 42 | -------------------------------------------------------------------------------- /opencv/include/opencv2/xphoto/tonemap.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_XPHOTO_TONEMAP_HPP 6 | #define OPENCV_XPHOTO_TONEMAP_HPP 7 | 8 | #include "opencv2/photo.hpp" 9 | 10 | namespace cv { namespace xphoto { 11 | 12 | //! @addtogroup xphoto 13 | //! @{ 14 | 15 | /** @brief This algorithm decomposes image into two layers: base layer and detail layer using bilateral filter 16 | and compresses contrast of the base layer thus preserving all the details. 17 | 18 | This implementation uses regular bilateral filter from OpenCV. 19 | 20 | Saturation enhancement is possible as in cv::TonemapDrago. 21 | 22 | For more information see @cite DD02 . 23 | */ 24 | class CV_EXPORTS_W TonemapDurand : public Tonemap 25 | { 26 | public: 27 | 28 | CV_WRAP virtual float getSaturation() const = 0; 29 | CV_WRAP virtual void setSaturation(float saturation) = 0; 30 | 31 | CV_WRAP virtual float getContrast() const = 0; 32 | CV_WRAP virtual void setContrast(float contrast) = 0; 33 | 34 | CV_WRAP virtual float getSigmaSpace() const = 0; 35 | CV_WRAP virtual void setSigmaSpace(float sigma_space) = 0; 36 | 37 | CV_WRAP virtual float getSigmaColor() const = 0; 38 | CV_WRAP virtual void setSigmaColor(float sigma_color) = 0; 39 | }; 40 | 41 | /** @brief Creates TonemapDurand object 42 | 43 | You need to set the OPENCV_ENABLE_NONFREE option in cmake to use those. Use them at your own risk. 44 | 45 | @param gamma gamma value for gamma correction. See createTonemap 46 | @param contrast resulting contrast on logarithmic scale, i. e. log(max / min), where max and min 47 | are maximum and minimum luminance values of the resulting image. 48 | @param saturation saturation enhancement value. See createTonemapDrago 49 | @param sigma_color bilateral filter sigma in color space 50 | @param sigma_space bilateral filter sigma in coordinate space 51 | */ 52 | CV_EXPORTS_W Ptr 53 | createTonemapDurand(float gamma = 1.0f, float contrast = 4.0f, float saturation = 1.0f, float sigma_color = 2.0f, float sigma_space = 2.0f); 54 | 55 | }} // namespace 56 | #endif // OPENCV_XPHOTO_TONEMAP_HPP 57 | -------------------------------------------------------------------------------- /widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "RemoveBGConn.h" 9 | #include "ScaleAndMix.h" 10 | 11 | QT_BEGIN_NAMESPACE 12 | namespace Ui { class Widget; } 13 | QT_END_NAMESPACE 14 | 15 | class Widget : public QWidget 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | Widget(QWidget *parent = nullptr); 21 | ~Widget(); 22 | bool isFileNotDir; 23 | void postData(QString filepath, QString token); 24 | 25 | private slots: 26 | void on_inputBtn_clicked(); 27 | 28 | void on_outputBtn_clicked(); 29 | 30 | void on_pushButton_4_clicked(); 31 | 32 | void on_outputBtn_2_clicked(); 33 | 34 | void on_matBtn_clicked(); 35 | 36 | void on_stopBtn_clicked(); 37 | 38 | void on_inputEdit_textChanged(const QString &arg1); 39 | 40 | void solveReply(QByteArray picRaw, QString filePath); 41 | 42 | void solveMessage(QString msg); 43 | 44 | private: 45 | Ui::Widget *ui; 46 | RemoveBGConn *rmbg; 47 | ScaleAndMix *sm; 48 | QThread *thread = new QThread(); 49 | 50 | signals: 51 | void addTask(QString fileName, QString token, bool startFlag); 52 | void clearTasks(); 53 | void smallToBig(QString origin, QString target); 54 | }; 55 | #endif // WIDGET_H 56 | --------------------------------------------------------------------------------