Skip to content

Commit

Permalink
add progress bar and sample size of population
Browse files Browse the repository at this point in the history
  • Loading branch information
SRMLabHUST authored Jun 15, 2022
1 parent 40a735a commit 4afad58
Show file tree
Hide file tree
Showing 32 changed files with 1,537 additions and 0 deletions.
31 changes: 31 additions & 0 deletions LuckyProfiler/LuckyProfiler.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.1927
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LuckyProfiler", "LuckyProfiler\LuckyProfiler.vcxproj", "{646A57BE-C795-4CCC-948D-29E173111E26}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{646A57BE-C795-4CCC-948D-29E173111E26}.Debug|x64.ActiveCfg = Debug|x64
{646A57BE-C795-4CCC-948D-29E173111E26}.Debug|x64.Build.0 = Debug|x64
{646A57BE-C795-4CCC-948D-29E173111E26}.Debug|x86.ActiveCfg = Debug|Win32
{646A57BE-C795-4CCC-948D-29E173111E26}.Debug|x86.Build.0 = Debug|Win32
{646A57BE-C795-4CCC-948D-29E173111E26}.Release|x64.ActiveCfg = Release|x64
{646A57BE-C795-4CCC-948D-29E173111E26}.Release|x64.Build.0 = Release|x64
{646A57BE-C795-4CCC-948D-29E173111E26}.Release|x86.ActiveCfg = Release|Win32
{646A57BE-C795-4CCC-948D-29E173111E26}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {81ECE81C-B8D8-431E-BB15-E4F4841B9CC0}
EndGlobalSection
EndGlobal
183 changes: 183 additions & 0 deletions LuckyProfiler/LuckyProfiler/LuckyProfiler.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{646A57BE-C795-4CCC-948D-29E173111E26}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>LuckyProfiler</RootNamespace>
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 10.0.props" />
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\include;C:\Program Files\Java\jdk1.8.0_202\include;C:\Program Files\Java\jdk1.8.0_202\include\win32;D:\a_XiaoYinghao\research material\LuckyProfile_\LuckyProfile_\src;$(IncludePath)</IncludePath>
<LibraryPath>C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\lib\x64;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;LUCKYPROFILER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;LUCKYPROFILER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;LUCKYPROFILER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;LUCKYPROFILER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>cudart_static.lib;
kernel32.lib;
user32.lib;
gdi32.lib
;winspool.lib
;comdlg32.lib
;advapi32.lib
;shell32.lib;
ole32.lib;
oleaut32.lib;
uuid.lib;
odbc32.lib;
odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\..\a_XiaoYinghao\research material\LuckyProfile_\LuckyProfile_\src\LuckyProfiler_.h" />
<ClInclude Include="kernel.h" />
<ClInclude Include="skeleton.h" />
</ItemGroup>
<ItemGroup>
<CudaCompile Include="kernel.cu">
<FileType>Document</FileType>
</CudaCompile>
</ItemGroup>
<ItemGroup>
<ClCompile Include="LuckyProfiler_.cpp" />
<ClCompile Include="skeleton.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 10.0.targets" />
</ImportGroup>
</Project>
41 changes: 41 additions & 0 deletions LuckyProfiler/LuckyProfiler/LuckyProfiler.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="kernel.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="skeleton.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="..\..\..\a_XiaoYinghao\research material\LuckyProfile_\LuckyProfile_\src\LuckyProfiler_.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="LuckyProfiler_.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="skeleton.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<CudaCompile Include="kernel.cu">
<Filter>源文件</Filter>
</CudaCompile>
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions LuckyProfiler/LuckyProfiler/LuckyProfiler.vcxproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
90 changes: 90 additions & 0 deletions LuckyProfiler/LuckyProfiler/LuckyProfiler_.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#include "cuda.h"
#include <LuckyProfiler_.h>
#include "kernel.h"
#include "skeleton.h"

int skelNum;
int PreProjectionNum;

