30 trieres_lib=os.environ[
'cFpRootDir'] +
"HOST/vision/harris/languages/python/build"
31 sys.path.append(trieres_lib)
33 import _trieres_harris_numpi
41 image_in_filename = os.environ[
'cFpRootDir'] +
"ROLE/vision/hls/harris/test/512x512.png"
42 image_out_filename = image_in_filename +
"_fpga_points_out_frame_" +
str(num_frame) +
".png"
46 image = cv2.imread(image_in_filename, cv2.IMREAD_UNCHANGED)
49 image = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
52 if ((image.shape[0] != height)
or (image.shape[1] != width)):
53 print(
"WARNING: The image was resized from [", image.shape[0] ,
" x ", image.shape[1] ,
"] to [", height ,
" x ", width,
"]")
55 image = cv2.resize(image, dim, interpolation = cv2.INTER_LINEAR)
58 image = image.flatten()
60 total_size = height * width
66 output_array = _trieres_harris_numpi.harris(input_array, total_size,
"10.12.200.234",
"2719")
69 output_array_2d = np.reshape(output_array, (height, width))
71 cv2.imwrite(image_out_filename, output_array_2d)
72 print(
"INFO: the output file is saved at : " + image_out_filename)