Skip to content

Commit

Permalink
Enhancing samples, adding image-debugger-visualizer.
Browse files Browse the repository at this point in the history
  • Loading branch information
dajuric committed Nov 19, 2017
1 parent ce05873 commit 605c097
Show file tree
Hide file tree
Showing 30 changed files with 976 additions and 784 deletions.
34 changes: 25 additions & 9 deletions DotImaging.sln
Expand Up @@ -14,7 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Deploy", "Deploy", "{80FC5E
Deploy\Licence.txt = Deploy\Licence.txt
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Playground", "Test\Playground.csproj", "{F34AE966-F8EB-46EC-A1A9-E7D8B1CA3DAB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Playground", "Test\Playground.csproj", "{F34AE966-F8EB-46EC-A1A9-E7D8B1CA3DAB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Logo", "Logo", "{817B040E-5F27-4ACD-B1E4-F46452668A0E}"
ProjectSection(SolutionItems) = preProject
Expand Down Expand Up @@ -43,27 +43,33 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UI", "Source\UI\UI.csproj",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IO.Web", "Source\IO.Web\IO.Web.csproj", "{B8404D66-B64E-43E0-9653-35FC6782072F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.UI", "Samples\Sample.UI\Sample.UI.csproj", "{4DA857A9-0CE3-43DF-A455-D38A2FA64B07}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.UI", "Samples\Sample.UI\Sample.UI.csproj", "{4DA857A9-0CE3-43DF-A455-D38A2FA64B07}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.VideoStreaming", "Samples\Sample.VideoStreaming\Sample.VideoStreaming.csproj", "{CB088D8A-3438-4DB9-87C2-99425FE27F07}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.VideoStreaming", "Samples\Sample.VideoStreaming\Sample.VideoStreaming.csproj", "{CB088D8A-3438-4DB9-87C2-99425FE27F07}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.Basic", "Samples\Sample.Basic\Sample.Basic.csproj", "{5F5FE08B-37C1-4C62-BB1A-DFFF61B3516A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.Basic", "Samples\Sample.Basic\Sample.Basic.csproj", "{5F5FE08B-37C1-4C62-BB1A-DFFF61B3516A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.Interop", "Samples\Sample.Interop\Sample.Interop.csproj", "{E4ED626D-359B-493C-A72E-3738A5353D1B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.Interop", "Samples\Sample.Interop\Sample.Interop.csproj", "{E4ED626D-359B-493C-A72E-3738A5353D1B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.Capture", "Samples\Sample.Capture\Sample.Capture.csproj", "{D0C18418-5282-4BA8-ABF7-CC2A9A179517}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.Capture", "Samples\Sample.Capture\Sample.Capture.csproj", "{D0C18418-5282-4BA8-ABF7-CC2A9A179517}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.CaptureAndRecord", "Samples\Sample.CaptureAndRecord\Sample.CaptureAndRecord.csproj", "{867ED0BD-FBFB-4C0C-A34B-D71361874AA0}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.CaptureAndRecord", "Samples\Sample.CaptureAndRecord\Sample.CaptureAndRecord.csproj", "{867ED0BD-FBFB-4C0C-A34B-D71361874AA0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.ImageExtractor", "Samples\Sample.ImageExtractor\Sample.ImageExtractor.csproj", "{55FF1668-9501-4007-84D8-26EF860F0D0D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.ImageExtractor", "Samples\Sample.ImageExtractor\Sample.ImageExtractor.csproj", "{55FF1668-9501-4007-84D8-26EF860F0D0D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.MultipleCameraCapture", "Samples\Sample.MultipleCameraCapture\Sample.MultipleCameraCapture.csproj", "{C30A145E-02FB-49B4-8F3E-6673AF9D121A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.MultipleCameraCapture", "Samples\Sample.MultipleCameraCapture\Sample.MultipleCameraCapture.csproj", "{C30A145E-02FB-49B4-8F3E-6673AF9D121A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{44744CCA-2769-4607-AC90-78B6A11A2E77}"
ProjectSection(SolutionItems) = preProject
Deploy\Nuget\Push.cmd = Deploy\Nuget\Push.cmd
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaseOperations", "Source\BaseOperations\BaseOperations.csproj", "{E8F6A81C-6806-41D5-B795-0E214B308D5C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageDebuggerVisualizer", "Tools\ImageDebuggerVisualizer\ImageDebuggerVisualizer.csproj", "{0EBA2590-3F39-4F8E-81A2-1F20CB934398}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{99AC6620-13B1-4543-91E7-08CD049B13B1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -146,6 +152,14 @@ Global
{C30A145E-02FB-49B4-8F3E-6673AF9D121A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C30A145E-02FB-49B4-8F3E-6673AF9D121A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C30A145E-02FB-49B4-8F3E-6673AF9D121A}.Release|Any CPU.Build.0 = Release|Any CPU
{E8F6A81C-6806-41D5-B795-0E214B308D5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E8F6A81C-6806-41D5-B795-0E214B308D5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E8F6A81C-6806-41D5-B795-0E214B308D5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E8F6A81C-6806-41D5-B795-0E214B308D5C}.Release|Any CPU.Build.0 = Release|Any CPU
{0EBA2590-3F39-4F8E-81A2-1F20CB934398}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0EBA2590-3F39-4F8E-81A2-1F20CB934398}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0EBA2590-3F39-4F8E-81A2-1F20CB934398}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0EBA2590-3F39-4F8E-81A2-1F20CB934398}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -172,6 +186,8 @@ Global
{55FF1668-9501-4007-84D8-26EF860F0D0D} = {05BDC895-7F7B-4B6F-8D69-E7916837092D}
{C30A145E-02FB-49B4-8F3E-6673AF9D121A} = {05BDC895-7F7B-4B6F-8D69-E7916837092D}
{44744CCA-2769-4607-AC90-78B6A11A2E77} = {80FC5EA1-3478-4E7F-8B05-190DF6750EA4}
{E8F6A81C-6806-41D5-B795-0E214B308D5C} = {80058A54-6223-480C-AA19-F99E7AE593F3}
{0EBA2590-3F39-4F8E-81A2-1F20CB934398} = {99AC6620-13B1-4543-91E7-08CD049B13B1}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DEAC2BC6-C697-4361-9909-CF7055FE9B05}
Expand Down
1 change: 1 addition & 0 deletions Samples/Sample.Capture/Program.cs
Expand Up @@ -52,6 +52,7 @@ static void Main()
while (!(Console.KeyAvailable && Console.ReadKey(true).Key == ConsoleKey.Escape));

reader.Dispose();
UI.CloseAll();
}

