Skip to content

Commit

Permalink
Fix canny sobel
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierbrgt committed Jul 3, 2024
1 parent ca2d16b commit 9e3f01b
Show file tree
Hide file tree
Showing 254 changed files with 93,089 additions and 33,029 deletions.
30 changes: 17 additions & 13 deletions Include/cv/feature_detection.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,30 @@
extern "C"
{
#endif
/**
* @brief Function returning the scratch size for canny sobel
*
* @param[in] imageIn The input image
* @return Scratch size in bytes
*
*/
uint16_t arm_cv_get_scratch_size_canny_sobel(int width);

/**
* @brief Canny edge with sobel integrated
*
* @param[in] ImageIn The input image
* @param[out] ImageOut The output image
* @param[in,out] Img_tmp_grad1 Temporary buffer gradient 1
* @param[in,out] Img_tmp_mag Temporary magnitude buffer
* @param[in,out] Img_tmp_grad2 Temporary buffer gradient 2
* @param[in] low_threshold The low threshold
* @param[in] high_threshold The high threshold
* @param[in] imageIn The input image
* @param[out] imageOut The output image
* @param[in,out] scratch Temporary buffer
* @param[in] lowThreshold The low threshold
* @param[in] highThreshold The high threshold
*
*/
extern void arm_canny_edge_sobel_fixp(const arm_cv_image_gray8_t* ImageIn,
extern void arm_cv_canny_edge_sobel(const arm_cv_image_gray8_t* ImageIn,
arm_cv_image_gray8_t* ImageOut,
arm_cv_image_gradient_q15_t* Img_tmp_grad1,
arm_cv_image_q15_t* Img_tmp_mag,
arm_cv_image_gradient_q15_t* Img_tmp_grad2,
int low_threshold,
int high_threshold);
q15_t* Buffer,
uint8_t low_threshold,
uint8_t high_threshold);

#ifdef __cplusplus
}
Expand Down
2,434 changes: 725 additions & 1,709 deletions Source/FeatureDetection/arm_cannysobel.c

Large diffs are not rendered by default.

Binary file added Testing/board/RefPatterns/test_0_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_100_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_101_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_102_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_103_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_104_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_105_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_106_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_107_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_108_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_109_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_10_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_110_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_111_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_112_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_113_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_114_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_115_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_116_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_117_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_118_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_119_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_11_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_120_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_121_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_122_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_123_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_124_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_125_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_126_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_127_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_128_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_129_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_12_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_130_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_131_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_132_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_133_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_134_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_135_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_136_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_137_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_138_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_139_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_13_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_140_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_141_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_142_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_143_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_144_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_145_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_146_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_147_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_148_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_149_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_14_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_150_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_151_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_152_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_153_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_154_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_155_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_156_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_157_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_158_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_159_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_15_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_160_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_161_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_162_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_163_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_164_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_165_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_166_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_167_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_168_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_169_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_16_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_170_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_171_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_172_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_173_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_174_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_175_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_176_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_177_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_178_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_179_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_17_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_180_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_181_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_182_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_183_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_184_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_185_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_186_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_187_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_188_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_189_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_18_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_190_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_191_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_192_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_193_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_194_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_195_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_196_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_197_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_198_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_199_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_19_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_1_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_200_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_201_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_202_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_203_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_204_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_205_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_206_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_207_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_208_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_209_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_20_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_210_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_211_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_212_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_213_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_214_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_215_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_216_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_217_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_218_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_219_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_21_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_220_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_221_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_222_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_223_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_224_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_225_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_226_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_227_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_228_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_229_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_22_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_230_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_231_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_232_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_233_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_234_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_235_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_23_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_24_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_25_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_26_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_27_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_28_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_29_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_2_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_30_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_31_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_32_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_33_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_34_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_35_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_36_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_37_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_38_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_39_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_3_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_40_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_41_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_42_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_43_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_44_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_45_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_46_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_47_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_48_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_49_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_4_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_50_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_51_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_52_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_53_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_54_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_55_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_56_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_57_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_58_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_59_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_5_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_60_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_61_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_62_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_63_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_64_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_65_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_66_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_67_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_68_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_69_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_6_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_70_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_71_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_72_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_73_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_74_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_75_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_76_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_77_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_78_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_79_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_7_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_80_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_81_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_82_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_83_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_84_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_85_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_86_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_87_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_88_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_89_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_8_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_90_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_91_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_92_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_93_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_94_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_95_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_96_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_97_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_98_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_99_img_0.tiff
Binary file not shown.
Binary file added Testing/board/RefPatterns/test_9_img_0.tiff
Binary file not shown.
83,371 changes: 71,897 additions & 11,474 deletions Testing/board/cinput.c

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Testing/board/cinput.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ extern "C"

