├── .gitignore ├── .idea ├── gradle.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── app ├── .gitignore ├── CMakeLists.txt ├── FaceAlignment │ ├── CMakeLists.txt │ ├── include │ │ ├── cfan.h │ │ ├── common.h │ │ ├── face_alignment.h │ │ └── sift.h │ └── src │ │ ├── cfan.cpp │ │ ├── face_alignment.cpp │ │ └── sift.cpp ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ ├── lbpcascade_frontalface.xml │ └── seeta_fa_v1.1.bin │ ├── cpp │ ├── FaceAlignment │ │ ├── CMakeLists.txt │ │ ├── include │ │ │ ├── cfan.h │ │ │ ├── common.h │ │ │ ├── face_alignment.h │ │ │ └── sift.h │ │ └── src │ │ │ ├── cfan.cpp │ │ │ ├── face_alignment.cpp │ │ │ └── sift.cpp │ ├── FaceTrack.cpp │ ├── FaceTrack.h │ ├── LogUtils.h │ ├── include │ │ ├── opencv │ │ │ ├── cv.h │ │ │ ├── cv.hpp │ │ │ ├── cvaux.h │ │ │ ├── cvaux.hpp │ │ │ ├── cvwimage.h │ │ │ ├── cxcore.h │ │ │ ├── cxcore.hpp │ │ │ ├── cxeigen.hpp │ │ │ ├── cxmisc.h │ │ │ ├── highgui.h │ │ │ └── ml.h │ │ └── opencv2 │ │ │ ├── calib3d.hpp │ │ │ ├── calib3d │ │ │ ├── calib3d.hpp │ │ │ └── calib3d_c.h │ │ │ ├── core.hpp │ │ │ ├── core │ │ │ ├── affine.hpp │ │ │ ├── base.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 │ │ │ ├── directx.hpp │ │ │ ├── eigen.hpp │ │ │ ├── fast_math.hpp │ │ │ ├── hal │ │ │ │ ├── hal.hpp │ │ │ │ ├── interface.h │ │ │ │ ├── intrin.hpp │ │ │ │ ├── intrin_avx.hpp │ │ │ │ ├── intrin_cpp.hpp │ │ │ │ ├── intrin_neon.hpp │ │ │ │ ├── intrin_sse.hpp │ │ │ │ └── intrin_vsx.hpp │ │ │ ├── ippasync.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 │ │ │ ├── ptr.inl.hpp │ │ │ ├── saturate.hpp │ │ │ ├── softfloat.hpp │ │ │ ├── sse_utils.hpp │ │ │ ├── traits.hpp │ │ │ ├── types.hpp │ │ │ ├── types_c.h │ │ │ ├── utility.hpp │ │ │ ├── utils │ │ │ │ ├── filesystem.hpp │ │ │ │ ├── logger.defines.hpp │ │ │ │ ├── logger.hpp │ │ │ │ └── trace.hpp │ │ │ ├── va_intel.hpp │ │ │ ├── version.hpp │ │ │ ├── vsx_utils.hpp │ │ │ └── wimage.hpp │ │ │ ├── cvconfig.h │ │ │ ├── dnn.hpp │ │ │ ├── dnn │ │ │ ├── all_layers.hpp │ │ │ ├── dict.hpp │ │ │ ├── dnn.hpp │ │ │ ├── dnn.inl.hpp │ │ │ ├── layer.details.hpp │ │ │ ├── layer.hpp │ │ │ └── shape_utils.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 │ │ │ ├── highgui.hpp │ │ │ ├── highgui │ │ │ ├── highgui.hpp │ │ │ └── highgui_c.h │ │ │ ├── imgcodecs.hpp │ │ │ ├── imgcodecs │ │ │ ├── imgcodecs.hpp │ │ │ ├── imgcodecs_c.h │ │ │ └── ios.h │ │ │ ├── imgproc.hpp │ │ │ ├── imgproc │ │ │ ├── detail │ │ │ │ └── distortion_model.hpp │ │ │ ├── hal │ │ │ │ ├── hal.hpp │ │ │ │ └── interface.h │ │ │ ├── imgproc.hpp │ │ │ ├── imgproc_c.h │ │ │ └── types_c.h │ │ │ ├── ml.hpp │ │ │ ├── ml │ │ │ ├── ml.hpp │ │ │ └── ml.inl.hpp │ │ │ ├── objdetect.hpp │ │ │ ├── objdetect │ │ │ ├── detection_based_tracker.hpp │ │ │ ├── objdetect.hpp │ │ │ └── objdetect_c.h │ │ │ ├── opencv.hpp │ │ │ ├── opencv_modules.hpp │ │ │ ├── photo.hpp │ │ │ ├── photo │ │ │ ├── cuda.hpp │ │ │ ├── photo.hpp │ │ │ └── photo_c.h │ │ │ ├── shape.hpp │ │ │ ├── shape │ │ │ ├── emdL1.hpp │ │ │ ├── hist_cost.hpp │ │ │ ├── shape.hpp │ │ │ ├── shape_distance.hpp │ │ │ └── shape_transformer.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 │ │ │ ├── superres.hpp │ │ │ ├── superres │ │ │ └── optical_flow.hpp │ │ │ ├── video.hpp │ │ │ ├── video │ │ │ ├── background_segm.hpp │ │ │ ├── tracking.hpp │ │ │ ├── tracking_c.h │ │ │ └── video.hpp │ │ │ ├── videoio.hpp │ │ │ ├── videoio │ │ │ ├── cap_ios.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 │ └── native-lib.cpp │ ├── java │ └── com │ │ └── yeliang │ │ ├── MainActivity.java │ │ ├── face │ │ ├── Face.java │ │ └── FaceTrack.java │ │ ├── filter │ │ ├── BaseFilter.java │ │ ├── BaseFrameFilter.java │ │ ├── BeautyFilter.java │ │ ├── BigEyeFilter.java │ │ ├── CameraFilter.java │ │ ├── ScreenFilter.java │ │ └── StickFilter.java │ │ ├── record │ │ ├── EGLBase.java │ │ └── MediaRecorder.java │ │ ├── utils │ │ ├── CameraHelper.java │ │ ├── FileUtils.java │ │ └── OpenGlUtils.java │ │ └── widget │ │ ├── CommonRender.java │ │ └── CommonSurfaceView.java │ ├── jniLibs │ └── armeabi-v7a │ │ └── libopencv_java3.so │ └── res │ ├── drawable-v24 │ └── ic_launcher_foreground.xml │ ├── drawable │ ├── bg_btn_circle_green.xml │ ├── bg_btn_circle_red.xml │ ├── ic_launcher_background.xml │ └── stick_ear.png │ ├── layout │ └── activity_main.xml │ ├── mipmap-anydpi-v26 │ ├── ic_launcher.xml │ └── ic_launcher_round.xml │ ├── mipmap-hdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── raw │ ├── beauty_frag.glsl │ ├── bigeye_frag.glsl │ ├── camera_frag.frag │ ├── camera_vertex.vert │ ├── screen_frag.glsl │ └── screen_vertex.glsl │ └── values │ ├── colors.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 26 | 27 | 28 | 29 | 30 | 31 | 33 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.4.1) 2 | 3 | add_library( 4 | native-lib 5 | 6 | SHARED 7 | 8 | src/main/cpp/native-lib.cpp 9 | src/main/cpp/FaceTrack.cpp) 10 | 11 | include_directories(src/main/cpp/include) 12 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}" ) 13 | 14 | add_subdirectory(src/main/cpp/FaceAlignment) 15 | 16 | include_directories(src/main/cpp/FaceAlignment/include) 17 | 18 | target_link_libraries( 19 | native-lib 20 | opencv_java3 21 | seeta_fa_lib 22 | log ) -------------------------------------------------------------------------------- /app/FaceAlignment/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") 2 | 3 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2") 4 | 5 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1") 6 | 7 | include_directories(include) 8 | set(src_files 9 | src/cfan.cpp 10 | src/face_alignment.cpp 11 | src/sift.cpp 12 | ) 13 | 14 | add_library(seeta_fa_lib STATIC ${src_files}) 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/FaceAlignment/include/common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This file is part of the open-source SeetaFace engine, which includes three modules: 4 | * SeetaFace Detection, SeetaFace Alignment, and SeetaFace Identification. 5 | * 6 | * This file is part of the SeetaFace Alignment module, containing codes implementing the 7 | * facial landmarks location method described in the following paper: 8 | * 9 | * 10 | * Coarse-to-Fine Auto-Encoder Networks (CFAN) for Real-Time Face Alignment, 11 | * Jie Zhang, Shiguang Shan, Meina Kan, Xilin Chen. In Proceeding of the 12 | * European Conference on Computer Vision (ECCV), 2014 13 | * 14 | * 15 | * Copyright (C) 2016, Visual Information Processing and Learning (VIPL) group, 16 | * Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China. 17 | * 18 | * The codes are mainly developed by Jie Zhang (a Ph.D supervised by Prof. Shiguang Shan) 19 | * 20 | * As an open-source face recognition engine: you can redistribute SeetaFace source codes 21 | * and/or modify it under the terms of the BSD 2-Clause License. 22 | * 23 | * You should have received a copy of the BSD 2-Clause License along with the software. 24 | * If not, see < https://opensource.org/licenses/BSD-2-Clause>. 25 | * 26 | * Contact Info: you can send an email to SeetaFace@vipl.ict.ac.cn for any problems. 27 | * 28 | * Note: the above information must be kept whenever or wherever the codes are used. 29 | * 30 | */ 31 | 32 | #ifndef SEETA_COMMON_H_ 33 | #define SEETA_COMMON_H_ 34 | 35 | #include 36 | 37 | #if defined (_MSC_VER) || defined (_WIN32) || defined (_WIN64) 38 | #ifdef SEETA_EXPORTS 39 | #define SEETA_API __declspec(dllexport) 40 | #else 41 | #define SEETA_API __declspec(dllimport) 42 | #endif // SEETA_API 43 | #else // defined (windows) 44 | #define SEETA_API 45 | #endif 46 | 47 | #define DISABLE_COPY_AND_ASSIGN(classname) \ 48 | private: \ 49 | classname(const classname&); \ 50 | classname& operator=(const classname&) 51 | 52 | #ifdef USE_OPENMP 53 | #include 54 | 55 | #define SEETA_NUM_THREADS 4 56 | #endif 57 | 58 | namespace seeta { 59 | 60 | typedef struct ImageData { 61 | ImageData() { 62 | data = nullptr; 63 | width = 0; 64 | height = 0; 65 | num_channels = 0; 66 | } 67 | 68 | ImageData(int32_t img_width, int32_t img_height, 69 | int32_t img_num_channels = 1) { 70 | data = nullptr; 71 | width = img_width; 72 | height = img_height; 73 | num_channels = img_num_channels; 74 | } 75 | 76 | uint8_t* data; 77 | int32_t width; 78 | int32_t height; 79 | int32_t num_channels; 80 | } ImageData; 81 | 82 | typedef struct Rect { 83 | int32_t x; 84 | int32_t y; 85 | int32_t width; 86 | int32_t height; 87 | } Rect; 88 | 89 | typedef struct FaceInfo { 90 | seeta::Rect bbox; 91 | 92 | double roll; 93 | double pitch; 94 | double yaw; 95 | 96 | double score; /**< Larger score should mean higher confidence. */ 97 | } FaceInfo; 98 | 99 | typedef struct { 100 | double x; 101 | double y; 102 | } FacialLandmark; 103 | } // namespace seeta 104 | 105 | #endif // SEETA_COMMON_H_ 106 | 107 | -------------------------------------------------------------------------------- /app/FaceAlignment/include/face_alignment.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This file is part of the open-source SeetaFace engine, which includes three modules: 4 | * SeetaFace Detection, SeetaFace Alignment, and SeetaFace Identification. 5 | * 6 | * This file is part of the SeetaFace Alignment module, containing codes implementing the 7 | * facial landmarks location method described in the following paper: 8 | * 9 | * 10 | * Coarse-to-Fine Auto-Encoder Networks (CFAN) for Real-Time Face Alignment, 11 | * Jie Zhang, Shiguang Shan, Meina Kan, Xilin Chen. In Proceeding of the 12 | * European Conference on Computer Vision (ECCV), 2014 13 | * 14 | * 15 | * Copyright (C) 2016, Visual Information Processing and Learning (VIPL) group, 16 | * Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China. 17 | * 18 | * The codes are mainly developed by Jie Zhang (a Ph.D supervised by Prof. Shiguang Shan) 19 | * 20 | * As an open-source face recognition engine: you can redistribute SeetaFace source codes 21 | * and/or modify it under the terms of the BSD 2-Clause License. 22 | * 23 | * You should have received a copy of the BSD 2-Clause License along with the software. 24 | * If not, see < https://opensource.org/licenses/BSD-2-Clause>. 25 | * 26 | * Contact Info: you can send an email to SeetaFace@vipl.ict.ac.cn for any problems. 27 | * 28 | * Note: the above information must be kept whenever or wherever the codes are used. 29 | * 30 | */ 31 | 32 | #ifndef SEETA_FACE_ALIGNMENT_H_ 33 | #define SEETA_FACE_ALIGNMENT_H_ 34 | 35 | #include 36 | #include "common.h" 37 | class CCFAN; 38 | 39 | namespace seeta { 40 | class FaceAlignment{ 41 | public: 42 | /** A constructor with an optional argument specifying path of the model file. 43 | * If called with no argument, the model file is assumed to be stored in the 44 | * the working directory as "seeta_fa_v1.1.bin". 45 | * 46 | * @param model_path Path of the model file, either absolute or relative to 47 | * the working directory. 48 | */ 49 | SEETA_API FaceAlignment(const char* model_path = NULL); 50 | 51 | /** A Destructor which should never be called explicitly. 52 | * Release all dynamically allocated resources. 53 | */ 54 | SEETA_API ~FaceAlignment(); 55 | 56 | /** Detect five facial landmarks, i.e., two eye centers, nose tip and two mouth corners. 57 | * @param gray_im A grayscale image 58 | * @param face_info The face bounding box 59 | * @param[out] points The locations of detected facial points 60 | */ 61 | SEETA_API bool PointDetectLandmarks(ImageData gray_im, FaceInfo face_info, FacialLandmark *points); 62 | 63 | private: 64 | CCFAN *facial_detector; 65 | }; 66 | } // namespace seeta 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /app/FaceAlignment/src/face_alignment.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This file is part of the open-source SeetaFace engine, which includes three modules: 4 | * SeetaFace Detection, SeetaFace Alignment, and SeetaFace Identification. 5 | * 6 | * This file is part of the SeetaFace Alignment module, containing codes implementing the 7 | * facial landmarks location method described in the following paper: 8 | * 9 | * 10 | * Coarse-to-Fine Auto-Encoder Networks (CFAN) for Real-Time Face Alignment, 11 | * Jie Zhang, Shiguang Shan, Meina Kan, Xilin Chen. In Proceeding of the 12 | * European Conference on Computer Vision (ECCV), 2014 13 | * 14 | * 15 | * Copyright (C) 2016, Visual Information Processing and Learning (VIPL) group, 16 | * Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China. 17 | * 18 | * The codes are mainly developed by Jie Zhang (a Ph.D supervised by Prof. Shiguang Shan) 19 | * 20 | * As an open-source face recognition engine: you can redistribute SeetaFace source codes 21 | * and/or modify it under the terms of the BSD 2-Clause License. 22 | * 23 | * You should have received a copy of the BSD 2-Clause License along with the software. 24 | * If not, see < https://opensource.org/licenses/BSD-2-Clause>. 25 | * 26 | * Contact Info: you can send an email to SeetaFace@vipl.ict.ac.cn for any problems. 27 | * 28 | * Note: the above information must be kept whenever or wherever the codes are used. 29 | * 30 | */ 31 | 32 | #include "face_alignment.h" 33 | 34 | #include 35 | #include 36 | #include "cfan.h" 37 | 38 | namespace seeta { 39 | /** A constructor with an optional argument specifying path of the model file. 40 | * If called with no argument, the model file is assumed to be stored in the 41 | * the working directory as "seeta_fa_v1.1.bin". 42 | * 43 | * @param model_path Path of the model file, either absolute or relative to 44 | * the working directory. 45 | */ 46 | FaceAlignment::FaceAlignment(const char * model_path){ 47 | facial_detector = new CCFAN(); 48 | if (model_path == NULL) 49 | model_path = "seeta_fa_v1.1.bin"; 50 | facial_detector->InitModel(model_path); 51 | } 52 | 53 | /** Detect five facial landmarks, i.e., two eye centers, nose tip and two mouth corners. 54 | * @param gray_im A grayscale image 55 | * @param face_info The face bounding box 56 | * @param[out] points The locations of detected facial points 57 | */ 58 | bool FaceAlignment::PointDetectLandmarks(ImageData gray_im, FaceInfo face_info, FacialLandmark *points) 59 | { 60 | if (gray_im.num_channels != 1) { 61 | return false; 62 | } 63 | int pts_num = 5; 64 | float *facial_loc = new float[pts_num * 2]; 65 | facial_detector->FacialPointLocate(gray_im.data, gray_im.width, gray_im.height, face_info, facial_loc); 66 | 67 | for (int i = 0; i < pts_num; i++) { 68 | points[i].x = facial_loc[i * 2]; 69 | points[i].y = facial_loc[i * 2 + 1]; 70 | } 71 | 72 | delete[]facial_loc; 73 | return true; 74 | } 75 | 76 | /** A Destructor which should never be called explicitly. 77 | * Release all dynamically allocated resources. 78 | */ 79 | FaceAlignment::~FaceAlignment() { 80 | if (facial_detector != NULL) { 81 | delete facial_detector; 82 | facial_detector = NULL; 83 | } 84 | } 85 | } // namespace seeta 86 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 26 5 | defaultConfig { 6 | applicationId "com.yeliang" 7 | minSdkVersion 21 8 | targetSdkVersion 26 9 | versionCode 1 10 | versionName "1.0" 11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 12 | externalNativeBuild { 13 | cmake { 14 | arguments "-DANDROID_STL=gnustl_static" 15 | cppFlags "-std=c++11" 16 | abiFilters "armeabi-v7a" 17 | } 18 | 19 | } 20 | } 21 | buildTypes { 22 | release { 23 | postprocessing { 24 | removeUnusedCode false 25 | removeUnusedResources false 26 | obfuscate false 27 | optimizeCode false 28 | proguardFile 'proguard-rules.pro' 29 | } 30 | } 31 | } 32 | externalNativeBuild { 33 | cmake { 34 | path "CMakeLists.txt" 35 | } 36 | } 37 | } 38 | 39 | dependencies { 40 | implementation fileTree(dir: 'libs', include: ['*.jar']) 41 | implementation 'com.android.support:appcompat-v7:26.1.0' 42 | implementation 'com.android.support.constraint:constraint-layout:1.1.3' 43 | } 44 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/assets/seeta_fa_v1.1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrYeLiang/Android-OpenGL-Filter/76774c74e81d056f50deae059ef1d38f3ffe9502/app/src/main/assets/seeta_fa_v1.1.bin -------------------------------------------------------------------------------- /app/src/main/cpp/FaceAlignment/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") 2 | 3 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2") 4 | 5 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1") 6 | 7 | include_directories(include) 8 | set(src_files 9 | src/cfan.cpp 10 | src/face_alignment.cpp 11 | src/sift.cpp 12 | ) 13 | 14 | add_library(seeta_fa_lib STATIC ${src_files}) 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/cpp/FaceAlignment/include/common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This file is part of the open-source SeetaFace engine, which includes three modules: 4 | * SeetaFace Detection, SeetaFace Alignment, and SeetaFace Identification. 5 | * 6 | * This file is part of the SeetaFace Alignment module, containing codes implementing the 7 | * facial landmarks location method described in the following paper: 8 | * 9 | * 10 | * Coarse-to-Fine Auto-Encoder Networks (CFAN) for Real-Time Face Alignment, 11 | * Jie Zhang, Shiguang Shan, Meina Kan, Xilin Chen. In Proceeding of the 12 | * European Conference on Computer Vision (ECCV), 2014 13 | * 14 | * 15 | * Copyright (C) 2016, Visual Information Processing and Learning (VIPL) group, 16 | * Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China. 17 | * 18 | * The codes are mainly developed by Jie Zhang (a Ph.D supervised by Prof. Shiguang Shan) 19 | * 20 | * As an open-source face recognition engine: you can redistribute SeetaFace source codes 21 | * and/or modify it under the terms of the BSD 2-Clause License. 22 | * 23 | * You should have received a copy of the BSD 2-Clause License along with the software. 24 | * If not, see < https://opensource.org/licenses/BSD-2-Clause>. 25 | * 26 | * Contact Info: you can send an email to SeetaFace@vipl.ict.ac.cn for any problems. 27 | * 28 | * Note: the above information must be kept whenever or wherever the codes are used. 29 | * 30 | */ 31 | 32 | #ifndef SEETA_COMMON_H_ 33 | #define SEETA_COMMON_H_ 34 | 35 | #include 36 | 37 | #if defined (_MSC_VER) || defined (_WIN32) || defined (_WIN64) 38 | #ifdef SEETA_EXPORTS 39 | #define SEETA_API __declspec(dllexport) 40 | #else 41 | #define SEETA_API __declspec(dllimport) 42 | #endif // SEETA_API 43 | #else // defined (windows) 44 | #define SEETA_API 45 | #endif 46 | 47 | #define DISABLE_COPY_AND_ASSIGN(classname) \ 48 | private: \ 49 | classname(const classname&); \ 50 | classname& operator=(const classname&) 51 | 52 | #ifdef USE_OPENMP 53 | #include 54 | 55 | #define SEETA_NUM_THREADS 4 56 | #endif 57 | 58 | namespace seeta { 59 | 60 | typedef struct ImageData { 61 | ImageData() { 62 | data = nullptr; 63 | width = 0; 64 | height = 0; 65 | num_channels = 0; 66 | } 67 | 68 | ImageData(int32_t img_width, int32_t img_height, 69 | int32_t img_num_channels = 1) { 70 | data = nullptr; 71 | width = img_width; 72 | height = img_height; 73 | num_channels = img_num_channels; 74 | } 75 | 76 | uint8_t* data; 77 | int32_t width; 78 | int32_t height; 79 | int32_t num_channels; 80 | } ImageData; 81 | 82 | typedef struct Rect { 83 | int32_t x; 84 | int32_t y; 85 | int32_t width; 86 | int32_t height; 87 | } Rect; 88 | 89 | typedef struct FaceInfo { 90 | seeta::Rect bbox; 91 | 92 | double roll; 93 | double pitch; 94 | double yaw; 95 | 96 | double score; /**< Larger score should mean higher confidence. */ 97 | } FaceInfo; 98 | 99 | typedef struct { 100 | double x; 101 | double y; 102 | } FacialLandmark; 103 | } // namespace seeta 104 | 105 | #endif // SEETA_COMMON_H_ 106 | 107 | -------------------------------------------------------------------------------- /app/src/main/cpp/FaceAlignment/include/face_alignment.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This file is part of the open-source SeetaFace engine, which includes three modules: 4 | * SeetaFace Detection, SeetaFace Alignment, and SeetaFace Identification. 5 | * 6 | * This file is part of the SeetaFace Alignment module, containing codes implementing the 7 | * facial landmarks location method described in the following paper: 8 | * 9 | * 10 | * Coarse-to-Fine Auto-Encoder Networks (CFAN) for Real-Time Face Alignment, 11 | * Jie Zhang, Shiguang Shan, Meina Kan, Xilin Chen. In Proceeding of the 12 | * European Conference on Computer Vision (ECCV), 2014 13 | * 14 | * 15 | * Copyright (C) 2016, Visual Information Processing and Learning (VIPL) group, 16 | * Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China. 17 | * 18 | * The codes are mainly developed by Jie Zhang (a Ph.D supervised by Prof. Shiguang Shan) 19 | * 20 | * As an open-source face recognition engine: you can redistribute SeetaFace source codes 21 | * and/or modify it under the terms of the BSD 2-Clause License. 22 | * 23 | * You should have received a copy of the BSD 2-Clause License along with the software. 24 | * If not, see < https://opensource.org/licenses/BSD-2-Clause>. 25 | * 26 | * Contact Info: you can send an email to SeetaFace@vipl.ict.ac.cn for any problems. 27 | * 28 | * Note: the above information must be kept whenever or wherever the codes are used. 29 | * 30 | */ 31 | 32 | #ifndef SEETA_FACE_ALIGNMENT_H_ 33 | #define SEETA_FACE_ALIGNMENT_H_ 34 | 35 | #include 36 | #include "common.h" 37 | class CCFAN; 38 | 39 | namespace seeta { 40 | class FaceAlignment{ 41 | public: 42 | /** A constructor with an optional argument specifying path of the model file. 43 | * If called with no argument, the model file is assumed to be stored in the 44 | * the working directory as "seeta_fa_v1.1.bin". 45 | * 46 | * @param model_path Path of the model file, either absolute or relative to 47 | * the working directory. 48 | */ 49 | SEETA_API FaceAlignment(const char* model_path = NULL); 50 | 51 | /** A Destructor which should never be called explicitly. 52 | * Release all dynamically allocated resources. 53 | */ 54 | SEETA_API ~FaceAlignment(); 55 | 56 | /** Detect five facial landmarks, i.e., two eye centers, nose tip and two mouth corners. 57 | * @param gray_im A grayscale image 58 | * @param face_info The face bounding box 59 | * @param[out] points The locations of detected facial points 60 | */ 61 | SEETA_API bool PointDetectLandmarks(ImageData gray_im, FaceInfo face_info, FacialLandmark *points); 62 | 63 | private: 64 | CCFAN *facial_detector; 65 | }; 66 | } // namespace seeta 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /app/src/main/cpp/FaceAlignment/src/face_alignment.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This file is part of the open-source SeetaFace engine, which includes three modules: 4 | * SeetaFace Detection, SeetaFace Alignment, and SeetaFace Identification. 5 | * 6 | * This file is part of the SeetaFace Alignment module, containing codes implementing the 7 | * facial landmarks location method described in the following paper: 8 | * 9 | * 10 | * Coarse-to-Fine Auto-Encoder Networks (CFAN) for Real-Time Face Alignment, 11 | * Jie Zhang, Shiguang Shan, Meina Kan, Xilin Chen. In Proceeding of the 12 | * European Conference on Computer Vision (ECCV), 2014 13 | * 14 | * 15 | * Copyright (C) 2016, Visual Information Processing and Learning (VIPL) group, 16 | * Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China. 17 | * 18 | * The codes are mainly developed by Jie Zhang (a Ph.D supervised by Prof. Shiguang Shan) 19 | * 20 | * As an open-source face recognition engine: you can redistribute SeetaFace source codes 21 | * and/or modify it under the terms of the BSD 2-Clause License. 22 | * 23 | * You should have received a copy of the BSD 2-Clause License along with the software. 24 | * If not, see < https://opensource.org/licenses/BSD-2-Clause>. 25 | * 26 | * Contact Info: you can send an email to SeetaFace@vipl.ict.ac.cn for any problems. 27 | * 28 | * Note: the above information must be kept whenever or wherever the codes are used. 29 | * 30 | */ 31 | 32 | #include "face_alignment.h" 33 | 34 | #include 35 | #include 36 | #include "cfan.h" 37 | 38 | namespace seeta { 39 | /** A constructor with an optional argument specifying path of the model file. 40 | * If called with no argument, the model file is assumed to be stored in the 41 | * the working directory as "seeta_fa_v1.1.bin". 42 | * 43 | * @param model_path Path of the model file, either absolute or relative to 44 | * the working directory. 45 | */ 46 | FaceAlignment::FaceAlignment(const char * model_path){ 47 | facial_detector = new CCFAN(); 48 | if (model_path == NULL) 49 | model_path = "seeta_fa_v1.1.bin"; 50 | facial_detector->InitModel(model_path); 51 | } 52 | 53 | /** Detect five facial landmarks, i.e., two eye centers, nose tip and two mouth corners. 54 | * @param gray_im A grayscale image 55 | * @param face_info The face bounding box 56 | * @param[out] points The locations of detected facial points 57 | */ 58 | bool FaceAlignment::PointDetectLandmarks(ImageData gray_im, FaceInfo face_info, FacialLandmark *points) 59 | { 60 | if (gray_im.num_channels != 1) { 61 | return false; 62 | } 63 | int pts_num = 5; 64 | float *facial_loc = new float[pts_num * 2]; 65 | facial_detector->FacialPointLocate(gray_im.data, gray_im.width, gray_im.height, face_info, facial_loc); 66 | 67 | for (int i = 0; i < pts_num; i++) { 68 | points[i].x = facial_loc[i * 2]; 69 | points[i].y = facial_loc[i * 2 + 1]; 70 | } 71 | 72 | delete[]facial_loc; 73 | return true; 74 | } 75 | 76 | /** A Destructor which should never be called explicitly. 77 | * Release all dynamically allocated resources. 78 | */ 79 | FaceAlignment::~FaceAlignment() { 80 | if (facial_detector != NULL) { 81 | delete facial_detector; 82 | facial_detector = NULL; 83 | } 84 | } 85 | } // namespace seeta 86 | -------------------------------------------------------------------------------- /app/src/main/cpp/FaceTrack.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 叶亮 on 2020/1/16. 3 | // 4 | 5 | #include "FaceTrack.h" 6 | 7 | 8 | FaceTrack::FaceTrack(const char *model, const char *seeta) { 9 | Ptr mainDetector = makePtr(makePtr(model)); 10 | Ptr trackingDetector = makePtr(makePtr(model)); 11 | DetectionBasedTracker::Parameters detectorParams; 12 | 13 | //追踪器 14 | tracker = makePtr(mainDetector, trackingDetector, detectorParams); 15 | 16 | faceAlignment = makePtr(seeta); 17 | } 18 | 19 | //开启追踪器 20 | void FaceTrack::startTracking() { 21 | tracker->run(); 22 | } 23 | 24 | //关闭追踪器 25 | void FaceTrack::stopTracking() { 26 | tracker->stop(); 27 | } 28 | 29 | void FaceTrack::detector(Mat src, vector &rects) { 30 | vector faces; 31 | 32 | tracker->process(src); 33 | tracker->getObjects(faces); 34 | 35 | if(faces.size()){ 36 | Rect face = faces[0]; 37 | rects.push_back(Rect2f(face.x, face.y, face.width, face.height)); 38 | 39 | //关键点定位 40 | //保存5个关键点坐标 41 | //0:左眼 1:右眼 2:鼻头 3:嘴巴左 4:嘴巴右 42 | seeta::FacialLandmark points[5]; 43 | 44 | //图像数据 45 | seeta::ImageData image_data(src.cols, src.rows); 46 | image_data.data = src.data; 47 | 48 | //指定人脸部位 49 | seeta::FaceInfo faceInfo; 50 | seeta::Rect bbox; 51 | 52 | bbox.x = face.x; 53 | bbox.y = face.y; 54 | bbox.width = face.width; 55 | bbox.height = face.height; 56 | faceInfo.bbox = bbox; 57 | 58 | faceAlignment->PointDetectLandmarks(image_data,faceInfo, points); 59 | 60 | for(int i =0; i<5; ++i){ 61 | rects.push_back(Rect2f(points[i].x, points[i].y, 0, 0)); 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /app/src/main/cpp/FaceTrack.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by 叶亮 on 2020/1/16. 3 | // 4 | 5 | #ifndef ANDROID_OPENGL_FILTER_FACETRACK_H 6 | #define ANDROID_OPENGL_FILTER_FACETRACK_H 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | using namespace std; 14 | using namespace cv; 15 | 16 | class CascadeDetectorAdapter : public DetectionBasedTracker :: IDetector{ 17 | public: 18 | CascadeDetectorAdapter(Ptr detector):IDetector(),Detector(detector){ 19 | CV_Assert(detector); 20 | } 21 | 22 | void detect(const cv::Mat & Image, std::vector &objects){ 23 | Detector->detectMultiScale(Image, objects, scaleFactor, minNeighbours, 0 ,minObjSize, maxObjSize); 24 | } 25 | 26 | virtual ~CascadeDetectorAdapter(){} 27 | 28 | private: 29 | CascadeDetectorAdapter(); 30 | Ptr Detector; 31 | }; 32 | 33 | class FaceTrack { 34 | public: 35 | FaceTrack(const char * model, const char * seeta); 36 | 37 | void detector(Mat src, vector &rects); 38 | 39 | void startTracking(); 40 | 41 | void stopTracking(); 42 | 43 | private: 44 | Ptr tracker; 45 | Ptr faceAlignment; 46 | }; 47 | 48 | 49 | #endif //ANDROID_OPENGL_FILTER_FACETRACK_H 50 | -------------------------------------------------------------------------------- /app/src/main/cpp/LogUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Tom on 2020/1/30. 3 | // 4 | 5 | #ifndef ANDROID_OPENGL_FILTER_LOGUTILS_H 6 | #define ANDROID_OPENGL_FILTER_LOGUTILS_H 7 | 8 | #ifdef ANDROID 9 | 10 | #include 11 | #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, "filter", __VA_ARGS__) 12 | 13 | 14 | #else 15 | #define LOGD(...) printf("filter", __VA_ARGS_) 16 | 17 | #endif 18 | 19 | #endif //ANDROID_OPENGL_FILTER_LOGUTILS_H 20 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/opencv/cv.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_OLD_CV_HPP 44 | #define OPENCV_OLD_CV_HPP 45 | 46 | //#if defined(__GNUC__) 47 | //#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module" 48 | //#endif 49 | 50 | #include "cv.h" 51 | #include "opencv2/core.hpp" 52 | #include "opencv2/imgproc.hpp" 53 | #include "opencv2/photo.hpp" 54 | #include "opencv2/video.hpp" 55 | #include "opencv2/highgui.hpp" 56 | #include "opencv2/features2d.hpp" 57 | #include "opencv2/calib3d.hpp" 58 | #include "opencv2/objdetect.hpp" 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/opencv/cvaux.h: -------------------------------------------------------------------------------- 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 | // Intel License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000, Intel Corporation, 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 Intel Corporation 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_OLD_AUX_H 43 | #define OPENCV_OLD_AUX_H 44 | 45 | //#if defined(__GNUC__) 46 | //#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module" 47 | //#endif 48 | 49 | #include "opencv2/core/core_c.h" 50 | #include "opencv2/imgproc/imgproc_c.h" 51 | #include "opencv2/photo/photo_c.h" 52 | #include "opencv2/video/tracking_c.h" 53 | #include "opencv2/objdetect/objdetect_c.h" 54 | 55 | #endif 56 | 57 | /* End of file. */ 58 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/opencv/cvaux.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 | // Intel License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000, Intel Corporation, 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 Intel Corporation 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_OLD_AUX_HPP 43 | #define OPENCV_OLD_AUX_HPP 44 | 45 | //#if defined(__GNUC__) 46 | //#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module" 47 | //#endif 48 | 49 | #include "cvaux.h" 50 | #include "opencv2/core/utility.hpp" 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/opencv/cvwimage.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 3 | // 4 | // By downloading, copying, installing or using the software you agree to 5 | // this license. If you do not agree to this license, do not download, 6 | // install, copy or use the software. 7 | // 8 | // License Agreement 9 | // For Open Source Computer Vision Library 10 | // 11 | // Copyright (C) 2008, Google, all rights reserved. 12 | // Third party copyrights are property of their respective owners. 13 | // 14 | // Redistribution and use in source and binary forms, with or without 15 | // modification, are permitted provided that the following conditions are met: 16 | // 17 | // * Redistribution's of source code must retain the above copyright notice, 18 | // this list of conditions and the following disclaimer. 19 | // 20 | // * Redistribution's in binary form must reproduce the above copyright notice, 21 | // this list of conditions and the following disclaimer in the documentation 22 | // and/or other materials provided with the distribution. 23 | // 24 | // * The name of Intel Corporation or contributors may not be used to endorse 25 | // or promote products derived from this software without specific 26 | // prior written permission. 27 | // 28 | // This software is provided by the copyright holders and contributors "as is" 29 | // and any express or implied warranties, including, but not limited to, the 30 | // implied warranties of merchantability and fitness for a particular purpose 31 | // are disclaimed. In no event shall the Intel Corporation or contributors be 32 | // liable for any direct, indirect, incidental, special, exemplary, or 33 | // 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 | 41 | #ifndef OPENCV_OLD_WIMAGE_HPP 42 | #define OPENCV_OLD_WIMAGE_HPP 43 | 44 | #include "opencv2/core/wimage.hpp" 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/opencv/cxcore.h: -------------------------------------------------------------------------------- 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_OLD_CXCORE_H 44 | #define OPENCV_OLD_CXCORE_H 45 | 46 | //#if defined(__GNUC__) 47 | //#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module" 48 | //#endif 49 | 50 | #include "opencv2/core/core_c.h" 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/opencv/cxcore.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_OLD_CXCORE_HPP 44 | #define OPENCV_OLD_CXCORE_HPP 45 | 46 | //#if defined(__GNUC__) 47 | //#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module" 48 | //#endif 49 | 50 | #include "cxcore.h" 51 | #include "opencv2/core.hpp" 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/opencv/cxeigen.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_OLD_EIGEN_HPP 44 | #define OPENCV_OLD_EIGEN_HPP 45 | 46 | #include "opencv2/core/eigen.hpp" 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/opencv/cxmisc.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENCV_OLD_CXMISC_H 2 | #define OPENCV_OLD_CXMISC_H 3 | 4 | #ifdef __cplusplus 5 | # include "opencv2/core/utility.hpp" 6 | #endif 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/opencv/highgui.h: -------------------------------------------------------------------------------- 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 | // Intel License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000, Intel Corporation, 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 Intel Corporation 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_OLD_HIGHGUI_H 43 | #define OPENCV_OLD_HIGHGUI_H 44 | 45 | #include "opencv2/core/core_c.h" 46 | #include "opencv2/highgui/highgui_c.h" 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/opencv/ml.h: -------------------------------------------------------------------------------- 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 | // Intel License Agreement 11 | // 12 | // Copyright (C) 2000, Intel Corporation, all rights reserved. 13 | // Third party copyrights are property of their respective owners. 14 | // 15 | // Redistribution and use in source and binary forms, with or without modification, 16 | // are permitted provided that the following conditions are met: 17 | // 18 | // * Redistribution's of source code must retain the above copyright notice, 19 | // this list of conditions and the following disclaimer. 20 | // 21 | // * Redistribution's in binary form must reproduce the above copyright notice, 22 | // this list of conditions and the following disclaimer in the documentation 23 | // and/or other materials provided with the distribution. 24 | // 25 | // * The name of Intel Corporation may not be used to endorse or promote products 26 | // derived from this software without specific prior written permission. 27 | // 28 | // This software is provided by the copyright holders and contributors "as is" and 29 | // any express or implied warranties, including, but not limited to, the implied 30 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 31 | // In no event shall the Intel Corporation or contributors be liable for any direct, 32 | // indirect, incidental, special, exemplary, or consequential damages 33 | // (including, but not limited to, procurement of substitute goods or services; 34 | // loss of use, data, or profits; or business interruption) however caused 35 | // and on any theory of liability, whether in contract, strict liability, 36 | // or tort (including negligence or otherwise) arising in any way out of 37 | // the use of this software, even if advised of the possibility of such damage. 38 | // 39 | //M*/ 40 | 41 | #ifndef OPENCV_OLD_ML_H 42 | #define OPENCV_OLD_ML_H 43 | 44 | #include "opencv2/core/core_c.h" 45 | #include "opencv2/ml.hpp" 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/opencv2/core/cuda/warp_reduce.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_CUDA_WARP_REDUCE_HPP__ 44 | #define OPENCV_CUDA_WARP_REDUCE_HPP__ 45 | 46 | /** @file 47 | * @deprecated Use @ref cudev instead. 48 | */ 49 | 50 | //! @cond IGNORED 51 | 52 | namespace cv { namespace cuda { namespace device 53 | { 54 | template 55 | __device__ __forceinline__ T warp_reduce(volatile T *ptr , const unsigned int tid = threadIdx.x) 56 | { 57 | const unsigned int lane = tid & 31; // index of thread in warp (0..31) 58 | 59 | if (lane < 16) 60 | { 61 | T partial = ptr[tid]; 62 | 63 | ptr[tid] = partial = partial + ptr[tid + 16]; 64 | ptr[tid] = partial = partial + ptr[tid + 8]; 65 | ptr[tid] = partial = partial + ptr[tid + 4]; 66 | ptr[tid] = partial = partial + ptr[tid + 2]; 67 | ptr[tid] = partial = partial + ptr[tid + 1]; 68 | } 69 | 70 | return ptr[tid - lane]; 71 | } 72 | }}} // namespace cv { namespace cuda { namespace cudev { 73 | 74 | //! @endcond 75 | 76 | #endif /* OPENCV_CUDA_WARP_REDUCE_HPP__ */ 77 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/opencv2/core/opencl/opencl_svm.hpp: -------------------------------------------------------------------------------- 1 | /* See LICENSE file in the root OpenCV directory */ 2 | 3 | #ifndef OPENCV_CORE_OPENCL_SVM_HPP 4 | #define OPENCV_CORE_OPENCL_SVM_HPP 5 | 6 | // 7 | // Internal usage only (binary compatibility is not guaranteed) 8 | // 9 | #ifndef __OPENCV_BUILD 10 | #error Internal header file 11 | #endif 12 | 13 | #if defined(HAVE_OPENCL) && defined(HAVE_OPENCL_SVM) 14 | #include "runtime/opencl_core.hpp" 15 | #include "runtime/opencl_svm_20.hpp" 16 | #include "runtime/opencl_svm_hsa_extension.hpp" 17 | 18 | namespace cv { namespace ocl { namespace svm { 19 | 20 | struct SVMCapabilities 21 | { 22 | enum Value 23 | { 24 | SVM_COARSE_GRAIN_BUFFER = (1 << 0), 25 | SVM_FINE_GRAIN_BUFFER = (1 << 1), 26 | SVM_FINE_GRAIN_SYSTEM = (1 << 2), 27 | SVM_ATOMICS = (1 << 3), 28 | }; 29 | int value_; 30 | 31 | SVMCapabilities(int capabilities = 0) : value_(capabilities) { } 32 | operator int() const { return value_; } 33 | 34 | inline bool isNoSVMSupport() const { return value_ == 0; } 35 | inline bool isSupportCoarseGrainBuffer() const { return (value_ & SVM_COARSE_GRAIN_BUFFER) != 0; } 36 | inline bool isSupportFineGrainBuffer() const { return (value_ & SVM_FINE_GRAIN_BUFFER) != 0; } 37 | inline bool isSupportFineGrainSystem() const { return (value_ & SVM_FINE_GRAIN_SYSTEM) != 0; } 38 | inline bool isSupportAtomics() const { return (value_ & SVM_ATOMICS) != 0; } 39 | }; 40 | 41 | CV_EXPORTS const SVMCapabilities getSVMCapabilitites(const ocl::Context& context); 42 | 43 | struct SVMFunctions 44 | { 45 | clSVMAllocAMD_fn fn_clSVMAlloc; 46 | clSVMFreeAMD_fn fn_clSVMFree; 47 | clSetKernelArgSVMPointerAMD_fn fn_clSetKernelArgSVMPointer; 48 | //clSetKernelExecInfoAMD_fn fn_clSetKernelExecInfo; 49 | //clEnqueueSVMFreeAMD_fn fn_clEnqueueSVMFree; 50 | clEnqueueSVMMemcpyAMD_fn fn_clEnqueueSVMMemcpy; 51 | clEnqueueSVMMemFillAMD_fn fn_clEnqueueSVMMemFill; 52 | clEnqueueSVMMapAMD_fn fn_clEnqueueSVMMap; 53 | clEnqueueSVMUnmapAMD_fn fn_clEnqueueSVMUnmap; 54 | 55 | inline SVMFunctions() 56 | : fn_clSVMAlloc(NULL), fn_clSVMFree(NULL), 57 | fn_clSetKernelArgSVMPointer(NULL), /*fn_clSetKernelExecInfo(NULL),*/ 58 | /*fn_clEnqueueSVMFree(NULL),*/ fn_clEnqueueSVMMemcpy(NULL), fn_clEnqueueSVMMemFill(NULL), 59 | fn_clEnqueueSVMMap(NULL), fn_clEnqueueSVMUnmap(NULL) 60 | { 61 | // nothing 62 | } 63 | 64 | inline bool isValid() const 65 | { 66 | return fn_clSVMAlloc != NULL && fn_clSVMFree && fn_clSetKernelArgSVMPointer && 67 | /*fn_clSetKernelExecInfo && fn_clEnqueueSVMFree &&*/ fn_clEnqueueSVMMemcpy && 68 | fn_clEnqueueSVMMemFill && fn_clEnqueueSVMMap && fn_clEnqueueSVMUnmap; 69 | } 70 | }; 71 | 72 | // We should guarantee that SVMFunctions lifetime is not less than context's lifetime 73 | CV_EXPORTS const SVMFunctions* getSVMFunctions(const ocl::Context& context); 74 | 75 | CV_EXPORTS bool useSVM(UMatUsageFlags usageFlags); 76 | 77 | }}} //namespace cv::ocl::svm 78 | #endif 79 | 80 | #endif // OPENCV_CORE_OPENCL_SVM_HPP 81 | /* End of file. */ 82 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/opencv2/core/opencl/runtime/autogenerated/opencl_gl.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AUTOGENERATED, DO NOT EDIT 3 | // 4 | #ifndef OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_HPP 5 | #error "Invalid usage" 6 | #endif 7 | 8 | // generated by parser_cl.py 9 | #define clCreateFromGLBuffer clCreateFromGLBuffer_ 10 | #define clCreateFromGLRenderbuffer clCreateFromGLRenderbuffer_ 11 | #define clCreateFromGLTexture clCreateFromGLTexture_ 12 | #define clCreateFromGLTexture2D clCreateFromGLTexture2D_ 13 | #define clCreateFromGLTexture3D clCreateFromGLTexture3D_ 14 | #define clEnqueueAcquireGLObjects clEnqueueAcquireGLObjects_ 15 | #define clEnqueueReleaseGLObjects clEnqueueReleaseGLObjects_ 16 | #define clGetGLContextInfoKHR clGetGLContextInfoKHR_ 17 | #define clGetGLObjectInfo clGetGLObjectInfo_ 18 | #define clGetGLTextureInfo clGetGLTextureInfo_ 19 | 20 | #if defined __APPLE__ 21 | #include 22 | #else 23 | #include 24 | #endif 25 | 26 | // generated by parser_cl.py 27 | #undef clCreateFromGLBuffer 28 | #define clCreateFromGLBuffer clCreateFromGLBuffer_pfn 29 | #undef clCreateFromGLRenderbuffer 30 | #define clCreateFromGLRenderbuffer clCreateFromGLRenderbuffer_pfn 31 | #undef clCreateFromGLTexture 32 | #define clCreateFromGLTexture clCreateFromGLTexture_pfn 33 | #undef clCreateFromGLTexture2D 34 | #define clCreateFromGLTexture2D clCreateFromGLTexture2D_pfn 35 | #undef clCreateFromGLTexture3D 36 | #define clCreateFromGLTexture3D clCreateFromGLTexture3D_pfn 37 | #undef clEnqueueAcquireGLObjects 38 | #define clEnqueueAcquireGLObjects clEnqueueAcquireGLObjects_pfn 39 | #undef clEnqueueReleaseGLObjects 40 | #define clEnqueueReleaseGLObjects clEnqueueReleaseGLObjects_pfn 41 | #undef clGetGLContextInfoKHR 42 | #define clGetGLContextInfoKHR clGetGLContextInfoKHR_pfn 43 | #undef clGetGLObjectInfo 44 | #define clGetGLObjectInfo clGetGLObjectInfo_pfn 45 | #undef clGetGLTextureInfo 46 | #define clGetGLTextureInfo clGetGLTextureInfo_pfn 47 | 48 | #ifdef cl_khr_gl_sharing 49 | 50 | // generated by parser_cl.py 51 | extern CL_RUNTIME_EXPORT cl_mem (CL_API_CALL*clCreateFromGLBuffer)(cl_context, cl_mem_flags, cl_GLuint, int*); 52 | extern CL_RUNTIME_EXPORT cl_mem (CL_API_CALL*clCreateFromGLRenderbuffer)(cl_context, cl_mem_flags, cl_GLuint, cl_int*); 53 | extern CL_RUNTIME_EXPORT cl_mem (CL_API_CALL*clCreateFromGLTexture)(cl_context, cl_mem_flags, cl_GLenum, cl_GLint, cl_GLuint, cl_int*); 54 | extern CL_RUNTIME_EXPORT cl_mem (CL_API_CALL*clCreateFromGLTexture2D)(cl_context, cl_mem_flags, cl_GLenum, cl_GLint, cl_GLuint, cl_int*); 55 | extern CL_RUNTIME_EXPORT cl_mem (CL_API_CALL*clCreateFromGLTexture3D)(cl_context, cl_mem_flags, cl_GLenum, cl_GLint, cl_GLuint, cl_int*); 56 | extern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueAcquireGLObjects)(cl_command_queue, cl_uint, const cl_mem*, cl_uint, const cl_event*, cl_event*); 57 | extern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueReleaseGLObjects)(cl_command_queue, cl_uint, const cl_mem*, cl_uint, const cl_event*, cl_event*); 58 | extern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetGLContextInfoKHR)(const cl_context_properties*, cl_gl_context_info, size_t, void*, size_t*); 59 | extern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetGLObjectInfo)(cl_mem, cl_gl_object_type*, cl_GLuint*); 60 | extern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetGLTextureInfo)(cl_mem, cl_gl_texture_info, size_t, void*, size_t*); 61 | 62 | #endif // cl_khr_gl_sharing 63 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/opencv2/core/opencl/runtime/autogenerated/opencl_gl_wrappers.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AUTOGENERATED, DO NOT EDIT 3 | // 4 | #ifndef OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_WRAPPERS_HPP 5 | #error "Invalid usage" 6 | #endif 7 | 8 | #ifdef cl_khr_gl_sharing 9 | 10 | // generated by parser_cl.py 11 | #undef clCreateFromGLBuffer 12 | #define clCreateFromGLBuffer clCreateFromGLBuffer_fn 13 | inline cl_mem clCreateFromGLBuffer(cl_context p0, cl_mem_flags p1, cl_GLuint p2, int* p3) { return clCreateFromGLBuffer_pfn(p0, p1, p2, p3); } 14 | #undef clCreateFromGLRenderbuffer 15 | #define clCreateFromGLRenderbuffer clCreateFromGLRenderbuffer_fn 16 | inline cl_mem clCreateFromGLRenderbuffer(cl_context p0, cl_mem_flags p1, cl_GLuint p2, cl_int* p3) { return clCreateFromGLRenderbuffer_pfn(p0, p1, p2, p3); } 17 | #undef clCreateFromGLTexture 18 | #define clCreateFromGLTexture clCreateFromGLTexture_fn 19 | inline cl_mem clCreateFromGLTexture(cl_context p0, cl_mem_flags p1, cl_GLenum p2, cl_GLint p3, cl_GLuint p4, cl_int* p5) { return clCreateFromGLTexture_pfn(p0, p1, p2, p3, p4, p5); } 20 | #undef clCreateFromGLTexture2D 21 | #define clCreateFromGLTexture2D clCreateFromGLTexture2D_fn 22 | inline cl_mem clCreateFromGLTexture2D(cl_context p0, cl_mem_flags p1, cl_GLenum p2, cl_GLint p3, cl_GLuint p4, cl_int* p5) { return clCreateFromGLTexture2D_pfn(p0, p1, p2, p3, p4, p5); } 23 | #undef clCreateFromGLTexture3D 24 | #define clCreateFromGLTexture3D clCreateFromGLTexture3D_fn 25 | inline cl_mem clCreateFromGLTexture3D(cl_context p0, cl_mem_flags p1, cl_GLenum p2, cl_GLint p3, cl_GLuint p4, cl_int* p5) { return clCreateFromGLTexture3D_pfn(p0, p1, p2, p3, p4, p5); } 26 | #undef clEnqueueAcquireGLObjects 27 | #define clEnqueueAcquireGLObjects clEnqueueAcquireGLObjects_fn 28 | inline cl_int clEnqueueAcquireGLObjects(cl_command_queue p0, cl_uint p1, const cl_mem* p2, cl_uint p3, const cl_event* p4, cl_event* p5) { return clEnqueueAcquireGLObjects_pfn(p0, p1, p2, p3, p4, p5); } 29 | #undef clEnqueueReleaseGLObjects 30 | #define clEnqueueReleaseGLObjects clEnqueueReleaseGLObjects_fn 31 | inline cl_int clEnqueueReleaseGLObjects(cl_command_queue p0, cl_uint p1, const cl_mem* p2, cl_uint p3, const cl_event* p4, cl_event* p5) { return clEnqueueReleaseGLObjects_pfn(p0, p1, p2, p3, p4, p5); } 32 | #undef clGetGLContextInfoKHR 33 | #define clGetGLContextInfoKHR clGetGLContextInfoKHR_fn 34 | inline cl_int clGetGLContextInfoKHR(const cl_context_properties* p0, cl_gl_context_info p1, size_t p2, void* p3, size_t* p4) { return clGetGLContextInfoKHR_pfn(p0, p1, p2, p3, p4); } 35 | #undef clGetGLObjectInfo 36 | #define clGetGLObjectInfo clGetGLObjectInfo_fn 37 | inline cl_int clGetGLObjectInfo(cl_mem p0, cl_gl_object_type* p1, cl_GLuint* p2) { return clGetGLObjectInfo_pfn(p0, p1, p2); } 38 | #undef clGetGLTextureInfo 39 | #define clGetGLTextureInfo clGetGLTextureInfo_fn 40 | inline cl_int clGetGLTextureInfo(cl_mem p0, cl_gl_texture_info p1, size_t p2, void* p3, size_t* p4) { return clGetGLTextureInfo_pfn(p0, p1, p2, p3, p4); } 41 | 42 | #endif // cl_khr_gl_sharing 43 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/opencv2/core/opencl/runtime/opencl_svm_20.hpp: -------------------------------------------------------------------------------- 1 | /* See LICENSE file in the root OpenCV directory */ 2 | 3 | #ifndef OPENCV_CORE_OCL_RUNTIME_OPENCL_SVM_2_0_HPP 4 | #define OPENCV_CORE_OCL_RUNTIME_OPENCL_SVM_2_0_HPP 5 | 6 | #if defined(HAVE_OPENCL_SVM) 7 | #include "opencl_core.hpp" 8 | 9 | #include "opencl_svm_definitions.hpp" 10 | 11 | #undef clSVMAlloc 12 | #define clSVMAlloc clSVMAlloc_pfn 13 | #undef clSVMFree 14 | #define clSVMFree clSVMFree_pfn 15 | #undef clSetKernelArgSVMPointer 16 | #define clSetKernelArgSVMPointer clSetKernelArgSVMPointer_pfn 17 | #undef clSetKernelExecInfo 18 | //#define clSetKernelExecInfo clSetKernelExecInfo_pfn 19 | #undef clEnqueueSVMFree 20 | //#define clEnqueueSVMFree clEnqueueSVMFree_pfn 21 | #undef clEnqueueSVMMemcpy 22 | #define clEnqueueSVMMemcpy clEnqueueSVMMemcpy_pfn 23 | #undef clEnqueueSVMMemFill 24 | #define clEnqueueSVMMemFill clEnqueueSVMMemFill_pfn 25 | #undef clEnqueueSVMMap 26 | #define clEnqueueSVMMap clEnqueueSVMMap_pfn 27 | #undef clEnqueueSVMUnmap 28 | #define clEnqueueSVMUnmap clEnqueueSVMUnmap_pfn 29 | 30 | extern CL_RUNTIME_EXPORT void* (CL_API_CALL *clSVMAlloc)(cl_context context, cl_svm_mem_flags flags, size_t size, unsigned int alignment); 31 | extern CL_RUNTIME_EXPORT void (CL_API_CALL *clSVMFree)(cl_context context, void* svm_pointer); 32 | extern CL_RUNTIME_EXPORT cl_int (CL_API_CALL *clSetKernelArgSVMPointer)(cl_kernel kernel, cl_uint arg_index, const void* arg_value); 33 | //extern CL_RUNTIME_EXPORT void* (CL_API_CALL *clSetKernelExecInfo)(cl_kernel kernel, cl_kernel_exec_info param_name, size_t param_value_size, const void* param_value); 34 | //extern CL_RUNTIME_EXPORT cl_int (CL_API_CALL *clEnqueueSVMFree)(cl_command_queue command_queue, cl_uint num_svm_pointers, void* svm_pointers[], 35 | // void (CL_CALLBACK *pfn_free_func)(cl_command_queue queue, cl_uint num_svm_pointers, void* svm_pointers[], void* user_data), void* user_data, 36 | // cl_uint num_events_in_wait_list, const cl_event* event_wait_list, cl_event* event); 37 | extern CL_RUNTIME_EXPORT cl_int (CL_API_CALL *clEnqueueSVMMemcpy)(cl_command_queue command_queue, cl_bool blocking_copy, void* dst_ptr, const void* src_ptr, size_t size, 38 | cl_uint num_events_in_wait_list, const cl_event* event_wait_list, cl_event* event); 39 | extern CL_RUNTIME_EXPORT cl_int (CL_API_CALL *clEnqueueSVMMemFill)(cl_command_queue command_queue, void* svm_ptr, const void* pattern, size_t pattern_size, size_t size, 40 | cl_uint num_events_in_wait_list, const cl_event* event_wait_list, cl_event* event); 41 | extern CL_RUNTIME_EXPORT cl_int (CL_API_CALL *clEnqueueSVMMap)(cl_command_queue command_queue, cl_bool blocking_map, cl_map_flags map_flags, void* svm_ptr, size_t size, 42 | cl_uint num_events_in_wait_list, const cl_event* event_wait_list, cl_event* event); 43 | extern CL_RUNTIME_EXPORT cl_int (CL_API_CALL *clEnqueueSVMUnmap)(cl_command_queue command_queue, void* svm_ptr, 44 | cl_uint num_events_in_wait_list, const cl_event* event_wait_list, cl_event* event); 45 | 46 | #endif // HAVE_OPENCL_SVM 47 | 48 | #endif // OPENCV_CORE_OCL_RUNTIME_OPENCL_SVM_2_0_HPP 49 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/opencv2/core/utils/filesystem.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_UTILS_FILESYSTEM_HPP 6 | #define OPENCV_UTILS_FILESYSTEM_HPP 7 | 8 | namespace cv { namespace utils { namespace fs { 9 | 10 | 11 | CV_EXPORTS bool exists(const cv::String& path); 12 | CV_EXPORTS bool isDirectory(const cv::String& path); 13 | 14 | CV_EXPORTS void remove_all(const cv::String& path); 15 | 16 | 17 | CV_EXPORTS cv::String getcwd(); 18 | 19 | /** Join path components */ 20 | CV_EXPORTS cv::String join(const cv::String& base, const cv::String& path); 21 | 22 | /** 23 | * Generate a list of all files that match the globbing pattern. 24 | * 25 | * Result entries are prefixed by base directory path. 26 | * 27 | * @param directory base directory 28 | * @param pattern filter pattern (based on '*'/'?' symbols). Use empty string to disable filtering and return all results 29 | * @param[out] result result of globing. 30 | * @param recursive scan nested directories too 31 | * @param includeDirectories include directories into results list 32 | */ 33 | CV_EXPORTS void glob(const cv::String& directory, const cv::String& pattern, 34 | CV_OUT std::vector& result, 35 | bool recursive = false, bool includeDirectories = false); 36 | 37 | /** 38 | * Generate a list of all files that match the globbing pattern. 39 | * 40 | * @param directory base directory 41 | * @param pattern filter pattern (based on '*'/'?' symbols). Use empty string to disable filtering and return all results 42 | * @param[out] result globbing result with relative paths from base directory 43 | * @param recursive scan nested directories too 44 | * @param includeDirectories include directories into results list 45 | */ 46 | CV_EXPORTS void glob_relative(const cv::String& directory, const cv::String& pattern, 47 | CV_OUT std::vector& result, 48 | bool recursive = false, bool includeDirectories = false); 49 | 50 | 51 | CV_EXPORTS bool createDirectory(const cv::String& path); 52 | CV_EXPORTS bool createDirectories(const cv::String& path); 53 | 54 | #ifdef __OPENCV_BUILD 55 | // TODO 56 | //CV_EXPORTS cv::String getTempDirectory(); 57 | 58 | /** 59 | * @brief Returns directory to store OpenCV cache files 60 | * Create sub-directory in common OpenCV cache directory if it doesn't exist. 61 | * @param sub_directory_name name of sub-directory. NULL or "" value asks to return root cache directory. 62 | * @param configuration_name optional name of configuration parameter name which overrides default behavior. 63 | * @return Path to cache directory. Returns empty string if cache directories support is not available. Returns "disabled" if cache disabled by user. 64 | */ 65 | CV_EXPORTS cv::String getCacheDirectory(const char* sub_directory_name, const char* configuration_name = NULL); 66 | 67 | #endif 68 | 69 | }}} // namespace 70 | 71 | #endif // OPENCV_UTILS_FILESYSTEM_HPP 72 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | //! @} 21 | 22 | #endif // OPENCV_LOGGER_DEFINES_HPP 23 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/opencv2/core/va_intel.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) 2015, Itseez, Inc., all rights reserved. 6 | // Third party copyrights are property of their respective owners. 7 | 8 | #ifndef OPENCV_CORE_VA_INTEL_HPP 9 | #define OPENCV_CORE_VA_INTEL_HPP 10 | 11 | #ifndef __cplusplus 12 | # error va_intel.hpp header must be compiled as C++ 13 | #endif 14 | 15 | #include "opencv2/core.hpp" 16 | #include "ocl.hpp" 17 | 18 | #if defined(HAVE_VA) 19 | # include "va/va.h" 20 | #else // HAVE_VA 21 | # if !defined(_VA_H_) 22 | typedef void* VADisplay; 23 | typedef unsigned int VASurfaceID; 24 | # endif // !_VA_H_ 25 | #endif // HAVE_VA 26 | 27 | namespace cv { namespace va_intel { 28 | 29 | /** @addtogroup core_va_intel 30 | This section describes Intel VA-API/OpenCL (CL-VA) interoperability. 31 | 32 | To enable CL-VA interoperability support, configure OpenCV using CMake with WITH_VA_INTEL=ON . Currently VA-API is 33 | supported on Linux only. You should also install Intel Media Server Studio (MSS) to use this feature. You may 34 | have to specify the path(s) to MSS components for cmake in environment variables: VA_INTEL_MSDK_ROOT for Media SDK 35 | (default is "/opt/intel/mediasdk"), and VA_INTEL_IOCL_ROOT for Intel OpenCL (default is "/opt/intel/opencl"). 36 | 37 | To use CL-VA interoperability you should first create VADisplay (libva), and then call initializeContextFromVA() 38 | function to create OpenCL context and set up interoperability. 39 | */ 40 | //! @{ 41 | 42 | /////////////////// CL-VA Interoperability Functions /////////////////// 43 | 44 | namespace ocl { 45 | using namespace cv::ocl; 46 | 47 | // TODO static functions in the Context class 48 | /** @brief Creates OpenCL context from VA. 49 | @param display - VADisplay for which CL interop should be established. 50 | @param tryInterop - try to set up for interoperability, if true; set up for use slow copy if false. 51 | @return Returns reference to OpenCL Context 52 | */ 53 | CV_EXPORTS Context& initializeContextFromVA(VADisplay display, bool tryInterop = true); 54 | 55 | } // namespace cv::va_intel::ocl 56 | 57 | /** @brief Converts InputArray to VASurfaceID object. 58 | @param display - VADisplay object. 59 | @param src - source InputArray. 60 | @param surface - destination VASurfaceID object. 61 | @param size - size of image represented by VASurfaceID object. 62 | */ 63 | CV_EXPORTS void convertToVASurface(VADisplay display, InputArray src, VASurfaceID surface, Size size); 64 | 65 | /** @brief Converts VASurfaceID object to OutputArray. 66 | @param display - VADisplay object. 67 | @param surface - source VASurfaceID object. 68 | @param size - size of image represented by VASurfaceID object. 69 | @param dst - destination OutputArray. 70 | */ 71 | CV_EXPORTS void convertFromVASurface(VADisplay display, VASurfaceID surface, Size size, OutputArray dst); 72 | 73 | //! @} 74 | 75 | }} // namespace cv::va_intel 76 | 77 | #endif /* OPENCV_CORE_VA_INTEL_HPP */ 78 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 3 9 | #define CV_VERSION_MINOR 4 10 | #define CV_VERSION_REVISION 3 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 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/opencv2/dnn/layer.details.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_LAYER_DETAILS_HPP 6 | #define OPENCV_DNN_LAYER_DETAILS_HPP 7 | 8 | #include 9 | 10 | namespace cv { 11 | namespace dnn { 12 | CV__DNN_EXPERIMENTAL_NS_BEGIN 13 | 14 | /** @brief Registers layer constructor in runtime. 15 | * @param type string, containing type name of the layer. 16 | * @param constructorFunc pointer to the function of type LayerRegister::Constructor, which creates the layer. 17 | * @details This macros must be placed inside the function code. 18 | */ 19 | #define CV_DNN_REGISTER_LAYER_FUNC(type, constructorFunc) \ 20 | cv::dnn::LayerFactory::registerLayer(#type, constructorFunc); 21 | 22 | /** @brief Registers layer class in runtime. 23 | * @param type string, containing type name of the layer. 24 | * @param class C++ class, derived from Layer. 25 | * @details This macros must be placed inside the function code. 26 | */ 27 | #define CV_DNN_REGISTER_LAYER_CLASS(type, class) \ 28 | cv::dnn::LayerFactory::registerLayer(#type, cv::dnn::details::_layerDynamicRegisterer); 29 | 30 | /** @brief Registers layer constructor on module load time. 31 | * @param type string, containing type name of the layer. 32 | * @param constructorFunc pointer to the function of type LayerRegister::Constructor, which creates the layer. 33 | * @details This macros must be placed outside the function code. 34 | */ 35 | #define CV_DNN_REGISTER_LAYER_FUNC_STATIC(type, constructorFunc) \ 36 | static cv::dnn::details::_LayerStaticRegisterer __LayerStaticRegisterer_##type(#type, constructorFunc); 37 | 38 | /** @brief Registers layer class on module load time. 39 | * @param type string, containing type name of the layer. 40 | * @param class C++ class, derived from Layer. 41 | * @details This macros must be placed outside the function code. 42 | */ 43 | #define CV_DNN_REGISTER_LAYER_CLASS_STATIC(type, class) \ 44 | Ptr __LayerStaticRegisterer_func_##type(LayerParams ¶ms) \ 45 | { return Ptr(new class(params)); } \ 46 | static cv::dnn::details::_LayerStaticRegisterer __LayerStaticRegisterer_##type(#type, __LayerStaticRegisterer_func_##type); 47 | 48 | namespace details { 49 | 50 | template 51 | Ptr _layerDynamicRegisterer(LayerParams ¶ms) 52 | { 53 | return Ptr(LayerClass::create(params)); 54 | } 55 | 56 | //allows automatically register created layer on module load time 57 | class _LayerStaticRegisterer 58 | { 59 | String type; 60 | public: 61 | 62 | _LayerStaticRegisterer(const String &layerType, LayerFactory::Constructor layerConstructor) 63 | { 64 | this->type = layerType; 65 | LayerFactory::registerLayer(layerType, layerConstructor); 66 | } 67 | 68 | ~_LayerStaticRegisterer() 69 | { 70 | LayerFactory::unregisterLayer(type); 71 | } 72 | }; 73 | 74 | } // namespace 75 | CV__DNN_EXPERIMENTAL_NS_END 76 | }} // namespace 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 featrure2d_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 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | #ifdef FLANN_VERSION_ 34 | #undef FLANN_VERSION_ 35 | #endif 36 | #define FLANN_VERSION_ "1.6.10" 37 | 38 | #endif /* OPENCV_FLANN_CONFIG_H_ */ 39 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/opencv2/flann/dummy.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef OPENCV_FLANN_DUMMY_H_ 3 | #define OPENCV_FLANN_DUMMY_H_ 4 | 5 | namespace cvflann 6 | { 7 | 8 | CV_DEPRECATED inline void dummyfunc() {} 9 | 10 | } 11 | 12 | 13 | #endif /* OPENCV_FLANN_DUMMY_H_ */ 14 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | #include "opencv2/core.hpp" 35 | 36 | namespace cvflann 37 | { 38 | 39 | class FLANNException : public cv::Exception 40 | { 41 | public: 42 | FLANNException(const char* message) : cv::Exception(0, message, "", __FILE__, __LINE__) { } 43 | 44 | FLANNException(const cv::String& message) : cv::Exception(0, message, "", __FILE__, __LINE__) { } 45 | }; 46 | 47 | } 48 | 49 | 50 | #endif /* OPENCV_FLANN_GENERAL_H_ */ 51 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/opencv2/flann/object_factory.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_OBJECT_FACTORY_H_ 32 | #define OPENCV_FLANN_OBJECT_FACTORY_H_ 33 | 34 | #include 35 | 36 | namespace cvflann 37 | { 38 | 39 | class CreatorNotFound 40 | { 41 | }; 42 | 43 | template 46 | class ObjectFactory 47 | { 48 | typedef ObjectFactory ThisClass; 49 | typedef std::map ObjectRegistry; 50 | 51 | // singleton class, private constructor 52 | ObjectFactory() {} 53 | 54 | public: 55 | 56 | bool subscribe(UniqueIdType id, ObjectCreator creator) 57 | { 58 | if (object_registry.find(id) != object_registry.end()) return false; 59 | 60 | object_registry[id] = creator; 61 | return true; 62 | } 63 | 64 | bool unregister(UniqueIdType id) 65 | { 66 | return object_registry.erase(id) == 1; 67 | } 68 | 69 | ObjectCreator create(UniqueIdType id) 70 | { 71 | typename ObjectRegistry::const_iterator iter = object_registry.find(id); 72 | 73 | if (iter == object_registry.end()) { 74 | throw CreatorNotFound(); 75 | } 76 | 77 | return iter->second; 78 | } 79 | 80 | static ThisClass& instance() 81 | { 82 | static ThisClass the_factory; 83 | return the_factory; 84 | } 85 | private: 86 | ObjectRegistry object_registry; 87 | }; 88 | 89 | } 90 | 91 | #endif /* OPENCV_FLANN_OBJECT_FACTORY_H_ */ 92 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/opencv2/flann/sampling.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 | * 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_SAMPLING_H_ 31 | #define OPENCV_FLANN_SAMPLING_H_ 32 | 33 | #include "matrix.h" 34 | #include "random.h" 35 | 36 | namespace cvflann 37 | { 38 | 39 | template 40 | Matrix random_sample(Matrix& srcMatrix, long size, bool remove = false) 41 | { 42 | Matrix newSet(new T[size * srcMatrix.cols], size,srcMatrix.cols); 43 | 44 | T* src,* dest; 45 | for (long i=0; i 63 | Matrix random_sample(const Matrix& srcMatrix, size_t size) 64 | { 65 | UniqueRandom rand((int)srcMatrix.rows); 66 | Matrix newSet(new T[size * srcMatrix.cols], size,srcMatrix.cols); 67 | 68 | T* src,* dest; 69 | for (size_t i=0; i 35 | #include "opencv2/core.hpp" 36 | #include "opencv2/core/utility.hpp" 37 | 38 | namespace cvflann 39 | { 40 | 41 | /** 42 | * A start-stop timer class. 43 | * 44 | * Can be used to time portions of code. 45 | */ 46 | class StartStopTimer 47 | { 48 | int64 startTime; 49 | 50 | public: 51 | /** 52 | * Value of the timer. 53 | */ 54 | double value; 55 | 56 | 57 | /** 58 | * Constructor. 59 | */ 60 | StartStopTimer() 61 | { 62 | reset(); 63 | } 64 | 65 | /** 66 | * Starts the timer. 67 | */ 68 | void start() 69 | { 70 | startTime = cv::getTickCount(); 71 | } 72 | 73 | /** 74 | * Stops the timer and updates timer value. 75 | */ 76 | void stop() 77 | { 78 | int64 stopTime = cv::getTickCount(); 79 | value += ( (double)stopTime - startTime) / cv::getTickFrequency(); 80 | } 81 | 82 | /** 83 | * Resets the timer value to 0. 84 | */ 85 | void reset() 86 | { 87 | value = 0; 88 | } 89 | 90 | }; 91 | 92 | } 93 | 94 | #endif // FLANN_TIMER_H 95 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/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/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/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_CALIB3D 14 | #define HAVE_OPENCV_CORE 15 | #define HAVE_OPENCV_DNN 16 | #define HAVE_OPENCV_FEATURES2D 17 | #define HAVE_OPENCV_FLANN 18 | #define HAVE_OPENCV_HIGHGUI 19 | #define HAVE_OPENCV_IMGCODECS 20 | #define HAVE_OPENCV_IMGPROC 21 | #define HAVE_OPENCV_ML 22 | #define HAVE_OPENCV_OBJDETECT 23 | #define HAVE_OPENCV_PHOTO 24 | #define HAVE_OPENCV_SHAPE 25 | #define HAVE_OPENCV_STITCHING 26 | #define HAVE_OPENCV_SUPERRES 27 | #define HAVE_OPENCV_VIDEO 28 | #define HAVE_OPENCV_VIDEOIO 29 | #define HAVE_OPENCV_VIDEOSTAB 30 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/opencv2/photo/photo_c.h: -------------------------------------------------------------------------------- 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) 2008-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_PHOTO_C_H 44 | #define OPENCV_PHOTO_C_H 45 | 46 | #include "opencv2/core/core_c.h" 47 | 48 | #ifdef __cplusplus 49 | extern "C" { 50 | #endif 51 | 52 | /** @addtogroup photo_c 53 | @{ 54 | */ 55 | 56 | /* Inpainting algorithms */ 57 | enum InpaintingModes 58 | { 59 | CV_INPAINT_NS =0, 60 | CV_INPAINT_TELEA =1 61 | }; 62 | 63 | 64 | /* Inpaints the selected region in the image */ 65 | CVAPI(void) cvInpaint( const CvArr* src, const CvArr* inpaint_mask, 66 | CvArr* dst, double inpaintRange, int flags ); 67 | 68 | /** @} */ 69 | 70 | #ifdef __cplusplus 71 | } //extern "C" 72 | #endif 73 | 74 | #endif //OPENCV_PHOTO_C_H 75 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/opencv2/stitching/detail/camera.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_STITCHING_CAMERA_HPP 44 | #define OPENCV_STITCHING_CAMERA_HPP 45 | 46 | #include "opencv2/core.hpp" 47 | 48 | namespace cv { 49 | namespace detail { 50 | 51 | //! @addtogroup stitching 52 | //! @{ 53 | 54 | /** @brief Describes camera parameters. 55 | 56 | @note Translation is assumed to be zero during the whole stitching pipeline. : 57 | */ 58 | struct CV_EXPORTS CameraParams 59 | { 60 | CameraParams(); 61 | CameraParams(const CameraParams& other); 62 | CameraParams& operator =(const CameraParams& other); 63 | Mat K() const; 64 | 65 | double focal; // Focal length 66 | double aspect; // Aspect ratio 67 | double ppx; // Principal point X 68 | double ppy; // Principal point Y 69 | Mat R; // Rotation 70 | Mat t; // Translation 71 | }; 72 | 73 | //! @} 74 | 75 | } // namespace detail 76 | } // namespace cv 77 | 78 | #endif // #ifndef OPENCV_STITCHING_CAMERA_HPP 79 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | #ifndef DISABLE_OPENCV_24_COMPATIBILITY 60 | #include "opencv2/video/tracking_c.h" 61 | #endif 62 | 63 | #endif //OPENCV_VIDEO_HPP 64 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 "unknown" 25 | @param api backend ID (#VideoCaptureAPIs) 26 | */ 27 | CV_EXPORTS_W cv::String getBackendName(VideoCaptureAPIs api); 28 | 29 | /** @brief Returns list of all builtin 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 | //! @} 42 | }} // namespace 43 | 44 | #endif // OPENCV_VIDEOIO_REGISTRY_HPP 45 | -------------------------------------------------------------------------------- /app/src/main/cpp/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 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/opencv2/videostab/log.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-2011, 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_VIDEOSTAB_LOG_HPP 44 | #define OPENCV_VIDEOSTAB_LOG_HPP 45 | 46 | #include "opencv2/core.hpp" 47 | 48 | namespace cv 49 | { 50 | namespace videostab 51 | { 52 | 53 | //! @addtogroup videostab 54 | //! @{ 55 | 56 | class CV_EXPORTS ILog 57 | { 58 | public: 59 | virtual ~ILog() {} 60 | virtual void print(const char *format, ...) = 0; 61 | }; 62 | 63 | class CV_EXPORTS NullLog : public ILog 64 | { 65 | public: 66 | virtual void print(const char * /*format*/, ...) CV_OVERRIDE {} 67 | }; 68 | 69 | class CV_EXPORTS LogToStdout : public ILog 70 | { 71 | public: 72 | virtual void print(const char *format, ...) CV_OVERRIDE; 73 | }; 74 | 75 | //! @} 76 | 77 | } // namespace videostab 78 | } // namespace cv 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /app/src/main/cpp/include/opencv2/videostab/ring_buffer.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-2011, 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_VIDEOSTAB_RING_BUFFER_HPP 44 | #define OPENCV_VIDEOSTAB_RING_BUFFER_HPP 45 | 46 | #include 47 | #include "opencv2/imgproc.hpp" 48 | 49 | namespace cv 50 | { 51 | namespace videostab 52 | { 53 | 54 | //! @addtogroup videostab 55 | //! @{ 56 | 57 | template inline T& at(int idx, std::vector &items) 58 | { 59 | return items[cv::borderInterpolate(idx, static_cast(items.size()), cv::BORDER_WRAP)]; 60 | } 61 | 62 | template inline const T& at(int idx, const std::vector &items) 63 | { 64 | return items[cv::borderInterpolate(idx, static_cast(items.size()), cv::BORDER_WRAP)]; 65 | } 66 | 67 | //! @} 68 | 69 | } // namespace videostab 70 | } // namespace cv 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /app/src/main/java/com/yeliang/face/Face.java: -------------------------------------------------------------------------------- 1 | package com.yeliang.face; 2 | 3 | import java.util.Arrays; 4 | 5 | /** 6 | * Created by yeliang on 2020/1/16. 7 | */ 8 | 9 | public class Face { 10 | 11 | //保存人脸的关键点坐标 12 | public float[] landmarks; 13 | 14 | //保存人脸宽高 15 | public int width; 16 | public int height; 17 | 18 | //送去检测图片的宽高 19 | public int imgWidth; 20 | public int imgHeight; 21 | 22 | public Face(int width, int height, int imgWidth, int imgHeight,float[] landmarks) { 23 | this.landmarks = landmarks; 24 | this.width = width; 25 | this.height = height; 26 | this.imgWidth = imgWidth; 27 | this.imgHeight = imgHeight; 28 | } 29 | 30 | @Override 31 | public String toString() { 32 | return "Face{" + 33 | "landmarks=" + Arrays.toString(landmarks) + 34 | ", width=" + width + 35 | ", height=" + height + 36 | ", imgWidth=" + imgWidth + 37 | ", imgHeight=" + imgHeight + 38 | '}'; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/com/yeliang/face/FaceTrack.java: -------------------------------------------------------------------------------- 1 | package com.yeliang.face; 2 | 3 | import android.os.Handler; 4 | import android.os.HandlerThread; 5 | import android.os.Message; 6 | import android.util.Log; 7 | 8 | import com.yeliang.utils.CameraHelper; 9 | 10 | /** 11 | * Created by yeliang on 2020/1/16. 12 | */ 13 | 14 | public class FaceTrack { 15 | static { 16 | System.loadLibrary("native-lib"); 17 | } 18 | 19 | private CameraHelper mCameraHelper; 20 | 21 | private Handler mHandler; 22 | private HandlerThread mHandlerThread; 23 | 24 | private long self; 25 | 26 | private Face mFace; 27 | 28 | private int mWidth; 29 | private int mHeight; 30 | 31 | public void setCameraHelper(CameraHelper cameraHelper) { 32 | mCameraHelper = cameraHelper; 33 | } 34 | 35 | public FaceTrack(String model, String seeta) { 36 | self = native_create(model, seeta); 37 | 38 | mHandlerThread = new HandlerThread("track"); 39 | mHandlerThread.start(); 40 | 41 | mHandler = new Handler(mHandlerThread.getLooper()) { 42 | @Override 43 | public void handleMessage(Message msg) { 44 | synchronized (FaceTrack.this) { 45 | if (mCameraHelper == null) { 46 | return; 47 | } 48 | 49 | mFace = native_detector(self, (byte[]) msg.obj, mCameraHelper.getCameraId(), CameraHelper.mWidth, CameraHelper.mHeight); 50 | } 51 | } 52 | }; 53 | } 54 | 55 | public void setSize(int width, int height) { 56 | mWidth = width; 57 | mHeight = height; 58 | } 59 | 60 | public void startTrack() { 61 | native_start(self); 62 | } 63 | 64 | public void stopTrack() { 65 | synchronized (this) { 66 | mHandlerThread.quitSafely(); 67 | mHandler.removeCallbacksAndMessages(null); 68 | native_stop(self); 69 | self = 0; 70 | } 71 | } 72 | 73 | public void detecor(byte[] data) { 74 | mHandler.removeMessages(11); 75 | 76 | Message message = mHandler.obtainMessage(11); 77 | message.obj = data; 78 | mHandler.sendMessage(message); 79 | } 80 | 81 | public Face getFace() { 82 | return mFace; 83 | } 84 | 85 | private native long native_create(String model, String seeta); 86 | 87 | private native void native_start(long self); 88 | 89 | private native void native_stop(long self); 90 | 91 | private native Face native_detector(long self, byte[] data, int cameraId, int width, int height); 92 | } 93 | -------------------------------------------------------------------------------- /app/src/main/java/com/yeliang/filter/BaseFilter.java: -------------------------------------------------------------------------------- 1 | package com.yeliang.filter; 2 | 3 | import android.content.Context; 4 | import android.opengl.GLES20; 5 | 6 | import com.yeliang.utils.FileUtils; 7 | import com.yeliang.utils.OpenGlUtils; 8 | 9 | import java.nio.ByteBuffer; 10 | import java.nio.ByteOrder; 11 | import java.nio.FloatBuffer; 12 | 13 | /** 14 | * Author: yeliang 15 | * Date: 2019/12/7 16 | * Time: 11:50 AM 17 | * Description: 18 | */ 19 | 20 | public abstract class BaseFilter { 21 | 22 | FloatBuffer mGLVertexBuffer; 23 | FloatBuffer mGLTextureBuffer; 24 | 25 | private int mVertexShaderId; 26 | private int mFragShaderId; 27 | 28 | int mGLProgramId; 29 | 30 | int vPosition; 31 | int vCoord; 32 | int vMatrix; 33 | int vTexture; 34 | 35 | int mOutputWidth; 36 | int mOutputHeight; 37 | 38 | BaseFilter(Context context, int vertexShaderId, int fragShaderId) { 39 | mVertexShaderId = vertexShaderId; 40 | mFragShaderId = fragShaderId; 41 | 42 | //1 初始化顶点坐标 43 | mGLVertexBuffer = ByteBuffer.allocateDirect(4 * 2 * 4).order(ByteOrder.nativeOrder()).asFloatBuffer(); 44 | mGLVertexBuffer.clear(); 45 | float[] vertex = { 46 | -1.0f, -1.0f, 47 | 1.0f, -1.0f, 48 | -1.0f, 1.0f, 49 | 1.0f, 1.0f 50 | }; 51 | mGLVertexBuffer.put(vertex); 52 | 53 | //2 初始化纹理坐标 54 | mGLTextureBuffer = ByteBuffer.allocateDirect(4 * 2 * 4).order(ByteOrder.nativeOrder()).asFloatBuffer(); 55 | mGLTextureBuffer.clear(); 56 | float[] texture = { 57 | 0.0f, 1.0f, 58 | 1.0f, 1.0f, 59 | 0.0f, 0.0f, 60 | 1.0f, 0.0f 61 | }; 62 | mGLTextureBuffer.put(texture); 63 | 64 | initShader(context); 65 | 66 | initCoordinate(); 67 | } 68 | 69 | //获取着色器中的属性 70 | private void initShader(Context context) { 71 | String vertexShader = FileUtils.readRawTextFile(context, mVertexShaderId); 72 | String fragShader = FileUtils.readRawTextFile(context, mFragShaderId); 73 | 74 | mGLProgramId = OpenGlUtils.loadProgram(vertexShader, fragShader); 75 | vPosition = GLES20.glGetAttribLocation(mGLProgramId, "vPosition"); 76 | vCoord = GLES20.glGetAttribLocation(mGLProgramId, "vCoord"); 77 | vMatrix = GLES20.glGetUniformLocation(mGLProgramId, "vMatrix"); 78 | vTexture = GLES20.glGetUniformLocation(mGLProgramId, "vTexture"); 79 | } 80 | 81 | //给着色器中的属性赋值 82 | protected void initCoordinate() { 83 | } 84 | 85 | public void onReady(int width, int height) { 86 | mOutputHeight = height; 87 | mOutputWidth = width; 88 | } 89 | 90 | public abstract int onDrawFrame(int textureId); 91 | 92 | public void release() { 93 | GLES20.glDeleteProgram(mGLProgramId); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /app/src/main/java/com/yeliang/filter/BaseFrameFilter.java: -------------------------------------------------------------------------------- 1 | package com.yeliang.filter; 2 | 3 | import android.content.Context; 4 | import android.opengl.GLES20; 5 | 6 | import com.yeliang.utils.OpenGlUtils; 7 | 8 | /** 9 | * Created by yeliang on 2020/1/18. 10 | */ 11 | 12 | public class BaseFrameFilter extends BaseFilter { 13 | protected int[] mFrameBuffers; 14 | protected int[] mFrameBufferTextures; 15 | 16 | BaseFrameFilter(Context context, int vertexShaderId, int fragShaderId) { 17 | super(context, vertexShaderId, fragShaderId); 18 | } 19 | 20 | @Override 21 | protected void initCoordinate() { 22 | mGLTextureBuffer.clear(); 23 | 24 | float[] TEXTURE = { 25 | 0.0f, 0.0f, 26 | 1.0f, 0.0f, 27 | 0.0f, 1.0f, 28 | 1.0f, 1.0f 29 | }; 30 | mGLTextureBuffer.put(TEXTURE); 31 | } 32 | 33 | private void destroyFrameBuffers() { 34 | if (mFrameBufferTextures != null) { 35 | GLES20.glDeleteTextures(1, mFrameBufferTextures, 0); 36 | mFrameBufferTextures = null; 37 | } 38 | 39 | if (mFrameBuffers != null) { 40 | GLES20.glDeleteFramebuffers(1, mFrameBuffers, 0); 41 | mFrameBuffers = null; 42 | } 43 | } 44 | 45 | @Override 46 | public void onReady(int width, int height) { 47 | super.onReady(width, height); 48 | if (mFrameBuffers != null) { 49 | destroyFrameBuffers(); 50 | } 51 | 52 | mFrameBuffers = new int[1]; 53 | 54 | //1 创建fbo 55 | GLES20.glGenFramebuffers(mFrameBuffers.length, mFrameBuffers, 0); 56 | 57 | mFrameBufferTextures = new int[1]; 58 | 59 | //2 创建fbo纹理 60 | OpenGlUtils.glConfigureTextures(mFrameBufferTextures); 61 | 62 | //3 绑定纹理 63 | GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mFrameBufferTextures[0]); 64 | GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, mOutputWidth, mOutputHeight, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null); 65 | 66 | //4 fbo绑定纹理 67 | GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, mFrameBuffers[0]); 68 | GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, GLES20.GL_TEXTURE_2D, mFrameBufferTextures[0], 0); 69 | 70 | //5 解绑 71 | GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0); 72 | GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0); 73 | } 74 | 75 | @Override 76 | public int onDrawFrame(int textureId) { 77 | return 0; 78 | } 79 | 80 | @Override 81 | public void release() { 82 | super.release(); 83 | destroyFrameBuffers(); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /app/src/main/java/com/yeliang/filter/BeautyFilter.java: -------------------------------------------------------------------------------- 1 | package com.yeliang.filter; 2 | 3 | import android.content.Context; 4 | import android.opengl.GLES20; 5 | 6 | import com.yeliang.R; 7 | 8 | /** 9 | * Author: yeliang 10 | * Date: 2020-02-09 11 | * Time: 16:53 12 | * Description: 13 | */ 14 | public class BeautyFilter extends BaseFrameFilter { 15 | 16 | private int width; 17 | private int height; 18 | 19 | public BeautyFilter(Context context) { 20 | super(context, R.raw.screen_vertex, R.raw.beauty_frag); 21 | 22 | width = GLES20.glGetUniformLocation(mGLProgramId, "width"); 23 | height = GLES20.glGetUniformLocation(mGLProgramId, "height"); 24 | } 25 | 26 | @Override 27 | public int onDrawFrame(int textureId) { 28 | //1 设置窗口大小 29 | GLES20.glViewport(0, 0, mOutputWidth, mOutputHeight); 30 | 31 | //2 绑定fbo 32 | GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, mFrameBuffers[0]); 33 | 34 | 35 | //3 使用着色器 36 | GLES20.glUseProgram(mGLProgramId); 37 | GLES20.glUniform1i(width, mOutputWidth); 38 | GLES20.glUniform1i(height, mOutputHeight); 39 | 40 | //4.1 传递顶点坐标 41 | mGLVertexBuffer.position(0); 42 | GLES20.glVertexAttribPointer(vPosition, 2, GLES20.GL_FLOAT, false, 0, mGLVertexBuffer); 43 | GLES20.glEnableVertexAttribArray(vPosition); 44 | 45 | //4.2 传递纹理坐标 46 | mGLTextureBuffer.position(0); 47 | GLES20.glVertexAttribPointer(vCoord, 2, GLES20.GL_FLOAT, false, 0, mGLTextureBuffer); 48 | GLES20.glEnableVertexAttribArray(vCoord); 49 | 50 | //5 绑定2D纹理 51 | GLES20.glActiveTexture(GLES20.GL_TEXTURE0); 52 | GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureId); 53 | GLES20.glUniform1i(vTexture, 0); 54 | 55 | //6 绘制 56 | GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4); 57 | 58 | //7 解绑 59 | GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0); 60 | GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0); 61 | return mFrameBufferTextures[0]; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /app/src/main/java/com/yeliang/filter/BigEyeFilter.java: -------------------------------------------------------------------------------- 1 | package com.yeliang.filter; 2 | 3 | import android.content.Context; 4 | import android.opengl.GLES20; 5 | 6 | import com.yeliang.R; 7 | import com.yeliang.face.Face; 8 | 9 | import java.nio.ByteBuffer; 10 | import java.nio.ByteOrder; 11 | import java.nio.FloatBuffer; 12 | 13 | /** 14 | * Created by yeliang on 2020/1/18. 15 | */ 16 | 17 | public class BigEyeFilter extends BaseFrameFilter { 18 | private int left_eye; 19 | private int right_eye; 20 | 21 | private FloatBuffer left; 22 | private FloatBuffer right; 23 | 24 | private Face mFace; 25 | 26 | public BigEyeFilter(Context context) { 27 | super(context, R.raw.screen_vertex, R.raw.bigeye_frag); 28 | 29 | //参数索引 30 | left_eye = GLES20.glGetUniformLocation(mGLProgramId, "left_eye"); 31 | right_eye = GLES20.glGetUniformLocation(mGLProgramId, "right_eye"); 32 | 33 | left = ByteBuffer.allocateDirect(2 * 4).order(ByteOrder.nativeOrder()).asFloatBuffer(); 34 | right = ByteBuffer.allocateDirect(2 * 4).order(ByteOrder.nativeOrder()).asFloatBuffer(); 35 | } 36 | 37 | public void setFace(Face face) { 38 | mFace = face; 39 | } 40 | 41 | @Override 42 | public int onDrawFrame(int textureId) { 43 | if (null == mFace) { 44 | return textureId; 45 | } 46 | 47 | //1 设置窗口大小 48 | GLES20.glViewport(0, 0, mOutputWidth, mOutputHeight); 49 | 50 | //2 绑定fbo 51 | GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, mFrameBuffers[0]); 52 | 53 | //3 使用着色器 54 | GLES20.glUseProgram(mGLProgramId); 55 | 56 | //4 传递坐标 57 | mGLVertexBuffer.position(0); 58 | GLES20.glVertexAttribPointer(vPosition, 2, GLES20.GL_FLOAT, false, 0, mGLVertexBuffer); 59 | GLES20.glEnableVertexAttribArray(vPosition); 60 | 61 | mGLTextureBuffer.position(0); 62 | GLES20.glVertexAttribPointer(vCoord, 2, GLES20.GL_FLOAT, false, 0 , mGLTextureBuffer); 63 | GLES20.glEnableVertexAttribArray(vCoord); 64 | 65 | float[] landmarks = mFace.landmarks; 66 | 67 | //5.1 左眼坐标点赋值 68 | float x = landmarks[2] / mFace.imgWidth; 69 | float y = landmarks[3] / mFace.imgHeight; 70 | 71 | left.clear(); 72 | left.put(x); 73 | left.put(y); 74 | left.position(0); 75 | GLES20.glUniform2fv(left_eye, 1, left); 76 | 77 | //5.2 右眼坐标点赋值 78 | x = landmarks[4] / mFace.imgWidth; 79 | y = landmarks[5] / mFace.imgHeight; 80 | 81 | right.clear(); 82 | right.put(x); 83 | right.put(y); 84 | right.position(0); 85 | GLES20.glUniform2fv(right_eye, 1, right); 86 | 87 | //6 激活并绑定纹理 88 | GLES20.glActiveTexture(GLES20.GL_TEXTURE0); 89 | GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureId); 90 | GLES20.glUniform1i(vTexture, 0); 91 | 92 | //7 绘制 93 | GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4); 94 | 95 | //8 解绑 96 | GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0); 97 | GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0); 98 | 99 | return mFrameBufferTextures[0]; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /app/src/main/java/com/yeliang/filter/CameraFilter.java: -------------------------------------------------------------------------------- 1 | package com.yeliang.filter; 2 | 3 | import android.content.Context; 4 | import android.opengl.GLES11Ext; 5 | import android.opengl.GLES20; 6 | 7 | import com.yeliang.R; 8 | import com.yeliang.utils.OpenGlUtils; 9 | 10 | /** 11 | * Author: yeliang 12 | * Date: 2019/12/2 13 | * Time: 3:46 PM 14 | * Description: 15 | */ 16 | 17 | public class CameraFilter extends BaseFrameFilter { 18 | 19 | private float[] matrix; 20 | 21 | public CameraFilter(Context context) { 22 | super(context, R.raw.camera_vertex, R.raw.camera_frag); 23 | } 24 | 25 | public void setMatrix(float[] matrix) { 26 | this.matrix = matrix; 27 | } 28 | 29 | @Override 30 | protected void initCoordinate() { 31 | mGLTextureBuffer.clear(); 32 | 33 | float[] TEXTURE = { 34 | 0.0f, 0.0f, 35 | 0.0f, 1.0f, 36 | 1.0f, 0.0f, 37 | 1.0f, 1.0f 38 | }; 39 | 40 | mGLTextureBuffer.put(TEXTURE); 41 | } 42 | 43 | @Override 44 | public int onDrawFrame(int textureId) { 45 | //1 设置窗口大小 46 | GLES20.glViewport(0, 0, mOutputWidth, mOutputHeight); 47 | 48 | //2 绑定fbo 49 | GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, mFrameBuffers[0]); 50 | 51 | //3 使用着色器 52 | GLES20.glUseProgram(mGLProgramId); 53 | 54 | 55 | //4.1 传递顶点坐标 56 | mGLVertexBuffer.position(0); 57 | GLES20.glVertexAttribPointer(vPosition, 2, GLES20.GL_FLOAT, false, 0, mGLVertexBuffer); 58 | GLES20.glEnableVertexAttribArray(vPosition); 59 | 60 | //4.2 传递纹理坐标 61 | mGLTextureBuffer.position(0); 62 | GLES20.glVertexAttribPointer(vCoord, 2, GLES20.GL_FLOAT, false, 0, mGLTextureBuffer); 63 | GLES20.glEnableVertexAttribArray(vCoord); 64 | 65 | //5 变换矩阵 66 | GLES20.glUniformMatrix4fv(vMatrix, 1, false, matrix, 0); 67 | 68 | //6 激活纹理 69 | GLES20.glActiveTexture(GLES20.GL_TEXTURE0); 70 | 71 | //7 绑定纹理 72 | GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, textureId); 73 | GLES20.glUniform1i(vTexture, 0); 74 | 75 | //8 绘制方式 76 | GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4); 77 | 78 | //9 解绑 79 | GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, 0); 80 | GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0); 81 | return mFrameBufferTextures[0]; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /app/src/main/java/com/yeliang/filter/ScreenFilter.java: -------------------------------------------------------------------------------- 1 | package com.yeliang.filter; 2 | 3 | import android.content.Context; 4 | import android.opengl.GLES20; 5 | 6 | import com.yeliang.R; 7 | 8 | /** 9 | * Author: yeliang 10 | * Date: 2019/12/7 11 | * Time: 5:11 PM 12 | * Description: 13 | */ 14 | 15 | public class ScreenFilter extends BaseFilter { 16 | public ScreenFilter(Context context) { 17 | super(context, R.raw.screen_vertex, R.raw.screen_frag); 18 | } 19 | 20 | @Override 21 | public int onDrawFrame(int textureId) { 22 | //1 设置窗口大小 23 | GLES20.glViewport(0, 0, mOutputWidth, mOutputHeight); 24 | 25 | //2 使用着色器 26 | GLES20.glUseProgram(mGLProgramId); 27 | 28 | 29 | //3.1 传递顶点坐标 30 | mGLVertexBuffer.position(0); 31 | GLES20.glVertexAttribPointer(vPosition, 2, GLES20.GL_FLOAT, false, 0, mGLVertexBuffer); 32 | GLES20.glEnableVertexAttribArray(vPosition); 33 | 34 | //3.2 传递纹理坐标 35 | mGLTextureBuffer.position(0); 36 | GLES20.glVertexAttribPointer(vCoord, 2, GLES20.GL_FLOAT, false, 0, mGLTextureBuffer); 37 | GLES20.glEnableVertexAttribArray(vCoord); 38 | 39 | //4 激活纹理 40 | GLES20.glActiveTexture(GLES20.GL_TEXTURE0); 41 | 42 | //5 解绑 43 | GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureId); 44 | GLES20.glUniform1i(vTexture, 0); 45 | 46 | //6 绘制 47 | GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4); 48 | return textureId; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/com/yeliang/utils/FileUtils.java: -------------------------------------------------------------------------------- 1 | package com.yeliang.utils; 2 | 3 | import android.content.Context; 4 | 5 | import java.io.BufferedReader; 6 | import java.io.IOException; 7 | import java.io.InputStream; 8 | import java.io.InputStreamReader; 9 | 10 | /** 11 | * Author: yeliang 12 | * Date: 2019/12/2 13 | * Time: 3:46 PM 14 | * Description: 15 | */ 16 | 17 | public class FileUtils { 18 | 19 | public static String readRawTextFile(Context context, int rawId) { 20 | InputStream inputStream = context.getResources().openRawResource(rawId); 21 | BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); 22 | 23 | String line; 24 | StringBuilder stringBuilder = new StringBuilder(); 25 | 26 | try { 27 | while ((line = bufferedReader.readLine()) != null) { 28 | stringBuilder.append(line); 29 | stringBuilder.append("\n"); 30 | } 31 | } catch (IOException e) { 32 | e.printStackTrace(); 33 | } 34 | 35 | try { 36 | bufferedReader.close(); 37 | } catch (IOException e) { 38 | e.printStackTrace(); 39 | } 40 | 41 | return stringBuilder.toString(); 42 | 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/com/yeliang/utils/OpenGlUtils.java: -------------------------------------------------------------------------------- 1 | package com.yeliang.utils; 2 | 3 | import android.opengl.GLES20; 4 | 5 | /** 6 | * Author: yeliang 7 | * Date: 2019/12/7 8 | * Time: 2:12 PM 9 | * Description: 10 | */ 11 | 12 | public class OpenGlUtils { 13 | 14 | /** 15 | * 创建并配置纹理 16 | * @param textures 被创建的纹理id 17 | */ 18 | public static void glConfigureTextures(int[] textures) { 19 | GLES20.glGenTextures(textures.length, textures, 0); 20 | 21 | for (int texture : textures) { 22 | //1 绑定纹理 23 | GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texture); 24 | 25 | //2 设置纹理过滤样式 GL_NEAREST:临近过滤,清晰看到组成纹理的像素但有颗粒感 26 | GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST); 27 | GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST); 28 | 29 | //3 设置纹理环绕方式 当纹理坐标超过默认范围时 GL_REPEAT:重复纹理图像 30 | GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_REPEAT); 31 | GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_REPEAT); 32 | 33 | //2 解绑 34 | GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0); 35 | } 36 | } 37 | 38 | /** 39 | * 根据顶点着色器和片元着色器代码来创建着色器程序 40 | * @param vSource 顶点着色器代码 41 | * @param fSource 片元着色器代码 42 | * @return 着色器program 43 | */ 44 | public static int loadProgram(String vSource, String fSource) { 45 | 46 | //1 顶点着色器 47 | int vShader = GLES20.glCreateShader(GLES20.GL_VERTEX_SHADER); 48 | GLES20.glShaderSource(vShader, vSource); 49 | GLES20.glCompileShader(vShader); 50 | int[] status = new int[1]; 51 | GLES20.glGetShaderiv(vShader, GLES20.GL_COMPILE_STATUS, status, 0); 52 | if (status[0] != GLES20.GL_TRUE) { 53 | throw new IllegalStateException("load vertex shader failed: " + GLES20.glGetShaderInfoLog(vShader)); 54 | } 55 | 56 | //2 片元着色器 57 | int fShader = GLES20.glCreateShader(GLES20.GL_FRAGMENT_SHADER); 58 | GLES20.glShaderSource(fShader, fSource); 59 | GLES20.glCompileShader(fShader); 60 | GLES20.glGetShaderiv(fShader, GLES20.GL_COMPILE_STATUS, status, 0); 61 | if (status[0] != GLES20.GL_TRUE) { 62 | throw new IllegalStateException("load fragment shader:" + GLES20.glGetShaderInfoLog(vShader)); 63 | } 64 | 65 | //3 着色器程序 66 | int program = GLES20.glCreateProgram(); 67 | GLES20.glAttachShader(program, vShader); 68 | GLES20.glAttachShader(program, fShader); 69 | GLES20.glLinkProgram(program); 70 | GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, status, 0); 71 | if (status[0] != GLES20.GL_TRUE) { 72 | throw new IllegalStateException("link program failed: " + GLES20.glGetProgramInfoLog(program)); 73 | } 74 | GLES20.glDeleteShader(vShader); 75 | GLES20.glDeleteShader(fShader); 76 | return program; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /app/src/main/java/com/yeliang/widget/CommonSurfaceView.java: -------------------------------------------------------------------------------- 1 | package com.yeliang.widget; 2 | 3 | import android.content.Context; 4 | import android.opengl.GLSurfaceView; 5 | import android.util.AttributeSet; 6 | import android.view.SurfaceHolder; 7 | 8 | /** 9 | * Author: yeliang 10 | * Date: 2019/12/2 11 | * Time: 7:52 PM 12 | * Description: 13 | */ 14 | 15 | public class CommonSurfaceView extends GLSurfaceView { 16 | 17 | private CommonRender mCommonRender; 18 | 19 | public CommonSurfaceView(Context context, AttributeSet attrs) { 20 | super(context, attrs); 21 | setEGLContextClientVersion(2); 22 | mCommonRender = new CommonRender(this); 23 | setRenderer(mCommonRender); 24 | setRenderMode(RENDERMODE_WHEN_DIRTY); 25 | } 26 | 27 | @Override 28 | public void surfaceDestroyed(SurfaceHolder holder) { 29 | super.surfaceDestroyed(holder); 30 | mCommonRender.onSurfaceDestroyed(); 31 | } 32 | 33 | public CommonRender getRender() { 34 | return mCommonRender; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi-v7a/libopencv_java3.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrYeLiang/Android-OpenGL-Filter/76774c74e81d056f50deae059ef1d38f3ffe9502/app/src/main/jniLibs/armeabi-v7a/libopencv_java3.so -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_btn_circle_green.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_btn_circle_red.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/stick_ear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrYeLiang/Android-OpenGL-Filter/76774c74e81d056f50deae059ef1d38f3ffe9502/app/src/main/res/drawable/stick_ear.png -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 |