Commit 0f868392 authored by 宋柯's avatar 宋柯

init

parent ba10a7ff
cmake_minimum_required(VERSION 3.17)
project(BeautyCamera)
set(CMAKE_CXX_STANDARD 11)
#find_package(nlohmann_json 3.2.0 REQUIRED)
#target_link_libraries(foo PRIVATE nlohmann_json::nlohmann_json)
#Poco
#find_package(Poco CONFIG REQUIRED Util Data Net XML Zip)
#message(STATUS "Using Poco ${Poco_VERSION}")
# <------------ add hiredis dependency --------------->
#find_path(HIREDIS_HEADER hiredis)
#message(STATUS "Using HIREDIS_HEADER ${HIREDIS_HEADER}")
#find_library(HIREDIS_LIB hiredis)
# <------------ add redis-plus-plus dependency -------------->
# NOTE: this should be *sw* NOT *redis++*
#find_path(REDIS_PLUS_PLUS_HEADER sw)
#find_library(REDIS_PLUS_PLUS_LIB redis++)
#opencv
find_package(OpenCV)
include_directories(${OpenCV_INCLUDE_DIRS})
find_package(Poco CONFIG REQUIRED Util Data Net XML Zip)
#FIND_PACKAGE(OpenMP REQUIRED)
#if(OPENMP_FOUND)
# set(CMAKE_C_FLAGS "${OpenMP_C_FLAGS}")
#endif()
aux_source_directory(. SRCS)
include_directories(/usr/local/include)
link_directories(/usr/local/lib)
#tenginekit sdk
include_directories(/Users/edz/Downloads/TengineKit-master/Linux/include)
link_directories(/Users/edz/Downloads/TengineKit-master/Linux/libs)
#add_executable(main f_BeautyCamera.cpp ${SRCS})
#target_link_libraries(main ${OpenCV_LIBS} ${Poco_LIBRARIES})
#add_executable(gender gender.cpp ${SRCS})
#target_link_libraries(gender ${OpenCV_LIBS} ${Poco_LIBRARIES})
add_executable(beautyIris f_BeautyIris.cpp ${SRCS})
target_link_libraries(beautyIris ${OpenCV_LIBS} ${Poco_LIBRARIES} TengineKitSDK)
#target_link_libraries(helloworld
# ${Poco_LIBRARIES}
# ${HIREDIS_LIB}
# ${REDIS_PLUS_PLUS_LIB}
# nlohmann_json::nlohmann_json
# rdkafka++)
\ No newline at end of file
#ifndef __COMMEN__
#define __COMMEN__
#endif
#define MIN2(a, b) ((a) < (b) ? (a) : (b))
#define MAX2(a, b) ((a) > (b) ? (a) : (b))
#define CLIP3(x, a, b) MIN2(MAX2(a,x), b)
\ No newline at end of file
B^F:\TRENT\DOC\3.10\TESTDEMO_C\TRGB2YCBCR.CPP
B^F:\TRENT\DOC\3.10\TESTDEMO_C\F_SKINPDF.CPP|F:\TRENT\DOC\3.10\TESTDEMO_C\TRGB2YCBCR.CPP
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level='asInvoker' uiAccess='false' />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
#v4.0:v100
Debug|Win32|F:\Trent\doc\3.14\|
Build started 2018/12/14 10:30:55.
1>Project "F:\Trent\doc\3.14\TestDemo_C\TestDemo_C.vcxproj" on node 2 (build target(s)).
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(299,5): warning MSB8004: Output Directory does not end with a trailing slash. This build instance will add the slash as it is required to allow proper evaluation of the Output Directory.
1>InitializeBuildStatus:
Creating "Debug\TestDemo_C.unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
G:\Software\VS2010\VC\bin\CL.exe /c /ZI /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _DEBUG /D _WINDOWS /D _USRDLL /D TESTDEMO_C_EXPORTS /D _WINDLL /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc100.pdb" /Gd /TP /analyze- /errorReport:prompt f_SoftSkin.cpp f_SoftSkin_ChannelMethod.cpp f_SoftSkin_DetailsAddingMethod.cpp f_SoftSkin_HPMethod.cpp f_SurfaceBlur.cpp
f_SurfaceBlur.cpp
1>f:\trent\doc\3.14\testdemo_c\f_surfaceblur.cpp(56): warning C4244: '=' : conversion from 'float' to 'int', possible loss of data
f_SoftSkin_HPMethod.cpp
f_SoftSkin_DetailsAddingMethod.cpp
f_SoftSkin_ChannelMethod.cpp
1>f:\trent\doc\3.14\testdemo_c\f_softskin_channelmethod.cpp(73): warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
f_SoftSkin.cpp
1>f:\trent\doc\3.14\testdemo_c\f_softskin.cpp(42): warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
Generating Code...
Link:
G:\Software\VS2010\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"..\TestDemo\bin\Debug\TestDemo_C.dll" /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /ManifestFile:"Debug\TestDemo_C.dll.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"F:\Trent\doc\3.14\TestDemo\bin\Debug\TestDemo_C.pdb" /SUBSYSTEM:WINDOWS /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"..\TestDemo\bin\Debug\TestDemo_C.lib" /MACHINE:X86 /DLL Debug\f_Commen_MixLayer.obj
Debug\f_GaussFilter.obj
Debug\f_LUTFilter.obj
Debug\f_SkinDetect.obj
Debug\f_SkinPDF.obj
Debug\f_SkinColor.obj
Debug\f_SmartBlur.obj
Debug\f_SoftSkin.obj
Debug\f_SoftSkin_ChannelMethod.obj
Debug\f_SoftSkin_DetailsAddingMethod.obj
Debug\f_SoftSkin_HPMethod.obj
Debug\f_SoftSkin_MixMethod.obj
Debug\f_SurfaceBlur.obj
Debug\TRGB2HSV.obj
Debug\TRGB2YCbCr.obj
Creating library ..\TestDemo\bin\Debug\TestDemo_C.lib and object ..\TestDemo\bin\Debug\TestDemo_C.exp
TestDemo_C.vcxproj -> F:\Trent\doc\3.14\TestDemo_C\..\TestDemo\bin\Debug\TestDemo_C.dll
Manifest:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\mt.exe /nologo /verbose /out:"F:\Trent\doc\3.14\TestDemo_C\..\TestDemo\bin\Debug\TestDemo_C.dll.manifest" /manifest Debug\TestDemo_C.dll.intermediate.manifest
FinalizeBuildStatus:
Deleting file "Debug\TestDemo_C.unsuccessfulbuild".
Touching "Debug\TestDemo_C.lastbuildstate".
1>Done Building Project "F:\Trent\doc\3.14\TestDemo_C\TestDemo_C.vcxproj" (build target(s)).
Build succeeded.
Time Elapsed 00:00:01.21
^F:\Trent\doc\3.10\TestDemo_C\TestDemo_C.vcxproj
F:\Trent\doc\3.10\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.10\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.10\TestDemo\bin\Debug\TestDemo_C.exp
F:\Trent\doc\3.10\TestDemo\bin\Debug\TestDemo_C.exp
^F:\Trent\doc\3.10\TestDemo_C\TestDemo_C.vcxproj
F:\Trent\doc\3.10\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.10\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.10\TestDemo\bin\Debug\TestDemo_C.exp
F:\Trent\doc\3.10\TestDemo\bin\Debug\TestDemo_C.exp
^F:\Trent\doc\3.10\TestDemo_C\TestDemo_C.vcxproj
F:\Trent\doc\3.10\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.10\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.10\TestDemo\bin\Debug\TestDemo_C.exp
F:\Trent\doc\3.10\TestDemo\bin\Debug\TestDemo_C.exp
^F:\Trent\doc\3.10\TestDemo_C\TestDemo_C.vcxproj
F:\Trent\doc\3.10\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.10\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.10\TestDemo\bin\Debug\TestDemo_C.exp
F:\Trent\doc\3.10\TestDemo\bin\Debug\TestDemo_C.exp
^F:\Trent\doc\3.10\TestDemo_C\TestDemo_C.vcxproj
F:\Trent\doc\3.10\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.10\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.10\TestDemo\bin\Debug\TestDemo_C.exp
F:\Trent\doc\3.10\TestDemo\bin\Debug\TestDemo_C.exp
^F:\Trent\doc\3.10\TestDemo_C\TestDemo_C.vcxproj
F:\Trent\doc\3.10\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.10\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.10\TestDemo\bin\Debug\TestDemo_C.exp
F:\Trent\doc\3.10\TestDemo\bin\Debug\TestDemo_C.exp
^F:\Trent\doc\3.11\TestDemo_C\TestDemo_C.vcxproj
F:\Trent\doc\3.11\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.11\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.11\TestDemo\bin\Debug\TestDemo_C.exp
F:\Trent\doc\3.11\TestDemo\bin\Debug\TestDemo_C.exp
^F:\Trent\doc\3.11\TestDemo_C\TestDemo_C.vcxproj
F:\Trent\doc\3.11\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.11\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.11\TestDemo\bin\Debug\TestDemo_C.exp
F:\Trent\doc\3.11\TestDemo\bin\Debug\TestDemo_C.exp
^F:\Trent\doc\3.11\TestDemo_C\TestDemo_C.vcxproj
F:\Trent\doc\3.11\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.11\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.11\TestDemo\bin\Debug\TestDemo_C.exp
F:\Trent\doc\3.11\TestDemo\bin\Debug\TestDemo_C.exp
^F:\Trent\doc\3.11\TestDemo_C\TestDemo_C.vcxproj
F:\Trent\doc\3.11\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.11\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.11\TestDemo\bin\Debug\TestDemo_C.exp
F:\Trent\doc\3.11\TestDemo\bin\Debug\TestDemo_C.exp
^F:\Trent\doc\3.11\TestDemo_C\TestDemo_C.vcxproj
F:\Trent\doc\3.11\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.11\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.11\TestDemo\bin\Debug\TestDemo_C.exp
F:\Trent\doc\3.11\TestDemo\bin\Debug\TestDemo_C.exp
^F:\Trent\doc\3.11\TestDemo_C\TestDemo_C.vcxproj
F:\Trent\doc\3.11\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.11\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.11\TestDemo\bin\Debug\TestDemo_C.exp
F:\Trent\doc\3.11\TestDemo\bin\Debug\TestDemo_C.exp
^F:\Trent\doc\3.14\TestDemo_C\TestDemo_C.vcxproj
F:\Trent\doc\3.14\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.14\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.14\TestDemo\bin\Debug\TestDemo_C.exp
F:\Trent\doc\3.14\TestDemo\bin\Debug\TestDemo_C.exp
^F:\Trent\doc\3.14\TestDemo_C\TestDemo_C.vcxproj
F:\Trent\doc\3.14\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.14\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.14\TestDemo\bin\Debug\TestDemo_C.exp
F:\Trent\doc\3.14\TestDemo\bin\Debug\TestDemo_C.exp
^F:\Trent\doc\3.14\TestDemo_C\TestDemo_C.vcxproj
F:\Trent\doc\3.14\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.14\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.14\TestDemo\bin\Debug\TestDemo_C.exp
F:\Trent\doc\3.14\TestDemo\bin\Debug\TestDemo_C.exp
^F:\Trent\doc\3.14\TestDemo_C\TestDemo_C.vcxproj
F:\Trent\doc\3.14\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.14\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.14\TestDemo\bin\Debug\TestDemo_C.exp
F:\Trent\doc\3.14\TestDemo\bin\Debug\TestDemo_C.exp
^F:\Trent\doc\3.14\TestDemo_C\TestDemo_C.vcxproj
F:\Trent\doc\3.14\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.14\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.14\TestDemo\bin\Debug\TestDemo_C.exp
F:\Trent\doc\3.14\TestDemo\bin\Debug\TestDemo_C.exp
^F:\Trent\doc\3.14\TestDemo_C\TestDemo_C.vcxproj
F:\Trent\doc\3.14\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.14\TestDemo\bin\Debug\TestDemo_C.lib
F:\Trent\doc\3.14\TestDemo\bin\Debug\TestDemo_C.exp
F:\Trent\doc\3.14\TestDemo\bin\Debug\TestDemo_C.exp
B^F:\TRENT\DOC\3.10\TESTDEMO_C\F_SKINPDF.CPP

