Skip to content

Commit a1ede81

Browse files
SDA USRsdausr
authored andcommitted
Squashed 'vision' changes from 6c95eeaf1..97246ea1c (#1061)
97246ea1c Updated crop info in doc Co-authored-by: sdausr <[email protected]>
1 parent 0e88b29 commit a1ede81

File tree

9 files changed

+52
-87
lines changed

9 files changed

+52
-87
lines changed

vision/L1/include/aie-ml/imgproc/cos.hpp

Lines changed: 0 additions & 70 deletions
This file was deleted.

vision/L2/examples/crop/config/xf_config_params.h

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,34 @@ typedef ap_uint<64> ap_uint64_t;
3030
/* set the height and weight */
3131
#define HEIGHT 2160
3232
#define WIDTH 3840
33+
#define MEMORYMAPPED_ARCH 1 // 0 is stream ,1 is memorymapped
3334

35+
#if MEMORYMAPPED_ARCH
3436
#define XF_CV_DEPTH_IN -1
3537
#define XF_CV_DEPTH_OUT -1
36-
3738
#define XF_CV_DEPTH_OUT_1 -1
3839
#define XF_CV_DEPTH_OUT_2 -1
39-
40-
#define MEMORYMAPPED_ARCH 1
40+
#else
41+
#define XF_CV_DEPTH_IN 2
42+
#define XF_CV_DEPTH_OUT 2
43+
#define XF_CV_DEPTH_OUT_1 2
44+
#define XF_CV_DEPTH_OUT_2 2
45+
#endif
4146

4247
#define NUM_ROI 3
4348

4449
/* set the type of input image*/
4550
#define GRAY 1
4651

4752
#define NPPCX XF_NPPC1
48-
4953
#define IN_TYPE XF_8UC1
5054
#define OUT_TYPE XF_8UC1
5155

5256
#define INPUT_CH_TYPE 1
5357
#define OUTPUT_CH_TYPE 1
5458

55-
#define INPUT_PTR_WIDTH 8
56-
#define OUTPUT_PTR_WIDTH 8
59+
#define INPUT_PTR_WIDTH 64
60+
#define OUTPUT_PTR_WIDTH 64
5761

5862
#endif
5963
// end of _XF_CROP_CONFIG_H_

vision/L2/examples/crop/xf_crop_accel.cpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,46 @@ void crop_accel(ap_uint<INPUT_PTR_WIDTH>* img_in,
4646
_roi[i].width = roi[j + 3];
4747
}
4848

49+
#if MEMORYMAPPED_ARCH
4950
xf::cv::Mat<IN_TYPE, HEIGHT, WIDTH, NPPCX, XF_CV_DEPTH_IN> in_mat(height, width, img_in);
5051
xf::cv::Mat<OUT_TYPE, HEIGHT, WIDTH, NPPCX, XF_CV_DEPTH_OUT> out_mat(_roi[0].height, _roi[0].width, _dst);
5152
xf::cv::Mat<OUT_TYPE, HEIGHT, WIDTH, NPPCX, XF_CV_DEPTH_OUT_1> out_mat1(_roi[1].height, _roi[1].width, _dst1);
5253
xf::cv::Mat<OUT_TYPE, HEIGHT, WIDTH, NPPCX, XF_CV_DEPTH_OUT_2> out_mat2(_roi[2].height, _roi[2].width, _dst2);
5354

5455
xf::cv::crop<OUT_TYPE, HEIGHT, WIDTH, MEMORYMAPPED_ARCH, NPPCX, XF_CV_DEPTH_IN, XF_CV_DEPTH_OUT>(in_mat, out_mat,
5556
_roi[0]);
57+
5658
xf::cv::crop<OUT_TYPE, HEIGHT, WIDTH, MEMORYMAPPED_ARCH, NPPCX, XF_CV_DEPTH_IN, XF_CV_DEPTH_OUT_1>(in_mat, out_mat1,
5759
_roi[1]);
60+
5861
xf::cv::crop<OUT_TYPE, HEIGHT, WIDTH, MEMORYMAPPED_ARCH, NPPCX, XF_CV_DEPTH_IN, XF_CV_DEPTH_OUT_2>(in_mat, out_mat2,
5962
_roi[2]);
63+
#else
64+
65+
xf::cv::Mat<IN_TYPE, HEIGHT, WIDTH, NPPCX, XF_CV_DEPTH_IN> in_mat(height, width);
66+
xf::cv::Mat<IN_TYPE, HEIGHT, WIDTH, NPPCX, XF_CV_DEPTH_IN> in_mat1(height, width);
67+
xf::cv::Mat<IN_TYPE, HEIGHT, WIDTH, NPPCX, XF_CV_DEPTH_IN> in_mat2(height, width);
68+
xf::cv::Mat<IN_TYPE, HEIGHT, WIDTH, NPPCX, XF_CV_DEPTH_IN> in_mat3(height, width);
69+
xf::cv::Mat<OUT_TYPE, HEIGHT, WIDTH, NPPCX, XF_CV_DEPTH_OUT> out_mat(_roi[0].height, _roi[0].width);
70+
xf::cv::Mat<OUT_TYPE, HEIGHT, WIDTH, NPPCX, XF_CV_DEPTH_OUT_1> out_mat1(_roi[1].height, _roi[1].width);
71+
xf::cv::Mat<OUT_TYPE, HEIGHT, WIDTH, NPPCX, XF_CV_DEPTH_OUT_2> out_mat2(_roi[2].height, _roi[2].width);
72+
73+
xf::cv::Array2xfMat<INPUT_PTR_WIDTH, IN_TYPE, HEIGHT, WIDTH, NPPCX, XF_CV_DEPTH_IN>(img_in, in_mat);
74+
75+
xf::cv::duplicateimages<IN_TYPE, HEIGHT, WIDTH, NPPCX, XF_CV_DEPTH_IN, XF_CV_DEPTH_IN, XF_CV_DEPTH_IN,
76+
XF_CV_DEPTH_IN>(in_mat, in_mat1, in_mat2, in_mat3);
77+
78+
xf::cv::crop<OUT_TYPE, HEIGHT, WIDTH, MEMORYMAPPED_ARCH, NPPCX, XF_CV_DEPTH_IN, XF_CV_DEPTH_OUT>(in_mat1, out_mat,
79+
_roi[0]);
80+
81+
xf::cv::crop<OUT_TYPE, HEIGHT, WIDTH, MEMORYMAPPED_ARCH, NPPCX, XF_CV_DEPTH_IN, XF_CV_DEPTH_OUT_1>(
82+
in_mat2, out_mat1, _roi[1]);
83+
84+
xf::cv::crop<OUT_TYPE, HEIGHT, WIDTH, MEMORYMAPPED_ARCH, NPPCX, XF_CV_DEPTH_IN, XF_CV_DEPTH_OUT_2>(
85+
in_mat3, out_mat2, _roi[2]);
86+
xf::cv::xfMat2Array<OUTPUT_PTR_WIDTH, OUT_TYPE, HEIGHT, WIDTH, NPPCX, XF_CV_DEPTH_OUT>(out_mat, _dst);
87+
xf::cv::xfMat2Array<OUTPUT_PTR_WIDTH, OUT_TYPE, HEIGHT, WIDTH, NPPCX, XF_CV_DEPTH_OUT_1>(out_mat1, _dst1);
88+
xf::cv::xfMat2Array<OUTPUT_PTR_WIDTH, OUT_TYPE, HEIGHT, WIDTH, NPPCX, XF_CV_DEPTH_OUT_1>(out_mat2, _dst2);
89+
#endif
6090
}
6191
}

