Pages

Tuesday, January 28, 2014

Image blocks toggling

need a cool program in matlab? Here is it..

A GUI with an image, but really a set of toggle buttons. Press each button and the image block changes.

There are plenty of ways to play with this.

About the Program:
- its about displaying an image on a toggle button
- don't forget to re-size your images to same size

Now, how about increasing the number of toggle buttons and changing between a set of images?

Monday, January 20, 2014

Programming....

What is programming? Its not just adding keywords or arranging them. Its creative. Everybody has and must have their own style and way with it. Its okay to copy down someone else's program from sites like MATLAB Central or the others but they must be understood and converted to your own style and make them yours.

Here is a code just for fun but may be useful to you somewhere (I used it in a GUI)

clc;clear all;close all;

% creating a colored plane image programatically

disp('Create a plane image of any color');
disp('Enter R,G,B plane values - between 0-255');
R = input('Enter RED plane value\n');
G = input('Enter GREEN plane value\n');
B = input('Enter BLUE plane value\n');

a = ones([500 500 3]);

new = a;
for plane = 1:3
    for i = 1:size(a,1)
        for j= 1:size(a,2)
            if plane == 1
                new(i,j,plane) = R;
            elseif plane == 2
                new(i,j,plane) = G;
            elseif plane == 3
                new(i,j,plane) = B;
            end
        end
    end
end
new = uint8(new);
figure;imshow(new);
whos new

In GUI: 

axes(handles.axes1);imshow(new);

axes(handles.axes2);imshow(new);

Initialize axes to the same color as the body of the GUI.

Sunday, January 19, 2014

Awesome Programming

Welcome to MatLab Programming!

Images are great, they convey a lot to us. Each image is unique and create different impressions on us. There may be a limit to words, but there is no limit to images. Even memories remain with us as images. The art of programming for image processing is thus awesome..