1 A histogram of gradients (HOG) computes edge direction histograms in localized image regions to detect objects such as faces or pedestrians.
“hog stands for histogram of gradients so what does a hog do you take an image first thing you do with that image is you essentially convert it to gray scale because usually when you want to understand let's say where a person is in the image or maybe a cup is in the image and so forth the color doesn't affect whether you want to detect something or not so often it's converted to gray scale once it's converted to gray scale you run an edge detector this is a filter that you run over the image that finds the high frequencies where image is rapidly changing its pixel values you see the result here on this slide if you run an edge detector on this image here that's the input image you run your Edge detector you get an image that looks like that where the edges are highlighted the reason to run an edge detector is because often the edges are more characteristic of what you're trying to detect and what's on inside once on your Edge detector you feed it through this hog thing what does this hog thing do when it comes back out you get an image that looks like this what just happened here um what is for example this thing over here that thing over there corresponds to this region of the original image and what you do is you look at every pixel in the original image or every region really every region this case that region over here look at that region in that region you look at every pixel and you look how intense how intense The Edge detection is for that pixel and what the direction is of the edge and so you build a histogram of edge directions and that's what's shown over here so within each little square you look at edges and histogram them over here when I say histogram them when you build a histogram you need buckets so you could have for example um eight directions eight principal directions and then whenever you have an edge you see what's the closest Direction in your bucketing system and that's where you bin it”