Skip to content

Commit

Permalink
Add project files.
Browse files Browse the repository at this point in the history
  • Loading branch information
vackup committed Jun 7, 2018
1 parent 0b5e6ed commit 7c0a298
Show file tree
Hide file tree
Showing 24 changed files with 859 additions and 0 deletions.
61 changes: 61 additions & 0 deletions CoreXimgprocSeg.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CoreXimgprocSeg", "CoreXimgprocSeg\CoreXimgprocSeg.vcxproj", "{B2F4BFFE-A94D-4C9B-8B1E-83160D24ADF5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CoreXimgprocSegWrapper", "CoreXimgprocSegWrapper\CoreXimgprocSegWrapper.vcxproj", "{72A3ECAB-9696-47A4-B236-264C94B02A6B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoreXimgprocSegConsoleApp", "CoreXimgprocSegConsoleApp\CoreXimgprocSegConsoleApp.csproj", "{8309B918-12F8-45DA-B071-CFE3E0B53A4C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B2F4BFFE-A94D-4C9B-8B1E-83160D24ADF5}.Debug|Any CPU.ActiveCfg = Debug|Win32
{B2F4BFFE-A94D-4C9B-8B1E-83160D24ADF5}.Debug|x64.ActiveCfg = Debug|x64
{B2F4BFFE-A94D-4C9B-8B1E-83160D24ADF5}.Debug|x64.Build.0 = Debug|x64
{B2F4BFFE-A94D-4C9B-8B1E-83160D24ADF5}.Debug|x86.ActiveCfg = Debug|Win32
{B2F4BFFE-A94D-4C9B-8B1E-83160D24ADF5}.Debug|x86.Build.0 = Debug|Win32
{B2F4BFFE-A94D-4C9B-8B1E-83160D24ADF5}.Release|Any CPU.ActiveCfg = Release|Win32
{B2F4BFFE-A94D-4C9B-8B1E-83160D24ADF5}.Release|x64.ActiveCfg = Release|x64
{B2F4BFFE-A94D-4C9B-8B1E-83160D24ADF5}.Release|x64.Build.0 = Release|x64
{B2F4BFFE-A94D-4C9B-8B1E-83160D24ADF5}.Release|x86.ActiveCfg = Release|Win32
{B2F4BFFE-A94D-4C9B-8B1E-83160D24ADF5}.Release|x86.Build.0 = Release|Win32
{72A3ECAB-9696-47A4-B236-264C94B02A6B}.Debug|Any CPU.ActiveCfg = Debug|Win32
{72A3ECAB-9696-47A4-B236-264C94B02A6B}.Debug|x64.ActiveCfg = Debug|x64
{72A3ECAB-9696-47A4-B236-264C94B02A6B}.Debug|x64.Build.0 = Debug|x64
{72A3ECAB-9696-47A4-B236-264C94B02A6B}.Debug|x86.ActiveCfg = Debug|Win32
{72A3ECAB-9696-47A4-B236-264C94B02A6B}.Debug|x86.Build.0 = Debug|Win32
{72A3ECAB-9696-47A4-B236-264C94B02A6B}.Release|Any CPU.ActiveCfg = Release|Win32
{72A3ECAB-9696-47A4-B236-264C94B02A6B}.Release|x64.ActiveCfg = Release|x64
{72A3ECAB-9696-47A4-B236-264C94B02A6B}.Release|x64.Build.0 = Release|x64
{72A3ECAB-9696-47A4-B236-264C94B02A6B}.Release|x86.ActiveCfg = Release|Win32
{72A3ECAB-9696-47A4-B236-264C94B02A6B}.Release|x86.Build.0 = Release|Win32
{8309B918-12F8-45DA-B071-CFE3E0B53A4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8309B918-12F8-45DA-B071-CFE3E0B53A4C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8309B918-12F8-45DA-B071-CFE3E0B53A4C}.Debug|x64.ActiveCfg = Debug|x64
{8309B918-12F8-45DA-B071-CFE3E0B53A4C}.Debug|x64.Build.0 = Debug|x64
{8309B918-12F8-45DA-B071-CFE3E0B53A4C}.Debug|x86.ActiveCfg = Debug|Any CPU
{8309B918-12F8-45DA-B071-CFE3E0B53A4C}.Debug|x86.Build.0 = Debug|Any CPU
{8309B918-12F8-45DA-B071-CFE3E0B53A4C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8309B918-12F8-45DA-B071-CFE3E0B53A4C}.Release|Any CPU.Build.0 = Release|Any CPU
{8309B918-12F8-45DA-B071-CFE3E0B53A4C}.Release|x64.ActiveCfg = Release|Any CPU
{8309B918-12F8-45DA-B071-CFE3E0B53A4C}.Release|x64.Build.0 = Release|Any CPU
{8309B918-12F8-45DA-B071-CFE3E0B53A4C}.Release|x86.ActiveCfg = Release|Any CPU
{8309B918-12F8-45DA-B071-CFE3E0B53A4C}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FD5EB6F4-37F7-45AD-8984-E0465F086C7A}
EndGlobalSection
EndGlobal
3 changes: 3 additions & 0 deletions CoreXimgprocSeg/Core.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//Core.h
#pragma once
#include "Entity.h"
133 changes: 133 additions & 0 deletions CoreXimgprocSeg/CoreXimgprocSeg.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" 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>15.0</VCProjectVersion>
<ProjectGuid>{B2F4BFFE-A94D-4C9B-8B1E-83160D24ADF5}</ProjectGuid>
<RootNamespace>CoreXimgprocSeg</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.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>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</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" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>C:\OpenCV\opencv_contrib-3.4.1\modules\ximgproc\include;C:\OpenCV\opencv-3.4.1\modules\highgui\include;C:\OpenCV\opencv-3.4.1\modules\imgproc\include;C:\OpenCV\opencv-3.4.1\include;C:\OpenCV\opencv-3.4.1\modules\core\include;C:\OpenCV\opencv-3.4.1\modules\imgcodecs\include;C:\OpenCV\build;C:\OpenCV\opencv-3.4.1\modules\videoio\include;$(IncludePath)</IncludePath>
<LibraryPath>C:\OpenCV\build\lib\Debug;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Lib>
<AdditionalDependencies>opencv_core341d.lib;opencv_ximgproc341d.lib;opencv_imgproc341d.lib;opencv_highgui341d.lib;opencv_imgcodecs341d.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="Core.h" />
<ClInclude Include="Entity.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Entity.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
30 changes: 30 additions & 0 deletions CoreXimgprocSeg/CoreXimgprocSeg.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?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;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;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>
<ClInclude Include="Entity.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Core.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Entity.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
84 changes: 84 additions & 0 deletions CoreXimgprocSeg/Entity.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
//Entity.cpp
#include "Entity.h"
#include "opencv2/ximgproc/segmentation.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
#include <ctime>

using namespace cv;
using namespace cv::ximgproc::segmentation;

namespace CoreXimgprocSeg
{
Entity::Entity()
{
//std::cout << "Created the Entity object!" << std::endl;
}

std::vector<CoreXimgprocSeg::RectCLR> Entity::Move(const char* fileName, const char* strategyType)
{
//std::cout << std::endl << "Start.." << std::endl;

Mat img = imread(fileName);

Ptr<SelectiveSearchSegmentation> gs = createSelectiveSearchSegmentation();
gs->setBaseImage(img);

if (strategyType[0] == 's') {
gs->switchToSingleStrategy();
}
else if (strategyType[0] == 'q') {
gs->switchToSelectiveSearchQuality();
}
else {
gs->switchToSelectiveSearchFast();
}

std::vector<cv::Rect> rects;
gs->process(rects);

std::vector<CoreXimgprocSeg::RectCLR> rectsCLR;
//rectsCLR.reserve(rects.size());


for (std::vector<cv::Rect>::iterator it = rects.begin(); it != rects.end(); ++it) {

rectsCLR.push_back(RectCLR((*it).x, (*it).y, (*it).width, (*it).height));
}

return rectsCLR;

/*int nb_rects = 10;
std::cout << std::endl <<
"Use a to display less rects, d to display more rects, q to quit" << std::endl;
char c = (char)waitKey();
while (c != 'q') {
Mat wimg = img.clone();
int i = 0;
for (std::vector<Rect>::iterator it = rects.begin(); it != rects.end(); ++it) {
if (i++ < nb_rects) {
rectangle(wimg, *it, Scalar(0, 0, 255));
}
}
imshow("Output", wimg);
c = (char)waitKey();
if (c == 'd') {
nb_rects += 10;
}
if (c == 'a' && nb_rects > 10) {
nb_rects -= 10;
}
}*/
}
}
26 changes: 26 additions & 0 deletions CoreXimgprocSeg/Entity.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//Entity.h
#pragma once
#include <vector>

namespace CoreXimgprocSeg
{
struct RectCLR
{
int x;
int y;
int width;
int height;

RectCLR(int x, int y, int width, int height)
: x(x), y(y), width(width), height(height)
{}
};

class Entity
{
public:
Entity();

std::vector<CoreXimgprocSeg::RectCLR> Move(const char* fileName, const char* strategyType);
};
}
6 changes: 6 additions & 0 deletions CoreXimgprocSegConsoleApp/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
Loading

0 comments on commit 7c0a298

Please sign in to comment.