aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj
blob: 41413f4bd01ac6cb632a34344aab0608570e8f75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{CAEDAE94-11ED-473C-888A-268A6D38CD20}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>Tango.CodeGeneration</RootNamespace>
    <AssemblyName>Tango.CodeGeneration</AssemblyName>
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <SccProjectName>SAK</SccProjectName>
    <SccLocalPath>SAK</SccLocalPath>
    <SccAuxPath>SAK</SccAuxPath>
    <SccProvider>SAK</SccProvider>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>..\Build\Core\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>..\Build\Core\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup>
    <SignAssembly>false</SignAssembly>
  </PropertyGroup>
  <PropertyGroup>
    <AssemblyOriginatorKeyFile>
    </AssemblyOriginatorKeyFile>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="RazorEngine, Version=3.10.0.0, Culture=neutral, PublicKeyToken=9ee697374c7e744a, processorArchitecture=MSIL">
      <HintPath>..\packages\RazorEngine.3.10.0\lib\net45\RazorEngine.dll</HintPath>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Web" />
    <Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll</HintPath>
    </Reference>
    <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="..\Versioning\GlobalVersionInfo.cs">
      <Link>GlobalVersionInfo.cs</Link>
    </Compile>
    <Compile Include="Class.cs" />
    <Compile Include="CodeFile.cs" />
    <Compile Include="CodeObject.cs" />
    <Compile Include="CustomResolver.cs" />
    <Compile Include="DpProperty.cs" />
    <Compile Include="EntityInheritedDTOCodeFile.cs" />
    <Compile Include="EntityDTOCodeFile.cs" />
    <Compile Include="EntityCodeFileJavaExtension.cs" />
    <Compile Include="EntityCodeFileJava.cs" />
    <Compile Include="EntityCodeFile.cs" />
    <Compile Include="EntityInheritedCodeFile.cs" />
    <Compile Include="EnumerationField.cs" />
    <Compile Include="ObservablesContextCodeFile.cs" />
    <Compile Include="ObservablesStaticCollectionsFile.cs" />
    <Compile Include="ProtoEnumFile.cs" />
    <Compile Include="ProtoMessageFile.cs" />
    <Compile Include="ProtoProperty.cs" />
    <Compile Include="DbPropertyExtensionModel.cs" />
    <Compile Include="TangoDAOJavaFile.cs" />
    <Compile Include="EnumerationFileJava.cs" />
    <Compile Include="EnumerationFile.cs" />
    <Compile Include="Helper.cs" />
    <Compile Include="ICodeObject.cs" />
    <Compile Include="Method.cs" />
    <Compile Include="CodeObjectModifier.cs" />
    <Compile Include="MethodModifier.cs" />
    <Compile Include="Namespace.cs" />
    <Compile Include="ObservablesAdapterFile.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="Property.cs" />
    <Compile Include="TangoWebClientv2CodeFile.cs" />
    <Compile Include="TangoWebClientCodeFile.cs" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="Templates\CodeFile.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="Templates\Property.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="Templates\DpProperty.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="Templates\Method.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="Templates\Class.cshtml" />
  </ItemGroup>
  <ItemGroup>
    <None Include="packages.config" />
    <EmbeddedResource Include="Templates\Namespace.cshtml" />
    <EmbeddedResource Include="Templates\EntityCodeFile.cshtml" />
    <EmbeddedResource Include="Templates\EnumerationFile.cshtml" />
    <EmbeddedResource Include="Templates\ObservablesAdapterFile.cshtml" />
    <EmbeddedResource Include="Templates\EntityCodeFileJava.cshtml" />
    <EmbeddedResource Include="Templates\EnumerationFileJava.cshtml" />
    <EmbeddedResource Include="Templates\TangoDAOJavaFile.cshtml" />
    <EmbeddedResource Include="Templates\ObservablesContextCodeFile.cshtml" />
    <EmbeddedResource Include="Templates\ProtoMessageFile.cshtml" />
    <EmbeddedResource Include="Templates\ProtoEnumFile.cshtml" />
    <EmbeddedResource Include="Templates\EntityCodeFileJavaExtension.cshtml" />
    <EmbeddedResource Include="Templates\ObservablesStaticCollectionsFile.cshtml" />
    <EmbeddedResource Include="Templates\EntityInheritedCodeFile.cshtml" />
    <EmbeddedResource Include="Templates\TangoWebClientCodeFile.cshtml" />
    <EmbeddedResource Include="Templates\EntityDTOCodeFile.cshtml" />
    <EmbeddedResource Include="Templates\EntityInheritedDTOCodeFile.cshtml" />
    <EmbeddedResource Include="Templates\TangoWebClientv2CodeFile.cshtml" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <ProjectExtensions>
    <VisualStudio>
      <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
    </VisualStudio>
  </ProjectExtensions>
  <!-- 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>