#if defined(CINPUT)

#define NB_CINPUT 115096
#define NB_CINPUT 719329
extern const uint8_t cinput[NB_CINPUT];

#endif
Expand Down
1 change: 1 addition & 0 deletions Testing/board/cmsiscv.cproject.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ project:
- file: tests/test_group0.cpp
- file: tests/test_group1.cpp
- file: tests/test_group2.cpp
- file: tests/test_group3.cpp
- file: tests/test_dev.cpp
- file: clang_sse300.c
for-context:
Expand Down
195 changes: 120 additions & 75 deletions Testing/board/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,85 +8,85 @@
from scripts.export import YUV420,AlgoImage,serialize_tensors,read_tensors
from scripts.details.input_generator import *

#with open("results/output_0.dat","rb") as f:
# t = read_tensors(f)
#alg = t[0].tensor
#print(alg)

output = AlgoImage.open("results/img/AC6/VHT-Corstone-300/dev/test_0_img_0.npy").tensor

#print(output)
#exit(0)

ref = AlgoImage.open("references/dev/test_0_img_0.npy").tensor


input = AlgoImage.open("inputs/dev/img_0.npy").tensor


##with open("results/output_0.dat","rb") as f:
## t = read_tensors(f)
##alg = t[0].tensor
##print(alg)
#
#output = AlgoImage.open("results/img/AC6/VHT-Corstone-300/dev/test_0_img_0.npy").tensor
#
##print(output)
##exit(0)
#
#ref = AlgoImage.open("references/dev/test_0_img_0.npy").tensor
#
#
#input = AlgoImage.open("inputs/dev/img_0.npy").tensor
#
#
##print(ref.shape)
##img = PIL.Image.fromarray(ref).convert('L')
##img.show()
##
##print(input.shape)
##img = PIL.Image.fromarray(input).convert('L')
##img.show()
##
#
#def Himax_resize(input,output_w,output_h):
# tmp = np.zeros((2,output_w),dtype=np.uint8)
# result = np.zeros((output_h,output_w),dtype=np.uint8)
# input_h,input_w = input.shape
# w_scale = (input_w - 1) / (output_w - 1)
# h_scale = (input_h - 1) / (output_h - 1)
#
#
# # DEBUG
# dy,iy = np.modf(h_scale*np.array(range(output_h),dtype=np.float32))
# iy = iy.astype(dtype=np.int32)
# pre_iy = np.hstack((-1,iy))
# #print(dy)
# #exit(0)
#
#
# dx,ix=np.modf(w_scale*np.array(range(output_w),dtype=np.float32))
# ix = ix.astype(dtype=np.int32)
#
# for row in range(output_h-1):
# if iy[row] != pre_iy[row-1]:
# tmp[:,0:output_w-1] = ((1-dx[:-1])*input[iy[row]:iy[row]+2,ix[:-1]] + dx[:-1] * input[iy[row]:iy[row]+2,ix[:-1]+1] + 0.5)
# tmp[:,output_w-1] = input[iy[row]:iy[row]+2,input_w-1]
#
# result[row,:] = np.floor(((1-dy[row])*tmp[0,:]).astype(np.uint8) + dy[row]*tmp[1,:] + np.float32(0.5))
#
#
# row = output_h - 1
#
# if iy[row] != pre_iy[row-1]:
# tmp[0,0:output_w-1] = ((1-dx[:-1])*input[iy[row],ix[:-1]] + dx[:-1] * input[iy[row],ix[:-1]+1] + 0.5)
# tmp[0,output_w-1] = input[iy[row],input_w-1]
#
# result[row,:] = ((1-dy[row])*tmp[0,:] + np.float32(0.5))
#
#
# return(result)
#
#
#print(output.shape)
#print(ref.shape)
#img = PIL.Image.fromarray(ref).convert('L')
#print(input[0].shape)
##print(ref[0])
##result=Himax_resize(input[0],32,16)
##print(result[0])
##
#img = PIL.Image.fromarray(output[0]).convert('L')
#img.show()
#
#print(input.shape)
#img = PIL.Image.fromarray(input).convert('L')
#img.show()
#exit(0)
#

