Skip to content

Instantly share code, notes, and snippets.

@JRJurman
Last active February 11, 2016 16:00
Show Gist options
  • Select an option

  • Save JRJurman/60288d3a691ef0bbce3b to your computer and use it in GitHub Desktop.

Select an option

Save JRJurman/60288d3a691ef0bbce3b to your computer and use it in GitHub Desktop.
% load image
orig = imread('jurman_lumiaicon.jpg');
% chartTopLeft and chartBotRight
ctl = [458 331];
cbr = [3926 2742];
% crop with the corners of the image
cropChart = orig(ctl(2):cbr(2),ctl(1):cbr(1),:);
% patchTopLeft and patchBotRight
ptl = [4091 1840];
pbr = [4835 2729];
% crop with the corners of the image
cropPatch = orig(ptl(2):pbr(2),ptl(1):pbr(1),:);
% resize the images
resizeChart = imresize(cropChart, [800 1125]);
resizePatch = imresize(cropPatch, [300 225]);
% write images to path
imwrite(resizeChart, 'patches.jpg');
imwrite(resizePatch, 'chart.jpg');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment