07-27-2018 03:38 PM - edited 11-06-2018 05:38 PM
If we change the NOB (number of bins) = 9 which is the default value of xilinx hog example, with some modifications it works up to NOB = 16.
However, when tried on NOB = 18 although the descriptor size of output is correct (4 x 18 =72) but the last 8 numbers are incorrect compared to hog opencv. Which means that the descriptor is calculated correctly up to 64 elements and after that it gets messed up.
Any idea why this would happen?
Is there any hard coded hyper parameter any where else other than those defined in the config or header files?
07-30-2018 01:49 PM
07-31-2018 03:13 AM
Hi @nessvan ,
In xfOpenCV HOG, the number of bins(NOB) has been fixed to 9. It has been documented in UG1233 (page 115). If you use it for a different NOB value, there will be dependencies in the kernel code(macros like XF_HOG_1_BY_20, fixed-point datatypes etc.,) which might cause the output to go wrong.
07-31-2018 10:02 AM
@gouthamb, we have considered those changes (including XF_HOG_1_BY_20 and other fixed parameters) due to the change in NOB.
If NOB is =16, we have confirmed that the output is correct and same as opencv output. In this case, the descriptor size is (4* 16 = 64), but if we go beyond that number (NOB = 16) the rest of the descriptor is not correct. We thought it might suggest buffer/data transfer limitation that we are not aware of.
08-06-2018 02:05 PM
We were able to replicate the issue that you faced when you changed the parameter for NOB to 18. There are three things that need to be changed in the code,
1. XF_HOG_1_BY_20 must be changed to 6553. (in xf_hog_descriptor_compute_hist.hpp file) (basically changing fixed point value of 1/20 to 1/10)
2. XF_3_P_6 must be changed to 1843. (in xf_hog_descriptor_norm.hpp) (basically changing the fix point value of 3.6 to 7.2)
3. Increase the width of the stream from 576 to 1152.
4. Change the datatype of the variable 'offset' in the function xFDHOGReNormalizeKernel() from ap_uint<10> to unsigned short (most probably this should be your issue). (in the file xf_hog_descriptor_norm.hpp)
These changes should help get the code to work for NOB of 18 config.
08-20-2018 04:38 AM - edited 08-20-2018 04:40 AM
@nessvan I am a beginner in xfopencv functions use in SDSoC. Can you share some resources or links related to use of HOG in SDSoC environment?