def Himax_resize(input,output_w,output_h):
tmp = np.zeros((2,output_w),dtype=np.uint8)
result = np.zeros((output_h,output_w),dtype=np.uint8)
input_h,input_w = input.shape
w_scale = (input_w - 1) / (output_w - 1)
h_scale = (input_h - 1) / (output_h - 1)


# DEBUG
dy,iy = np.modf(h_scale*np.array(range(output_h),dtype=np.float32))
iy = iy.astype(dtype=np.int32)
pre_iy = np.hstack((-1,iy))
#print(dy)
#exit(0)


dx,ix=np.modf(w_scale*np.array(range(output_w),dtype=np.float32))
ix = ix.astype(dtype=np.int32)

for row in range(output_h-1):
if iy[row] != pre_iy[row-1]:
tmp[:,0:output_w-1] = ((1-dx[:-1])*input[iy[row]:iy[row]+2,ix[:-1]] + dx[:-1] * input[iy[row]:iy[row]+2,ix[:-1]+1] + 0.5)
tmp[:,output_w-1] = input[iy[row]:iy[row]+2,input_w-1]

result[row,:] = np.floor(((1-dy[row])*tmp[0,:]).astype(np.uint8) + dy[row]*tmp[1,:] + np.float32(0.5))


row = output_h - 1

if iy[row] != pre_iy[row-1]:
tmp[0,0:output_w-1] = ((1-dx[:-1])*input[iy[row],ix[:-1]] + dx[:-1] * input[iy[row],ix[:-1]+1] + 0.5)
tmp[0,output_w-1] = input[iy[row],input_w-1]

result[row,:] = ((1-dy[row])*tmp[0,:] + np.float32(0.5))


return(result)


print(output.shape)
print(ref.shape)
print(input[0].shape)
#print(ref[0])
#result=Himax_resize(input[0],32,16)
#print(result[0])
#err = np.abs(ref.astype(float)-output.astype(float))
#
img = PIL.Image.fromarray(output[0]).convert('L')
img.show()

exit(0)

err = np.abs(ref.astype(float)-output.astype(float))

err[np.abs(err) < 1] = 0
#err[np.abs(err) < 1] = 0

#print(err)

Expand Down Expand Up @@ -187,4 +187,49 @@ def Himax_resize(input,output_w,output_h):


#gray = cv.cvtColor(rgb, cv.COLOR_RGB2GRAY)
#print(gray)
#print(gray)


