morphological processing : Hit or Miss shape detection I am currently looking at shape detection for Hit or Miss. I am having a bit of trouble with the concept of the window that they have you to detect the shape. Up till now reading about hit or miss they just give an example of a target set of pixels and a target image 1 and the step for this are as follows:


The first step in Hit-or-miss translation is the erosion of the image by the target configuration (shape), thus producing the hits. The logical operation is given by $A\ominus B$ where A is the image and B is the target shape to be found.
The second step, we take the complement of the image $\bar{A}$ and the target shape $\bar{B}$. The we erode the compliment to produce the misses with in the image. The logical operation for this is given by $\bar{A}\ominus\bar{B}$.
The final step take the intersection of the two eroded images and any surviving pixels give the location of the target shape in the original image A. The logical operation for this final step is given by $(A \ominus B) \cap (\bar{A} \ominus \bar{B}$).
Any surviving pixels give the location of the target shape in the original image A

However when I looked further into this method for shape detection I came across the following website:
(http://oramos.epizy.com/teaching/16/dip/lectures/07_Morphological_Image_Processing_1.pdf?i=1)
and on slide 34 to 35 it has the following for shape detection


in there example for the shape detection they are using another structuring factor which they have named window, which it what I am having and issue with. with why have they done this? Is this a generally way when using hit or miss for shape detection?
They are using the same method. The second resource is just showing the windowing function. Look at slide 12, the windowing function is shown here. 

Erosion implies you use a windowed kernel, and slide it around the entire image (as seen in this gif), so the first source doesn't mention this step. The 2nd source is explicitly stating you must pad the search space, and then slide the kernel around it.Hope that makes sense