Showing posts with label IP. Show all posts
Showing posts with label IP. Show all posts

MATLAB code to crop the portion of the image without using built in function.

The program have perform crop operation without in built functions.Without in-built function,the work is not easy.There are more function to use.

The below steps to perform the crop operations:
    1. first identify location which we needs to remove.
    2. Then tack the picture information from the starts points.
    3. Then move the row and tack value.
    4. draw images.


CODE:
clear all;
close all;
clc;

a=imread('cameraman.tif');
x=0;
y=0;
for n=95:130
    x=x+1;
    y=0;
    for m=38:73
        y=y+1;
        b(y,x)=a(m,n);
    end
end

MATLAB code to hide the information of the part of the image.

 The below program describe the image parts hides.The parts that are needs to remove from the images.We need to first the location of the image.The program parts have a location such a (45,100) to (85,130) location.

The location of the image is 2D. We need to two loop to content retrieve and update each pictures.The location are described the information in images.
There are below steps to describe the program.
First step to read the image
Second step to retrieve each pixel information.
Third is identify parts location that is remove.
Assign each pixel value as 0.
Show the images.


CODE:
clear all;
close all;
clc;
a=imread('cameraman.tif');
for m=45:85
    for n=100:130
        a(m,n)=0;
    end
end


imshow(a);

Introduction to MATLAB with basic command

Furthermore, MATLAB is a modern programming language environment: it has sophisticated data structures, contains built-in editing and debugging tools, and supports object-oriented programming.
 These factors make MATLAB an excellent tool for teaching and research. MATLAB has many advantages compared to conventional computer languages (e.g., C, FORTRAN) for solving technical problems. MATLABis an interactive system whose basic data element is an array that does not require dimensioning.

 The software package has been commercially available since 1984 and is now considered as a standard tool at most universities and industries worldwide. It has powerful built-in routines that enable a very wide variety of computations. It also has easy to use graphics commands that make the visualization of results immediately available.

 Specific applications are collected in packages referred to as toolbox. There are toolboxes for signal processing, symbolic computation, control theory, simulation, optimiza- tion, and several other fields of applied science and engineering. I

For an introduction on Matlab we strongly recommend the student to read the system’s on-line help, particularly the sections MATLAB and subsections Development Environment, Mathematics, Programming and Data Types, and for information about Matlab’s graphical resources, the student should read the subsections Graphics, 3-D Visualization and Creating Graphical User Interfaces.
  1. For an introduction on Matlab’s image processing functions we recommend the exercises on this list as well as the reading of the section Image Processing Toolbox and of the subsections Getting Started, Introduction and Displaying and Printing Images of the on-line help.
 Basic command:
imread
Read image from graphics file
Syntax
A = imread(filename, fmt)
[X, map] = imread(...)
[...] = imread(filename)

[...] = imread(URL,...)
[...] = imread(...,Param1,Val1,Param2,Val2...)

The return value A is an array containing the image data. If the file contains a grayscale image, A is an M-by-N array. If the file contains a truecolor image, A is an M-by-N-by-3 array. For TIFF files containing color images that use the CMYK color space, A is an M-by-N-by-4 array. See TIFF in the Format-Specific Information section for more information.

Imshow:-
Display image
Syntax
  • imshow(I)
    • imshow(I,RI)
    •  imshow(X,map)
    • imshow(X,RX,map)
    • imshow(filename)
    •  imshow(___,Name,Value...)
    • imshow(gpuarrayIM,___)
    •  imshow(I,[low high])
    •  himage = imshow(__)
    • imshow(I,RI) displays the image I with associated 2-D spatial referencing object RI.
      imshow(I) displays the image I in a Handle Graphics® figure, where I is a grayscale, RGB (truecolor), or binary image. For binary images, imshow displays pixels with the value 0 (zero) as black and 1 as white.
    • imshow(X,RX,map) displays the indexed image X with associated 2-D spatial referencing object RX and colormap MAP.