I work with OpenCV 2.4 in C++.
I have some image, say, 360x240 (but it is not relevant), and I want to compute one HOG vector for the whole image.
Is there any short way to do it, or should I initialize an object of gpu::HOGDescriptor with winSize equals to the image size?
Is the winSize parameter anyway relevant when you use the getDescriptors() method (or is it relevant only for the detection related methods)?
Is there some easy way to tell the coordinates in the image of each block in the vector?
getDescriptors() because it defines the size of your descriptor. The descriptor of size winSize is first devided into cell of size cellSize. For each cell a histogram of oriented gradients is build. The descriptor is further arranged in Blocks. A Block uses blockSize.width * blockSize.height adjecent cells in order to estimate a normalize the histogram out of the blockSize.width * blockSize.height cell histomgrams. blockStride can be use to arange the blocks in an overlapping manner. Finaly all normalized histograms estimated for each Block are concatenated which defines the final descriptor vector length. here you can find a good visualisation. So different sizes can result in various descriptor length.locations attribute of the compute function. If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With