span class="cm"> // In no event shall the Intel Corporation or contributors be liable for any direct, // indirect, incidental, special, exemplary, or consequential damages // (including, but not limited to, procurement of substitute goods or services; // loss of use, data, or profits; or business interruption) however caused // and on any theory of liability, whether in contract, strict liability, // or tort (including negligence or otherwise) arising in any way out of // the use of this software, even if advised of the possibility of such damage. // //M*/ #include "precomp.hpp" namespace cv { namespace saliency { /** * Fine Grained Saliency */ StaticSaliencyFineGrained::StaticSaliencyFineGrained() { className = "FINE_GRAINED"; } StaticSaliencyFineGrained::~StaticSaliencyFineGrained() { } bool StaticSaliencyFineGrained::computeSaliencyImpl(InputArray image, OutputArray saliencyMap ) { Mat dst(Size(image.getMat().cols, image.getMat().rows), CV_8UC1); calcIntensityChannel(image.getMat(), dst); dst.copyTo(saliencyMap); #ifdef SALIENCY_DEBUG // visualize saliency map imshow( "Saliency Map Interna", saliencyMap ); #endif return true; } void StaticSaliencyFineGrained::copyImage(Mat srcArg, Mat dstArg) { srcArg.copyTo(dstArg); } void StaticSaliencyFineGrained::calcIntensityChannel(Mat srcArg, Mat dstArg) { if(dstArg.channels() > 1) { //("Error: Destiny image must have only one channel.\n"); return; } const int numScales = 6; Mat intensityScaledOn[numScales]; Mat intensityScaledOff[numScales]; Mat gray = Mat::zeros(Size(srcArg.cols, srcArg.rows), CV_8UC1); Mat integralImage(Size(srcArg.cols + 1, srcArg.rows + 1), CV_32FC1); Mat intensity(Size(srcArg.cols, srcArg.rows), CV_8UC1); Mat intensityOn(Size(srcArg.cols, srcArg.rows), CV_8UC1); Mat intensityOff(Size(srcArg.cols, srcArg.rows), CV_8UC1); int i; int neighborhood; int neighborhoods[] = {3*4, 3*4*2, 3*4*2*2, 7*4, 7*4*2, 7*4*2*2}; for(i=0; i<numScales; i++) { intensityScaledOn[i] = Mat(Size(srcArg.cols, srcArg.rows), CV_8UC1); intensityScaledOff[i] = Mat(Size(srcArg.cols, srcArg.rows), CV_8UC1); } // Prepare the input image: put it into a grayscale image. if(srcArg.channels()==3) { cvtColor(srcArg, gray, COLOR_BGR2GRAY); } else { srcArg.copyTo(gray); } // smooth pixels at least twice, as done by Frintrop and Itti GaussianBlur( gray, gray, Size( 3, 3 ), 0, 0 ); GaussianBlur( gray, gray, Size( 3, 3 ), 0, 0 ); // Calculate integral image, only once. integral(gray, integralImage, CV_32F); for(i=0; i< numScales; i++) { neighborhood = neighborhoods[i] ; getIntensityScaled(integralImage, gray, intensityScaledOn[i], intensityScaledOff[i], neighborhood); } mixScales(intensityScaledOn, intensityOn, intensityScaledOff, intensityOff, numScales); mixOnOff(intensityOn, intensityOff, intensity); intensity.copyTo(dstArg); } void StaticSaliencyFineGrained::getIntensityScaled(Mat integralImage, Mat gray, Mat intensityScaledOn, Mat intensityScaledOff, int neighborhood) { float value, meanOn, meanOff; Point2i point; int x,y; intensityScaledOn.setTo(Scalar::all(0)); intensityScaledOff.setTo(Scalar::all(0)); for(y = 0; y < gray.rows; y++) { for(x = 0; x < gray.cols; x++) { point.x = x; point.y = y; value = getMean(integralImage, point, neighborhood, gray.at<uchar>(y, x)); meanOn = gray.at<uchar>(y, x) - value; meanOff = value - gray.at<uchar>(y, x); if(meanOn > 0) intensityScaledOn.at<uchar>(y, x) = (uchar)meanOn; else intensityScaledOn.at<uchar>(y, x) = 0; if(meanOff > 0) intensityScaledOff.at<uchar>(y, x) = (uchar)meanOff; else intensityScaledOff.at<uchar>(y, x) = 0; } } } float StaticSaliencyFineGrained::getMean(Mat srcArg, Point2i PixArg, int neighbourhood, int centerVal) { Point2i P1, P2; float value; P1.x = PixArg.x - neighbourhood + 1; P1.y = PixArg.y - neighbourhood + 1; P2.x = PixArg.x + neighbourhood + 1; P2.y = PixArg.y + neighbourhood + 1; if(P1.x < 0) P1.x = 0; else if(P1.x > srcArg.cols - 1) P1.x = srcArg.cols - 1; if(P2.x < 0) P2.x = 0; else if(P2.x > srcArg.cols - 1) P2.x = srcArg.cols - 1; if(P1.y < 0) P1.y = 0; else if(P1.y > srcArg.rows - 1) P1.y = srcArg.rows - 1; if(P2.y < 0) P2.y = 0; else if(P2.y > srcArg.rows - 1) P2.y = srcArg.rows - 1; // we use the integral image to compute fast features value = (float) ( (srcArg.at<float>(P2.y, P2.x)) + (srcArg.at<float>(P1.y, P1.x)) - (srcArg.at<float>(P2.y, P1.x)) - (srcArg.at<float>(P1.y, P2.x)) ); value = (value - centerVal)/ (( (P2.x - P1.x) * (P2.y - P1.y))-1) ; return value; } void StaticSaliencyFineGrained::mixScales(Mat *intensityScaledOn, Mat intensityOn, Mat *intensityScaledOff, Mat intensityOff, const int numScales) { int i=0, x, y; int width = intensityScaledOn[0].cols; int height = intensityScaledOn[0].rows; short int maxValOn = 0, currValOn=0; short int maxValOff = 0, currValOff=0; int maxValSumOff = 0, maxValSumOn=0; Mat mixedValuesOn(Size(width, height), CV_16UC1); Mat mixedValuesOff(Size(width, height), CV_16UC1); mixedValuesOn.setTo(Scalar::all(0)); mixedValuesOff.setTo(Scalar::all(0)); for(i=0;i<numScales;i++) { for(y=0;y<height;y++) for(x=0;x<width;x++) { currValOn = intensityScaledOn[i].at<uchar>(y, x); if(currValOn > maxValOn) maxValOn = currValOn; currValOff = intensityScaledOff[i].at<uchar>(y, x); if(currValOff > maxValOff) maxValOff = currValOff; mixedValuesOn.at<unsigned short>(y, x) += currValOn; mixedValuesOff.at<unsigned short>(y, x) += currValOff; } } for(y=0;y<height;y++) for(x=0;x<width;x++) { currValOn = mixedValuesOn.at<unsigned short>(y, x); currValOff = mixedValuesOff.at<unsigned short>(y, x); if(currValOff > maxValSumOff) maxValSumOff = currValOff; if(currValOn > maxValSumOn) maxValSumOn = currValOn; } for(y=0;y<height;y++) for(x=0;x<width;x++) { intensityOn.at<uchar>(y, x) = (uchar)(255.*((float)(mixedValuesOn.at<unsigned short>(y, x) / (float)maxValSumOn))); intensityOff.at<uchar>(y, x) = (uchar)(255.*((float)(mixedValuesOff.at<unsigned short>(y, x) / (float)maxValSumOff))); } } void StaticSaliencyFineGrained::mixOnOff(Mat intensityOn, Mat intensityOff, Mat intensityArg) { int x,y; int width = intensityOn.cols; int height= intensityOn.rows; int maxVal=0; int currValOn, currValOff, maxValSumOff, maxValSumOn; Mat intensity(Size(width, height), CV_8UC1); maxValSumOff = 0; maxValSumOn = 0; for(y=0;y<height;y++) for(x=0;x<width;x++) { currValOn = intensityOn.at<uchar>(y, x); currValOff = intensityOff.at<uchar>(y, x); if(currValOff > maxValSumOff) maxValSumOff = currValOff; if(currValOn > maxValSumOn) maxValSumOn = currValOn; } if(maxValSumOn > maxValSumOff) maxVal = maxValSumOn; else maxVal = maxValSumOff; for(y=0;y<height;y++) for(x=0;x<width;x++) { intensity.at<uchar>(y, x) = (uchar) (255. * (float) (intensityOn.at<uchar>(y, x) + intensityOff.at<uchar>(y, x)) / (float)maxVal); } intensity.copyTo(intensityArg); } } /* namespace saliency */ }/* namespace cv */