Add project files.

master
sigonasr2 1 year ago
parent fbc2f7b6e6
commit 27adeb0dc7
  1. 31
      OpenCVVideoParser.sln
  2. 151
      OpenCVVideoParser/OpenCVVideoParser.vcxproj
  3. 22
      OpenCVVideoParser/OpenCVVideoParser.vcxproj.filters
  4. BIN
      OpenCVVideoParser/lib/opencv_calib3d480d.exp
  5. BIN
      OpenCVVideoParser/lib/opencv_calib3d480d.lib
  6. BIN
      OpenCVVideoParser/lib/opencv_core480d.exp
  7. BIN
      OpenCVVideoParser/lib/opencv_core480d.lib
  8. BIN
      OpenCVVideoParser/lib/opencv_dnn480d.exp
  9. BIN
      OpenCVVideoParser/lib/opencv_dnn480d.lib
  10. BIN
      OpenCVVideoParser/lib/opencv_features2d480d.exp
  11. BIN
      OpenCVVideoParser/lib/opencv_features2d480d.lib
  12. BIN
      OpenCVVideoParser/lib/opencv_flann480d.exp
  13. BIN
      OpenCVVideoParser/lib/opencv_flann480d.lib
  14. BIN
      OpenCVVideoParser/lib/opencv_gapi480d.exp
  15. BIN
      OpenCVVideoParser/lib/opencv_gapi480d.lib
  16. BIN
      OpenCVVideoParser/lib/opencv_highgui480d.exp
  17. BIN
      OpenCVVideoParser/lib/opencv_highgui480d.lib
  18. BIN
      OpenCVVideoParser/lib/opencv_imgcodecs480d.exp
  19. BIN
      OpenCVVideoParser/lib/opencv_imgcodecs480d.lib
  20. BIN
      OpenCVVideoParser/lib/opencv_imgproc480d.exp
  21. BIN
      OpenCVVideoParser/lib/opencv_imgproc480d.lib
  22. BIN
      OpenCVVideoParser/lib/opencv_java480.dll
  23. BIN
      OpenCVVideoParser/lib/opencv_java480.exp
  24. BIN
      OpenCVVideoParser/lib/opencv_java480.lib
  25. BIN
      OpenCVVideoParser/lib/opencv_ml480d.exp
  26. BIN
      OpenCVVideoParser/lib/opencv_ml480d.lib
  27. BIN
      OpenCVVideoParser/lib/opencv_objdetect480d.exp
  28. BIN
      OpenCVVideoParser/lib/opencv_objdetect480d.lib
  29. BIN
      OpenCVVideoParser/lib/opencv_photo480d.exp
  30. BIN
      OpenCVVideoParser/lib/opencv_photo480d.lib
  31. BIN
      OpenCVVideoParser/lib/opencv_stitching480d.exp
  32. BIN
      OpenCVVideoParser/lib/opencv_stitching480d.lib
  33. BIN
      OpenCVVideoParser/lib/opencv_ts480d.lib
  34. BIN
      OpenCVVideoParser/lib/opencv_video480d.exp
  35. BIN
      OpenCVVideoParser/lib/opencv_video480d.lib
  36. BIN
      OpenCVVideoParser/lib/opencv_videoio480d.exp
  37. BIN
      OpenCVVideoParser/lib/opencv_videoio480d.lib
  38. BIN
      OpenCVVideoParser/lib/opencv_world480.lib
  39. BIN
      OpenCVVideoParser/lib/opencv_world480d.lib
  40. 57
      OpenCVVideoParser/main.cpp
  41. BIN
      OpenCVVideoParser/opencv_calib3d480d.dll
  42. BIN
      OpenCVVideoParser/opencv_core480d.dll
  43. BIN
      OpenCVVideoParser/opencv_dnn480d.dll
  44. BIN
      OpenCVVideoParser/opencv_features2d480d.dll
  45. BIN
      OpenCVVideoParser/opencv_flann480d.dll
  46. BIN
      OpenCVVideoParser/opencv_gapi480d.dll
  47. BIN
      OpenCVVideoParser/opencv_highgui480d.dll
  48. BIN
      OpenCVVideoParser/opencv_imgcodecs480d.dll
  49. BIN
      OpenCVVideoParser/opencv_imgproc480d.dll
  50. BIN
      OpenCVVideoParser/opencv_ml480d.dll
  51. BIN
      OpenCVVideoParser/opencv_objdetect480d.dll
  52. BIN
      OpenCVVideoParser/opencv_photo480d.dll
  53. BIN
      OpenCVVideoParser/opencv_stitching480d.dll
  54. BIN
      OpenCVVideoParser/opencv_video480d.dll
  55. BIN
      OpenCVVideoParser/opencv_videoio480d.dll
  56. BIN
      OpenCVVideoParser/opencv_videoio_ffmpeg480_64.dll

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33516.290
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenCVVideoParser", "OpenCVVideoParser\OpenCVVideoParser.vcxproj", "{F62B7B71-0349-475C-AECA-5161913BF22E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F62B7B71-0349-475C-AECA-5161913BF22E}.Debug|x64.ActiveCfg = Debug|x64
{F62B7B71-0349-475C-AECA-5161913BF22E}.Debug|x64.Build.0 = Debug|x64
{F62B7B71-0349-475C-AECA-5161913BF22E}.Debug|x86.ActiveCfg = Debug|Win32
{F62B7B71-0349-475C-AECA-5161913BF22E}.Debug|x86.Build.0 = Debug|Win32
{F62B7B71-0349-475C-AECA-5161913BF22E}.Release|x64.ActiveCfg = Release|x64
{F62B7B71-0349-475C-AECA-5161913BF22E}.Release|x64.Build.0 = Release|x64
{F62B7B71-0349-475C-AECA-5161913BF22E}.Release|x86.ActiveCfg = Release|Win32
{F62B7B71-0349-475C-AECA-5161913BF22E}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0A9D7E8C-D348-4871-9F72-337FA37110DA}
EndGlobalSection
EndGlobal

