diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 29d9e8e09..d594ad218 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -56,3 +56,4 @@ This file lists everyone, who contributed to this repo and wanted to show up her - Ishaan Verma - Delphi1024 - ntindle +- Ridham177 diff --git a/contents/convolutions/2d/2d.md b/contents/convolutions/2d/2d.md index d026c8a52..7fc21aeb6 100644 --- a/contents/convolutions/2d/2d.md +++ b/contents/convolutions/2d/2d.md @@ -21,6 +21,8 @@ In code, a two-dimensional convolution might look like this: {% method %} {% sample lang="jl" %} [import:4-28, lang:"julia"](../code/julia/2d_convolution.jl) +{% sample lang="py" %} +[import:5-19, lang:"python"](../code/python/2d_convolution.py) {% endmethod %} This is very similar to what we have shown in previous sections; however, it essentially requires four iterable dimensions because we need to iterate through each axis of the output domain *and* the filter. @@ -48,6 +50,8 @@ At this stage, it is important to write some code, so we will generate a simple {% method %} {% sample lang="jl" %} [import:30-47, lang:"julia"](../code/julia/2d_convolution.jl) +{% sample lang="py" %} +[import:21-33, lang:"python"](../code/python/2d_convolution.py) {% endmethod %} Though it is entirely possible to create a Gaussian kernel whose standard deviation is independent on the kernel size, we have decided to enforce a relation between the two in this chapter. @@ -135,6 +139,8 @@ In code, the Sobel operator involves first finding the operators in $$x$$ and $$ {% method %} {% sample lang="jl" %} [import:49-63, lang:"julia"](../code/julia/2d_convolution.jl) +{% sample lang="py" %} +[import:36-52, lang:"python"](../code/python/2d_convolution.py) {% endmethod %} With that, I believe we are at a good place to stop discussions on two-dimensional convolutions. @@ -148,6 +154,8 @@ We have also added code to create the Gaussian kernel and Sobel operator and app {% method %} {% sample lang="jl" %} [import, lang:"julia"](../code/julia/2d_convolution.jl) +{% sample lang="py" %} +[import, lang:"python"](../code/python/2d_convolution.py) {% endmethod %}