diff --git a/blog/_posts/2017-04-18-offset-arrays.md b/blog/_posts/2017-04-18-offset-arrays.md index 26014466f3..3b10a73193 100644 --- a/blog/_posts/2017-04-18-offset-arrays.md +++ b/blog/_posts/2017-04-18-offset-arrays.md @@ -149,10 +149,13 @@ give them all the same indices, and `colorview(RGB, r, g, b)` inserts the grayscale images `r`, `g`, and `b` into the red, green, and blue channels respectively. If we visualize `cv`, we see the following: -![cameraman_overlay](/blog/_posts/offsetarrays_figures/cameraman_overlay.png) +| around image center | around head (cv) | +|:-------------------:|:----------------:| +| ![cameraman](/blog/_posts/offsetarrays_figures/cameraman_overlay_center.png) | ![cameraman_rot](/blog/_posts/offsetarrays_figures/cameraman_overlay.png) | -which indeed confirms that the rotation is around the head. Alternatively, -we can focus on the overlapping portions of these images like this: +The right image (corresponding to the steps taken above) indeed +confirms that the rotation is around the head. Alternatively, we can +focus on the overlapping portions of these images like this: ```julia julia> inds = map(intersect, indices(img), indices(img_rotated)) diff --git a/blog/_posts/offsetarrays_figures/cameraman_overlay_center.png b/blog/_posts/offsetarrays_figures/cameraman_overlay_center.png new file mode 100644 index 0000000000..1a50e54150 Binary files /dev/null and b/blog/_posts/offsetarrays_figures/cameraman_overlay_center.png differ diff --git a/blog/_posts/offsetarrays_figures/figures.jl b/blog/_posts/offsetarrays_figures/figures.jl index 70b6803ab0..da608cff5a 100644 --- a/blog/_posts/offsetarrays_figures/figures.jl +++ b/blog/_posts/offsetarrays_figures/figures.jl @@ -10,6 +10,11 @@ save("cameraman.png", img) save("cameraman_rotated.png", clamp01nan.(img_rotated)) cv = colorview(RGB, paddedviews(0, img, img_rotated, img)...) save("cameraman_overlay.png", clamp01nan.(cv)) +pimg = parent(img) +tfmcntr = recenter(RotMatrix(-pi/6), center(pimg)) +img_rotated_cntr = warp(pimg, tfmcntr) +cvc = colorview(RGB, paddedviews(0, pimg, img_rotated_cntr, pimg)...) +save("cameraman_overlay_center.png", clamp01nan.(cvc)) inds = map(intersect, indices(img), indices(img_rotated)) cvi = colorview(RGB, img[inds...], img_rotated[inds...], img[inds...]) save("cameraman_overlay_interior.png", clamp01nan.(cvi))