DSP Report Exp 6
DSP Report Exp 6
Theory:
An image may be defined as a two-dimensional: function fxy(), where x and y are spatial
(plane ) , and the amplitude of fat any pair of coordinates is called the intensity of the
image at that point. The term gray level is often used to refer to the intensity of monochrome
images. Color images are formed by a combination of individual images.
For example, in the RGB color system, a color image consists of three individual
monochrome images, referred to as the red (R), green (G), and blue (B) primary (or
component) images. F01• this reason, many of the techniques developed for monochrome
images can be extended to color images by processing the three component images
individually. An image may be continuous with respect to the x- and y-coordinates and in
amplitude. Converting such an image to digital form requires that the coordinates, as well
as the amplitude, be digitized. Digitizing the coordinate values is called sampling;
digitizing the amplitude values is called quantization. Thus, when x, y and the amplitude
values of fare are all finite, discrete quantities, we call the image a digital image.
Coordinate Conventions:
The result of sampling and quantization is a matrix of real numbers. We use two principal
ways in this book to represent digital images. Assume that an image f-.\C) is sampled so that
the resulting image has M rows and N columns. We say that the image is of size MN*. The
values of the coordinates are discrete quantities. For notational clarity and convenience, we
use integer values for these discrete coordinates. In many image processing books, the
image origin is defined to be at (,)(,)xy=00. The next coordinate values along the first row
of the image are (,)(,)xy=01. The notation (,)01 is used to signify the second sample along
the first row. It does not mean that these were the actual values of physical coordinate_
when the image was sampled.
Images as Matrices:
The coordinate system and the preceding lead to the following representation for a digitized
image:
The right side of this equation is a digital image by definition. Each element of this array is called an
Image element, picture element, pixel, or pel. The term image and pixel are used throughout the rest of
discussions to denote a digital image and its elements.
#include <stdio.11>
#include <math.h>
#include "image.h"
int 12[256][256]:
int 13[256][256];
int b=50;
int main(void) {
int i,j;
//brightness for(j=0;i<255;i+
+){
for(j=0;j<255;j++):
12[i][j]=II[i][j]+b;
if(l2[i][j]>255) (
I2[i][j]=255;
}
//darkness for(i=0;i<255;i++)
{
for(j=0;·· 55;j++){
I3[i][i]=Il [i][j]-b:
if(l2[i][j]<0)
12[i][j]=0;
}
}
Return 0;
INPUT:-
Darker
Brighter
Procedure:
1.) Connect the TMS320C6748 DSP processor to the system with the required wires.
2.) Create a new CCS project, for creating a new project (File > New > CCS project)
3.) Select Processor type TMS320C6748 and then select "Empty Project(main.c)" and then click on the finish
option.
4.) Main.c file opens, and here need to write the code for the addition operation.
5.) Next, to get the output from the code, we need to first debug the code by clicking on the debug option after
debugging, we need to build the project as the last step.
6.) After we finish building the project then, we need to run the project to get the final output of the program.
7.) Output answers will be displayed in the console window.
Result:
Image result for desired contrast after getting the image coefficients on
MATLAB.
B)
Aim: To perform the enhancement of image contrast using ccs and dsp processo
The ory:
For example, in the RGB color system, a color image consists of three individual
monochrome images, referred to as the red (R), green (G), and blue (8) primary (or
component) images. For this reason, many of the techniques developed for monochrome
images can be extended to color images by processing the three component images
individually. An image may be continuoL1s with respect to the x- and y-coordinates and also
in amplitude. Conve1iing such an image to digital fom1 requires that the coordinates, as
well as the amplitude, be digitized. Digitizing the coordinate values is called sampling;
digitizing the amplitude values is called quantization. Thus, when x, y and the amplitude
values of fare are all finite, discrete quantities, we call the image a digital image.
Coordinate Conventions:
The result of sampling mid quantization is a matrix of real numbers. We use two principal
ways in this book to represent digital images. Assume that an image fxv() is sampled so that
the resulting image has M rows and N columns. We say that the image is of size MN*. The
values of the coordinates are discrete quantities. For notational clarity and convenience, we
use integer values for these discrete coordinates. In many image processing books, the
image origin is defined to be at (,)(,)xy=00. The next coordinate values along the first row
of the image are (,)(,)xy=01. The notation (,)01 is used to signify the second-- sample along
the first row. It does not mean that these were the actual values of physical coordinates
when the image was sampled.
Images as Matrices:
INPUT:
OUTPUT:
Low Contrast
High Contrast
The right side of the equation is a digital image. Enhancement of this array is called an
Image element , picture element, pixel, or pel.
#include <stdio.h>
#include <math.h>
#include "image.h"
int 12[256][256];
for(j=0;j<255;j++)
12[i][j]=(m*11[i][j])+b;
if(12[i][j]>255)
//contrast low
b=0;
m=0.8;
b=(1/2)*(1-m):
for(i=0;i<255;i++) {
for(j=0;j<255;j++){
13[b][j]=(m*11[b][j])+b;
if(13[i][j]>255)
13[i][j]=255;
if(13[1][j]<0)
13[i][j]=0; }} return 0;
'
Procedure:
1.) Connect the TMS320C6748 DSP processor to the system with the required
wires.
2.) Create a new CCS project, for creating a new project (File > New > CCS project)
3.) Select Processor type TMS320C6748 and then select "Empty Project(main.c)" and then click on the
finish option.
4.) Main.c file opens, and here need to write the code for the addition operation.
5.) Next, to get the output from the code, we need to first debug the code by clicking on the debug
option after debugging, we need to build the project as the last step.
6.) After we finish building the project then, we need to run the project to get the final output of the
program.
7.) Output answers will be displayed in the console window.
Result:
Image results for desired contrast after getting the image coefficients on MATLAB.
•.