Commit be394247 authored by BORNON Théophile's avatar BORNON Théophile

V1.0.0

parent bdf3478e
...@@ -256,4 +256,11 @@ paket-files/ ...@@ -256,4 +256,11 @@ paket-files/
# Python Tools for Visual Studio (PTVS) # Python Tools for Visual Studio (PTVS)
__pycache__/ __pycache__/
*.pyc *.pyc
\ No newline at end of file /S04_Projet/bin/Debug/sharpen.bmp
/S04_Projet/bin/Debug/id.bmp
/S04_Projet/bin/Debug/edge3.bmp
/S04_Projet/bin/Debug/edge2.bmp
/S04_Projet/bin/Debug/edge1.bmp
/S04_Projet/bin/Debug/blur.bmp
/ImageProcessing_Benchmark/bin/Debug/ImageProcessing_Benchmark.exe.config
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15 # Visual Studio 15
VisualStudioVersion = 15.0.27130.2026 VisualStudioVersion = 15.0.27004.2010
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageProcessing", "S04_Projet\ImageProcessing.csproj", "{229D3602-654B-498B-9478-5CC3982C358C}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageProcessing", "S04_Projet\ImageProcessing.csproj", "{229D3602-654B-498B-9478-5CC3982C358C}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageProcessing_Benchmark", "ImageProcessing_Benchmark\ImageProcessing_Benchmark.csproj", "{54D04E0E-009D-4928-BEF8-B2FF464536CC}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageProcessing_Benchmark", "ImageProcessing_Benchmark\ImageProcessing_Benchmark.csproj", "{54D04E0E-009D-4928-BEF8-B2FF464536CC}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageProcessing_Test", "ImageProcessing_Test\ImageProcessing_Test.csproj", "{F0906169-0946-4552-A06C-1D57C52B1C10}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
...@@ -21,6 +23,10 @@ Global ...@@ -21,6 +23,10 @@ Global
{54D04E0E-009D-4928-BEF8-B2FF464536CC}.Debug|Any CPU.Build.0 = Debug|Any CPU {54D04E0E-009D-4928-BEF8-B2FF464536CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{54D04E0E-009D-4928-BEF8-B2FF464536CC}.Release|Any CPU.ActiveCfg = Release|Any CPU {54D04E0E-009D-4928-BEF8-B2FF464536CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{54D04E0E-009D-4928-BEF8-B2FF464536CC}.Release|Any CPU.Build.0 = Release|Any CPU {54D04E0E-009D-4928-BEF8-B2FF464536CC}.Release|Any CPU.Build.0 = Release|Any CPU
{F0906169-0946-4552-A06C-1D57C52B1C10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0906169-0946-4552-A06C-1D57C52B1C10}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0906169-0946-4552-A06C-1D57C52B1C10}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F0906169-0946-4552-A06C-1D57C52B1C10}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F0906169-0946-4552-A06C-1D57C52B1C10}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ImageProcessing_Test</RootNamespace>
<AssemblyName>ImageProcessing_Test</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.1.1.18\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.1.1.18\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="Pixel_Test.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\S04_Projet\ImageProcessing.csproj">
<Project>{229d3602-654b-498b-9478-5cc3982c358c}</Project>
<Name>ImageProcessing</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>Ce projet fait référence à des packages NuGet qui sont manquants sur cet ordinateur. Utilisez l'option de restauration des packages NuGet pour les télécharger. Pour plus d'informations, consultez http://go.microsoft.com/fwlink/?LinkID=322105. Le fichier manquant est : {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props'))" />
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets'))" />
</Target>
<Import Project="..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets')" />
</Project>
\ No newline at end of file
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using S04_Projet;
namespace ImageProcessing_Test
{
[TestClass]
public class Pixel_Test
{
[TestMethod]
public void Pixel_RGB_Separate()
{
Pixel pixel = new Pixel(0, 127, 255);
Assert.AreEqual(0, pixel.r);
Assert.AreEqual(127, pixel.g);
Assert.AreEqual(255, pixel.b);
}
[TestMethod]
public void Pixel_RGB_Unified()
{
Pixel pixel = new Pixel(0);
Assert.AreEqual(0, pixel.r);
Assert.AreEqual(0, pixel.g);
Assert.AreEqual(0, pixel.b);
}
[TestMethod]
public void Pixel_RGB_Array()
{
Pixel pixel = new Pixel(new byte[] { 0, 127, 255 });
Assert.AreEqual(0, pixel.r);
Assert.AreEqual(127, pixel.g);
Assert.AreEqual(255, pixel.b);
}
[TestMethod]
public void Pixel_getRGB()
{
byte[] rgb = new byte[] { 0, 127, 255 };
Pixel pixel = new Pixel(rgb);
CollectionAssert.AreEqual(rgb, pixel.getRGB());
}
[TestMethod]
public void Pixel_getBGR()
{
Pixel pixel = new Pixel(0,127,255);
CollectionAssert.AreEqual(new byte[] { 255, 127, 0 }, pixel.getBGR());
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("ImageProcessing_Test")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ImageProcessing_Test")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("f0906169-0946-4552-a06c-1d57c52b1c10")]
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MSTest.TestAdapter" version="1.1.18" targetFramework="net461" />
<package id="MSTest.TestFramework" version="1.1.18" targetFramework="net461" />
</packages>
\ No newline at end of file
## Introduction
Application de traitement d'image en C#. Utilisation du multithreading pour améliorer les performances (**WIP**)
## Motivation
Le but est de réaliser une application console prenant en charge des images au format BMP 24 bits capable de faire d'effectuer des traitements plus ou moins basiques tels que l'agrandissement / rétrécissement d'une image ou l'application de filtres de convolution.
## Installation
Pour fonctionner, le programme à besoin du framework .NET 4.6.1
## Tests
WIP
\ No newline at end of file
...@@ -14,20 +14,50 @@ namespace S04_Projet ...@@ -14,20 +14,50 @@ namespace S04_Projet
public static bool MULTITHREADING = false; public static bool MULTITHREADING = false;
static void Main(string[] args) static void Main(string[] args)
{ {
MyImage img = new MyImage("img/lena.bmp"); #region Filters Matrix
img.Save("output.bmp"); short[,] boxBlurFilter = new short[,] {
{1,1,1 },
{1,1,1 },
{1,1,1 }
};
/* short[,] identityFilter = new short[,]
{
{ 0, 0, 0 },
{ 0, 1, 0 },
{ 0, 0, 0 }
};
MyImage imgg = new MyImage("img/coco.bmp"); short[,] edgeDetect1Filter = new short[,]
imgg.ApplyConvFilter(identityFilter, 1).Save("id.bmp"); {
imgg.ApplyConvFilter(edgeDetect1Filter, 1).Save("edge1.bmp"); { 1, 0, -1 },
imgg.ApplyConvFilter(edgeDetect2Filter, 1).Save("edge2.bmp"); { 0, 0, 0 },
imgg.ApplyConvFilter(edgeDetect3Filter, 1).Save("edge3.bmp"); { -1, 0, 1 }
imgg.ApplyConvFilter(sharpenFilter, 1).Save("sharpen.bmp"); };
imgg.ApplyConvFilter(boxBlurFilter, (double)1/9).Save("blur.bmp");*/
short[,] edgeDetect2Filter = new short[,]
{
{ 0, 1, 0 },
{ 1, -4, 1 },
{ 0, 1, 0 }
};
short[,] edgeDetect3Filter = new short[,]
{
{ -1, -1, -1 },
{ -1, 8, -1 },
{ -1, -1, -1 }
};
/*Console.ForegroundColor = ConsoleColor.White; short[,] sharpenFilter = new short[,]
{
{ 0, -1, 0 },
{ -1, 5, -1 },
{ 0, -1, 0 }
};
#endregion
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("#############################################################"); Console.WriteLine("#############################################################");
Console.WriteLine("### Bienvenue ###"); Console.WriteLine("### Bienvenue ###");
Console.WriteLine("#############################################################"); Console.WriteLine("#############################################################");
...@@ -46,34 +76,7 @@ namespace S04_Projet ...@@ -46,34 +76,7 @@ namespace S04_Projet
Console.ForegroundColor = ConsoleColor.Green; Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Image sauvegardée en {0}ms!", Display.elapsedTime); Console.WriteLine("Image sauvegardée en {0}ms!", Display.elapsedTime);
Console.Read();
//Console.Clear();
Console.Read();*/
#region Test
/*MyImage imgRotate90 = img.Rotate90();
imgRotate90.Save("90.bmp");
MyImage imgRotate180 = img.Rotate180();
imgRotate180.Save("180.bmp");
MyImage imgRotate270 = img.Rotate270();
imgRotate270.Save("270.bmp");
Console.WriteLine("Rotations terminées");
MyImage bwLumnisity = img.ToGrayScale(2, MyImage.grayFilterType.LUMINOSITY);
bwLumnisity.Save("bwLumnosity.bmp");
MyImage bwLinear = img.ToGrayScale(2, MyImage.grayFilterType.LINEAR);
bwLinear.Save("bwLinear.bmp");
Console.WriteLine("Done");*/
/*int[,] convFilter = new int[,]
{
{ 0, 0, 0 },
{ 0, 0, 7 },
{ 3, 5, 1 }
};
MyImage conv = img.ApplyConvFilter(convFilter, (1.0 / 16.0));
conv.Save("dither.bmp");
Console.WriteLine("Done");*/
#endregion
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment