Getting an image into the octave

In order to load the image into octave, use ‘imread’ function. For example-

>> I = imread('Desktop/a.jpg');
>> imshow(I);

imshow(I) will display the image. You can also use image() instead of imshow().

>> I                // To display image matrix
>> whos I;          // To display basic information about image

It will display the following-
Variable in the current scope:-
Attr Name Size Bytes Class
I 604x604x3 1094448 uint8
Total is 1094448 elements using 1094448 bytes.

New octave is similar to MATLAB. It provides GUI and in workspace you can see the properties of image, you just added.

You can also pass address of the image as an argument to imread function.

>> filename = ('path');
>> A = imread(filename);
>> image(A);

In order to read the meta data of an image, use function imfinfo().

>> info = imfinfo(filename);

This will display the complete data about the image as given below:

scalar structure containing the fields:-
filename = a
FileModDate =
File Size =
etc.

In order to get pixel’s intensity value at any particular point of u and v coordinate, use the following:

>> A(131,154);
ans = 4

That’s all.

Advertisements

Published by

kaurdavinder

I am the one who discover myself daily through reading, writing, interacting with people and expressing my thoughts to inspire them if I would be able to bring a little change to the society through my work. I write blogs, participate in various social activities and want to be a Professional Speaker. Currently, I am pursuing my post graduation in Computer Applications from Guru Nanak Dev Engineering College, Ludhiana and I’m very much active in many technical & social communities.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s