머지
This commit is contained in:
@@ -65,6 +65,20 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "edge", "Homework\edge\edge.
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "YCbCrHist", "Homework\YCbCrHist\YCbCrHist.vcxproj", "{2DB82859-6BEC-40B4-A8CA-BFA2C60145B0}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "YCbCrHist", "Homework\YCbCrHist\YCbCrHist.vcxproj", "{2DB82859-6BEC-40B4-A8CA-BFA2C60145B0}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ch11", "ch11", "{94FE4669-77AC-4D41-8E24-F5DEDEAC930F}"
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "thershhold", "ch11\thershhold\thershhold.vcxproj", "{12A25565-0007-412B-9490-9AA28305272D}"
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "adaptive", "ch11\adaptive\adaptive.vcxproj", "{8F873187-A5F8-4D02-ABE9-BF652FE53BC3}"
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "morphology", "ch11\morphology\morphology.vcxproj", "{9BD9A147-29ED-4F6C-8BFD-71F03E56332C}"
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ch12", "ch12", "{792AFFC9-6147-4A66-B676-D64FB3E62F2E}"
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "labeling", "ch12\labeling\labeling.vcxproj", "{AC2741E6-3BF6-417D-8CE5-82696760AC35}"
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "findcts", "ch12\findcts\findcts.vcxproj", "{6F3AAF9A-D050-4BE9-A2F7-3E0CAB16E69E}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|x64 = Debug|x64
|
Debug|x64 = Debug|x64
|
||||||
@@ -241,6 +255,46 @@ Global
|
|||||||
{2DB82859-6BEC-40B4-A8CA-BFA2C60145B0}.Release|x64.Build.0 = Release|x64
|
{2DB82859-6BEC-40B4-A8CA-BFA2C60145B0}.Release|x64.Build.0 = Release|x64
|
||||||
{2DB82859-6BEC-40B4-A8CA-BFA2C60145B0}.Release|x86.ActiveCfg = Release|Win32
|
{2DB82859-6BEC-40B4-A8CA-BFA2C60145B0}.Release|x86.ActiveCfg = Release|Win32
|
||||||
{2DB82859-6BEC-40B4-A8CA-BFA2C60145B0}.Release|x86.Build.0 = Release|Win32
|
{2DB82859-6BEC-40B4-A8CA-BFA2C60145B0}.Release|x86.Build.0 = Release|Win32
|
||||||
|
{12A25565-0007-412B-9490-9AA28305272D}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{12A25565-0007-412B-9490-9AA28305272D}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{12A25565-0007-412B-9490-9AA28305272D}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
|
{12A25565-0007-412B-9490-9AA28305272D}.Debug|x86.Build.0 = Debug|Win32
|
||||||
|
{12A25565-0007-412B-9490-9AA28305272D}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{12A25565-0007-412B-9490-9AA28305272D}.Release|x64.Build.0 = Release|x64
|
||||||
|
{12A25565-0007-412B-9490-9AA28305272D}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
{12A25565-0007-412B-9490-9AA28305272D}.Release|x86.Build.0 = Release|Win32
|
||||||
|
{8F873187-A5F8-4D02-ABE9-BF652FE53BC3}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{8F873187-A5F8-4D02-ABE9-BF652FE53BC3}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{8F873187-A5F8-4D02-ABE9-BF652FE53BC3}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
|
{8F873187-A5F8-4D02-ABE9-BF652FE53BC3}.Debug|x86.Build.0 = Debug|Win32
|
||||||
|
{8F873187-A5F8-4D02-ABE9-BF652FE53BC3}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{8F873187-A5F8-4D02-ABE9-BF652FE53BC3}.Release|x64.Build.0 = Release|x64
|
||||||
|
{8F873187-A5F8-4D02-ABE9-BF652FE53BC3}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
{8F873187-A5F8-4D02-ABE9-BF652FE53BC3}.Release|x86.Build.0 = Release|Win32
|
||||||
|
{9BD9A147-29ED-4F6C-8BFD-71F03E56332C}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{9BD9A147-29ED-4F6C-8BFD-71F03E56332C}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{9BD9A147-29ED-4F6C-8BFD-71F03E56332C}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
|
{9BD9A147-29ED-4F6C-8BFD-71F03E56332C}.Debug|x86.Build.0 = Debug|Win32
|
||||||
|
{9BD9A147-29ED-4F6C-8BFD-71F03E56332C}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{9BD9A147-29ED-4F6C-8BFD-71F03E56332C}.Release|x64.Build.0 = Release|x64
|
||||||
|
{9BD9A147-29ED-4F6C-8BFD-71F03E56332C}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
{9BD9A147-29ED-4F6C-8BFD-71F03E56332C}.Release|x86.Build.0 = Release|Win32
|
||||||
|
{AC2741E6-3BF6-417D-8CE5-82696760AC35}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{AC2741E6-3BF6-417D-8CE5-82696760AC35}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{AC2741E6-3BF6-417D-8CE5-82696760AC35}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
|
{AC2741E6-3BF6-417D-8CE5-82696760AC35}.Debug|x86.Build.0 = Debug|Win32
|
||||||
|
{AC2741E6-3BF6-417D-8CE5-82696760AC35}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{AC2741E6-3BF6-417D-8CE5-82696760AC35}.Release|x64.Build.0 = Release|x64
|
||||||
|
{AC2741E6-3BF6-417D-8CE5-82696760AC35}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
{AC2741E6-3BF6-417D-8CE5-82696760AC35}.Release|x86.Build.0 = Release|Win32
|
||||||
|
{6F3AAF9A-D050-4BE9-A2F7-3E0CAB16E69E}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{6F3AAF9A-D050-4BE9-A2F7-3E0CAB16E69E}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{6F3AAF9A-D050-4BE9-A2F7-3E0CAB16E69E}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
|
{6F3AAF9A-D050-4BE9-A2F7-3E0CAB16E69E}.Debug|x86.Build.0 = Debug|Win32
|
||||||
|
{6F3AAF9A-D050-4BE9-A2F7-3E0CAB16E69E}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{6F3AAF9A-D050-4BE9-A2F7-3E0CAB16E69E}.Release|x64.Build.0 = Release|x64
|
||||||
|
{6F3AAF9A-D050-4BE9-A2F7-3E0CAB16E69E}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
{6F3AAF9A-D050-4BE9-A2F7-3E0CAB16E69E}.Release|x86.Build.0 = Release|Win32
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
@@ -267,6 +321,11 @@ Global
|
|||||||
{F7126457-CC07-433A-B762-C4DFB352653C} = {2BBACE58-DAC1-4D1E-85FC-3A3E9F789D9B}
|
{F7126457-CC07-433A-B762-C4DFB352653C} = {2BBACE58-DAC1-4D1E-85FC-3A3E9F789D9B}
|
||||||
{85DBF128-C338-4C43-B575-87C1B8CD2EFA} = {E583E257-9FCE-4A4B-A554-8514F982D1BF}
|
{85DBF128-C338-4C43-B575-87C1B8CD2EFA} = {E583E257-9FCE-4A4B-A554-8514F982D1BF}
|
||||||
{2DB82859-6BEC-40B4-A8CA-BFA2C60145B0} = {E583E257-9FCE-4A4B-A554-8514F982D1BF}
|
{2DB82859-6BEC-40B4-A8CA-BFA2C60145B0} = {E583E257-9FCE-4A4B-A554-8514F982D1BF}
|
||||||
|
{12A25565-0007-412B-9490-9AA28305272D} = {94FE4669-77AC-4D41-8E24-F5DEDEAC930F}
|
||||||
|
{8F873187-A5F8-4D02-ABE9-BF652FE53BC3} = {94FE4669-77AC-4D41-8E24-F5DEDEAC930F}
|
||||||
|
{9BD9A147-29ED-4F6C-8BFD-71F03E56332C} = {94FE4669-77AC-4D41-8E24-F5DEDEAC930F}
|
||||||
|
{AC2741E6-3BF6-417D-8CE5-82696760AC35} = {792AFFC9-6147-4A66-B676-D64FB3E62F2E}
|
||||||
|
{6F3AAF9A-D050-4BE9-A2F7-3E0CAB16E69E} = {792AFFC9-6147-4A66-B676-D64FB3E62F2E}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {E1A0C3F4-F16D-4626-86CE-D8484C0C776D}
|
SolutionGuid = {E1A0C3F4-F16D-4626-86CE-D8484C0C776D}
|
||||||
|
|||||||
139
ch11/adaptive/adaptive.vcxproj
Normal file
139
ch11/adaptive/adaptive.vcxproj
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
<?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>17.0</VCProjectVersion>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
<ProjectGuid>{8f873187-a5f8-4d02-abe9-bf652fe53bc3}</ProjectGuid>
|
||||||
|
<RootNamespace>adaptive</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" />
|
||||||
|
<Import Project="..\..\OPENCV4110_debug.props" />
|
||||||
|
</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" />
|
||||||
|
<Import Project="..\..\OPENCV4110_release.props" />
|
||||||
|
</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" />
|
||||||
|
<Import Project="..\..\OPENCV4110_debug.props" />
|
||||||
|
</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" />
|
||||||
|
<Import Project="..\..\OPENCV4110_release.props" />
|
||||||
|
</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>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</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>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</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>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="main.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
||||||
22
ch11/adaptive/adaptive.vcxproj.filters
Normal file
22
ch11/adaptive/adaptive.vcxproj.filters
Normal file
@@ -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="소스 파일">
|
||||||
|
<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="헤더 파일">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="리소스 파일">
|
||||||
|
<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>소스 파일</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
43
ch11/adaptive/main.cpp
Normal file
43
ch11/adaptive/main.cpp
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include "opencv2/opencv.hpp"
|
||||||
|
|
||||||
|
using namespace cv;
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
void on_trackbar(int pos, void* userdata);
|
||||||
|
|
||||||
|
int main(int argc, char* argv[]) {
|
||||||
|
Mat src;
|
||||||
|
|
||||||
|
if (argc < 2)
|
||||||
|
src = imread("../../resources/images/sudoku.jpg", IMREAD_GRAYSCALE);
|
||||||
|
else
|
||||||
|
src = imread(argv[1], IMREAD_GRAYSCALE);
|
||||||
|
|
||||||
|
if (src.empty()) {
|
||||||
|
cerr << "Image load failed!" << endl;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
imshow("src", src);
|
||||||
|
|
||||||
|
namedWindow("dst");
|
||||||
|
createTrackbar("Block size", "dst", 0, 200, on_trackbar, (void*)&src);
|
||||||
|
setTrackbarPos("Block size", "dst", 11);
|
||||||
|
|
||||||
|
cv::waitKey();
|
||||||
|
cv::destroyAllWindows();
|
||||||
|
}
|
||||||
|
|
||||||
|
void on_trackbar(int pos, void* userdata) {
|
||||||
|
Mat src = *(Mat*)userdata;
|
||||||
|
|
||||||
|
int bsize = pos;
|
||||||
|
if (bsize % 2 == 0) bsize--;
|
||||||
|
if (bsize < 3) bsize = 3;
|
||||||
|
|
||||||
|
Mat dst;
|
||||||
|
adaptiveThreshold(src, dst, 255, ADAPTIVE_THRESH_GAUSSIAN_C, THRESH_BINARY, bsize, 5);
|
||||||
|
|
||||||
|
imshow("dst", dst);
|
||||||
|
}
|
||||||
72
ch11/morphology/main.cpp
Normal file
72
ch11/morphology/main.cpp
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include "opencv2/opencv.hpp"
|
||||||
|
|
||||||
|
using namespace cv;
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
void erode_dilate() {
|
||||||
|
Mat src = imread("../../resources/images/milkdrop.bmp", IMREAD_GRAYSCALE);
|
||||||
|
Mat bin;
|
||||||
|
threshold(src, bin, 0, 255, THRESH_BINARY | THRESH_OTSU);
|
||||||
|
|
||||||
|
Mat dst1, dst2;
|
||||||
|
erode(bin, dst1, getStructuringElement(MorphShapes::MORPH_CROSS, Size(7, 7)));
|
||||||
|
dilate(bin, dst2, getStructuringElement(MorphShapes::MORPH_ELLIPSE, Size(3, 5)));
|
||||||
|
|
||||||
|
imshow("src", src);
|
||||||
|
imshow("bin", bin);
|
||||||
|
imshow("erode", dst1);
|
||||||
|
imshow("dilate", dst2);
|
||||||
|
|
||||||
|
cv::waitKey();
|
||||||
|
cv::destroyAllWindows();
|
||||||
|
}
|
||||||
|
|
||||||
|
void open_close() {
|
||||||
|
cv::VideoCapture video("../../resources/images/vtest.avi");
|
||||||
|
if (!video.isOpened()) {
|
||||||
|
std::cerr << "camera.isopened()" << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
cv::Mat src;
|
||||||
|
cv::Mat prevSrc;
|
||||||
|
double fps = 1000 / video.get(cv::VideoCaptureProperties::CAP_PROP_FPS);
|
||||||
|
std::cout << "\n\n" << fps << "\n\n";
|
||||||
|
while (true) {
|
||||||
|
prevSrc = src;
|
||||||
|
video >> src;
|
||||||
|
if (src.empty()) {
|
||||||
|
std::cerr << "img.empty()" << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
cv::imshow("src", src);
|
||||||
|
if (cv::waitKey(fps) == 27)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
cv::cvtColor(src, src, cv::COLOR_BGR2GRAY);
|
||||||
|
src.convertTo(src, CV_8U);
|
||||||
|
|
||||||
|
Mat bin;
|
||||||
|
threshold(src, bin, 0, 255, THRESH_BINARY | THRESH_OTSU);
|
||||||
|
|
||||||
|
Mat dst1, dst2, dst3, dst4, dst5;
|
||||||
|
morphologyEx(bin, dst1, MORPH_OPEN, Mat());
|
||||||
|
morphologyEx(bin, dst2, MORPH_CLOSE, Mat());
|
||||||
|
morphologyEx(bin, dst3, MORPH_GRADIENT, Mat());
|
||||||
|
Canny(bin, dst4, 30, 127);
|
||||||
|
dst5 = std::abs(src - prevSrc);
|
||||||
|
|
||||||
|
imshow("src", src);
|
||||||
|
imshow("bin", bin);
|
||||||
|
imshow("erode", dst1);
|
||||||
|
imshow("dilate", dst2);
|
||||||
|
imshow("gradient", dst3);
|
||||||
|
imshow("Canny", dst4);
|
||||||
|
|
||||||
|
cv::waitKey();
|
||||||
|
cv::destroyAllWindows();
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char* argv[]) {
|
||||||
|
open_close();
|
||||||
|
}
|
||||||
145
ch11/morphology/morphology.vcxproj
Normal file
145
ch11/morphology/morphology.vcxproj
Normal file
@@ -0,0 +1,145 @@
|
|||||||
|
<?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>17.0</VCProjectVersion>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
<ProjectGuid>{9bd9a147-29ed-4f6c-8bfd-71f03e56332c}</ProjectGuid>
|
||||||
|
<RootNamespace>morphology</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" />
|
||||||
|
<Import Project="..\..\OPENCV4110_debug.props" />
|
||||||
|
</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" />
|
||||||
|
<Import Project="..\..\OPENCV4110_release.props" />
|
||||||
|
</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" />
|
||||||
|
<Import Project="..\..\OPENCV4110_debug.props" />
|
||||||
|
</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" />
|
||||||
|
<Import Project="..\..\OPENCV4110_release.props" />
|
||||||
|
</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>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</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>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</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>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="main.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Image Include="..\..\resources\images\milkdrop.bmp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="..\..\resources\images\vtest.avi" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
||||||
32
ch11/morphology/morphology.vcxproj.filters
Normal file
32
ch11/morphology/morphology.vcxproj.filters
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="소스 파일">
|
||||||
|
<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="헤더 파일">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="리소스 파일">
|
||||||
|
<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>소스 파일</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Image Include="..\..\resources\images\milkdrop.bmp">
|
||||||
|
<Filter>리소스 파일</Filter>
|
||||||
|
</Image>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="..\..\resources\images\vtest.avi">
|
||||||
|
<Filter>리소스 파일</Filter>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
54
ch11/thershhold/main.cpp
Normal file
54
ch11/thershhold/main.cpp
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include "opencv2/opencv.hpp"
|
||||||
|
|
||||||
|
using namespace cv;
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
void on_trackbar(int pos, void* userdata);
|
||||||
|
|
||||||
|
int main(int argc, char* argv[]) {
|
||||||
|
Mat src;
|
||||||
|
|
||||||
|
if (argc < 2)
|
||||||
|
src = imread("../../resources/images/neutrophils.png", IMREAD_GRAYSCALE);
|
||||||
|
else
|
||||||
|
src = imread(argv[1], IMREAD_GRAYSCALE);
|
||||||
|
|
||||||
|
if (src.empty()) {
|
||||||
|
cerr << "Image load failed!" << endl;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
namedWindow("dst");
|
||||||
|
createTrackbar("Threshold", "dst", 0, 255, on_trackbar, (void*)&src);
|
||||||
|
setTrackbarPos("Threshold", "dst", 128);
|
||||||
|
|
||||||
|
cv::waitKey();
|
||||||
|
cv::destroyAllWindows();
|
||||||
|
}
|
||||||
|
|
||||||
|
void on_trackbar(int pos, void* userdata) {
|
||||||
|
Mat src = *(Mat*)userdata;
|
||||||
|
|
||||||
|
Mat hist;
|
||||||
|
int channels[] = { 0 };
|
||||||
|
int dims = 1;
|
||||||
|
const int histSize[] = { 256 };
|
||||||
|
float graylevel[] = { 0, 256 };
|
||||||
|
const float* ranges[] = { graylevel };
|
||||||
|
|
||||||
|
calcHist(&src, 1, channels, noArray(), hist, dims, histSize, ranges);
|
||||||
|
double histMax;
|
||||||
|
minMaxLoc(hist, 0, &histMax);
|
||||||
|
Mat imgHist(100, 256, CV_8UC1, Scalar(255));
|
||||||
|
for (int i = 0; i < 256; i++) {
|
||||||
|
line(imgHist, Point(i, 100), Point(i, 100 - cvRound(hist.at<float>(i, 0) * 100 / histMax)), Scalar(0));
|
||||||
|
}
|
||||||
|
line(imgHist, Point(pos, 0), Point(pos, 100), 0, 1, LINE_AA);
|
||||||
|
|
||||||
|
Mat dst;
|
||||||
|
threshold(src, dst, pos, 255, THRESH_BINARY);
|
||||||
|
|
||||||
|
imshow("dst", dst);
|
||||||
|
imshow("hist", imgHist);
|
||||||
|
}
|
||||||
144
ch11/thershhold/thershhold.vcxproj
Normal file
144
ch11/thershhold/thershhold.vcxproj
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
<?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>17.0</VCProjectVersion>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
<ProjectGuid>{12a25565-0007-412b-9490-9aa28305272d}</ProjectGuid>
|
||||||
|
<RootNamespace>thershhold</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" />
|
||||||
|
<Import Project="..\..\OPENCV4110_debug.props" />
|
||||||
|
</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" />
|
||||||
|
<Import Project="..\..\OPENCV4110_release.props" />
|
||||||
|
</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" />
|
||||||
|
<Import Project="..\..\OPENCV4110_debug.props" />
|
||||||
|
</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" />
|
||||||
|
<Import Project="..\..\OPENCV4110_release.props" />
|
||||||
|
</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>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</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>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</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>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="main.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Image Include="..\..\resources\images\Cameraman256.bmp" />
|
||||||
|
<Image Include="..\..\resources\images\document.bmp" />
|
||||||
|
<Image Include="..\..\resources\images\neutrophils.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
||||||
33
ch11/thershhold/thershhold.vcxproj.filters
Normal file
33
ch11/thershhold/thershhold.vcxproj.filters
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="소스 파일">
|
||||||
|
<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="헤더 파일">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="리소스 파일">
|
||||||
|
<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>소스 파일</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Image Include="..\..\resources\images\document.bmp">
|
||||||
|
<Filter>리소스 파일</Filter>
|
||||||
|
</Image>
|
||||||
|
<Image Include="..\..\resources\images\Cameraman256.bmp">
|
||||||
|
<Filter>리소스 파일</Filter>
|
||||||
|
</Image>
|
||||||
|
<Image Include="..\..\resources\images\neutrophils.png">
|
||||||
|
<Filter>리소스 파일</Filter>
|
||||||
|
</Image>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
142
ch12/findcts/findcts.vcxproj
Normal file
142
ch12/findcts/findcts.vcxproj
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
<?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>17.0</VCProjectVersion>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
<ProjectGuid>{6f3aaf9a-d050-4be9-a2f7-3e0cab16e69e}</ProjectGuid>
|
||||||
|
<RootNamespace>findcts</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" />
|
||||||
|
<Import Project="..\..\OPENCV4110_debug.props" />
|
||||||
|
</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" />
|
||||||
|
<Import Project="..\..\OPENCV4110_release.props" />
|
||||||
|
</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" />
|
||||||
|
<Import Project="..\..\OPENCV4110_debug.props" />
|
||||||
|
</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" />
|
||||||
|
<Import Project="..\..\OPENCV4110_release.props" />
|
||||||
|
</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>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</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>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</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>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="main.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Image Include="..\..\resources\images\beta.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
||||||
27
ch12/findcts/findcts.vcxproj.filters
Normal file
27
ch12/findcts/findcts.vcxproj.filters
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="소스 파일">
|
||||||
|
<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="헤더 파일">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="리소스 파일">
|
||||||
|
<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>소스 파일</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Image Include="..\..\resources\images\beta.png">
|
||||||
|
<Filter>리소스 파일</Filter>
|
||||||
|
</Image>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
133
ch12/findcts/main.cpp
Normal file
133
ch12/findcts/main.cpp
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include "opencv2/opencv.hpp"
|
||||||
|
using namespace cv;
|
||||||
|
|
||||||
|
void contours_basic() {
|
||||||
|
Mat src = imread("../../resources/images/contours.bmp", IMREAD_GRAYSCALE);
|
||||||
|
|
||||||
|
std::vector<std::vector<Point>> contours;
|
||||||
|
findContours(src, contours, RETR_LIST, CHAIN_APPROX_NONE);
|
||||||
|
|
||||||
|
Mat dst;
|
||||||
|
cvtColor(src, dst, COLOR_GRAY2BGR);
|
||||||
|
|
||||||
|
for (int i = 0; i < contours.size(); i++) {
|
||||||
|
Scalar c(rand() & 255, rand() & 255, rand() & 255);
|
||||||
|
drawContours(dst, contours, i, c, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
imshow("src", src);
|
||||||
|
imshow("dst", dst);
|
||||||
|
|
||||||
|
waitKey();
|
||||||
|
destroyAllWindows();
|
||||||
|
}
|
||||||
|
|
||||||
|
void contours_hier() {
|
||||||
|
Mat src = imread("../../resources/images/contours.bmp", IMREAD_GRAYSCALE);
|
||||||
|
|
||||||
|
std::vector<std::vector<Point>> contours;
|
||||||
|
std::vector<Vec4i> hirarchy;
|
||||||
|
findContours(src, contours, hirarchy, RETR_CCOMP, CHAIN_APPROX_NONE);
|
||||||
|
|
||||||
|
Mat dst;
|
||||||
|
cvtColor(src, dst, COLOR_GRAY2BGR);
|
||||||
|
|
||||||
|
for (int i = 0; i >= 0; i = hirarchy[i][0]) {
|
||||||
|
Scalar c(rand() & 255, rand() & 255, rand() & 255);
|
||||||
|
drawContours(dst, contours, i, c, -1, LINE_8, hirarchy);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < contours.size(); i++) {
|
||||||
|
std::cout << "Hirarchy of contour index: " << i << "-->" << hirarchy[i] << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
imshow("src", src);
|
||||||
|
imshow("dst", dst);
|
||||||
|
|
||||||
|
waitKey();
|
||||||
|
destroyAllWindows();
|
||||||
|
}
|
||||||
|
|
||||||
|
void contour_apps() {
|
||||||
|
Mat src = imread("../../resources/images/beta.png", IMREAD_GRAYSCALE);
|
||||||
|
|
||||||
|
Mat bin;
|
||||||
|
std::vector<std::vector<Point>> contours;
|
||||||
|
std::vector<Vec4i> hirarchy;
|
||||||
|
threshold(src, bin, 128, 255, THRESH_BINARY | THRESH_OTSU);
|
||||||
|
morphologyEx(bin, bin, MORPH_OPEN, Mat(), Point(-1, -1), 1);
|
||||||
|
|
||||||
|
findContours(bin, contours, hirarchy, RETR_TREE, CHAIN_APPROX_NONE);
|
||||||
|
|
||||||
|
Mat dst;
|
||||||
|
cvtColor(src, dst, COLOR_GRAY2BGR);
|
||||||
|
|
||||||
|
for (int idx = 0; idx >= 0; idx = hirarchy[idx][0]) {
|
||||||
|
Scalar c(rand() & 255, rand() & 255, rand() & 255);
|
||||||
|
drawContours(dst, contours, idx, c, 2, LINE_AA, hirarchy, 2, Point(0, 0));
|
||||||
|
|
||||||
|
Rect rect = boundingRect(contours[idx]);
|
||||||
|
rectangle(dst, rect, Scalar(0, 0, 255), 2, LINE_AA, 0);
|
||||||
|
|
||||||
|
RotatedRect rrect = minAreaRect(contours[idx]);
|
||||||
|
Point2f vertices[4];
|
||||||
|
rrect.points(vertices);
|
||||||
|
for (int i = 0; i < 4; i++)
|
||||||
|
line(dst, vertices[i], vertices[(i + 1 & 3)], Scalar(255, 0, 0), 2, LINE_AA, 0);
|
||||||
|
float angle = rrect.angle;
|
||||||
|
std::cout << "\nrotated angle: " << cvRound(angle) << std::endl;
|
||||||
|
|
||||||
|
Point2f center;
|
||||||
|
float radius;
|
||||||
|
minEnclosingCircle(contours[idx], center, radius);
|
||||||
|
circle(dst, center, radius, Scalar(0, 255, 255), 2, LINE_AA, 0);
|
||||||
|
|
||||||
|
double len = arcLength(contours[idx], true);
|
||||||
|
std::cout << "\nlength of contour: " << cvRound(len) << std::endl;
|
||||||
|
|
||||||
|
double area = contourArea(contours[idx], false);
|
||||||
|
std::cout << "\narea of contour: " << cvRound(area) << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
imshow("dst", dst);
|
||||||
|
|
||||||
|
waitKey();
|
||||||
|
destroyAllWindows();
|
||||||
|
}
|
||||||
|
|
||||||
|
void contour_approximation() {
|
||||||
|
Mat src = imread("../../resources/images/kmap_simple.jpg", IMREAD_GRAYSCALE);
|
||||||
|
|
||||||
|
Mat bin;
|
||||||
|
std::vector<std::vector<Point>> contours;
|
||||||
|
std::vector<Vec4i> hirarchy;
|
||||||
|
threshold(src, bin, 128, 255, THRESH_BINARY | THRESH_OTSU);
|
||||||
|
findContours(bin, contours, hirarchy, RETR_TREE, CHAIN_APPROX_NONE);
|
||||||
|
Mat dst;
|
||||||
|
cvtColor(src, dst, COLOR_GRAY2BGR);
|
||||||
|
for (int idx = 0; idx >= 0; idx = hirarchy[idx][0]) {
|
||||||
|
Scalar c(rand() & 255, rand() & 255, rand() & 255);
|
||||||
|
drawContours(dst, contours, idx, c, 2, LINE_AA, hirarchy, 2, Point(0, 0));
|
||||||
|
|
||||||
|
std::vector<Point> approxCurve;
|
||||||
|
approxPolyDP(contours[idx], approxCurve, arcLength(contours[idx], true) * 0.005, true);
|
||||||
|
int no_vertex = approxCurve.size();
|
||||||
|
std::cout << "The nimber of vertex: " << no_vertex << std::endl;
|
||||||
|
for (int v = 0; v < no_vertex; v++) {
|
||||||
|
circle(dst, approxCurve[v], 3, Scalar(0, 0, 255), 2);
|
||||||
|
line(dst, approxCurve[v], approxCurve[(v+1) % no_vertex], Scalar(255, 255, 0), 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
imshow("src", src);
|
||||||
|
imshow("dst", dst);
|
||||||
|
|
||||||
|
waitKey();
|
||||||
|
destroyAllWindows();
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
contour_approximation();
|
||||||
|
}
|
||||||
142
ch12/labeling/labeling.vcxproj
Normal file
142
ch12/labeling/labeling.vcxproj
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
<?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>17.0</VCProjectVersion>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
<ProjectGuid>{ac2741e6-3bf6-417d-8ce5-82696760ac35}</ProjectGuid>
|
||||||
|
<RootNamespace>labeling</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" />
|
||||||
|
<Import Project="..\..\OPENCV4110_debug.props" />
|
||||||
|
</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" />
|
||||||
|
<Import Project="..\..\OPENCV4110_release.props" />
|
||||||
|
</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" />
|
||||||
|
<Import Project="..\..\OPENCV4110_debug.props" />
|
||||||
|
</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" />
|
||||||
|
<Import Project="..\..\OPENCV4110_release.props" />
|
||||||
|
</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>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</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>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</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>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="main.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Image Include="..\..\resources\images\keyboard.bmp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
||||||
27
ch12/labeling/labeling.vcxproj.filters
Normal file
27
ch12/labeling/labeling.vcxproj.filters
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="소스 파일">
|
||||||
|
<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="헤더 파일">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="리소스 파일">
|
||||||
|
<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>소스 파일</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Image Include="..\..\resources\images\keyboard.bmp">
|
||||||
|
<Filter>리소스 파일</Filter>
|
||||||
|
</Image>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
61
ch12/labeling/main.cpp
Normal file
61
ch12/labeling/main.cpp
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include "opencv2/opencv.hpp"
|
||||||
|
using namespace cv;
|
||||||
|
|
||||||
|
void labeling_basic() {
|
||||||
|
uchar data[] = {
|
||||||
|
0, 0, 1, 1, 0, 0, 0, 0,
|
||||||
|
1, 1, 1, 1, 0, 0, 1, 0,
|
||||||
|
1, 1, 1, 1, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0, 1, 1, 0,
|
||||||
|
0, 0, 0, 1, 1, 1, 1, 0,
|
||||||
|
0, 0, 0, 1, 0, 0, 1, 0,
|
||||||
|
0, 0, 1, 1, 1, 1, 1, 0,
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0
|
||||||
|
};
|
||||||
|
|
||||||
|
Mat src = Mat(8, 8, CV_8UC1, data) * 255;
|
||||||
|
|
||||||
|
Mat labels;
|
||||||
|
int cnt = connectedComponents(src, labels);
|
||||||
|
|
||||||
|
std::cout << "src:\n" << src << std::endl;
|
||||||
|
std::cout << "lables:\n" << labels << std::endl;
|
||||||
|
std::cout << "number of lables:\n" << cnt << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
void labling_stats() {
|
||||||
|
Mat src = imread("../../resources/images/keyboard.bmp", IMREAD_GRAYSCALE);
|
||||||
|
|
||||||
|
Mat bin;
|
||||||
|
threshold(src, bin, 0, 255, THRESH_BINARY | THRESH_OTSU);
|
||||||
|
|
||||||
|
Mat labels, stats, centroids;
|
||||||
|
int cnt = connectedComponentsWithStats(bin, labels, stats, centroids);
|
||||||
|
|
||||||
|
Mat dst;
|
||||||
|
cvtColor(src, dst, COLOR_GRAY2BGR);
|
||||||
|
|
||||||
|
for (int i = 1; i < cnt; i++) {
|
||||||
|
int* p = stats.ptr<int>(i);
|
||||||
|
double* c = centroids.ptr<double>(i);
|
||||||
|
|
||||||
|
//if (p[4] < 20)
|
||||||
|
// continue;
|
||||||
|
|
||||||
|
rectangle(dst, Rect(p[0], p[1], p[2], p[3]), Scalar(0, 255, 255), 2);
|
||||||
|
char num[30] = { '0' + i, '\0'};
|
||||||
|
sprintf_s(num, "%d", i);
|
||||||
|
putText(dst, num, Point(c[0], c[1]), FONT_HERSHEY_PLAIN, 1.2, Scalar(0, 0, 255));
|
||||||
|
}
|
||||||
|
|
||||||
|
imshow("src", src);
|
||||||
|
imshow("dst", dst);
|
||||||
|
|
||||||
|
waitKey();
|
||||||
|
destroyAllWindows();
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
labling_stats();
|
||||||
|
}
|
||||||
BIN
resources/images/beta.png
(Stored with Git LFS)
Normal file
BIN
resources/images/beta.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
resources/images/document.bmp
(Stored with Git LFS)
Normal file
BIN
resources/images/document.bmp
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
resources/images/kmap_simple.jpg
(Stored with Git LFS)
Normal file
BIN
resources/images/kmap_simple.jpg
(Stored with Git LFS)
Normal file
Binary file not shown.
Reference in New Issue
Block a user