Error with opencv

I want to run this demo How to Compile and Use Amlogic NN Api demo | Khadas Documentation
However, on this command ($ cd ${workspace}/aml_npu_nnsdk_app/person_detect_640x384
$ ./build-cv3.sh /path/to/aml_npu_sdk/linux_sdk/linux_sdk), I get an error
~/NeuralNetworks/aml_npu_nnsdk_app/image_classify_224x224# ./build-cv3.sh /root/NeuralNetworks/aml_npu_sdk_6.4.3/linux_sdk/linux_sdk_6.4.3
/usr/bin/ld: cv3_output/image_classify_224x224.o: in function get_input_data_cv(char*, unsigned char*, int, int)': image_classify_224x224.cpp:(.text+0x830): undefined reference to cv::Mat::Mat(int, int, int, cv::Scalar_ const&)’
collect2: error: ld returned 1 exit status
make: *** [makefile-cv3.linux:41: cv3_output/image_classify_224x224] Error 1

I tried to change makefile-cv3. linux as follows:
LIBS += -L$(NNSDK_DIR) -lnnsdk
LIBS += -L/user/local/lib -lopencv_core -lopencv_dnn -lopencv_imgproc -lopencv_core -lopencv_videoio -lopencv_imgcodecs -lopencv_highgui -lopencv_video
LIBS += -L/user/local/lib -lz -lm #-llapack -lcblas -lblas -lgfortran -latlas -lOpenCL -lz -lm

INCLUDE += -I/usr/local/include/opencv
INCLUDE += -I/usr/local/include
INCLUDE += -I/usr/local/include/opencv2/objdetect/
INCLUDE += -I/usr/local/include/opencv2/core/
INCLUDE += -I/usr/local/include/opencv2
INCLUDE += -I/usr/local/include/opencv2/highgui
INCLUDE += -I/usr/local/include/opencv2/imgcodecs
INCLUDE += -I/usr/local/include/opencv2/videoio
INCLUDE += -I/usr/local/include/opencv2/imgproc
CXXFLAGS += -std=c++11 -std=gnu++11 -Wall -std=c++11 $(INCLUDE)

But the error remains. Please tell me how to fix it (i have Ubuntu 20.04)

@ilya71

khadas@Khadas:~/aml_npu_nnsdk_app/image_classify_224x224$ cat /etc/fenix-release 
# PLEASE DO NOT EDIT THIS FILE
BOARD=VIM3
VENDOR=Amlogic
VERSION=1.0.6
ARCH=arm64
INITRD_ARCH=arm64
INSTALL_TYPE=EMMC
IMAGE_VERSION=V1.0.6-210520
################ GIT VERSION ################
UBOOT_GIT_VERSION=khadas-vims-v1.0.6-release
LINUX_GIT_VERSION=khadas-vims-v1.0.6-release
FENIX_GIT_VERSION=v1.0.6
#############################################
khadas@Khadas:~/aml_npu_nnsdk_app/image_classify_224x224$ git log --oneline 
fbdc567 (HEAD -> master, origin/master, origin/HEAD) Remove unusable demo
39b1fd9 Update image_classify to npu 6.4.4.3
789ee9a (origin/6.4.3) Update README : add local comiple method
b7eabc6 Add local compile method
a429a06 remove unuse share library
e97f307 Update readme
6f5dcda fixup post prescess
094463a update README
5b4dbaa fixup help info error
0e656a9 Add body pose demo
8e41de3 Add person detect demo
348ea97 Add image classify demo
e436cc0 Add output dir to ignore file
khadas@Khadas:~/aml_npu_nnsdk_app/image_classify_224x224$ ./build-cv3.sh    
  COMPILE /home/khadas/aml_npu_nnsdk_app/image_classify_224x224/image_classify_224x224.cpp
image_classify_224x224.cpp: In function ‘int postpress_network()’:
image_classify_224x224.cpp:263:6: warning: unused variable ‘i’ [-Wunused-variable]
  263 |  int i;
      |      ^
image_classify_224x224.cpp:265:22: warning: unused variable ‘pout’ [-Wunused-variable]
  265 |  img_classify_out_t *pout = NULL;
      |                      ^~~~
image_classify_224x224.cpp:266:15: warning: variable ‘modelType’ set but not used [-Wunused-but-set-variable]
  266 |  aml_module_t modelType;
      |               ^~~~~~~~~
khadas@Khadas:~/aml_npu_nnsdk_app/image_classify_224x224$

Please chek you system version and you nn_app commit. It work fine for me