JNIEXPORT void JNICALL Java_LuckyProfiler_1_computeAngs(JNIEnv* env, jobject, jintArray locx, jintArray locy, jintArray SkelImwithout1, jint SkelNum, jint imgH, jint imgW) {
jint* Locx = env->GetIntArrayElements(locx, NULL);
jint* Locy = env->GetIntArrayElements(locy, NULL);
jint* skel = env->GetIntArrayElements(SkelImwithout1, NULL);
skelNum = SkelNum;

getAngs(Locx, Locy, skel, SkelNum, imgH, imgW);

env->ReleaseIntArrayElements(SkelImwithout1, skel, 0);
env->ReleaseIntArrayElements(locx, Locx, 0);
env->ReleaseIntArrayElements(locy, Locy, 0);
}

JNIEXPORT JNIEXPORT jintArray JNICALL Java_LuckyProfiler_1_getSkeleton(JNIEnv *env, jobject, jintArray JSkeletontemp, jint imgH, jint imgW) {
jint* Skeletontemp = env->GetIntArrayElements(JSkeletontemp, NULL);

long* skg = compute_skeleton_gradient(Skeletontemp, imgH, imgW);

//int thres = 30;

//bool* skr = (bool*)calloc(0, sizeof(bool) * imgH * imgW);
//int idx = 0;
//for (int j = 0; j < imgW; j++) {
// for (int i = 0; i < imgH; i++) {
// if (skg[idx] > thres) {
// skr[i * imgW + j] = 1;
// }
// idx++;
// }
//}

//bool *BoolSkelImwithout1 = algbwmorph(skr, imgH, imgW);
//short *SkelImwithout1 = (short*)malloc(sizeof(short) * imgH * imgW);
//for (int i = 0; i < imgH * imgW; i++) SkelImwithout1[i] = BoolSkelImwithout1[i];

jintArray result = NULL;
result = env->NewIntArray(imgH * imgW);
env->SetIntArrayRegion(result, 0, imgH * imgW, skg);

env->ReleaseIntArrayElements(JSkeletontemp, Skeletontemp, 0);

free(skg);
return result;
}

JNIEXPORT void JNICALL Java_LuckyProfiler_1_computeRCadiAndRelatedLocIndex
(JNIEnv* env, jobject, jintArray JSkelImwithout1, jintArray JSingleResult, jintArray Jrr, jint JPreProjectionNum, jint imH, jint imgW) {
PreProjectionNum = JPreProjectionNum;
jint* SkelImwithout1 = env->GetIntArrayElements(JSkelImwithout1, NULL);
jint* SingleResult = env->GetIntArrayElements(JSingleResult, NULL);
jint* rr = env->GetIntArrayElements(Jrr, NULL);

getRCadiAndRelatedLocIndex(SkelImwithout1, SingleResult, rr, PreProjectionNum, imH, imgW, skelNum);

env->ReleaseIntArrayElements(JSkelImwithout1, SkelImwithout1, 0);
env->ReleaseIntArrayElements(JSingleResult, SingleResult, 0);
env->ReleaseIntArrayElements(Jrr, rr, 0);
}

JNIEXPORT jintArray JNICALL Java_LuckyProfiler_1_getRCadi(JNIEnv* env, jobject) {
jintArray result = NULL;
result = env->NewIntArray(skelNum * PreProjectionNum);
env->SetIntArrayRegion(result, 0, skelNum * PreProjectionNum, RCadi);
free(RCadi);
return result;
}

JNIEXPORT jintArray JNICALL Java_LuckyProfiler_1_getRelatedLocIndex(JNIEnv* env, jobject) {
jintArray result = NULL;
result = env->NewIntArray(skelNum * PreProjectionNum);
env->SetIntArrayRegion(result, 0, skelNum * PreProjectionNum, RelatedLocIndex);
free(RelatedLocIndex);
return result;
}

JNIEXPORT jdoubleArray JNICALL Java_LuckyProfiler_1_getAngs(JNIEnv* env, jobject) {
jdoubleArray result = NULL;
result = env->NewDoubleArray(skelNum);
env->SetDoubleArrayRegion(result, 0, skelNum, angs);
free(angs);
return result;
}
Loading

0 comments on commit 4afad58

Please sign in to comment.