Skip to content

Instantly share code, notes, and snippets.

View juniorhero's full-sized avatar
:octocat:

Athul Jayaram juniorhero

:octocat:
View GitHub Profile
@juniorhero
juniorhero / gist:9f967086fb70f38a47a23419fac39240
Created March 1, 2017 19:31
Matlab code to run any script on any folder of N files
cd 'D:\\'
imagefiles = dir('*.jpg');
nfiles = length(imagefiles);
for ii=1:nfiles
currentfilename = imagefiles(ii).name;
I = imread(currentfilename);
% YOUr CODE HERE %
end
@juniorhero
juniorhero / gist:858824a3bfa31ad58ef4ad51d4095f72
Created February 19, 2017 18:13
charmap cant encode character error in python
# write following commands in windows cmd
chcp 65001
set PYTHONIOENCODING=utf-8
# now run your python script
python yourfile.py
@juniorhero
juniorhero / gist:913f7f44d911707a3e906e0a5281306b
Created September 7, 2016 20:36
Edge Detection using Prewitt method
BW2 = edge(I,'Prewitt');
imshow(BW2,'Parent',handles.axes2);
@juniorhero
juniorhero / Rgb2gray error solution
Created September 7, 2016 20:32
Rgb2gray error solution for MAP must be a m x 3 array.
if size(I, 3) > 1
output = rgb2gray(I);
else
output = I;
end
@juniorhero
juniorhero / gist:49e7bfe3a33ade6f301ea1b4d9f22121
Created September 7, 2016 20:19
Edge detection using prewitt
bu=rgb2gray(b);
edge_prewitt = edge(bu,'Prewitt');
imshow(edge_prewitt,'Parent',handles.axes2);
@juniorhero
juniorhero / Black White Image using Threshold
Created September 7, 2016 19:45
Black White Image using Threshold
bu=im2double(b);
threshold=im2bw(bu,0.15);
imshow(threshold,'Parent',handles.axes2);
bu=im2double(b);
heq = histeq(bu);
imshow(heq,'Parent',handles.axes2)
@juniorhero
juniorhero / gist:a371904529a51264a153cf3c015e8c87
Created September 4, 2016 21:18
Read image from Axes in Matlab GUI
im=getimage(handles.axes1);
set(handles.text6,'String','Saved Output');