@ -0,0 +1,151 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{f62b7b71-0349-475c-aeca-5161913bf22e}</ProjectGuid>
<RootNamespace>OpenCVVideoParser</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>C:\Users\sigon\Downloads\opencv\build\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>C:\Users\sigon\Downloads\opencv-4.8.0\opencv-4.8.0\build\bin\Debug;C:\Users\sigon\Downloads\opencv-4.8.0\opencv-4.8.0\build\lib\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>opencv_imgcodecs480d.lib;opencv_videoio480d.lib;opencv_video480d.lib;opencv_imgproc480d.lib;opencv_core480d.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<ProjectReference>
<UseLibraryDependencyInputs>true</UseLibraryDependencyInputs>
</ProjectReference>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>C:\Users\sigon\Downloads\opencv\build\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>C:\Users\sigon\Downloads\opencv-4.8.0\opencv-4.8.0\build\lib\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>C:\Users\sigon\Downloads\opencv\build\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>C:\Users\sigon\Downloads\opencv-4.8.0\opencv-4.8.0\build\bin\Debug;C:\Users\sigon\Downloads\opencv-4.8.0\opencv-4.8.0\build\lib\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>opencv_imgcodecs480d.lib;opencv_videoio480d.lib;opencv_video480d.lib;opencv_imgproc480d.lib;opencv_core480d.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<ProjectReference>
<UseLibraryDependencyInputs>true</UseLibraryDependencyInputs>
</ProjectReference>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>C:\Users\sigon\Downloads\opencv\build\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>C:\Users\sigon\Downloads\opencv-4.8.0\opencv-4.8.0\build\lib\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

@ -0,0 +1,57 @@
#include <opencv2/videoio.hpp>
#include <opencv2/video.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/core/types_c.h>
#include <opencv2/imgcodecs.hpp>
#include <string>
#include <vector>
#include <iostream>
/*
This functions opens a video file and extracts the frames and put them into a vector of Mat(its the class for representing an img)
*/
void extract_frames(const std::string &videoFilePath,std::vector<cv::Mat>& frames){
try{
//open the video file
cv::VideoCapture cap(videoFilePath); // open the video file
if(!cap.isOpened()) // check if we succeeded
cv::error(CV_StsError,"Can not open Video file",__FUNCTION__,"C:\\Users\\sigon\\source\\repos\\OpenCVVideoParser\\OpenCVVideoParser\\main.cpp",14);
//cap.get(CV_CAP_PROP_FRAME_COUNT) contains the number of frames in the video;
for(int frameNum = 0; frameNum < cap.get(cv::CAP_PROP_FRAME_COUNT);frameNum++)
{
cv::Mat frame;
cap >> frame; // get the next frame from video
frames.push_back(frame);
}
}
catch( cv::Exception& e ){
std::cerr << e.msg << std::endl;
exit(1);
}
}
/*
It saves a vector of frames into jpg images into the outputDir as 1.jpg,2.jpg etc where 1,2 etc represents the frame number
*/
void save_frames(std::vector<cv::Mat>& frames, const std::string& outputDir){
std::vector<int> compression_params;
compression_params.push_back(cv::IMWRITE_JPEG_QUALITY);
compression_params.push_back(100);
int frameNumber=0;
for(std::vector<cv::Mat>::iterator frame = frames.begin(); frame != frames.end(); ++frame){
std::string filePath = outputDir + std::to_string(static_cast<long long>(frameNumber))+ ".jpg";
imwrite(filePath,*frame,compression_params);
frameNumber++;
}
}
int main(){
std::vector<cv::Mat>frameData;
extract_frames("C:/Users/sigon/Videos/test.mp4",frameData);
}
Loading…
Cancel
Save