input = AlgoImage.open("inputs/dev/img_0.tiff").tensor
ref = AlgoImage.open("references/dev/test_0_img_0.tiff").tensor
refauto = AlgoImage.open("RefPatterns/test_2_img_0.tiff").tensor
out2 = AlgoImage.open("results/img/AC6/VHT-M7/group_3/test_2_img_0.tiff").tensor
out = AlgoImage.open("results/img/AC6/VHT-Corstone-300/group_3/test_2_img_0.tiff").tensor
mv = AlgoImage.open("references/dev/output.tif").tensor
#
#print(ref-out)
#
#print("out", out[0,0])
#print("ref", ref[0,0])
c = 0
t = np.array([])
ref = ref.astype(dtype=np.int16)
out = out.astype(dtype=np.int16)
diff = np.array(abs(refauto-out))
#for i in range(0, 512):
# for j in range(0, 512):
# if(abs(ref[i,j]- out[i,j]) >1):
# if(c == 0):
# print(i,j)
# c+=1
# np.append(t,abs(ref[i,j]- out[i,j]))
img = PIL.Image.fromarray(diff)
img.show()
#def custom_filter(image):
# return((image[0]+(image[1])*2+image[2]+(image[3])*2+(image[4])*4+(image[5])*2+image[6]+(image[7])*2+image[8])/16)
##footprint = np.ones((3,3))
#blur = scipy.ndimage.generic_filter(input,custom_filter, [3,3],mode='reflect')
##blur = scipy.ndimage.gaussian_filter(input, 0)
#print(c)
#print(t)
#c=0
#t2=[]
#for i in range(0, 64):
# for j in range(0, 64):
# if(abs(blur[i,j]- out[i,j]) >1):
# if(c == 0):
# print(i,j)
# c+=1
# t2.append((blur[i,j]- out[i,j]))
#print(c)
#print(t2)
1 change: 0 additions & 1 deletion Testing/board/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ void run_test_group()
save_mem(out.str().c_str(),outputs,total_bytes);
#endif
aligned_free((void*)outputs);

}
else
{
Expand Down
18 changes: 17 additions & 1 deletion Testing/board/scripts/details/description.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,20 @@ def bgr8U3C_resize_to_rgb_test(imgdim,funcid,dst_w,dst_h):
"useimg": [2],
"reference": HimaxResizeBGR_8U3C_to_RGB24(dst_w,dst_h),
"check" : SimilarTensorFixp(20)
}
}

def canny_sobel_test(imgid, imgdim, funcid=2, img_type="gray8"):
return {"desc":f"Gauss {img_type} image {imgdim[0]}x{imgdim[1]}",
"funcid": funcid,
"useimg": [imgid],
"reference": CannyEdge(),
"check" : SimilarImage(1)
}

def canny_sobel_test_autoref(imgid, imgdim, funcid=2, img_type="gray8"):
return {"desc":f"Gauss {img_type} image {imgdim[0]}x{imgdim[1]}",
"funcid": funcid,
"useimg": [imgid],
"reference": CannyEdgeAutoRef(),
"check" : SimilarImage(1)
}
2 changes: 1 addition & 1 deletion Testing/board/scripts/details/input_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def loop_vec_iterations(dt):
def image_dims(dt):
la = list(itertools.product(loop_vec_iterations(dt),LOOP_UNROLL_ITERATIONS))
# Add some square images and some corner cases for padding checks
return (la + [(16,16),(32,32),(64,64),(1,1),(2,2),(3,3)])
return (la + [(16,16),(32,32),(64,64),(2,2),(3,3)])

def is_ok_for_yuv(x):
width,height = x
Expand Down
33 changes: 33 additions & 0 deletions Testing/board/scripts/details/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,5 +368,38 @@ def __call__(self,args,group_id,test_id,srcs):
for image_id,img in enumerate(filtered):
record_reference_img(args,group_id,test_id,image_id,img)

def nb_references(self,srcs):
return len(srcs)

class CannyEdge:
def __call__(self,args,group_id,test_id,srcs):
procesed = []
for i in srcs:
canny = cv.Canny(i.tensor, 95,78)
# Pack the image in an AlgoImage and add it to the reference patterns
# If we get the blur as it is, it will be recorded as an .npy file
# It would be simpler with a gray8 as tiff image
# So we need to convert back to Pillow
pil = PIL.Image.fromarray(canny)
procesed.append(AlgoImage(pil))

# Record the filtered images
for image_id,img in enumerate(procesed):
record_reference_img(args,group_id,test_id,image_id,img)

def nb_references(self,srcs):
return len(srcs)

class CannyEdgeAutoRef:

def __call__(self,args,group_id,test_id,srcs):
procesed = []
pil = AlgoImage.open(f"RefPatterns/test_{test_id}_img_0.tiff")
procesed.append(pil)

# Record the filtered images
for image_id,img in enumerate(procesed):
record_reference_img(args,group_id,test_id,image_id,img)

def nb_references(self,srcs):
return len(srcs)
Loading

0 comments on commit 9e3f01b

Please sign in to comment.