Able to now view individual frames of video.
This commit is contained in:
parent
3766c28cf8
commit
f659e3267b
@ -94,7 +94,7 @@
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>C:\Users\sigon\Downloads\opencv\build\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
@ -103,7 +103,8 @@
|
||||
<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>
|
||||
<AdditionalLibraryDirectories>C:\Users\sigon\Downloads\opencv-4.8.0\opencv-4.8.0\build\bin\Release;C:\Users\sigon\Downloads\opencv-4.8.0\opencv-4.8.0\build\lib\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>opencv_imgcodecs480.lib;opencv_videoio480.lib;opencv_video480.lib;opencv_imgproc480.lib;opencv_core480.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
@ -130,7 +131,7 @@
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>C:\Users\sigon\Downloads\opencv\build\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
@ -139,12 +140,16 @@
|
||||
<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>
|
||||
<AdditionalLibraryDirectories>C:\Users\sigon\Downloads\opencv-4.8.0\opencv-4.8.0\build\bin\Release;C:\Users\sigon\Downloads\opencv-4.8.0\opencv-4.8.0\build\lib\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>opencv_imgcodecs480.lib;opencv_videoio480.lib;opencv_video480.lib;opencv_imgproc480.lib;opencv_core480.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="olcPixelGameEngine.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
|
@ -19,4 +19,9 @@
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="olcPixelGameEngine.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -6,6 +6,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
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)
|
||||
@ -50,8 +51,60 @@ void save_frames(std::vector<cv::Mat>& frames, const std::string& outputDir){
|
||||
|
||||
}
|
||||
|
||||
int main(){
|
||||
std::vector<cv::Mat>frameData;
|
||||
extract_frames("C:/Users/sigon/Videos/test.mp4",frameData);
|
||||
#define OLC_PGE_APPLICATION
|
||||
#include "olcPixelGameEngine.h"
|
||||
|
||||
using namespace olc;
|
||||
|
||||
// Override base class with your custom functionality
|
||||
class Example : public olc::PixelGameEngine
|
||||
{
|
||||
public:
|
||||
Example()
|
||||
{
|
||||
// Name your application
|
||||
sAppName = "Example";
|
||||
}
|
||||
|
||||
public:
|
||||
std::vector<cv::Mat>frames;
|
||||
float frameView=0;
|
||||
bool OnUserCreate() override
|
||||
{
|
||||
// Called once at the start, so create things here
|
||||
extract_frames("C:/users/sigon/Videos/test.mp4",frames);
|
||||
return true;
|
||||
}
|
||||
|
||||
void UpdateScreen(){
|
||||
Clear(BLACK);
|
||||
cv::Mat&targetFrame=frames[int(frameView)];
|
||||
for(int y=0;y<targetFrame.rows;y++){
|
||||
for(int x=0;x<targetFrame.cols;x++){
|
||||
cv::Vec3b col=targetFrame.at<cv::Vec3b>(cv::Point{x,y});
|
||||
Draw(x,y,{col[2],col[1],col[0]});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool OnUserUpdate(float fElapsedTime) override
|
||||
{
|
||||
// Called once per frame, draws random coloured pixels
|
||||
if(GetKey(RIGHT).bHeld){
|
||||
frameView+=fElapsedTime*60;
|
||||
UpdateScreen();
|
||||
}
|
||||
if(GetKey(LEFT).bHeld){
|
||||
frameView-=fElapsedTime*60;
|
||||
UpdateScreen();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
int main()
|
||||
{
|
||||
Example demo;
|
||||
if (demo.Construct(1920, 1080, 1, 1))
|
||||
demo.Start();
|
||||
return 0;
|
||||
}
|
6695
OpenCVVideoParser/olcPixelGameEngine.h
Normal file
6695
OpenCVVideoParser/olcPixelGameEngine.h
Normal file
File diff suppressed because it is too large
Load Diff
BIN
OpenCVVideoParser/opencv_calib3d480.dll
Normal file
BIN
OpenCVVideoParser/opencv_calib3d480.dll
Normal file
Binary file not shown.
BIN
OpenCVVideoParser/opencv_core480.dll
Normal file
BIN
OpenCVVideoParser/opencv_core480.dll
Normal file
Binary file not shown.
BIN
OpenCVVideoParser/opencv_dnn480.dll
Normal file
BIN
OpenCVVideoParser/opencv_dnn480.dll
Normal file
Binary file not shown.
BIN
OpenCVVideoParser/opencv_features2d480.dll
Normal file
BIN
OpenCVVideoParser/opencv_features2d480.dll
Normal file
Binary file not shown.
BIN
OpenCVVideoParser/opencv_flann480.dll
Normal file
BIN
OpenCVVideoParser/opencv_flann480.dll
Normal file
Binary file not shown.
BIN
OpenCVVideoParser/opencv_gapi480.dll
Normal file
BIN
OpenCVVideoParser/opencv_gapi480.dll
Normal file
Binary file not shown.
BIN
OpenCVVideoParser/opencv_highgui480.dll
Normal file
BIN
OpenCVVideoParser/opencv_highgui480.dll
Normal file
Binary file not shown.
BIN
OpenCVVideoParser/opencv_imgcodecs480.dll
Normal file
BIN
OpenCVVideoParser/opencv_imgcodecs480.dll
Normal file
Binary file not shown.
BIN
OpenCVVideoParser/opencv_imgproc480.dll
Normal file
BIN
OpenCVVideoParser/opencv_imgproc480.dll
Normal file
Binary file not shown.
BIN
OpenCVVideoParser/opencv_ml480.dll
Normal file
BIN
OpenCVVideoParser/opencv_ml480.dll
Normal file
Binary file not shown.
BIN
OpenCVVideoParser/opencv_objdetect480.dll
Normal file
BIN
OpenCVVideoParser/opencv_objdetect480.dll
Normal file
Binary file not shown.
BIN
OpenCVVideoParser/opencv_photo480.dll
Normal file
BIN
OpenCVVideoParser/opencv_photo480.dll
Normal file
Binary file not shown.
BIN
OpenCVVideoParser/opencv_stitching480.dll
Normal file
BIN
OpenCVVideoParser/opencv_stitching480.dll
Normal file
Binary file not shown.
BIN
OpenCVVideoParser/opencv_video480.dll
Normal file
BIN
OpenCVVideoParser/opencv_video480.dll
Normal file
Binary file not shown.
BIN
OpenCVVideoParser/opencv_videoio480.dll
Normal file
BIN
OpenCVVideoParser/opencv_videoio480.dll
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user