cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
nessvan
Contributor
Contributor
1,724 Views
Registered: ‎04-03-2018

xfopencv + SDSoC 2018.2 + hog NOB=9 vs hog NOB=18

Hi,

 

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?

 

Thank you,

Ness

 

 

 

0 Kudos
7 Replies
qhall
Explorer
Explorer
1,664 Views
Registered: ‎10-24-2008

@gouthambare you potentially able to assist @nessvan with this problem?  Any assistance that you can provide will be greatly appreciated.  Cheers - Quenton

gouthamb
Xilinx Employee
Xilinx Employee
1,644 Views
Registered: ‎05-25-2018

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.

0 Kudos
nessvan
Contributor
Contributor
1,634 Views
Registered: ‎04-03-2018

@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.

 

 

0 Kudos
akashsun
Xilinx Employee
Xilinx Employee
1,583 Views
Registered: ‎07-31-2018

Hi @nessvan and @qhall,

 

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.

 

Regards,

Akash 

nessvan
Contributor
Contributor
1,558 Views
Registered: ‎04-03-2018

@akashsun@qhall

Thank you for your timely response. The no. 4 suggestion change of data type solved our issue.

 

Cheers,

Ness

0 Kudos
idiotic_genius
Adventurer
Adventurer
1,448 Views
Registered: ‎07-20-2017

@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?

Regards, abhidan@logictronix.com
Please mark the Answer as "Accept as solution" if information provided solves your query. Give Kudos if you think it was helpful and reply oriented.
0 Kudos
nessvan
Contributor
Contributor
1,394 Views
Registered: ‎04-03-2018

Hi @idiotic_genius,

 

you can have a look at xilinx opencv user guide for start.

 

Ness

0 Kudos