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 / Dynamic-form-dynamic-combo-box-without-reload.txt
Last active August 26, 2016 20:11
Dynamic Form that changes Combo-box value based on value on another Combo-box without reload
/*
Dynamic Form that changes Combo-box value based on value on another Combo-box without reload
Original Code By ATHUL JAYARAM
athuljayaram@gmail.com
*/
<p>
<div id="label" style="width: 140px; text-align: right; display: inline-block;">NAME: </div>
<input name="firstname" type="text" id="firstname" placeholder="First" size="15" />
@juniorhero
juniorhero / batch-resize-image-matlab
Last active August 26, 2016 20:12
Matlab Batch Resize Image
% Original Code By ATHUL JAYARAM
% athuljayaram@gmail.com
function imout = myimfcn(im)
% IM - input image.
% IMOUT - output image.
a=imread('Jellyfish.jpg');
figure,imshow(a)
R=a(:,:,1);
G=a(:,:,2);
B=a(:,:,3);
% figure,imshow(R)
%figure,imshow(G)
% figure,imshow(B)
subplot(2,2,1)
imshow(a)
@juniorhero
juniorhero / matlab-code-log-transformations
Created August 26, 2016 20:17
matlab code log transformations
a=imread('Penguins.jpg')
subplot(2,2,1)
imshow(a);
title 'Original Image'
b=im2double(a)
s=(1*log(1+b))*256;
s1=uint8(s)
subplot(2,2,2)
imshow(s1);
title 'c=1'
@juniorhero
juniorhero / matlab code gamma transformations
Created August 26, 2016 20:20
matlab code gamma transformations
a=imread('Penguins.jpg');
subplot(2,2,1);
imshow(a);
title 'Original Image';
b=im2double(a);
a1=input('enter value a');
ga1=input('enter value gamma');
s=(a1*(b.^ga1))*256;
s1=uint8(s);
a=imread('lena.png');
subplot(2,2,1);
imshow(a);
[M,N]=size(a);
title 'Original Image';
r1=input('enter value r1: ');
r2=input('enter value r2: ');
for i=1:1:M
for j=1:1:N
if a(i,j)>=r1 && a(i,j)<=r2
@juniorhero
juniorhero / matlab negative of image
Created August 26, 2016 20:22
matlab negative of image
a=imread('Koala.jpg');
b=255-a
subplot(1,2,1)
imshow(a)
title 'Original Image'
subplot(1,2,2)
imshow(b)
title 'Negative Image'
% code by juniorhero to show image in axes in gui
axes(handles.axes2);
imshow('D:\maj proj\samples\Lenna.png')
@juniorhero
juniorhero / gist:94f55a18f76da3001cfcd065afc607ba
Created August 27, 2016 18:39
Matlab GUI Button Press Fetches Image url and Show Image
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
handles.output = hObject;
[fn pn] = uigetfile('*.png','select png file');
complete = strcat(pn,fn);
set(handles.edit1,'string',complete);
I = imread(complete);
imshow(I,[]);
@juniorhero
juniorhero / gist:445fd369af3a79560f839b230950cae5
Created August 27, 2016 19:58
Select Files with Specific File Types using Dialog Box in Matlab GUI
function pushbutton2_Callback(hObject, eventdata, handles)
% above line of code is default line ofcode for button
% an example to open image files only
% when button is clicked, a dialog box appears to select the file
handles.output = hObject;
[fn pn] = uigetfile( {
'*.png;*.jpg;*.jpeg;*.gif','Image Files (*.png, *.jpg, *.jpeg, *.gif)'; ...