Fixed sample TrackColor

Signed-off-by: Michael Grigorev <sleuthhound@gmail.com>
This commit is contained in:
Michael Grigorev 2013-05-21 13:29:02 +06:00
parent 123f41b336
commit 39ae6e38ba
2 changed files with 15 additions and 12 deletions

View File

@ -37,9 +37,10 @@ uses
Core.types_c in '..\..\..\include\core\Core.types_c.pas', Core.types_c in '..\..\..\include\core\Core.types_c.pas',
imgproc.types_c in '..\..\..\include\imgproc\imgproc.types_c.pas', imgproc.types_c in '..\..\..\include\imgproc\imgproc.types_c.pas',
imgproc_c in '..\..\..\include\imgproc\imgproc_c.pas', imgproc_c in '..\..\..\include\imgproc\imgproc_c.pas',
Core in '..\..\..\include\core\core.pas', core in '..\..\..\include\core\core.pas',
cvUtils in '..\..\..\include\cvUtils.pas', cvUtils in '..\..\..\include\cvUtils.pas',
Mat in '..\..\..\include\core\Mat.pas'; Mat in '..\..\..\include\core\Mat.pas',
core.types in '..\..\..\include\core\core.types.pas';
function GetThresholdedImage(img: pIplImage): pIplImage; function GetThresholdedImage(img: pIplImage): pIplImage;
Var Var
@ -124,8 +125,16 @@ begin
lastX := posX; lastX := posX;
lastY := posY; lastY := posY;
posX := Trunc(moment10 / area); if area > 0 then
posY := Trunc(moment01 / area); begin
posX := Trunc(moment10 / area);
posY := Trunc(moment01 / area);
end
else
begin
posX := Trunc(moment10);
posY := Trunc(moment01);
end;
// Print it out for debugging purposes // Print it out for debugging purposes
Writeln(Format('position (%d,%d)', [posX, posY])); Writeln(Format('position (%d,%d)', [posX, posY]));

View File

@ -50,7 +50,7 @@
<PropertyGroup Condition="'$(Base_Win32)'!=''"> <PropertyGroup Condition="'$(Base_Win32)'!=''">
<VerInfo_Locale>1033</VerInfo_Locale> <VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys> <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace> <DCC_Namespace>System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''"> <PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols> <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
@ -81,6 +81,7 @@
<DCCReference Include="..\..\..\include\core\core.pas"/> <DCCReference Include="..\..\..\include\core\core.pas"/>
<DCCReference Include="..\..\..\include\cvUtils.pas"/> <DCCReference Include="..\..\..\include\cvUtils.pas"/>
<DCCReference Include="..\..\..\include\core\Mat.pas"/> <DCCReference Include="..\..\..\include\core\Mat.pas"/>
<DCCReference Include="..\..\..\include\core\core.types.pas"/>
<BuildConfiguration Include="Debug"> <BuildConfiguration Include="Debug">
<Key>Cfg_2</Key> <Key>Cfg_2</Key>
<CfgParent>Base</CfgParent> <CfgParent>Base</CfgParent>
@ -155,10 +156,3 @@
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/> <Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/> <Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
</Project> </Project>
<!-- EurekaLog First Line
[Exception Log]
EurekaLog Version=7001
DeleteMapAfterCompile=1
Encrypt Password=""
EurekaLog Last Line -->