Permalink
Browse files

Built and tested the new picture walker project.

  • Loading branch information...
1 parent 286baf3 commit f15422605210913388847fe5a35f7c0f268792b4 @Amichai committed Feb 23, 2012
Showing with 49,316 additions and 405 deletions.
  1. +62 −0 PictureWalker/PictureWalker.cs
  2. +69 −0 PictureWalker/PictureWalker.csproj
  3. +21 −0 PictureWalker/Program.cs
  4. +36 −0 PictureWalker/Properties/AssemblyInfo.cs
  5. BIN PictureWalker/bin/Debug/Common.dll
  6. BIN PictureWalker/bin/Debug/Common.pdb
  7. BIN PictureWalker/bin/Debug/EM-001.jpg
  8. BIN PictureWalker/bin/Debug/EM-002.jpg
  9. BIN PictureWalker/bin/Debug/EM-003jpg.jpg
  10. BIN PictureWalker/bin/Debug/MathNet.Numerics.dll
  11. BIN PictureWalker/bin/Debug/MathNet.Numerics.pdb
  12. +49,071 −0 PictureWalker/bin/Debug/MathNet.Numerics.xml
  13. BIN PictureWalker/bin/Debug/PictureWalker.exe
  14. BIN PictureWalker/bin/Debug/PictureWalker.pdb
  15. BIN PictureWalker/bin/Debug/PictureWalker.vshost.exe
  16. +11 −0 PictureWalker/bin/Debug/PictureWalker.vshost.exe.manifest
  17. BIN PictureWalker/bin/Debug/ThreeDWalker.exe
  18. BIN PictureWalker/bin/Debug/ThreeDWalker.pdb
  19. BIN PictureWalker/bin/Debug/zlib.net.dll
  20. BIN PictureWalker/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  21. +13 −0 PictureWalker/obj/x86/Debug/PictureWalker.csproj.FileListAbsolute.txt
  22. BIN PictureWalker/obj/x86/Debug/PictureWalker.exe
  23. BIN PictureWalker/obj/x86/Debug/PictureWalker.pdb
  24. BIN PictureWalker/obj/x86/Debug/ResolveAssemblyReference.cache
  25. +14 −0 RandomWalker.sln
  26. BIN RandomWalker.suo
  27. +1 −3 ThreeDWalker/FullPath.cs
  28. +17 −3 ThreeDWalker/Heatmap.cs
  29. +1 −1 ThreeDWalker/Point.cs
  30. BIN ThreeDWalker/bin/Debug/Common.dll
  31. BIN ThreeDWalker/bin/Debug/Common.pdb
  32. BIN ThreeDWalker/bin/Debug/ThreeDWalker.exe
  33. BIN ThreeDWalker/bin/Debug/ThreeDWalker.pdb
  34. BIN ThreeDWalker/obj/x86/Debug/ResolveAssemblyReference.cache
  35. BIN ThreeDWalker/obj/x86/Debug/ThreeDWalker.exe
  36. BIN ThreeDWalker/obj/x86/Debug/ThreeDWalker.pdb
  37. +0 −4 Walker/Walker.csproj
  38. +0 −1 Walker/WalkerForm.cs
  39. BIN Walker/bin/Debug/SLaks.Progression.dll
  40. BIN Walker/bin/Debug/SLaks.Progression.pdb
  41. +0 −390 Walker/bin/Debug/SLaks.Progression.xml
  42. BIN Walker/bin/Debug/Walker.exe
  43. BIN Walker/bin/Debug/Walker.pdb
  44. BIN Walker/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  45. +0 −3 Walker/obj/x86/Debug/Walker.csproj.FileListAbsolute.txt
  46. BIN Walker/obj/x86/Debug/Walker.exe
  47. BIN Walker/obj/x86/Debug/Walker.pdb
