Skip to content

Instantly share code, notes, and snippets.

@mrifkikurniawan
Last active August 19, 2019 22:29
Show Gist options
  • Save mrifkikurniawan/4183202944d8bc729b0f7cd4ed8a6bc0 to your computer and use it in GitHub Desktop.
Save mrifkikurniawan/4183202944d8bc729b0f7cd4ed8a6bc0 to your computer and use it in GitHub Desktop.
Slice image sub-regions and perform SSD (sum of squared distance)
# Accessing Image Sub-Regions
img = imread('cameraman.png'); #read image filename
subimg1 = img(1:50, 1:50);
subimg2 = img(end-49:end, end-49:end);
ssd = sum(sum((double(subimg1) - double(subimg2)).^2))
@mrifkikurniawan
Copy link
Author

mrifkikurniawan commented Aug 19, 2019

Image accessing subregions output looks like this
cameraman

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment