├── main.cpp ├── MoveDetect.cpp ├── x64 └── Release │ ├── main.obj │ ├── vc120.pdb │ ├── MoveDetect.obj │ ├── Move_detect.tlog │ ├── CL.read.1.tlog │ ├── CL.write.1.tlog │ ├── link.read.1.tlog │ ├── cl.command.1.tlog │ ├── link.write.1.tlog │ ├── link.command.1.tlog │ └── Move_detect.lastbuildstate │ ├── Move_detect.Build.CppClean.log │ └── Move_detect.log ├── README.md ├── Move_detect.vcxproj.filters ├── MoveDetect.h └── Move_detect.vcxproj /main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XuHao9166/CameraMove_detect/HEAD/main.cpp -------------------------------------------------------------------------------- /MoveDetect.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XuHao9166/CameraMove_detect/HEAD/MoveDetect.cpp -------------------------------------------------------------------------------- /x64/Release/main.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XuHao9166/CameraMove_detect/HEAD/x64/Release/main.obj -------------------------------------------------------------------------------- /x64/Release/vc120.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XuHao9166/CameraMove_detect/HEAD/x64/Release/vc120.pdb -------------------------------------------------------------------------------- /x64/Release/MoveDetect.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XuHao9166/CameraMove_detect/HEAD/x64/Release/MoveDetect.obj -------------------------------------------------------------------------------- /x64/Release/Move_detect.tlog/CL.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XuHao9166/CameraMove_detect/HEAD/x64/Release/Move_detect.tlog/CL.read.1.tlog -------------------------------------------------------------------------------- /x64/Release/Move_detect.tlog/CL.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XuHao9166/CameraMove_detect/HEAD/x64/Release/Move_detect.tlog/CL.write.1.tlog -------------------------------------------------------------------------------- /x64/Release/Move_detect.tlog/link.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XuHao9166/CameraMove_detect/HEAD/x64/Release/Move_detect.tlog/link.read.1.tlog -------------------------------------------------------------------------------- /x64/Release/Move_detect.tlog/cl.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XuHao9166/CameraMove_detect/HEAD/x64/Release/Move_detect.tlog/cl.command.1.tlog -------------------------------------------------------------------------------- /x64/Release/Move_detect.tlog/link.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XuHao9166/CameraMove_detect/HEAD/x64/Release/Move_detect.tlog/link.write.1.tlog -------------------------------------------------------------------------------- /x64/Release/Move_detect.tlog/link.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XuHao9166/CameraMove_detect/HEAD/x64/Release/Move_detect.tlog/link.command.1.tlog -------------------------------------------------------------------------------- /x64/Release/Move_detect.tlog/Move_detect.lastbuildstate: -------------------------------------------------------------------------------- 1 | #TargetFrameworkVersion=v4.0:PlatformToolSet=v120:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit 2 | Release|x64|E:\Move_detect\| 3 | -------------------------------------------------------------------------------- /x64/Release/Move_detect.Build.CppClean.log: -------------------------------------------------------------------------------- 1 | e:\move_detect\move_detect\x64\release\vc120.pdb 2 | e:\move_detect\move_detect\x64\release\movedetect.obj 3 | e:\move_detect\move_detect\x64\release\main.obj 4 | e:\move_detect\x64\release\move_detect.exe 5 | e:\move_detect\x64\release\move_detect.pdb 6 | e:\move_detect\move_detect\x64\release\move_detect.tlog\cl.command.1.tlog 7 | e:\move_detect\move_detect\x64\release\move_detect.tlog\cl.read.1.tlog 8 | e:\move_detect\move_detect\x64\release\move_detect.tlog\cl.write.1.tlog 9 | e:\move_detect\move_detect\x64\release\move_detect.tlog\link.command.1.tlog 10 | e:\move_detect\move_detect\x64\release\move_detect.tlog\link.read.1.tlog 11 | e:\move_detect\move_detect\x64\release\move_detect.tlog\link.write.1.tlog 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CameraMove_detect 2 | Based on the phase metric, including cropping, splicing, and calculating the phase shift scale for the four corners of the image, and calculating the moving direction angle (基于相位度量 ,包括图像四角裁剪、拼接、计算相位移尺度及方向角) 3 | 4 | 该算法主要包括以下几个步骤: 5 | 1、将当前视频的每一帧提取出人员运动相对较少的四个区域后进行重新拼接 6 | 2、对拼接后生成的新图像计算当前相位相关值以及运动的角度 7 | 3、通过图像处理的方法将运动角度提取出来 8 | 4、设定相机移动的判定阈值进行判断。 9 | 10 | 如果觉得对您有点帮助,希望您给我一颗星,谢谢 11 | 12 | The algorithm mainly includes the following steps: 13 | 1. Re-splicing each frame of the current video out of four areas with relatively few people's motions 14 | 2. Calculate the current phase correlation value and the angle of motion for the new image generated after splicing 15 | 3. Extract the motion angle by image processing 16 | 4. Determine the threshold for camera movement to determine. 17 | 18 | If you feel helpful to you, please give me a star, thank you 19 | -------------------------------------------------------------------------------- /Move_detect.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 源文件 20 | 21 | 22 | 源文件 23 | 24 | 25 | 26 | 27 | 头文件 28 | 29 | 30 | -------------------------------------------------------------------------------- /MoveDetect.h: -------------------------------------------------------------------------------- 1 | #ifndef MoveDetect_H 2 | #define MoveDetect_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "opencv2/features2d/features2d.hpp" 8 | //#include "opencv2/nonfree/nonfree.hpp" 9 | #include "opencv2/flann/flann.hpp" 10 | #include "opencv2/calib3d/calib3d.hpp" 11 | //#include "opencv2/gpu/gpu.hpp" 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | using namespace cv; 19 | using namespace std; 20 | 21 | class MoveDetect 22 | { 23 | public: 24 | MoveDetect(); 25 | VideoCapture capture; 26 | 27 | Mat frame2; 28 | Mat frame1; 29 | 30 | Mat currROI, prevROI; 31 | Mat hann; 32 | Mat prev64f, curr64f; 33 | 34 | 35 | vector features1, features2; 36 | vector goodFeatures1, goodFeatures2; 37 | vector status; 38 | vector err; 39 | 40 | double dx; 41 | double dy; 42 | double da; 43 | 44 | 45 | bool result_label; 46 | bool phase_label; 47 | bool Itfirst; 48 | int IsMove; 49 | int IsNoMove; 50 | int computtimes; 51 | float ratio; 52 | int angle; 53 | 54 | void Detect(Mat frame_1, Mat frame_2, bool& result); 55 | void Change_position(Mat& img); 56 | Mat extract_ROI(Mat input, float prop_row, float prop_col); 57 | }; 58 | 59 | 60 | 61 | #endif // VIDEOSTAB_H 62 | -------------------------------------------------------------------------------- /x64/Release/Move_detect.log: -------------------------------------------------------------------------------- 1 | 生成启动时间为 2018/9/29 16:38:14。 2 | 1>项目“E:\Move_detect\Move_detect\Move_detect.vcxproj”在节点 2 上(Build 个目标)。 3 | 1>ClCompile: 4 | D:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\CL.exe /c /Zi /nologo /W3 /WX- /sdl /O2 /Oi /GL /D _MBCS /Gm- /EHsc /MD /GS /Gy /Zc:wchar_t /Zc:forScope /Fo"x64\Release\\" /Fd"x64\Release\vc120.pdb" /Gd /TP /errorReport:prompt main.cpp 5 | main.cpp 6 | 1>D:\行人分析\GXX_算法预研组\公共库\GXX_3rdparty\hpp\opencv310_withContrib\opencv2/core/mat.hpp(1965): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 7 | 1>D:\行人分析\GXX_算法预研组\公共库\GXX_3rdparty\hpp\opencv310_withContrib\opencv2/core/persistence.hpp : warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 8 | 1>D:\行人分析\GXX_算法预研组\公共库\GXX_3rdparty\hpp\opencv310_withContrib\opencv2/core/utility.hpp : warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 9 | Link: 10 | D:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:PROMPT /OUT:"E:\Move_detect\x64\Release\Move_detect.exe" /NOLOGO opencv_core310.lib opencv_imgproc310.lib opencv_highgui310.lib opencv_optflow310.lib opencv_video310.lib opencv_videoio310.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"E:\Move_detect\x64\Release\Move_detect.pdb" /OPT:REF /OPT:ICF /LTCG /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"E:\Move_detect\x64\Release\Move_detect.lib" /MACHINE:X64 x64\Release\main.obj 11 | x64\Release\MoveDetect.obj 12 | 正在生成代码 13 | 已完成代码的生成 14 | Move_detect.vcxproj -> E:\Move_detect\x64\Release\Move_detect.exe 15 | 1>已完成生成项目“E:\Move_detect\Move_detect\Move_detect.vcxproj”(Build 个目标)的操作。 16 | 17 | 生成成功。 18 | 19 | 已用时间 00:00:03.05 20 | -------------------------------------------------------------------------------- /Move_detect.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Debug 10 | x64 11 | 12 | 13 | Release 14 | Win32 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | {ABB795CE-1E09-461A-85DD-FE51A1EB2E39} 23 | Move_detect 24 | 25 | 26 | 27 | Application 28 | true 29 | v120 30 | MultiByte 31 | 32 | 33 | Application 34 | true 35 | v120 36 | MultiByte 37 | 38 | 39 | Application 40 | false 41 | v120 42 | true 43 | MultiByte 44 | 45 | 46 | Application 47 | false 48 | v120 49 | true 50 | MultiByte 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | D:\行人分析\GXX_算法预研组\公共库\GXX_3rdparty\hpp\opencv310_withContrib;D:\行人分析\GXX_算法预研组\公共库\GXX_3rdparty\hpp\opencv310_withContrib\opencv2;D:\行人分析\GXX_算法预研组\公共库\GXX_3rdparty\hpp\opencv310_withContrib\opencv;$(IncludePath) 70 | D:\行人分析\GXX_算法预研组\公共库\GXX_3rdparty\libs\opencv310_withContrib\x64;$(LibraryPath) 71 | 72 | 73 | 74 | Level3 75 | Disabled 76 | true 77 | 78 | 79 | true 80 | 81 | 82 | 83 | 84 | Level3 85 | Disabled 86 | true 87 | 88 | 89 | true 90 | 91 | 92 | 93 | 94 | Level3 95 | MaxSpeed 96 | true 97 | true 98 | true 99 | 100 | 101 | true 102 | true 103 | true 104 | 105 | 106 | 107 | 108 | Level3 109 | MaxSpeed 110 | true 111 | true 112 | true 113 | 114 | 115 | true 116 | true 117 | true 118 | opencv_core310.lib;opencv_imgproc310.lib;opencv_highgui310.lib;opencv_optflow310.lib;opencv_video310.lib;opencv_videoio310.lib;%(AdditionalDependencies) 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | --------------------------------------------------------------------------------