Forums - Using HOG and SVM together in FastCV

4 posts / 0 new
Last post
Using HOG and SVM together in FastCV
rishtonbo
Join Date: 8 Dec 16
Posts: 1
Posted: Sun, 2016-12-18 11:40

Hi. 

I'm attempting to do feature detection using HOG and then face detection using the SVM api to detect faces using trained vectors (trained using opencv, as suggested by the documentation).

My plan of action is as follows - 

Calculate hog vectors using `fcvExtractHogu16()`. It takes as input a `const uint16_t *__restrict strength` and `const uint16_t *__restrict orientation` arguments. These are gradient vectors (magnitude and strength) at each pixel. 

To calculate strength gradient vector, I'm using `fcvMagnitudes16()` and to calculate orientation gradient vector, Im using `fcvPhases16()`. The input of both of these are gradient vectors in the X direction and gradient vector in the Y direction. 

To calculate the gradient vector in the X and Y direction, Im using `fcvImageGradientSobelPlanars16()`. 

I then plan to send the hogVector calculated by the fcvExtractHogu16 function to the fcvSVMPredict2Classf32() function.

My questions are as follows-

1. Is this the right way to do this? This seems like an awfully long process with several fcv api calls. 

2. The output of fcvPhases16() gives me a uint8_t array. However, the fcvExtractHogu16() takes a uint16_t array. Is there an efficient way to convert the uint8_t array to a uint16_t array? Remember, I shall be calling these functions in the update method every time a camera preview frame is received. (That's about 30fps.)

3. Is there a reference, or a usage example for the svmPredict and extractHog apis? Unfortunately, the documentation is really poor.

 

Regards,

Rishabh

  • Up0
  • Down0
s101010tw
Join Date: 23 Jul 18
Posts: 2
Posted: Thu, 2018-11-29 23:32

Hi rishtonbo:

Excuse me, I have one question.

Could you share me how to load SVM model in your code?

I know that there is an "fcvSVMPredict2Classf32" function in Qualcomm FastCV library. However, I don't know how to load SVM model in Qualcomm because there is no any function about "load" function in FastCV library.

Thanks

Evan

  • Up0
  • Down0
tiansongzhao
Join Date: 16 Sep 19
Posts: 2
Posted: Tue, 2019-10-15 01:34

did you resolve this problem ?I dont know neither how to use this function?

fcvSVMPredict2Classf32

  • Up0
  • Down0
f.anusha
Join Date: 20 Nov 20
Posts: 3
Posted: Fri, 2021-01-29 23:56

hi,

i m feeling difficulty in calculating x and y direction, could you please help me with it?

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.