vision/L2/examples/crop/xf_crop_tb.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ int main(int argc, char** argv) {
7676
x_loc[2] = 64;
7777
y_loc[2] = 64;
7878
ROI_height[2] = 300;
79-
ROI_width[2] = 301;
79+
ROI_width[2] = 300;
8080

8181
for (int i = 0; i < NUM_ROI; i++) {
8282
out_img[i].create(ROI_height[i], ROI_width[i], in_img.type());

vision/L2/tests/aie-ml/yuv2rgba/8bit_aie_8bit_pl/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ endif
303303
@echo 'fi' >> $(RUN_SCRIPT)
304304
@echo 'echo "INFO: Embedded host run completed."' >> $(RUN_SCRIPT)
305305
@echo 'exit $$return_code' >> $(RUN_SCRIPT)
306-
DATA_FILE := $(custom_data_file)
306+
DATA_FILE := $(XFLIB_DIR)/data/Y.png $(XFLIB_DIR)/data/UV.png $(custom_data_file)
307307
DATA_DIR := $(custom_data_dir)
308308
SD_FILES += $(RUN_SCRIPT)
309309
SD_FILES += $(EXE_FILE)
@@ -464,4 +464,4 @@ cleanall: cleanh cleank
464464
-$(RMDIR) $(AIE_CONTAINER) aiesimulator_output .AIE_SIM_CMD_LINE_OPTIONS x86simulator_output $(AIE_WORK_DIR) $(AIE_PKG_DIR) $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut
465465
-$(RMDIR) ISS_RPC_SERVER_PORT pl_sample_counts *.html $(GENERATED_FILES)
466466

467-
clean: cleanh
467+
clean: cleanh

vision/L2/tests/ispstats/ispstats_NPPC1_16UC1_16UC1_ISPSTATS_BAYER/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ ifeq ($(PLATFORM),)
5757
PLATFORM := $(DEVICE)
5858
endif
5959
ifeq ($(PLATFORM),)
60-
PLATFORM := aws-vu9p-f1
60+
PLATFORM := u200
6161
endif
6262

6363
# #################### Checking if PLATFORM in whitelist ############################
64-
PLATFORM_ALLOWLIST += aws-vu9p-f1
64+
PLATFORM_ALLOWLIST += u200 aws-vu9p-f1
6565
PLATFORM_BLOCKLIST += vck190 u280 u250 zcu104
6666

6767
include ./utils.mk
@@ -98,7 +98,7 @@ VPP_FLAGS += $(EXTRA_VPP_FLAGS)
9898
########################## Setting up Host Variables ##########################
9999

100100
#Inclue Required Host Source Files
101-
ifneq (,$(shell echo $(XPLATFORM) | awk '/aws-vu9p-f1/'))
101+
ifneq (,$(shell echo $(XPLATFORM) | awk '/u200/'))
102102
HOST_SRCS += $(XFLIB_DIR)/L2/examples/ispstats/xf_ispstats_tb.cpp $(XFLIB_DIR)/ext/xcl2/xcl2.cpp
103103
CXXFLAGS += -I $(OPENCV_INCLUDE) -I $(XFLIB_DIR)/L2/tests/ispstats/ispstats_NPPC1_16UC1_16UC1_ISPSTATS_BAYER -I $(XFLIB_DIR)/ext/xcl2/ -I $(XFLIB_DIR)/L1/include
104104
CXXFLAGS += -O3 -I$(XILINX_HLS)/include -I$(XILINX_HLS)/include -I$(XILINX_HLS)/include
@@ -405,4 +405,4 @@ cleanall: cleanh cleank
405405
-$(RMDIR) $(AIE_WORK_DIR) $(AIE_PKG_DIR) $(CUR_DIR)/*.xpe $(CUR_DIR)/hw.o $(CUR_DIR)/*.xsa $(CUR_DIR)/xnwOut
406406
-$(RMDIR) *.html $(GENERATED_FILES)
407407

408-
clean: cleanh
408+
clean: cleanh

vision/L2/tests/ispstats/ispstats_NPPC1_16UC1_16UC1_ISPSTATS_BAYER/description.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
],
66
"flow": "system",
77
"platform_allowlist": [
8-
8+
"u200",
99
"aws-vu9p-f1"
1010
],
1111
"platform_blocklist": [
@@ -163,4 +163,4 @@
163163
],
164164
"category": "full"
165165
}
166-
}
166+
}

vision/L2/tests/ispstats/ispstats_NPPC1_16UC1_16UC1_ISPSTATS_BAYER/utils.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,4 +352,4 @@ MV = mv -f
352352
CP = cp -rf
353353
ECHO:= @echo
354354
PYTHON3 ?= python3
355-
VITIS_PYTHON3 = LD_LIBRARY_PATH=$(XILINX_VITIS)/tps/lnx64/python-3.8.3/lib $(XILINX_VITIS)/tps/lnx64/python-3.8.3/bin/python3
355+
VITIS_PYTHON3 = LD_LIBRARY_PATH=$(XILINX_VITIS)/tps/lnx64/python-3.8.3/lib $(XILINX_VITIS)/tps/lnx64/python-3.8.3/bin/python3

vision/docs/src/api-reference.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8307,7 +8307,8 @@ The following table describes the template and the function parameters.
83078307
+-----------------------+------------------------------------------------------+
83088308
| roi | ROI is a ``xf::cv::Rect`` object that consists of the|
83098309
| | top left corner of the rectangle along with the |
8310-
| | height and width of the rectangle. |
8310+
| | height and width of the rectangle. The dimension |
8311+
| | values of roi must be multiple of NPC |
83118312
+-----------------------+------------------------------------------------------+
83128313

83138314

0 commit comments

Comments
 (0)