Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Commit

Permalink
1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Molodowitch committed Jul 18, 2012
1 parent 077f719 commit a5cc402
Show file tree
Hide file tree
Showing 41 changed files with 4,036 additions and 2,045 deletions.
115 changes: 59 additions & 56 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

PROJECT(aruco)
set(PROJECT_VERSION "1.0.0")
set(PROJECT_VERSION "1.1.0")
string(REGEX MATCHALL "[0-9]" PROJECT_VERSION_PARTS "${PROJECT_VERSION}")
list(GET PROJECT_VERSION_PARTS 0 PROJECT_VERSION_MAJOR)
list(GET PROJECT_VERSION_PARTS 1 PROJECT_VERSION_MINOR)
list(GET PROJECT_VERSION_PARTS 2 PROJECT_VERSION_PATCH)
set(PROJECT_SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")


#------------------------------------------------------
# Build type
#------------------------------------------------------

IF(NOT CMAKE_BUILD_TYPE )
SET( CMAKE_BUILD_TYPE "Release" )
SET( CMAKE_BUILD_TYPE "Debug" )
ENDIF()

#------------------------------------------------------
Expand All @@ -25,67 +26,66 @@ ENDIF()

if(WIN32)
# Postfix of DLLs:
set(PROJECT_DLLVERSION "${PROJECT_VERSION_MAJOR}${PROJECT_VERSION_MINOR}${PROJECT_VERSION_PATCH}")
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}")
SET(PROJECT_DLLVERSION "${PROJECT_VERSION_MAJOR}${PROJECT_VERSION_MINOR}${PROJECT_VERSION_PATCH}")
SET(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}")
SET(RUNTIME_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH "Directory for dlls and binaries")
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH "Directory for binaries")
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH "Directory for dlls")
else()
# Postfix of so's:
set(PROJECT_DLLVERSION)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_INSTALL_PREFIX}/lib/cmake/ /usr/lib/cmake)
endif()


OPTION(BUILD_SHARED_LIBS "Set to OFF to build static libraries" ON)

# ----------------------------------------------------------------------------
# Find Dependencies
# ----------------------------------------------------------------------------
FIND_PACKAGE(OpenCV REQUIRED)

FIND_PACKAGE(OpenCV REQUIRED )
set (REQUIRED_LIBRARIES ${OpenCV_LIBS})


IF(EXISTS ${GLUT_PATH})
INCLUDE_DIRECTORIES(${GLUT_PATH}/include)
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${GLUT_PATH}/lib)
ENDIF()

##LOOK FOR OPENGL AND GLUT
find_package(OpenGL)
find_package(GLUT)#standard package
#FIND OPENGL LIBRARY. In Android, there is no need since it is included
IF(NOT ANDROID_CREATION)
find_package(OpenGL)
find_package(GLUT)#standard package

MESSAGE(STATUS "GLUT_FOUND=${GLUT_FOUND} OPENGL_gl_LIBRARY=${OPENGL_gl_LIBRARY} GLUT_HEADER=${GLUT_HEADER}")
if(NOT GLUT_FOUND) #else, freeglut
MESSAGE(STATUS "GLUT_FOUND=${GLUT_FOUND} OPENGL_gl_LIBRARY=${OPENGL_gl_LIBRARY} GLUT_HEADER=${GLUT_HEADER}")
IF(NOT GLUT_FOUND) #else, freeglut
FIND_LIBRARY(GLUT_glut_LIBRARY NAMES freeglut)
MESSAGE(STATUS "GLUT_glut_LIBRARY=${GLUT_glut_LIBRARY}")
ENDIF()
IF ( (NOT GLUT_glut_LIBRARY AND NOT GLUT_FOUND) OR NOT OPENGL_gl_LIBRARY)
ENDIF()
IF ( (NOT GLUT_glut_LIBRARY AND NOT GLUT_FOUND) OR NOT OPENGL_gl_LIBRARY)
set(GL_FOUND "NO")
ELSE()
set(GL_FOUND "YES")
set (OPENGL_LIBS ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${GLUT_glut_LIBRARY})
ELSE()
set(GL_FOUND "YES")
set (OPENGL_LIBS ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${GLUT_glut_LIBRARY})
ENDIF()
ENDIF()



# ----------------------------------------------------------------------------
# PROJECT CONFIGURATION
# force some variables that could be defined in the command line to be written to cache
# ----------------------------------------------------------------------------
OPTION(BUILD_SHARED_LIBS "Set to OFF to build static libraries" ON)

FIND_PACKAGE(Doxygen)
IF (DOXYGEN_FOUND)
OPTION(INSTALL_DOC "Set to OFF to skip build/install Documentation" ON)
ELSE()
OPTION(INSTALL_DOC "Set to OFF to skip build/install Documentation" OFF)
OPTION(INSTALL_DOC "Set to ON to build/install Documentation" OFF)
IF (INSTALL_DOC)
FIND_PACKAGE(Doxygen REQUIRED)
MESSAGE( STATUS "INSTALL_DOC: ${INSTALL_DOC} ")
INCLUDE("${PROJECT_SOURCE_DIR}/generateDoc.cmake")
GENERATE_DOCUMENTATION(${PROJECT_SOURCE_DIR}/dox.in)
ENDIF()

IF (WIN32)
SET(RUNTIME_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH "Directory for dlls and binaries")
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH "Directory for binaries")
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH "Directory for dlls")
ENDIF ()

IF (INSTALL_DOC)
message( STATUS "INSTALL_DOC: ${INSTALL_DOC} ")
INCLUDE("${PROJECT_SOURCE_DIR}/generateDoc.cmake")
GENERATE_DOCUMENTATION(${PROJECT_SOURCE_DIR}/dox.in)
ENDIF()


# ----------------------------------------------------------------------------
# Uninstall target, for "make uninstall"
Expand Down Expand Up @@ -116,7 +116,6 @@ set(EXTRA_EXE_LINKER_FLAGS "")
set(EXTRA_EXE_LINKER_FLAGS_RELEASE "")
set(EXTRA_EXE_LINKER_FLAGS_DEBUG "")


IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
set(ENABLE_PROFILING OFF CACHE BOOL "Enable profiling in the GCC compiler (Add flags: -g -pg)")
set(USE_OMIT_FRAME_POINTER ON CACHE BOOL "Enable -fomit-frame-pointer for GCC")
Expand Down Expand Up @@ -206,21 +205,23 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)

set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} -DNDEBUG")
set(EXTRA_C_FLAGS_DEBUG "-g3 -O0 -DDEBUG -D_DEBUG -W -Wextra -Wno-return-type")
ENDIF ()

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_C_FLAGS}")
SET(CMAKE_CXX_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE}")
SET(CMAKE_CXX_FLAGS_DEBUG "${EXTRA_C_FLAGS_DEBUG}")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${EXTRA_EXE_LINKER_FLAGS}")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${EXTRA_EXE_LINKER_FLAGS_RELEASE}")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${EXTRA_EXE_LINKER_FLAGS_DEBUG}")
MESSAGE( STATUS "-------------------------------------------------------------------------------" )
message( STATUS "GNU COMPILER")
MESSAGE( STATUS "-------------------------------------------------------------------------------" )

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_C_FLAGS}")
SET(CMAKE_CXX_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE}")
SET(CMAKE_CXX_FLAGS_DEBUG "${EXTRA_C_FLAGS_DEBUG}")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${EXTRA_EXE_LINKER_FLAGS}")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${EXTRA_EXE_LINKER_FLAGS_RELEASE}")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${EXTRA_EXE_LINKER_FLAGS_DEBUG}")
ENDIF ()

# ----------------------------------------------------------------------------
# PACKAGE GENERATOR
# ----------------------------------------------------------------------------


IF (UNIX)
SET(CPACK_GENERATOR "DEB")
SET(CPACK_PACKAGE_CONTACT "[email protected]")
Expand All @@ -232,13 +233,23 @@ SET(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
SET(CPACK_STRIP_FILES "bin/lib${PROJECT_NAME}")
SET(CPACK_SOURCE_STRIP_FILES "")
IF (CPACK_GENERATOR STREQUAL "DEB")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "opencv (>= 2.1.0)")
ENDIF()
INCLUDE(CPack)
ENDIF()
# ----------------------------------------------------------------------------
# PROJECT CONTENT
# ----------------------------------------------------------------------------

#------------------------------------------------
# DIRS
#------------------------------------------------
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(utils)
IF(NOT ANDROID_CREATION)
ADD_SUBDIRECTORY(utils)
ENDIF()



# ----------------------------------------------------------------------------
# display status message for important variables
Expand All @@ -248,19 +259,12 @@ MESSAGE( STATUS "---------------------------------------------------------------
message( STATUS "General configuration for ${PROJECT_NAME} ${PROJECT_VERSION}")
MESSAGE( STATUS "-------------------------------------------------------------------------------" )
message( STATUS )
message( STATUS "Compiler: ${CMAKE_COMPILER}")
message(" Built as dynamic libs?:" ${BUILD_SHARED_LIBS})
message(" Compiler:" "${CMAKE_COMPILER}" "${CMAKE_CXX_COMPILER}")
message( STATUS "C++ flags (Release): ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
message( STATUS "C++ flags (Debug): ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
message( STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
message( STATUS "CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}")
if (MSVC)
message( STATUS "Linker flags (Release): ${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
message( STATUS "Linker flags (Debug): ${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
message( STATUS "GNU libraries include dir: ${GNULIBS_INCLUDE_DIR}")
message( STATUS "GNU libraries dir: ${GNULIBS_PATH}")
endif ()

#MESSAGE( STATUS "REQUIRED_LIBRARIES = ${REQUIRED_LIBRARIES}" )

MESSAGE( STATUS )
MESSAGE( STATUS "CMAKE_SYSTEM_PROCESSOR = ${CMAKE_SYSTEM_PROCESSOR}" )
Expand All @@ -284,4 +288,3 @@ MESSAGE( STATUS )
MESSAGE( STATUS )
MESSAGE( STATUS "Change a value with: cmake -D<Variable>=<Value>" )
MESSAGE( STATUS )

15 changes: 14 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
VERSION 1.1.0
- Ogre integration ( Board::OgreGetPoseParameters and Marker::OgreGetPoseParameters).
- Changes to make it compile with MSVC 2010
- Remove getopt.h dependency. Command line are simpler now
- MarkerDetector: Externalization of the marker detector to allow using user-defined markers. The function setMakerDetectorFunction allows to define this function
- Added class FiducidalMarkers to detect the original aruco markers
- MarkerDetector: function glGetProjectionMatrix is moved to the CameraParameters class. Sorry, but it is more logical.
- MarkerDetector: Clear separation between the detection phases into separated functions that can be externally called (thresHold and detectRectangles) for more sohpisticated user needs
- MarkerDetector: new corner refinement method based on harris detector. Also, added the possibility of not refining corners at all.
- Added an option to work on a reduced version of the images (pyrDown).
- Changes the adaptive threshold method. Now we employ the MEAN. As a consequence, the process is faster and do not depen on the window size.
- Initial tests with android
- Bugs fixed
VERSION 1.0.0
- New names for the main classes Marker,MarkerDector... etc. Sorry, but I needed to clear up things. I wont be difficult to adapt.
- New names for the main classes Marker,MarkerDector... etc. Sorry, but I needed to clear up things. It wont be difficult to adapt.
- A new class for the camera parameters. It can be readed from the calibration.cpp application in OpenCv2.2
- Refactorization of code to make it more maintainable
- Better support for Windows (Cmake) and OpenGL
Expand Down
66 changes: 34 additions & 32 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,37 @@ ArUco is a minimal C++ library for detection of Augmented Reality markers based
It is an educational project to show student how to detect augmented reality markers and it is provided under BSD license.


CONTACT: Rafael Munoz-Salinas: [email protected]

\section INTRODUCTION

The library relies on the use of coded markers. Each marker has an unique code indicated by the black and white colors in it. The libary detect borders, and analyzes into the rectangular regions which of them are likely to be markers. Then, a decoding is performed and if the code is valid, it is considered that the rectangle is a marker.

The codification included into the marker is a slighly modified version of the Hamming Code. It has a total a 25 bits didived in 5 rows of 5 bits each. So, we have 5 words of 5 bits. Each word, contains only 2 bits of real information, the rest is for and error detection/correction (error correction is yet to be done). As a conclusion, a marker contains 10 bits of real information wich allows 1024 different markers.




\section LIBRARY DESCRIPTION:

The ArUco library contents are divided in two main directories. The src directory, which contains the library itself. And the utils directory which contains the applications.

\section BOARDS
The library main classes are:

- aruco::Marker: which represent a marker detected in the image
- aruco::MarkerDetector: that is in charge of deteting the markers in a image Detection is done by simple calling the member funcion ArMarkerDetector::detect(). Additionally, the classes contain members to create the required matrices for rendering using OpenGL. See aruco_test_gl for details
- aruco::BoardConfiguration: A board is an array of markers in a known order. BoardConfiguracion is the class that defines a board by indicating the id of its markers. In addition, it has informacion about the distance between the markers so that extrinsica camera computations can be done.
- aruco::Board: This class defines a board detected in a image. The board has the extrinsic camera parameters as public atributes. In addition, it has a method that allows obtain the matrix for getting its position in OpenGL (see aruco_test_board_gl for details).
- aruco::BoardDetector : This is the class in charge of detecting a board in a image. You must pass to it the set of markers detected by ArMarkerDetector and the BoardConfiguracion of the board you want to detect. This class will do the rest for you, even calculating the camera extrinsics.

\subsection BOARDS

Aruco allows the possibility to employ board. Boards are markers composed by an array of markers arranged in a known order. The advantages of using boards instead of simple markers are:
- More robusteness. The misdetection of several markers of the board is not a problem as long as a minimum set of them are detected.
- More precision. Since there are a larger number of corners, camera pose estimation becomes more precise.


\section APPLICATIONS
\subsection APPLICATIONS

- The library comes with five applications that will help you to learn how to use the library:
-# aruco_create_marker: which creates marker and saves it in a jpg file you can print.
Expand All @@ -32,22 +48,11 @@ Aruco allows the possibility to employ board. Boards are markers composed by an
-# aruco_simple_board: simple application that detects boards in an image
-# aruco_test_board_gl: application that detects boards and uses OpenGL to draw


\section LIBRARY DESCRIPTION:

The ArUco library contents are divided in two main directories. The src directory, which contains the library itself. And the utils directory which contains the applications.

The library main classes are:

- aruco::Marker: which represent a marker detected in the image
- aruco::MarkerDetector: that is in charge of deteting the markers in a image Detection is done by simple calling the member funcion ArMarkerDetector::detect(). Additionally, the classes contain members to create the required matrices for rendering using OpenGL. See aruco_test_gl for details
- aruco::BoardConfiguration: A board is an array of markers in a known order. BoardConfiguracion is the class that defines a board by indicating the id of its markers. In addition, it has informacion about the distance between the markers so that extrinsica camera computations can be done.
- aruco::Board: This class defines a board detected in a image. The board has the extrinsic camera parameters as public atributes. In addition, it has a method that allows obtain the matrix for getting its position in OpenGL (see aruco_test_board_gl for details).
- aruco::BoardDetector : This is the class in charge of detecting a board in a image. You must pass to it the set of markers detected by ArMarkerDetector and the BoardConfiguracion of the board you want to detect. This class will do the rest for you, even calculating the camera extrinsics.


\section COMPILING THE LIBRARY:

REQUIREMENTS: OpenCv >= 2.3.1, cmake >= 2.8
OPTIONAL: OpenGL for aruco_test_gl and aruco_test_board_gl

\subsection LINUX:

Go to the aruco library and do
Expand All @@ -61,20 +66,25 @@ NOTE ON OPENGL: The library supports eaily the integration with OpenGL. In order

\subsection WINDOWS

The library has been compiled using MinGW and codeblocks. Below I describe the best way to compile it that I know. If you knoe better, please let me know.
We have successfully compiled in in two compilers: MSVC2010 and MinGW.
In both cases cmake and OpenCv are required first. So install them


\subsubsection Microsoft Visual C++ (Express Edition 2010)

a) Downdload MSVC 2010 (http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express).
b) Use cmake to create the project. Compile and run!

\subsubsection MinGW and codeblocks

The library has been compiled using MinGW and codeblocks. Below I describe the best way to compile it that I know. If you know better, please let me know.

step 1) codeblocks
-# Download codeblocks. I recommend to download the version 10.5 with mingw included (codeblocks-10.05mingw-setup.exe)
-# Install and set the PATH variable so that the codeblock/mingw/bin directory is included. In my case "c:\codeblocks\mingw\bin". This will allow cmake to find the compiler.
-# The codeblock program will not find the mingw path by deafult. So, run codeblocks and go to setting->Compuiler debugger and set the correct path to the MinGW dir.

step 2) cmake
-# Download and install the last version of cmake.

step 3) OpenCv
-# Download the source code and compile it using cmake and codeblocks
Note: install the library in C:\ if you want it to be easily detected by cmake afterwards
step 4) aruco
step 2) aruco
-# download and decompress.
-# Open cmake gui application and set the path to the main library directory and also set a path where the project is going to be built. Generate the codeblock project.
-# Open the project with codeblock and compile then, install. The programs will be probably generated into the bin directory
Expand All @@ -85,18 +95,10 @@ So, download the library (http://www.martinpayne.me.uk/software/development/GLUT
>cmake .. -DGLUT_PATH="C:\x"
Finally, recompile and test. Indeed, you should move the freeglut.dll to the directory with the binaries or to any other place in the PATH.


CONCLUSION: Move to Linux, things are simpler :P


\section Testing

For testing the applications, the library provides videos and the corresponding camera parameters of these videos. Into the directories you will find information on how to run the examples.

\section Final Notes

- REQUIREMENTS: OpenCv >= 2.1.0. and OpenGL for (aruco_test_gl and aruco_test_board_gl)
- CONTACT: Rafael Munoz-Salinas: [email protected]
- This libary is free software and come with no guaratee!


15 changes: 15 additions & 0 deletions android/Aruco.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
USER_LOCAL_PATH:=$(LOCAL_PATH)
LOCAL_PATH:=$(call my-dir)
### GLOBAL VARIABLES
ARUCO_STATIC_LIBRARIES:= aruco
ARUCO_C_INCLUDES:= $(LOCAL_PATH)/include

##ADD THE MODULE TO THE PROJECT
include $(CLEAR_VARS)
LOCAL_MODULE:= aruco
LOCAL_SRC_FILES:=libs/$(TARGET_ARCH_ABI)/libaruco.a
include $(PREBUILT_STATIC_LIBRARY)

LOCAL_PATH:=$(USER_LOCAL_PATH)


Loading

0 comments on commit a5cc402

Please sign in to comment.