private static string getResourceDir()
Expand Down
8 changes: 4 additions & 4 deletions Samples/Sample.Interop/Program.cs
Expand Up @@ -36,15 +36,15 @@ static void Main(string[] args)
var img = new Bgr<byte>[480, 640];

//***********************************************************************************************************************************************************************
Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("********* TColor[,] <=> Image<> conversions (built-in) ****************"); Console.ResetColor();
Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("********* TColor[,] <=> Image<> conversions (built-in) ****************"); Console.ResetColor();
//to Image<>
Image<Bgr<byte>> lockedImg = img.Lock();
//from Image<>
var arr = lockedImg.Clone();

//***********************************************************************************************************************************************************************
Console.WriteLine();
Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("********* Image<,> <=> OpenCV conversions (built-in) ****************"); Console.ResetColor();
Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("********* Image<,> <=> OpenCV conversions (built-in) ****************"); Console.ResetColor();
//to IplImage
IplImage iplImage;
using (var uImg = img.Lock())
Expand All @@ -56,15 +56,15 @@ static void Main(string[] args)

//***********************************************************************************************************************************************************************
Console.WriteLine();
Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("*********** Image<,> <=> Bitmap conversions (BitmapInterop) ****************"); Console.ResetColor();
Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("*********** Image<,> <=> Bitmap conversions (BitmapInterop) ****************"); Console.ResetColor();
//to Bitmap
var bmp = img.ToBitmap();
//from Bitmap
var imgFromBmp = bmp.ToArray();

//***********************************************************************************************************************************************************************
Console.WriteLine();
Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("*********** Image<,> <=> BitmapSource conversions (BitmapSourceInterop) ****************"); Console.ResetColor();
Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("*********** Image<,> <=> BitmapSource conversions (BitmapSourceInterop) ****************"); Console.ResetColor();
//to generic-image
var colorBitmap = new BitmapImage(new Uri("http://www.online-image-editor.com//styles/2014/images/example_image.png"));
Bgra<byte>[,] colorImg = colorBitmap.ToArray<Bgra<byte>>();
Expand Down
5 changes: 2 additions & 3 deletions Samples/Sample.VideoStreaming/Program.cs
Expand Up @@ -28,7 +28,7 @@ public static void Main()

//read video frames
Bgr<byte>[,] frame = null;
do
while(true)
{
reader.ReadTo(ref frame);
if (frame == null)
Expand All @@ -37,11 +37,10 @@ public static void Main()
frame.Show(scaleForm: true);
((double)reader.Position / reader.Length).Progress();
}
while (!(Console.KeyAvailable && Console.ReadKey(true).Key == ConsoleKey.Escape));

Console.WriteLine("The end.");

//---------------------------------------------------------------------------
UI.CloseAll();
Console.WriteLine("Downloading video...");

string fileExtension;
Expand Down
8 changes: 8 additions & 0 deletions Source/BaseOperations/Base/CvInvoke.cs
@@ -0,0 +1,8 @@
using System;

namespace DotImaging
{
public class Class1
{
}
}
25 changes: 25 additions & 0 deletions Source/BaseOperations/BaseOperations.cs
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace DotImaging
{
public static class BaseOperations
{
public static Bgr<byte>[,] Resize(Bgr<byte>[,] image, float scale)
{
return null;
}

public static Bgr<byte>[,] Resize(Bgr<byte>[,] image, int newWidth, int newHeight)
{
return null;
}


public static Bgr<byte>[,] Flip(Bgr<byte>[,] image)
{
return null;
}
}
}
15 changes: 15 additions & 0 deletions Source/BaseOperations/BaseOperations.csproj
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Folder Include="References\" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Image\Image.csproj" />
</ItemGroup>

</Project>
6 changes: 2 additions & 4 deletions Source/BitmapInterop/BitmapInterop.csproj
@@ -1,11 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net47;netcoreapp2.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
<RootNamespace>DotImaging</RootNamespace>
<OutputPath>bin\</OutputPath>
<AssemblyName>DotImaging.BitmapInterop</AssemblyName>
<RootNamespace>DotImaging</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 605c097

Please sign in to comment.