Skip to content

Commit d92641a

Browse files
committed
Imported project
1 parent b019026 commit d92641a

File tree

247 files changed

+48419
-8
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

247 files changed

+48419
-8
lines changed

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,3 +286,19 @@ __pycache__/
286286
*.btm.cs
287287
*.odx.cs
288288
*.xsd.cs
289+
.tfignore
290+
CMakeCache.txt
291+
CPackConfig.cmake
292+
CPackSourceConfig.cmake
293+
*Config.cmake
294+
cmake_install.cmake
295+
*.vcxproj
296+
*.vcxproj.filters
297+
*.sln
298+
CMakeFiles/
299+
Dataset/
300+
dependencies/
301+
docs/xml/
302+
modules/hdf5/*
303+
samples/
304+
install/

CMakeLists.txt

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
cmake_minimum_required(VERSION 3.6.2)
2+
project(Texturize)
3+
4+
set (Texturize_VERSION_MAJOR 1)
5+
set (Texturize_VERSION_MINOR 0)
6+
7+
set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/install")
8+
set(CMAKE_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_PREFIX}/include")
9+
10+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_INSTALL_PREFIX}/bin/")
11+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_INSTALL_PREFIX}/bin/")
12+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_INSTALL_PREFIX}/lib/")
13+
set(CMAKE_EXECUTABLE_OUTPUT_DIRECTORY "${CMAKE_INSTALL_PREFIX}/bin/")
14+
set(CMAKE_PDB_OUTPUT_DIRECTORY "${CMAKE_INSTALL_PREFIX}/bin/")
15+
16+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules")
17+
18+
if (OpenCV_FOUND)
19+
message("Importing OpenCV from '${OpenCV_DIR}'...")
20+
else()
21+
set(OpenCV_DIR "${CMAKE_MODULE_PATH}/opencv")
22+
message("No OpenCV directory provided, defaulting to '${OpenCV_DIR}'...")
23+
endif()
24+
25+
if (OpenEXR_FOUND)
26+
message("Importing OpenEXR from '${OPENEXR_LOCATION}'...")
27+
set(ILMBASE_LOCATION ${OPENEXR_LOCATION})
28+
else()
29+
set(OPENEXR_LOCATION "${CMAKE_MODULE_PATH}")
30+
set(ILMBASE_LOCATION "${CMAKE_MODULE_PATH}")
31+
message("No OpenEXR directory provided, defaulting to '${OPENEXR_LOCATION}'...")
32+
endif()
33+
34+
if (TBB_FOUND)
35+
message("Importing tbb from '${TBB_DIR}'...")
36+
else()
37+
set(TBB_DIR "${CMAKE_MODULE_PATH}/tbb")
38+
message("No tbb directory provided, defaulting to '${TBB_DIR}'...")
39+
endif()
40+
41+
if (HDF5_FOUND)
42+
message("Importing hdf5 from '${HDF5_ROOT}'...")
43+
else()
44+
set(HDF5_ROOT "${CMAKE_MODULE_PATH}/hdf5/cmake")
45+
message("No hdf5 directory provided, defaulting to '${HDF5_ROOT}'...")
46+
endif()
47+
48+
if (NOT DEFINED CMAKE_INSTALL_PREFIX)
49+
set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/install)
50+
endif()
51+
52+
message("Installing to ${CMAKE_INSTALL_PREFIX}")
53+
54+
add_subdirectory(Texturize.Core)
55+
add_subdirectory(Texturize.Codecs)
56+
add_subdirectory(Texturize.Analysis)
57+
add_subdirectory(Texturize.Sampling)
58+
add_subdirectory(Texturize.Codecs.EXR)
59+
60+
add_subdirectory(Texturize.Sandbox)
61+
62+
add_dependencies(Texturize.Codecs Texturize.Core)
63+
add_dependencies(Texturize.Analysis Texturize.Core)
64+
add_dependencies(Texturize.Sampling Texturize.Core)
65+
add_dependencies(Texturize.Codecs Texturize.Analysis)
66+
add_dependencies(Texturize.Codecs.EXR Texturize.Core)
67+
add_dependencies(Texturize.Codecs.EXR Texturize.Codecs)
68+
add_dependencies(Texturize.Sampling Texturize.Analysis)
69+
70+
add_dependencies(Texturize.Sandbox Texturize.Core)
71+
add_dependencies(Texturize.Sandbox Texturize.Codecs)
72+
add_dependencies(Texturize.Sandbox Texturize.Codecs.EXR)
73+
add_dependencies(Texturize.Sandbox Texturize.Analysis)
74+
add_dependencies(Texturize.Sandbox Texturize.Sampling)

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# MIT License
2+
3+
*Copyright (c) 2018 Carsten Rudolph*
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.**

README.md

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,35 @@
1-
# Texturize
2-
A unified framework for example-based Texture Synthesis, developed alongside my master's thesis.
1+
# Texturize: A framework for example-based Texture Synthesis
32

4-
This repository is currently a placeholder, used to provide meaningful URL's within my thesis. The actual code is currently developed within a private Visual Studio Online (VSO) repository and will be migrated after the work has been submitted.
3+
*Texturize* is a framework, that has been created alongside my [master's thesis](https://github.com/Aschratt/Texturize-Thesis). Most of the researchers in the field of texture synthesis do either not provide any implementation samples or have abandoned their sources, so that they are no longer accessible. My motivation was to create a framework, that can be used as a starting point to implement different algorithms and make them comparable, without requiring to re-implement common principles. It provides a unified infrastructure, that allows to customize and mix various aspects of different synthesis algorithms. It follows a modular design that allows to build new modules or customize existing ones. Typical tasks of example-based texture synthesis have been carefully studied and generalized in order to construct a common workflow. That way, I was able to create a prototype synthesizer, that is capable of synthesizing materials for Physically Based Rendering (PBR) from low-resolution exemplars.
54

6-
## What to expect?
5+
The framework must not be confused with the [GIMP PlugIn of the same name](https://github.com/lmanul/gimp-texturize).
76

8-
Currently I am researching methologies and concepts to extent example-based Texture Synthesis towards materials for Physically Based Rendering (PBR). The actual synthesizer is influenced by the papers of Sylvain Lefebvre and Hugues Hoppe [LH06][LH07], whose sample implementation does not seam to be around the web any longer. I based my research on their *Appearance Space Texture Synthesis* (ASTS) algorithm, so everybody who is interested in a reference implementation may find this helpful.
7+
## What's it all about?
98

10-
## Bibliography
9+
In general, texture synthesis is a problem field, that researches algorithms, that can create images which are used to add detail to geometric surfaces in computer graphics. Those images are called *textures* and if they are not created by humans, they are called *synthetic textures*. There are two major areas in texture synthesis:
1110

12-
- [LH05] Sylvain Lefebvre and Hugues Hoppe. “Parallel Controllable Texture Synthesis.” In: ACM Trans. Graph.24.3 (July 2005), pp. 777–786. ISSN: 0730-0301. DOI: 10.1145/1073204.1073261, URL: http://doi.acm.org/10.1145/1073204.1073261, http://hhoppe.com/proj/paratexsyn/
13-
- [LH06] Sylvain Lefebvre and Hugues Hoppe. “Appearance-space Texture Synthesis.” In: ACM Trans. Graph.25.3 (July 2006), pp. 541–548. ISSN: 0730-0301. DOI:10.1145/1141911.1141921. URL: http://doi.acm.org/10.1145/1141911.1141921, http://hhoppe.com/proj/apptexsyn/
11+
- Procedural synthesizers are algorithms that form new textures from mathematical models.
12+
- Non-Parametric synthesizers take existing texture *exemplars* and aim to create new, visually similar textures with higher resolution.
13+
14+
*Texturize* is a framework for non-parametric synthesizers. Those algorithms have applications in many different computer graphics problems. They are used in image editing (e.g. to fill "holes" or transfer style), video editing and others. When creating this framework, I focused on re-mixing existing textures, i.e. synthesizing new images, that look visually similar to the exemplar, but do not feature heavy repetitions. This can, for example, be used to cover geometric surfaces without visible tiling artifacts.
15+
16+
If you want a more detailed introduction into texture synthesis, consider taking a look int my [thesis](https://github.com/Aschratt/Texturize-Thesis).
17+
18+
## Getting started
19+
20+
Building a synthesizer is a process that involves multiple steps. For convenience, they are described in the [getting started guide](https://aschratt.github.io/Texturize/getting-started.html). A reference implementation, called *Sandbox*, is also provided. You can learn more about it in the [sandbox guide]
21+
(https://aschratt.github.io/Texturize/getting-started-sandbox.html).
22+
23+
## Custom framework builds
24+
25+
In case you want to include the framework into other applications, or require different versions of its dependencies, a custom build might be required. Please refer to [the building guide](https://aschratt.github.io/Texturize/getting-started-build.html) for more information.
26+
27+
## MIT License
28+
29+
> Copyright (c) 2018 Carsten Rudolph
30+
>
31+
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
32+
>
33+
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
34+
>
35+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Texturize.Analysis/CMakeLists.txt

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
cmake_minimum_required(VERSION 3.6.2 FATAL_ERROR)
2+
set(PROJECT_NAME Texturize.Analysis)
3+
project(${PROJECT_NAME})
4+
set(CONFIG_NAME ${PROJECT_NAME}Config)
5+
6+
# Folders files
7+
set(INCLUDE_DIR include)
8+
set(SOURCES_DIR src)
9+
set(PROJECT_DIR )
10+
11+
project(${PROJECT_NAME} CXX)
12+
13+
if(NOT CMAKE_BUILD_TYPE)
14+
set(CMAKE_BUILD_TYPE "Release")
15+
message(STATUS "Build type not specified: Use Release by default.")
16+
endif(NOT CMAKE_BUILD_TYPE)
17+
18+
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
19+
add_definitions(
20+
-DTEXTURIZE_EXPORTS
21+
-D_DEBUG
22+
-D_WINDOWS
23+
-D_USRDLL
24+
-DTEXTURIZECORE_EXPORTS
25+
-DUNICODE
26+
-D_UNICODE
27+
)
28+
else()
29+
add_definitions(
30+
-DTEXTURIZE_EXPORTS
31+
-D_WINDOWS
32+
-D_USRDLL
33+
-DTEXTURIZECORE_EXPORTS
34+
-DUNICODE
35+
-D_UNICODE
36+
)
37+
endif()
38+
39+
if(MSVC)
40+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W3 /MD /Od /EHsc")
41+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W3 /GL /Od /Oi /Gy /EHsc")
42+
endif(MSVC)
43+
44+
if(NOT MSVC)
45+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
46+
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
47+
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
48+
endif()
49+
endif(NOT MSVC)
50+
51+
# Find modules.
52+
find_package(OpenCV REQUIRED core imgproc ximgproc imgcodecs highgui features2d calib3d flann)
53+
find_package(TBB REQUIRED tbb)
54+
55+
if (OpenCV_FOUND)
56+
message("Linking ${PROJECT_NAME} to ${OpenCV_LIBS}...")
57+
else()
58+
message(FATAL_ERROR "Required OpenCV modules have not been found.")
59+
endif()
60+
61+
if (TBB_FOUND)
62+
message("Linking ${PROJECT_NAME} to ${TBB_IMPORTED_TARGETS}...")
63+
else()
64+
message(FATAL_ERROR "Required tbb modules have not been found.")
65+
endif()
66+
67+
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
68+
list (APPEND OpenCV_DLLS
69+
"opencv_core${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}d.dll"
70+
"opencv_imgproc${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}d.dll"
71+
"opencv_ximgproc${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}d.dll"
72+
"opencv_imgcodecs${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}d.dll"
73+
"opencv_highgui${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}d.dll"
74+
"opencv_features2d${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}d.dll"
75+
"opencv_calib3d${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}d.dll"
76+
"opencv_flann${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}d.dll"
77+
)
78+
else()
79+
list (APPEND OpenCV_DLLS
80+
"opencv_core${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}.dll"
81+
"opencv_imgproc${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}.dll"
82+
"opencv_ximgproc${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}.dll"
83+
"opencv_imgcodecs${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}.dll"
84+
"opencv_highgui${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}.dll"
85+
"opencv_features2d${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}.dll"
86+
"opencv_calib3d${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}.dll"
87+
"opencv_flann${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}.dll"
88+
)
89+
endif()
90+
91+
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
92+
get_target_property(TBB_DLLS ${TBB_IMPORTED_TARGETS} IMPORTED_LOCATION_DEBUG)
93+
else()
94+
get_target_property(TBB_DLLS ${TBB_IMPORTED_TARGETS} IMPORTED_LOCATION_RELEASE)
95+
endif()
96+
97+
include_directories(
98+
include
99+
${TXTRZ_CORE_INCLUDE_DIRS}
100+
${OpenCV_INCLUDE_DIRS}
101+
${TBB_INCLUDE_DIRS}
102+
)
103+
104+
file(GLOB SRC_FILES
105+
${SOURCES_DIR}/*.cpp
106+
${INCLUDE_DIR}/*.hpp
107+
${PROJECT_DIR}/*.h
108+
${PROJECT_DIR}/*.cpp
109+
)
110+
111+
add_library(${PROJECT_NAME} SHARED
112+
${SRC_FILES}
113+
)
114+
115+
foreach(OpenCV_DLL ${OpenCV_DLLS})
116+
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
117+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
118+
"${OpenCV_DIR}/bin/${CMAKE_BUILD_TYPE}/${OpenCV_DLL}"
119+
"${CMAKE_INSTALL_PREFIX}/bin/${CMAKE_BUILD_TYPE}/${OpenCV_DLL}")
120+
endforeach()
121+
122+
foreach(TBB_DLL ${TBB_DLLS})
123+
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
124+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
125+
"${TBB_DLL}"
126+
"${CMAKE_INSTALL_PREFIX}/bin/${CMAKE_BUILD_TYPE}/")
127+
endforeach()
128+
129+
target_link_libraries(${PROJECT_NAME} Texturize.Core
130+
${OpenCV_LIBS}
131+
${TBB_IMPORTED_TARGETS})
132+
133+
target_include_directories(${PROJECT_NAME} PUBLIC
134+
${PROJECT_DIR}/include>
135+
$<INSTALL_INTERFACE:include>
136+
PRIVATE ${SOURCES_DIR})
137+
138+
install(TARGETS ${PROJECT_NAME} EXPORT ${CONFIG_NAME}
139+
ARCHIVE DESTINATION ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}
140+
LIBRARY DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}
141+
RUNTIME DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE})
142+
143+
export(TARGETS ${PROJECT_NAME} FILE ${CONFIG_NAME}.cmake)
144+
145+
install(DIRECTORY ${INCLUDE_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX})
146+
147+
set(TXTRZ_ANALYSIS_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/include
148+
${TXTRZ_CORE_INCLUDE_DIRS}
149+
${OpenCV_INCLUDE_DIRS}
150+
CACHE INTERNAL "${PROJECT_NAME}: Include Directories" FORCE
151+
)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ImportGroup Label="PropertySheets" />
4+
<PropertyGroup Label="UserMacros" />
5+
<PropertyGroup>
6+
<LibraryPath>$(SolutionDir)$(PlatformTarget)\$(Configuration)\;$(LibraryPath)</LibraryPath>
7+
<IncludePath>$(SolutionDir)\Texturize.Analysis\include\;$(IncludePath)</IncludePath>
8+
</PropertyGroup>
9+
<ItemDefinitionGroup>
10+
<Link>
11+
<AdditionalDependencies>Texturize.Analysis.lib;%(AdditionalDependencies)</AdditionalDependencies>
12+
</Link>
13+
<PostBuildEvent>
14+
<Command>xcopy /y /d "$(SolutionDir)\$(PlatformTarget)\$(Configuration)\Texturize.Analysis.dll" "$(OutDir)"</Command>
15+
</PostBuildEvent>
16+
</ItemDefinitionGroup>
17+
<ItemGroup />
18+
</Project>

0 commit comments

Comments
 (0)