@@ -0,0 +1,62 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Common;
+using System.Drawing;
+using ThreeDWalker;
+using Point = ThreeDWalker.Point;
+
+namespace PictureWalker {
+ class PictureWalker {
+ Heatmap heatmap = null;
+ Walker walker = null;
+ FullPath path = new FullPath();
+ UploadedImage image = null;
+ public PictureWalker(Heatmap heatmap, Walker walker, UploadedImage image) {
+ this.heatmap = heatmap;
+ this.walker = walker;
+ this.image = image;
+ }
+
+ public void Walk(int NumberOfSteps) {
+ int intensity = 0;
+ foreach (var A in walker.Walk(NumberOfSteps)) {
+ path.Add((Point)A.LastStep);
+ intensity = getScaledIntensityVal((Point)A.LastStep);
+ heatmap.AddStep((Point)A.LastStep, intensity);
+ }
+ }
+
+ private int getScaledIntensityVal(Point point) {
+ point = point.CorrectForPeriodicBoundaries(image.Width, image.Height);
+ return image[(int)point.X][(int)point.Y] / 10;
+ }
+
+ public void PrintProjections() {
+ string filepath = @"C:\Users\Amichai\Documents\Visual Studio 2010\Projects\RandomWalker\PictureWalker\bin\Debug\";
+ path.PrintProjections(5, filepath);
+ }
+ }
+
+ class Walker {
+ public Walker(double stepSize, Point startingPt = null) {
+ this.stepSize = stepSize;
+ if (startingPt == null)
+ currentPosition = new Point(0, 0, 0);
+ else currentPosition = startingPt;
+ }
+ double stepSize;
+ Point currentPosition = null;
+ Random rand = new Random();
+ public IEnumerable<StatusReport> Walk(int NumberOfSteps) {
+ for (int i = 0; i < NumberOfSteps; i++) {
+ //gets a random angle in radians
+ double angle1 = ((double)rand.Next(360) + rand.NextDouble()) * (Math.PI / 180d);
+ double angle2 = ((double)rand.Next(360) + rand.NextDouble()) * (Math.PI / 180d);
+ currentPosition = currentPosition.GetNextPt(stepSize, angle1, angle2);
+ yield return new StatusReport((int)((double)i * 100 / NumberOfSteps), currentPosition);
+ }
+ }
+ }
+}
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{38782C45-D8A1-4E14-A01E-DDB0E0B7583C}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>PictureWalker</RootNamespace>
+ <AssemblyName>PictureWalker</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ <PlatformTarget>x86</PlatformTarget>
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ <PlatformTarget>x86</PlatformTarget>
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="PictureWalker.cs" />
+ <Compile Include="Program.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\OpenPadProject\Common\Common.csproj">
+ <Project>{D7BCE323-ADC9-4E4C-9DB9-E54E3BE20559}</Project>
+ <Name>Common</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\ThreeDWalker\ThreeDWalker.csproj">
+ <Project>{6ED9C533-195F-475C-8567-C32A5AF707DD}</Project>
+ <Name>ThreeDWalker</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
View
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using ThreeDWalker;
+using Common;
+
+namespace PictureWalker {
+ class Program {
+ static void Main(string[] args) {
+ var filepath = @"C:\Users\Amichai\Documents\Visual Studio 2010\Projects\RandomWalker\PictureWalker\bin\Debug\" + "EM-001.jpg";
+ var image = new UploadedImage(filepath, new System.Drawing.Rectangle(500, 200, 3500, 3500));
+ var heatmap = new Heatmap(ns:2, nt:5, magnification:3, sideLength:20);
+ var walker = new Walker(stepSize:.5, startingPt:new Point(image.Width/2, image.Height /2, 0));
+ var pictureWalker = new PictureWalker(heatmap, walker, image);
+ pictureWalker.Walk(NumberOfSteps:100000);
+ pictureWalker.PrintProjections();
+ heatmap.Print();
+ }
+ }
+}
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("PictureWalker")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("PictureWalker")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("522ced2a-b546-416e-9858-a5d01aee42de")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.

0 comments on commit f154226

Please sign in to comment.