\ No newline at end of file

\ No newline at end of file

\ No newline at end of file

\ No newline at end of file

\ No newline at end of file

\ No newline at end of file

\ No newline at end of file

\ No newline at end of file
B^F:\TRENT\DOC\3.10\TESTDEMO_C\DEBUG\F_SKINPDF.OBJ|F:\TRENT\DOC\3.10\TESTDEMO_C\DEBUG\TRGB2YCBCR.OBJ
B^F:\TRENT\DOC\3.10\TESTDEMO_C\DEBUG\F_SKINPDF.OBJ|F:\TRENT\DOC\3.10\TESTDEMO_C\DEBUG\TRGB2YCBCR.OBJ
B^F:\TRENT\DOC\3.10\TESTDEMO_C\DEBUG\F_SKINPDF.OBJ|F:\TRENT\DOC\3.10\TESTDEMO_C\DEBUG\TRGB2YCBCR.OBJ
B^F:\TRENT\DOC\3.10\TESTDEMO_C\DEBUG\TESTDEMO_C.DLL.INTERMEDIATE.MANIFEST
B^F:\TRENT\DOC\3.10\TESTDEMO_C\DEBUG\TESTDEMO_C.DLL.INTERMEDIATE.MANIFEST
B^F:\TRENT\DOC\3.14\TESTDEMO_C\DEBUG\TESTDEMO_C.DLL.INTERMEDIATE.MANIFEST
File added
File added
========================================================================
DYNAMIC LINK LIBRARY : TestDemo_C Project Overview
========================================================================
AppWizard has created this TestDemo_C DLL for you.
This file contains a summary of what you will find in each of the files that
make up your TestDemo_C application.
TestDemo_C.vcxproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
TestDemo_C.vcxproj.filters
This is the filters file for VC++ projects generated using an Application Wizard.
It contains information about the association between the files in your project
and the filters. This association is used in the IDE to show grouping of files with
similar extensions under a specific node (for e.g. ".cpp" files are associated with the
"Source Files" filter).
TestDemo_C.cpp
This is the main DLL source file.
When created, this DLL does not export any symbols. As a result, it
will not produce a .lib file when it is built. If you wish this project
to be a project dependency of some other project, you will either need to
add code to export some symbols from the DLL so that an export library
will be produced, or you can set the Ignore Input Library property to Yes
on the General propert page of the Linker folder in the project's Property
Pages dialog box.
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named TestDemo_C.pch and a precompiled types file named StdAfx.obj.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" comments to indicate parts of the source code you
should add to or customize.
/////////////////////////////////////////////////////////////////////////////
B^I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\F_COMMEN_MIXLAYER.CPP
B^I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\F_BEAUTYCAMERA.CPP|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\F_COMMEN_MIXLAYER.CPP|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\F_GAUSSFILTER.CPP|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\F_LAPLACESHARPEN.CPP|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\F_LUTFILTER.CPP|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\F_SKINCOLOR.CPP|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\F_SKINDETECT.CPP|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\F_SKINPDF.CPP|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\F_SMARTBLUR.CPP|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\F_SOFTSKIN.CPP|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\F_SOFTSKIN_CHANNELMETHOD.CPP|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\F_SOFTSKIN_DETAILSADDINGMETHOD.CPP|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\F_SOFTSKIN_HPMETHOD.CPP|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\F_SOFTSKIN_MIXMETHOD.CPP|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\F_SURFACEBLUR.CPP|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\TRGB2HSV.CPP|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\TRGB2YCBCR.CPP
This diff is collapsed.
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level='asInvoker' uiAccess='false' />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
#v4.0:v100
Release|Win32|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\|
Build started 9/30/2019 3:47:42 PM.
1>Project "I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo_C\TestDemo_C.vcxproj" on node 2 (build target(s)).
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(299,5): warning MSB8004: Output Directory does not end with a trailing slash. This build instance will add the slash as it is required to allow proper evaluation of the Output Directory.
1>InitializeBuildStatus:
Creating "Release\TestDemo_C.unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
G:\Software\VS2010\VC\bin\CL.exe /c /IG:\Software\vld\include /Zi /nologo /W3 /WX- /O2 /Oi /Oy- /GL /D WIN32 /D NDEBUG /D _WINDOWS /D _USRDLL /D TESTDEMO_C_EXPORTS /D _WINDLL /D _UNICODE /D UNICODE /Gm- /EHsc /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Release\\" /Fd"Release\vc100.pdb" /Gd /TP /analyze- /errorReport:prompt f_BeautyCamera.cpp
f_BeautyCamera.cpp
1>f_BeautyCamera.cpp(79): warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
1>f_BeautyCamera.cpp(212): warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
Link:
G:\Software\VS2010\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"..\TestDemo\bin\Release\TestDemo_C.dll" /INCREMENTAL:NO /NOLOGO /LIBPATH:G:\Software\vld\lib\Win32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /ManifestFile:"Release\TestDemo_C.dll.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo\bin\Release\TestDemo_C.pdb" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /LTCG /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"..\TestDemo\bin\Release\TestDemo_C.lib" /MACHINE:X86 /DLL Release\f_BeautyCamera.obj
Release\f_Commen_MixLayer.obj
Release\f_GaussFilter.obj
Release\f_LaplaceSharpen.obj
Release\f_LUTFilter.obj
Release\f_SkinDetect.obj
Release\f_SkinPDF.obj
Release\f_SkinColor.obj
Release\f_SmartBlur.obj
Release\f_SoftSkin.obj
Release\f_SoftSkin_ChannelMethod.obj
Release\f_SoftSkin_DetailsAddingMethod.obj
Release\f_SoftSkin_HPMethod.obj
Release\f_SoftSkin_MixMethod.obj
Release\f_SurfaceBlur.obj
Release\TRGB2HSV.obj
Release\TRGB2YCbCr.obj
Creating library ..\TestDemo\bin\Release\TestDemo_C.lib and object ..\TestDemo\bin\Release\TestDemo_C.exp
Generating code
Finished generating code
TestDemo_C.vcxproj -> I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo_C\..\TestDemo\bin\Release\TestDemo_C.dll
Manifest:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\mt.exe /nologo /verbose /out:"I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo_C\..\TestDemo\bin\Release\TestDemo_C.dll.manifest" /manifest Release\TestDemo_C.dll.intermediate.manifest
FinalizeBuildStatus:
Deleting file "Release\TestDemo_C.unsuccessfulbuild".
Touching "Release\TestDemo_C.lastbuildstate".
1>Done Building Project "I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo_C\TestDemo_C.vcxproj" (build target(s)).
Build succeeded.
Time Elapsed 00:00:07.00
^I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo_C\TestDemo_C.vcxproj
I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo\bin\Release\TestDemo_C.lib
I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo\bin\Release\TestDemo_C.lib
I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo\bin\Release\TestDemo_C.exp
I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo\bin\Release\TestDemo_C.exp
^I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo_C\TestDemo_C.vcxproj
I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo\bin\Release\TestDemo_C.lib
I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo\bin\Release\TestDemo_C.lib
I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo\bin\Release\TestDemo_C.exp
I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo\bin\Release\TestDemo_C.exp
^I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo_C\TestDemo_C.vcxproj
I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo\bin\Release\TestDemo_C.lib
I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo\bin\Release\TestDemo_C.lib
I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo\bin\Release\TestDemo_C.exp
I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo\bin\Release\TestDemo_C.exp
^I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo_C\TestDemo_C.vcxproj
I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo\bin\Release\TestDemo_C.lib
I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo\bin\Release\TestDemo_C.lib
I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo\bin\Release\TestDemo_C.exp
I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo\bin\Release\TestDemo_C.exp
^I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo_C\TestDemo_C.vcxproj
I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo\bin\Release\TestDemo_C.lib
I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo\bin\Release\TestDemo_C.lib
I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo\bin\Release\TestDemo_C.exp
I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TestDemo\bin\Release\TestDemo_C.exp
B^I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\F_COMMEN_MIXLAYER.CPP
B^I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_BEAUTYCAMERA.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_COMMEN_MIXLAYER.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_GAUSSFILTER.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_LAPLACESHARPEN.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_LUTFILTER.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SKINCOLOR.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SKINDETECT.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SKINPDF.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SMARTBLUR.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SOFTSKIN.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SOFTSKIN_CHANNELMETHOD.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SOFTSKIN_DETAILSADDINGMETHOD.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SOFTSKIN_HPMETHOD.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SOFTSKIN_MIXMETHOD.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SURFACEBLUR.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\TRGB2HSV.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\TRGB2YCBCR.OBJ
B^I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_BEAUTYCAMERA.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_COMMEN_MIXLAYER.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_GAUSSFILTER.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_LAPLACESHARPEN.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_LUTFILTER.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SKINCOLOR.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SKINDETECT.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SKINPDF.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SMARTBLUR.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SOFTSKIN.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SOFTSKIN_CHANNELMETHOD.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SOFTSKIN_DETAILSADDINGMETHOD.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SOFTSKIN_HPMETHOD.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SOFTSKIN_MIXMETHOD.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SURFACEBLUR.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\TRGB2HSV.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\TRGB2YCBCR.OBJ
B^I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_BEAUTYCAMERA.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_COMMEN_MIXLAYER.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_GAUSSFILTER.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_LAPLACESHARPEN.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_LUTFILTER.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SKINCOLOR.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SKINDETECT.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SKINPDF.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SMARTBLUR.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SOFTSKIN.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SOFTSKIN_CHANNELMETHOD.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SOFTSKIN_DETAILSADDINGMETHOD.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SOFTSKIN_HPMETHOD.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SOFTSKIN_MIXMETHOD.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\F_SURFACEBLUR.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\TRGB2HSV.OBJ|I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\TRGB2YCBCR.OBJ
B^I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\TESTDEMO_C.DLL.INTERMEDIATE.MANIFEST
B^I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\TESTDEMO_C.DLL.INTERMEDIATE.MANIFEST
B^I:\MYBOOK\作者文件\资源\书籍初稿\第三章\第4-5-6节\3.15\TESTDEMO_C\RELEASE\TESTDEMO_C.DLL.INTERMEDIATE.MANIFEST
#include"TRGB2HSV.h"
#include"Commen.h"
#include<stdlib.h>
#include<math.h>
void RGB2HSV(unsigned char R, unsigned char G, unsigned char B, float* h, float* s, float * v)
{
float min, max;
float r = R / 255.0;
float g = G / 255.0;
float b = B / 255.0;
min = MIN2(r,MIN2(g,b));
max = MAX2(r,MAX2(g,b));
if (max == min)
*h = 0;
else if (max == r && g >= b)
*h = 60.0 * (g - b) / (max - min);
else if (max == r && g < b)
*h = 60.0 * (g - b) / (max - min) + 360.0;
else if (max == g)
*h = 60.0 * (b - r) / (max - min) + 120.0;
else if (max == b)
*h = 60.0 * (r - g) / (max - min) + 240.0;
*h = CLIP3(*h, 0, 360);
if (max == 0)
*s = 0;
else
*s = (max - min) / max;
*v = max;
};
void HSV2RGB(float h, float s, float v, unsigned char* R, unsigned char *G, unsigned char *B)
{
float q = 0, p = 0, t = 0, f = 0, r = 0, g = 0, b = 0;
int hN = 0;
if(h == 360)
h = 0;
if (h < 0)
h = 360 + h;
hN = (int)((int)h / 60);
f = h / 60.0f - hN;
p = v * (1.0 - s);
q = v * (1.0 - f * s);
t = v * (1.0 - (1.0 - f) * s);
switch (hN)
{
case 0:
r = v;
g = t;
b = p;
break;
case 1:
r = q;
g = v;
b = p;
break;
case 2:
r = p;
g = v;
b = t;
break;
case 3:
r = p;
g = q;
b = v;
break;
case 4:
r = t;
g = p;
b = v;
break;
case 5:
r = v;
g = p;
b = q;
break;
default:
break;
}
*R = (unsigned char)CLIP3((r * 255.0),0,255);
*G = (unsigned char)CLIP3((g * 255.0),0,255);
*B = (unsigned char)CLIP3((b * 255.0),0,255);
};
/*************************************************************************
Copyright: Trent.
Author: Trent1985
Date: 2018-9-23
Mail: dongtingyueh@163.com
Description: RGB2HSV
*************************************************************************/
#ifndef __RGB2HSI__
#define __RGB2HSI__
void RGB2HSV(unsigned char R, unsigned char G, unsigned char B, float *H, float *S, float *V);
void HSV2RGB(float H, float S, float V, unsigned char * R, unsigned char * G, unsigned char *B);
#endif
\ No newline at end of file
#include"TRGB2YCbCr.h"
#include <stdlib.h>
#include <stdio.h>
#include "math.h"
#include <string.h>
const float YCbCrYRF = 0.299F; // RGB转YCbCr的系数(浮点类型)
const float YCbCrYGF = 0.587F;
const float YCbCrYBF = 0.114F;
const float YCbCrCbRF = -0.168736F;
const float YCbCrCbGF = -0.331264F;
const float YCbCrCbBF = 0.500000F;
const float YCbCrCrRF = 0.500000F;
const float YCbCrCrGF = -0.418688F;
const float YCbCrCrBF = -0.081312F;
const float RGBRYF = 1.00000F; // YCbCr转RGB的系数(浮点类型)
const float RGBRCbF = 0.0000F;
const float RGBRCrF = 1.40200F;
const float RGBGYF = 1.00000F;
const float RGBGCbF = -0.34414F;
const float RGBGCrF = -0.71414F;
const float RGBBYF = 1.00000F;
const float RGBBCbF = 1.77200F;
const float RGBBCrF = 0.00000F;
const int Shift = 20;
const int HalfShiftValue = 1 << (Shift - 1);
const int YCbCrYRI = (int)(YCbCrYRF * (1 << Shift) + 0.5); // RGB转YCbCr的系数(整数类型)
const int YCbCrYGI = (int)(YCbCrYGF * (1 << Shift) + 0.5);
const int YCbCrYBI = (int)(YCbCrYBF * (1 << Shift) + 0.5);
const int YCbCrCbRI = (int)(YCbCrCbRF * (1 << Shift) + 0.5);
const int YCbCrCbGI = (int)(YCbCrCbGF * (1 << Shift) + 0.5);
const int YCbCrCbBI = (int)(YCbCrCbBF * (1 << Shift) + 0.5);
const int YCbCrCrRI = (int)(YCbCrCrRF * (1 << Shift) + 0.5);
const int YCbCrCrGI = (int)(YCbCrCrGF * (1 << Shift) + 0.5);
const int YCbCrCrBI = (int)(YCbCrCrBF * (1 << Shift) + 0.5);
const int RGBRYI = (int)(RGBRYF * (1 << Shift) + 0.5); // YCbCr转RGB的系数(整数类型)
const int RGBRCbI = (int)(RGBRCbF * (1 << Shift) + 0.5);
const int RGBRCrI = (int)(RGBRCrF * (1 << Shift) + 0.5);
const int RGBGYI = (int)(RGBGYF * (1 << Shift) + 0.5);
const int RGBGCbI = (int)(RGBGCbF * (1 << Shift) + 0.5);
const int RGBGCrI = (int)(RGBGCrF * (1 << Shift) + 0.5);
const int RGBBYI = (int)(RGBBYF * (1 << Shift) + 0.5);
const int RGBBCbI = (int)(RGBBCbF * (1 << Shift) + 0.5);
const int RGBBCrI = (int)(RGBBCrF * (1 << Shift) + 0.5);
void RGBToYCbCr(int R, int G, int B, int*Y,int*Cb, int* Cr)
{
*Y = ((YCbCrYRI * R + YCbCrYGI * G + YCbCrYBI * B + HalfShiftValue) >> Shift);
*Cb = (128 + ((YCbCrCbRI * R + YCbCrCbGI * G + YCbCrCbBI * B + HalfShiftValue) >> Shift));
*Cr = (128 + ((YCbCrCrRI * R + YCbCrCrGI * G + YCbCrCrBI * B + HalfShiftValue) >> Shift));
}
void YCbCrToRGB(int Y, int Cb, int Cr, int*R,int*G, int* B)
{
Cb = Cb - 128; Cr = Cr - 128;
*R = Y + ((RGBRCrI * Cr + HalfShiftValue) >> Shift);
*G = Y + ((RGBGCbI * Cb + RGBGCrI * Cr + HalfShiftValue) >> Shift);
*B = Y + ((RGBBCbI * Cb + HalfShiftValue) >> Shift);
if (*R > 255) *R = 255; else if (*R < 0) *R = 0;
if (*G > 255) *G = 255; else if (*G < 0) *G = 0;
if (*B > 255) *B = 255; else if (*B < 0) *B = 0;
}
\ No newline at end of file
/*************************************************
Copyright: Copyright HZ.
Author: Hu Yaowu
Date: 2015-04-21
Mail: dongtingyueh@163.com
Description:RGB to YCbCr.
**************************************************/
#ifndef TRGB2YCbCr
#define TRGB2YCbCr
#include<string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
void RGBToYCbCr(int R, int G, int B, int*Y,int*Cb, int* Cr);
void YCbCrToRGB(int Y, int Cb, int Cr, int*R,int*G, int* B);
#endif
\ No newline at end of file
#include"TRGB2YUV.h"
#include"Commen.h"
#include<stdlib.h>
#include<math.h>
void RGB2YUV(unsigned char R, unsigned char G, unsigned char B, int *Y, int* U, int*V)
{
*Y = (299 * R + 587 * G + 114 * B) / 1000;
*U = (-147 * R - 289 * G + 436 * B) / 1000;
*V = (615 * R - 515 * G - 100 * B) / 1000;
};
void YUV2RGB(int Y, int U, int V, unsigned char * R, unsigned char * G, unsigned char *B)
{
*R = CLIP3((100 * Y + 114 * V) / 100, 0, 255);
*G = CLIP3((1000 * Y - 395 * U - 581 * V) / 1000, 0, 255);
*B = CLIP3((1000 * Y + 2032 * U) / 1000, 0, 255);
};
\ No newline at end of file
/*************************************************************************
Copyright: Trent.
Author: Trent1985
Date: 2018-9-23
Mail: dongtingyueh@163.com
Description: RGB2YUV
*************************************************************************/
#ifndef __RGB2YUV__
#define __RGB2YUV__
void RGB2YUV(unsigned char R, unsigned char G, unsigned char B, int *Y, int* U, int*V);
void YUV2RGB(int Y, int U, int V, unsigned char * R, unsigned char * G, unsigned char *B);
#endif
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.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>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{9F6555E5-E791-44C8-B90B-4FFB3AD7C52D}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>TestDemo_C</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</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>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\TestDemo\bin\Debug</OutDir>
<EmbedManifest>false</EmbedManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\TestDemo\bin\Release</OutDir>
<EmbedManifest>false</EmbedManifest>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;TESTDEMO_C_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;TESTDEMO_C_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Commen.h" />
<ClInclude Include="f_BeautyCamera.h" />
<ClInclude Include="f_Commen_MixLayer.h" />
<ClInclude Include="f_GaussFilter.h" />
<ClInclude Include="f_LaplaceSharpen.h" />
<ClInclude Include="f_LUTFilter.h" />
<ClInclude Include="f_SkinDetect.h" />
<ClInclude Include="f_SkinPDF.h" />
<ClInclude Include="f_SkinColor.h" />
<ClInclude Include="f_SmartBlur.h" />
<ClInclude Include="f_SoftSkin.h" />
<ClInclude Include="f_SoftSkin_ChannelMethod.h" />
<ClInclude Include="f_SoftSkin_DetailsAddingMethod.h" />
<ClInclude Include="f_SoftSkin_HPMethod.h" />
<ClInclude Include="f_SoftSkin_MixMethod.h" />
<ClInclude Include="f_SurfaceBlur.h" />
<ClInclude Include="TRGB2HSV.h" />
<ClInclude Include="TRGB2YCbCr.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="f_BeautyCamera.cpp" />
<ClCompile Include="f_Commen_MixLayer.cpp" />
<ClCompile Include="f_GaussFilter.cpp" />
<ClCompile Include="f_LaplaceSharpen.cpp" />
<ClCompile Include="f_LUTFilter.cpp" />
<ClCompile Include="f_SkinDetect.cpp" />
<ClCompile Include="f_SkinPDF.cpp" />
<ClCompile Include="f_SkinColor.cpp" />
<ClCompile Include="f_SmartBlur.cpp" />
<ClCompile Include="f_SoftSkin.cpp" />
<ClCompile Include="f_SoftSkin_ChannelMethod.cpp" />
<ClCompile Include="f_SoftSkin_DetailsAddingMethod.cpp" />
<ClCompile Include="f_SoftSkin_HPMethod.cpp" />
<ClCompile Include="f_SoftSkin_MixMethod.cpp" />
<ClCompile Include="f_SurfaceBlur.cpp" />
<ClCompile Include="TRGB2HSV.cpp" />
<ClCompile Include="TRGB2YCbCr.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<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>
<None Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="TRGB2YCbCr.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="f_SkinPDF.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Commen.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="f_GaussFilter.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="f_SoftSkin.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="f_SmartBlur.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="f_SkinDetect.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="TRGB2HSV.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="f_LUTFilter.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="f_SkinColor.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="f_SoftSkin_ChannelMethod.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="f_SoftSkin_HPMethod.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="f_SurfaceBlur.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="f_SoftSkin_MixMethod.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="f_Commen_MixLayer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="f_SoftSkin_DetailsAddingMethod.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="f_LaplaceSharpen.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="f_BeautyCamera.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="TRGB2YCbCr.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="f_SkinPDF.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="f_GaussFilter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="f_SoftSkin.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="f_SmartBlur.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="f_SkinDetect.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TRGB2HSV.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="f_LUTFilter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="f_SkinColor.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="f_SoftSkin_ChannelMethod.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="f_SoftSkin_HPMethod.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="f_SurfaceBlur.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="f_SoftSkin_MixMethod.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="f_Commen_MixLayer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="f_SoftSkin_DetailsAddingMethod.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="f_LaplaceSharpen.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="f_BeautyCamera.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>
\ No newline at end of file
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include"f_SkinDetect.h"
#include"../TRGB2YCbCr.h"
#include"../TRGB2HSV.h"
#define MIN2(a, b) ((a) < (b) ? (a) : (b))
#define MAX2(a, b) ((a) > (b) ? (a) : (b))
#define CLIP3(x, a, b) MIN2(MAX2(a,x), b)
/*************************************************************************
*Function: Skin detection in RGB color space
*Params:
*srcData:32BGRA image buffer
*width: width of image
*height: height of image
*stride: Stride of image
*Return: 0-OK,other failed
*Refference: Human skin color clustering for face detection.
**************************************************************************/
int f_SkindetectionRGB(unsigned char* srcData, int width, int height, int stride)
{
int ret = 0;
unsigned char* pSrc = srcData;
int R, G, B;
for(int j = 0; j < height; j++)
{
for(int i = 0; i < width; i++)
{
B = pSrc[0];
G = pSrc[1];
R = pSrc[2];
if(!((R > 95) && (G > 40) && (B > 20) && (R > G) && (R > B) && (MAX2(R, G, B)-MIN2(R, G, B) > 15) && (abs(R - G) > 15)))
{
pSrc[0] = 0;
pSrc[1] = 0;
pSrc[2] = 0;
}
pSrc += 4;
}
}
return ret;
}
/*************************************************************************
*Function: Skin detection in hsv color space
*Params:
*srcData:32BGRA image buffer
*width: width of image
*height: height of image
*stride: Stride of image
*Return: 0-OK,other failed
*Refference: Skin color enhancement based on favorite skin color in HSV color space.
**************************************************************************/
int f_SkindetectionHSV(unsigned char* srcData, int width, int height, int stride)
{
int ret = 0;
unsigned char* pSrc = srcData;
int R, G, B;
float H, S, V;
for(int j = 0; j < height; j++)
{
for(int i = 0; i < width; i++)
{
B = pSrc[0];
G = pSrc[1];
R = pSrc[2];
RGB2HSV(R, G, B, &H, &S, &V);
if (!(((S >= 0.1) && (S <= 0.68)) && ((V >= 0.13 && V <= 0.25 && H >= ((0.4 - V) / 0.014) && H <= ((V + 0.062) / 0.01)) || ((V > 0.25) && (V <= 0.38) && (H >= (0.4 - V) / 0.014) && (H <= (0.67 - V) / 0.014)) || ((V > 0.38) && (V <= 0.46) && (H >= (V - 0.34) / 0.03) && (H <= (0.67 - V) / 0.014)) ||
((V > 0.46) && (V <= 0.6) && (H >= (V - 0.34) / 0.03) && (H <= (V - 0.31) / 0.009)) || ((V > 0.6) && (V <= 0.76) && (H >= (0.91 - V) / 0.14) && (H <= (V - 0.31) / 0.009)) || ((V > 0.76) && (V <= 0.91) && (H >= (0.91 - V) / 0.14) && (H <= (1.17 - V) / 0.0082)) || ((V > 0.91) && (V <= 1) && (H >= (V - 0.91) / 0.0041) && (H <= (1.17 - V) / 0.0082)))))
{
pSrc[0] = 0;
pSrc[1] = 0;
pSrc[2] = 0;
}
pSrc += 4;
}
}
return ret;
}
/*************************************************************************
*Function: Skin detection in ycgcr color space
*Params:
*srcData:32BGRA image buffer
*width: width of image
*height: height of image
*stride: Stride of image
*Return: 0-OK,other failed
*Refference: YCgCr��ɫ�ռ�ķ�ɫ����������ⷨ.
**************************************************************************/
int f_SkindetectionYCgCr(unsigned char* srcData, int width, int height, int stride)
{
int ret = 0;
unsigned char* pSrc = srcData;
int R, G, B;
float Cr, Cg, Cb;
for(int j = 0; j < height; j++)
{
for(int i = 0; i < width; i++)
{
B = pSrc[0];
G = pSrc[1];
R = pSrc[2];
Cg = 128 - 0.318f * R + 0.4392f * G - 0.1212f * B;
Cr = 128 + 0.4392f * R - 0.3677f * G - 0.0714f * B;
if (!((Cg >= 85) && (Cg <= 135) && ((Cr <= (280 - Cg)) && (Cr >= (260 - Cg)))))
{
pSrc[0] = 0;
pSrc[1] = 0;
pSrc[2] = 0;
}
pSrc += 4;
}
}
return ret;
}
\ No newline at end of file
/*************************************************************************
Copyright: HZ.
Author: Hu Yaowu
Date: 2018-4-23
Mail: dongtingyueh@163.com
Description: Skin detection.
*************************************************************************/
#ifndef __T_BEEPS_FILTER__
#define __T_BEEPS_FILTER__
#ifdef _MSC_VER
#ifdef __cplusplus
#define EXPORT extern "C" _declspec(dllexport)
#else
#define EXPORT __declspec(dllexport)
#endif
/*************************************************************************
*Function: Skin detection in RGB color space
*Params:
*srcData:32BGRA image buffer
*width: width of image
*height: height of image
*stride: Stride of image
*Return: 0-OK,other failed
*Refference: Human skin color clustering for face detection.
**************************************************************************/
EXPORT int f_SkindetectionRGB(unsigned char* srcData, int width, int height, int stride);
/*************************************************************************
*Function: Skin detection in hsv color space
*Params:
*srcData:32BGRA image buffer
*width: width of image
*height: height of image
*stride: Stride of image
*Return: 0-OK,other failed
*Refference: Skin color enhancement based on favorite skin color in HSV color space.
**************************************************************************/
EXPORT int f_SkindetectionHSV(unsigned char* srcData, int width, int height, int stride);
/*************************************************************************
*Function: Skin detection in ycgcr color space
*Params:
*srcData:32BGRA image buffer
*width: width of image
*height: height of image
*stride: Stride of image
*Return: 0-OK,other failed
*Refference: YCgCr颜色空间的肤色据类人脸检测法.
**************************************************************************/
EXPORT int f_SkindetectionYCgCr(unsigned char* srcData, int width, int height, int stride);
#else
#ifdef __cplusplus
extern "C" {
#endif
int f_SkindetectionRGB(unsigned char* srcData, int width, int height, int stride);
int f_SkindetectionHSV(unsigned char* srcData, int width, int height, int stride);
int f_SkindetectionYCgCr(unsigned char* srcData, int width, int height, int stride);
#ifdef __cplusplus
}
#endif
#endif
#endif
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include"../Commen.h"
#include"../f_GaussFilter.h"//1.5.2
#include"../f_SkinPDF.h" //3.10
//#include"disabled/f_SkinDetect.h"//3.9
#include"../f_SmartBlur.h"//3.6
#include"f_SoftSkin.h"
/*************************************************************************
*Function: SOFT SKIN
*Params:
*srcData:32BGRA image buffer
*width: width of image
*height: height of image
*stride: Stride of image
*ratio: Intensity of softskin,range [0,100]
*Return: 0-OK,other failed
**************************************************************************/
int f_Softskin(unsigned char* srcData, int width, int height, int stride, int skinMode, int ratio)
{
int ret = 0;
int length = height * stride;
unsigned char* smoothData = (unsigned char*)malloc(sizeof(unsigned char) * length);
memcpy(smoothData, srcData, sizeof(unsigned char) * length);
unsigned char* skinPDF = (unsigned char*)malloc(sizeof(unsigned char) * length);
memcpy(skinPDF, srcData, sizeof(unsigned char) * length);
int smoothRadius = CLIP3(8 * width * height / (500 * 500), 3,12);
int smoothThreshold = 38;
int maskSmoothRadius = 3;
ret = f_SmartBlur(smoothData, width, height, stride, smoothRadius, smoothThreshold);
if(skinMode == 0)
{
ret = f_SkindetectionYCgCr(skinPDF, width, height, stride);
maskSmoothRadius = 6;
}
else
{
ret = f_SkinPDF(skinPDF, width, height, stride);
}
ret = f_FastGaussFilter(skinPDF, width, height, stride, maskSmoothRadius);
unsigned char* pSrc = srcData;
unsigned char* pMask = skinPDF;
unsigned char* pSmooth = smoothData;
for(int j = 0; j < height; j++)
{
for(int i = 0; i < width; i++)
{
int mask = (pMask[0] + pMask[1] + pMask[2]) / 3;
int b = (pSrc[0] * (255 - mask) + pSmooth[0] * mask) / 255;
int g = (pSrc[1] * (255 - mask) + pSmooth[1] * mask) / 255;
int r = (pSrc[2] * (255 - mask) + pSmooth[2] * mask) / 255;
pSrc[0] = CLIP3((b * ratio + pSrc[0] * (100 - ratio)) / 100, 0, 255);
pSrc[1] = CLIP3((g * ratio + pSrc[1] * (100 - ratio)) / 100, 0, 255);
pSrc[2] = CLIP3((r * ratio + pSrc[2] * (100 - ratio)) / 100, 0, 255);
pSrc += 4;
pSmooth += 4;
pMask += 4;
}
}
free(skinPDF);
free(smoothData);
return ret;
};
\ No newline at end of file
/*************************************************************************
Copyright: HZ.
Author: Hu Yaowu
Date: 2018-11-23
Mail: dongtingyueh@163.com
Description: Soft skin .
*************************************************************************/
#ifndef __T_SOFT_SKIN__
#define __T_SOFT_SKIN__
#ifdef _MSC_VER
#ifdef __cplusplus
#define EXPORT extern "C" _declspec(dllexport)
#else
#define EXPORT __declspec(dllexport)
#endif
/*************************************************************************
*Function: SOFT SKIN
*Params:
*srcData:32BGRA image buffer
*width: width of image
*height: height of image
*stride: Stride of image
*ratio: Intensity of softskin,range [0,100]
*Return: 0-OK,other failed
**************************************************************************/
EXPORT int f_Softskin(unsigned char* srcData, int width, int height, int stride, int skinMode, int ratio);
#else
#ifdef __cplusplus
extern "C" {
#endif
int f_Softskin(unsigned char* srcData, int width, int height, int stride, int skinMode, int ratio);
#ifdef __cplusplus
}
#endif
#endif
#endif
This diff is collapsed.
/*************************************************************************
Copyright: HZ.
Author: Hu Yaowu
Date: 2018-4-23
Mail: dongtingyueh@163.com
Description: BeautyCamera .
Refference: None
*************************************************************************/
#ifndef __T_BEAUTY_CAMERA__
#define __T_BEAUTY_CAMERA__
#ifdef _MSC_VER
#ifdef __cplusplus
#define EXPORT extern "C" _declspec(dllexport)
#else
#define EXPORT __declspec(dllexport)
#endif
/*************************************************************************
*Function: Smart Blur
*Params:
*srcData:32BGRA image buffer
*width: width of image
*height: height of image
*stride: Stride of image
*softRatio: intensity of softskin, [0,100]
*skinWhiteRatio: intensity of skin white, [0,100]
*skinColorRatio: intensity of skin color, [-50,50]
*sharpenRatio: intensity of sharpen, [0, 100],default 30
*Return: 0-OK,other failed
**************************************************************************/
EXPORT int f_BeautyCamera(unsigned char* srcData, int width, int height, int stride, int softRatio, int skinWhiteRatio, int skinColorRatio, int sharpenRatio);
#else
#ifdef __cplusplus
extern "C" {
#endif
int f_BeautyCamera(unsigned char* srcData, int width, int height, int stride, int softRatio, int skinWhiteRatio, int skinColorRatio, int sharpenRatio);
#ifdef __cplusplus
}
#endif
#endif
#endif
This diff is collapsed.
/*************************************************************************
Copyright: HZ.
Author: Hu Yaowu
Date: 2018-11-23
Mail: dongtingyueh@163.com
Description: BeautyIris .
*************************************************************************/
#ifndef __T_BEAUTY_IRIS__
#define __T_BEAUTY_IRIS__
#ifdef _MSC_VER
#ifdef __cplusplus
#define EXPORT extern "C" _declspec(dllexport)
#else
#define EXPORT __declspec(dllexport)
#endif
/*************************************************************************
*Function: BeautyIris
*Params:
*srcData:32BGRA image buffer
*width: width of image
*height: height of image
*stride: Stride of image
*srcPoints: 12 eyepoints and one center points
*maskData: 32BGRA mask image buffer
*mWidth: width of mask
*mHeight:height of mask
*mStride:Stride of mask
*maskPoints: 12 eyepoints and one center points of mask image
*ratio: intensity of iris, [0,100]
*Return: 0-OK,other failed
**************************************************************************/
EXPORT int f_BeautyIris(unsigned char* srcData, int width, int height, int stride, int srcPoints[], unsigned char* maskData, int mWidth, int mHeight, int mStride, int maskPoints[], int ratio);
#else
#ifdef __cplusplus
extern "C" {
#endif
int f_BeautyIris(unsigned char* srcData, int width, int height, int stride, int srcPoints[], unsigned char* maskData, int mWidth, int mHeight, int mStride, int maskPoints[], int ratio);
#ifdef __cplusplus
}
#endif
#endif
#endif
#include"Commen.h"
#include<math.h>
int ModeLinearLight(int basePixel,int mixPixel)
{
int res = 0;
res = 2 * mixPixel + basePixel - 256;
return CLIP3(res, 0, 255);
};
int ModeSuperposition(int basePixel,int mixPixel)//基色 < = 128:结果色 = 混合色 * 基色 / 128;基色 > 128:结果色 = 255 - (255 - 混合色)* (255 - 基色) / 128
{
int res = 0;
res = ((basePixel <= 128) ? (mixPixel * basePixel / 128):(255 - (255 - mixPixel) * (255 - basePixel) / 128));
return CLIP3(res, 0, 255);
};
\ No newline at end of file
#ifndef __COMMEN_MIX_LAYER__
#define __COMMEN_MIX_LAYER__
int ModeLinearLight(int basePixel,int mixPixel);//线性光
int ModeSuperposition(int basePixel,int mixPixel);//叠加//基色 < = 128:结果色 = 混合色 * 基色 / 128;基色 > 128:结果色 = 255 - (255 - 混合色)* (255 - 基色) / 128
#endif
\ No newline at end of file
#include"f_GaussFilter.h"
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<stdio.h>
#include"Commen.h"
/*************************************************************
*Function: Gauss mask compute
*Params:
* r-radius of gauss filter
* sigma-sigma of gauss filter
* gaussMask-gauss weight to compute with size of (2r+1)*(2r+1)
*Return NULL
************************************************************/
void GaussMask(int r, double sigma, double gaussMask[])
{
double PI = 3.1415926;
double sum = 0;
int stride = 2 * r + 1;
for (int y = -r, h = 0; y <= r; y++, h++)
{
for (int x = -r, w = 0; x <= r; x++, w++)
{
gaussMask[w + h * stride] = (1.0 / (2.0 * PI * sigma * sigma)) * (exp(-((double)x * (double)x + (double)y * (double)y) / (2.0 * sigma * sigma)));
sum += gaussMask[w + h * stride];
}
}
for (int i = 0; i < stride * stride; i++)
{
gaussMask[i] = gaussMask[i] / sum;
}
};
int f_FastGaussFilter(unsigned char* srcData,int width, int height,int stride,float r)
{
int ret = 0;
int radius = (int)r;
if(r == 0)
return ret;
unsigned char* dstData = (unsigned char*)malloc(sizeof(unsigned char)*height*stride);
unsigned char* tempData = (unsigned char*)malloc(sizeof(unsigned char)*height*stride);
int totalWei = 0;
int i,j,k;
float sigma = r;
unsigned char *kernel = (unsigned char *)malloc(2*radius+1);
for (i = -radius; i <= radius; i++)
{
kernel[i+radius] = (unsigned char) (exp(-(float)i*i/(2*sigma*sigma))*128);
totalWei += kernel[i+radius];
}
int tempR = 0, tempG = 0, tempB = 0;
int v = 0;
int K = 0;
int rem = 0;
int t = 0;
int offset = stride - width * 4;
for ( j = 0; j < height; j++)
{
for ( i = 0; i < width; i++)
{
tempR = 0; tempG = 0; tempB = 0;
for ( k = -radius; k <= radius; k++)
{
rem = (abs(i + k) % width);
t = rem * 3 + j * stride;
K = kernel[k + radius];
tempB += srcData[t] * K;
tempG += srcData[t + 1] * K;
tempR += srcData[t + 2] * K;
}
v = i * 3 + j * stride;
tempData[v] = tempB / totalWei;
tempData[v + 1] = tempG / totalWei;
tempData[v + 2] = tempR / totalWei;
}
}
for ( i = 0; i < width; i++)
{
for ( j = 0; j < height; j++)
{
tempR = 0; tempG = 0; tempB = 0;
for ( k = -radius; k <= radius; k++)
{
rem = (abs(j + k) % height);
t = rem * stride + i * 3;
K = kernel[k + radius];
tempB += tempData[t] * K;
tempG += tempData[t + 1] * K;
tempR += tempData[t + 2] * K;
}
v = i * 3 + j * stride;
dstData[v] = tempB/totalWei;
dstData[v + 1] = tempG/totalWei;
dstData[v + 2] = tempR/totalWei;
}
}
memcpy(srcData, dstData, sizeof(unsigned char) * height * stride);
free(dstData);
free(tempData);
return ret;
};
\ No newline at end of file
/*************************************************************************
Copyright: Trent.
Author: Trent1985
Date: 2018-9-23
Mail: dongtingyueh@163.com
Description: Gauss Filter
*************************************************************************/
#ifndef __TEST_GAUSSFILTER__
#define __TEST_GAUSSFILTER__
#ifdef _MSC_VER
#ifdef __cplusplus
#define EXPORT extern "C" _declspec(dllexport)
#else
#define EXPORT __declspec(dllexport)
#endif
/************************************************************
*Function: Gauss Filter
*Description: Gauss Filter process
*Params:
*srcData: image bgra data
*width :image width
*height :image height
*stride :image stride
*r: radius of gauss filter, range [0,]
*Return :0-OK,or failed
************************************************************/
EXPORT int f_FastGaussFilter(unsigned char* srcData,int width, int height,int stride,float r);
#else
#ifdef __cplusplus
extern "C" {
#endif
int f_FastGaussFilter(unsigned char* srcData,int width, int height,int stride,float r);
////
#ifdef __cplusplus
}
#endif
#endif
#endif
#include"f_LUTFilter.h"
#include"Commen.h"
static int f_Filter512(unsigned char* srcData, int width ,int height, int stride, unsigned char*Map)
{
int i, j, r, g, b, offset, pos, nx, ny, k;
unsigned char* pSrc = srcData;
offset = stride - (width * 4);
for(j = 0; j < height; j++)
{
for(i = 0; i < width; i++)
{
b = pSrc[0];
g = pSrc[1];
r = pSrc[2];
k = (b >> 2);
nx = (int)(r >> 2) + ((k - ((k >> 3) << 3)) << 6);
ny = (int)(((b >> 5) << 6) + (g >> 2));
pos = (nx * 4) + (ny * 512 * 4);
pSrc[0] = Map[pos];
pSrc[1] = Map[pos + 1];
pSrc[2] = Map[pos + 2];
pSrc += 4;
}
pSrc += offset;
}
return 0;
};
int f_LUTFilter(unsigned char *srcData, int width, int height, int stride,unsigned char* Map)
{
return f_Filter512(srcData, width, height, stride, Map);
};
\ No newline at end of file
/*************************************************************************
Copyright: Trent.
Author: Trent1985
Date: 2018-9-23
Mail: dongtingyueh@163.com
Description: LUT Filter
*************************************************************************/
#ifndef __TEST_LUT_FILTER__
#define __TEST_LUT_FILTER__
#ifdef _MSC_VER
#ifdef __cplusplus
#define EXPORT extern "C" _declspec(dllexport)
#else
#define EXPORT __declspec(dllexport)
#endif
/************************************************************
*Function: LUT Filter
*Description: LUT Filter process
*Params:
*srcData: image bgr data
*width :image width
*height :image height
*stride :image stride
*Map: 512x512 LUT
*Return :0-OK,or failed
************************************************************/
EXPORT int f_LUTFilter(unsigned char *srcData, int width, int height, int stride, unsigned char* Map);
#else
#ifdef __cplusplus
extern "C" {
#endif
int f_LUTFilter(unsigned char *srcData, int width, int height, int stride, unsigned char* Map);
////
#ifdef __cplusplus
}
#endif
#endif
#endif
#include"f_LaplaceSharpen.h"
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<stdio.h>
#include"Commen.h"
int f_LaplaceSharpen(unsigned char* srcData,int width, int height,int stride,int mode)
{
int ret = 0;
unsigned char* tempData = (unsigned char*)malloc(sizeof(unsigned char) * height * stride);
int offset = stride - width * 4;
int pos;
memcpy(tempData, srcData, sizeof(unsigned char) * height * stride);
if(mode == 0)
{
for(int j = 1; j < height - 1; j++)
{
for(int i = 1; i < width - 1; i++)
{
pos = i * 3 + j * stride;
srcData[pos] = CLIP3(tempData[pos] + (tempData[pos] * 4 - tempData[pos - stride] - tempData[pos - 3] - tempData[pos + 3] - tempData[pos + stride]), 0, 255);
pos++;
srcData[pos] = CLIP3(tempData[pos] + (tempData[pos] * 4 - tempData[pos - stride] - tempData[pos - 3] - tempData[pos + 3] - tempData[pos + stride]), 0, 255);
pos++;
srcData[pos] = CLIP3(tempData[pos] + (tempData[pos] * 4 - tempData[pos - stride] - tempData[pos - 3] - tempData[pos + 3] - tempData[pos + stride]), 0, 255);
}
}
}
else
{
for(int j = 1; j < height - 1; j++)
{
for(int i = 1; i < width - 1; i++)
{
pos = i * 3 + j * stride;
srcData[pos] = CLIP3(tempData[pos] + (tempData[pos] * 6 - tempData[pos - stride] - tempData[pos - 3] - tempData[pos + 3] - tempData[pos + stride] - tempData[pos - 3 - stride] - tempData[pos + 3 - stride] - tempData[pos - 3 + stride] - tempData[pos + 3 + stride]), 0, 255);
pos++;
srcData[pos] = CLIP3(tempData[pos] + (tempData[pos] * 6 - tempData[pos - stride] - tempData[pos - 3] - tempData[pos + 3] - tempData[pos + stride] - tempData[pos - 3 - stride] - tempData[pos + 3 - stride] - tempData[pos - 3 + stride] - tempData[pos + 3 + stride]), 0, 255);
pos++;
srcData[pos] = CLIP3(tempData[pos] + (tempData[pos] * 6 - tempData[pos - stride] - tempData[pos - 3] - tempData[pos + 3] - tempData[pos + stride] - tempData[pos - 3 - stride] - tempData[pos + 3 - stride] - tempData[pos - 3 + stride] - tempData[pos + 3 + stride]), 0, 255);
}
}
}
free(tempData);
return ret;
};
\ No newline at end of file
/*************************************************************************
Copyright: Trent.
Author: Trent1985
Date: 2018-9-23
Mail: dongtingyueh@163.com
Description: Laplace sharpen
*************************************************************************/
#ifndef __TEST_LAPLACE_SHARPEN__
#define __TEST_LAPLACE_SHARPEN__
#ifdef _MSC_VER
#ifdef __cplusplus
#define EXPORT extern "C" _declspec(dllexport)
#else
#define EXPORT __declspec(dllexport)
#endif
/************************************************************
*Function: Laplace sharpen
*Description: Laplace sharpen process
*Params:
*srcData: image bgra data
*width :image width
*height :image height
*stride :image stride
*mode :0-MASK4,1-MASK8
*Return :0-OK,or failed
************************************************************/
EXPORT int f_LaplaceSharpen(unsigned char* srcData,int width, int height,int stride,int mode);
#else
#ifdef __cplusplus
extern "C" {
#endif
int f_LaplaceSharpen(unsigned char* srcData,int width, int height,int stride,int mode);
////
#ifdef __cplusplus
}
#endif
#endif
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment