![](https://csdnimg.cn/release/download_crawler_static/86361170/bg5.jpg)
第二部分:数据获取
根据上文环境配置的结果,对数据获取部分的代码进行调整,由于官方 OpenNI2 代码
运用 Makefile 进行管理,所以将 OpenCV 的配置也运用 Makefile 进行管理。本文以官方示
例代码 SimpleViewer 文件加下的文件作为基础,对其中的 Makefile 进行配置。
首先,“Makefile”文件内容进行修改,红色部分为添加部分,内容是官方 OpenNI2 的
相关文件路径:
include CommonDefs.mak
BIN_DIR = Bin
OPENNI2_INCLUDE=/home/orbbec/Desktop/OpenNI-Linux-Arm64-2.3.0.65/OpenNI-Linux-Arm64-2.3.0.65/include/
OPENNI2_REDIST=/home/orbbec/Desktop/OpenNI-Linux-Arm64-2.3.0.65/OpenNI-Linux-Arm64-2.3.0.65/Redist/
INC_DIRS = \
../../Include \
../../ThirdParty/GL/ \
../Common
SRC_FILES = *.cpp
ifeq ("$(OSTYPE)","Darwin")
CFLAGS += -DMACOS
LDFLAGS += -framework OpenGL -framework GLUT
else
CFLAGS += -DUNIX -DGLX_GLXEXT_LEGACY
USED_LIBS += glut GL
endif
USED_LIBS += OpenNI2
EXE_NAME = SimpleViewer
CFLAGS += -Wall
ifndef OPENNI2_INCLUDE
$(error OPENNI2_INCLUDE is not defined. Please define it or 'source' the OpenNIDevEnvironment file fro
m the installation)
else ifndef OPENNI2_REDIST
$(error OPENNI2_REDIST is not defined. Please define it or 'source' the OpenNIDevEnvironment file from
the installation)
endif
INC_DIRS += $(OPENNI2_INCLUDE)
include CommonCppMakefile
.PHONY: copy-redist
copy-redist: