Wednesday 22 January 2020

Digital Image Processing



Syllabus :: Digital Image Processing (RCS-082)

Unit I 





Advance Study in DIP


Recent Trends in Digital Image Processing

Notes on Color Pattern (RGB, CMY, HSI)


Sample Paper Quiz Image Processing RCS082
















Previous Year Question Paper:
  1. DIGITAL-IMAGE-PROCESSING-NCS-801 2018_19
  2. DIGITAL-IMAGE-PROCESSING-NCS801 2017_18
  3. DIGITAL-IMAGE-PROCESSING-NCS801 2016_17



-----------------------------------------------------------------------------------------------

Image Segment by Morphological Algorithm Image Processing Unit 4 Part 1


-----------------------------------------------------------------------------------------------

Hoge Detection Image Processing Unit 4 Part 2


-----------------------------------------------------------------------------------------------

Image Segment by Morphological Algorithm: Image Processing Unit 4 Part 3


-----------------------------------------------------------------------------------------------

Image Segment by Dam Construction: Image Processing Unit 4 Part 4

-----------------------------------------------------------------------------------------------



Quiz 1


1. To convert a continuous sensed data into Digital form, which of the following is required?
a) Sampling
b) Quantization
c) Both Sampling and Quantization
d) Neither Sampling nor Quantization
Answer (c)

2. To convert a continuous image f(x, y) to digital form, we have to sample the function in __________
a) Coordinates
b) Amplitude`
c) All of the mentioned
d) None of the mentioned
Answer (c)

3. The quality of a digital image is well determined by ___________
a) The number of samples
b) The discrete gray levels
c) All of the mentioned
d) None of the mentioned
Answer (c)

4. A continuous image is digitised at _______ points.
a) random
b) vertex
c) contour
d) sampling
Answer (d)

5. What is the first and foremost step in Image Processing?
a) Image restoration
b) Image enhancement
c) Image acquisition
d) Segmentation
Answer (c)

6. How many number of steps are involved in image processing?
a) 10
b) 9
c) 11
d) 12
Answer (a)

Quiz 2

1. How is array operation carried out involving one or more images?
a) array by array
b) pixel by pixel
c) column by column
d) row by row
Answer: b

2. Enhancement of differences between images is based on the principle of ____________
a) Additivity
b) Homogeneity
c) Subtraction
d) None of the Mentioned
Answer: c

3. If every element of a set A is also an element of a set B, then A is said to be a _________ of set B.
a) Disjoint set
b) Union
c) Subset
d) Complement set
Answer: c

4. Image processing approaches operating directly on pixels of input image work directly in ____________
a) Transform domain
b) Spatial domain
c) Inverse transformation
d) None of the Mentioned
Answer: b

5. Which expression is obtained by performing the negative transformation on the negative of an image with gray

levels in the range[0,L-1] ?
a) s=L+1-r
b) s=L+1+r
c) s=L-1-r
d) s=L-1+r
Answer: c

6. In contrast stretching, if r1=s1 and r2=s2 then which of the following is true?
a) The transformation is not a linear function that produces no changes in gray levels
b) The transformation is a linear function that produces no changes in gray levels
c) The transformation is a linear function that produces changes in gray levels
d) The transformation is not a linear function that produces changes in gray levels
Answer: b



7. In which type of slicing, highlighting a specific range of gray levels in an image often is desired?
a) Gray-level slicing
b) Bit-plane slicing
c) Contrast stretching
d) Byte-level slicing
Answer: a

8. The principal factor to determine the spatial resolution of an image is _______
a) Quantization
b) Sampling
c) Contrast
d) Dynamic range
Answer: b

9. What is the name of the effect caused by the use of an insufficient number of gray levels in smooth areas of a

digital image?
a) Dynamic range
b) Ridging
c) Graininess
d) False contouring
Answer: d

10. What does a shift up and right in the curves of isopreference curve simply means? Verify in terms of N

(number of pixels) and k (L=2k, L is the gray level) values.
a) Smaller values for N and k, implies a better picture quality
b) Larger values for N and k, implies low picture quality
c) Larger values for N and k, implies better picture quality
d) Smaller values for N and k, implies low picture quality
Answer: c




Quiz-3

1. Color model is also named as (another name):
a) Color space
b) Color gap
c) Color space & color system
d) Color system

Answer: c

2. What do you mean by the term pixel depth?
a) It is the number of bits used to represent each pixel in RGB space
b) It is the number of bytes used to represent each pixel in RGB space
c) It is the number of units used to represent each pixel in RGB space
d) It is the number of mm used to represent each pixel in RGB space

Answer: a

3. How many bit RGB color image is represented by full-color image?
a) 32-bit RGB color image
b) 24-bit RGB color image
c) 16-bit RGB color image
d) 8-bit RGB color image

Answer: b

4. What is the equation used to obtain S component of each RGB pixel in RGB color format?
a) S=1+3/(R+G+B) [min⁡(R,G,B)].
b) S=1+3/(R+G+B) [max⁡(R,G,B)].
c) S=1-3/(R+G+B) [max⁡(R,G,B)].
d) S=1-3/(R+G+B) [min⁡(R,G,B)].

Answer: d

5. What is the equation used to obtain I(Intensity) component of each RGB pixel in RGB color format?
a) I=1/2(R+G+B)
b) I=1/3(R+G+B)
c) I=1/3(R-G-B)
d) I=1/3(R-G+B)
Answer: b 
6. What is the equation used for calculating B value in terms of HSI components?
a) B=I(1+S)
b) B=S(1-I)
c) B=S(1+I)
d) B=I(1-S)
Answer: d
7. Which of the following color models are used for color printing?
a) RGB
b) CMY
c) CMYK
d) CMY and CMYK
Answer: d
8. What does the total number of pixels in the region defines?
a) Perimeter
b) Area
c) Intensity
d) Brightness
Answer: b
9. What is the unit of compactness of a region?
a) Meter
b) Meter2
c) No units
d) Meter-1
Answer: c
10.  Which of the following measures are not used to describe a region?
a) Mean and median of grey values
b) Minimum and maximum of grey values
c) Number of pixels alone
d) Number of pixels above and below mean
Answer: c



Monday 20 January 2020

Computer Graphics


Subject Name: Computer Graphics                                                           


About Subject: This subject emphasized on working process of graphics and animation on digital platform. Human eyes perceive the object in 3D format but digital screen portrait in 2 dimensional. How pixels work and projected on screen to draw a picture or image. Here, handwritten notes, previous year question papers, assignment, tutorials and programming illustrated.

The following will help one to gain the credential of this subject: 

Subject Name: Computer Graphics                                                           
------------------------------------------------------------------------------------------------------------------
Subject Code: RCS-603                                                            Syllabus: Click Here
------------------------------------------------------------------------------------------------------------------
Course File: Computer Graphics Theory Handbook
------------------------------------------------------------------------------------------------------------------
Course File: Computer Graphics Lab Handbook
------------------------------------------------------------------------------------------------------------------
University Name: Dr. APJ Abdul Kalam Technical University (AKTU, Lucknow)
-------------------------------------------------------------------------------------------------------------------
College Name: Shri Ram Murti Smarak College Of Engineering, Technology & Research                                    Bareilly
------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------
Facebook Link: https://www.facebook.com/sachin36500081

------------------------------------------------------------------------------------------------------------------
Assignment 2 Last Date September 28, 2020 Assignment 1




1.

Mathematics for Computer Graphics

Download E-Book

2.

Fundamental of Computer Graphics

Download E-Book

3.

Introduction to Computer Graphics

Download E-Book

4.

Computer Graphics and Multimedia

Download E-Book

5.

Computer Graphics

Download E-Book



Unit 1



                                                                                                     

Tutorial 2 Solution











COMPUTER GRAPHICS AND SUBJECT CODE: KCS053

Max. Marks: 50 Time:                                                                                   2:00Hrs.

All questions are compulsory. 

 

Solutions

  • Distinguish between window port and viewport?

A portion of a picture that is to be presented by a window is known as Window port.

The display method of the part selected or the design in which the selected element is viewed is called a viewport.

  • 1.       What are the Spline curves?

The name spline is a flexible strip used to generate a smooth curve through a designated set of points. In computer Graphics, the name spline curves define to any combined curve create with polynomial portions fulfilling specified continuity methods at the edge of the pieces.

 

2.       What does it mean by RGB?

RGB is a color model; it is an additive color image in which red, green, and blue lights are added composed in various methods to reproduce a broad display of colors. The term of the model comes from the labels of the three additive primary colors, red, green, and blue. The main objective of the RGB color model is for the sensing, defining and display of pictures in electronic systems, such as televisions and computers, though it has also been utilizing in conventional photography.

 

  • 3.       What are the advantages of laser printers?

·         Large speed, precision, and economy.

·         Low-cost to maintain.

·         Quality printers.

·         Lasts for high time.

·         Toner power is very in-expensive.

 

  • 4.       Define Random and Raster scan displays?

Answer- Random scan is a method in which display is made by electronic beam, which is directed only to the points or parts of the screen where picture is to be drawn.

·         The Raster scan system is a scanning technique in which the electron sweep from top to bottom and from left to right.

·         The intensity is turned on or off to light and un-light the pixel.

 


 

5.       What Is Ant Aliasing?

 

Answer : The process of adjusting intensities of the pixels along the line to minimize the effect of aliasing is called ant aliasing.

 

6.       Write The Important Applications Of Computer Graphic?

 

Answer : Following are the applications of computer graphic

a.       computer graphics is used in the field of computer aided design.

b.      It is used to produce illustrations for reports or to generate slide for with projections.

c.       Computer graphic methods are widely used in both fine are and commercial are applications.

d.      The artist uses a combination of 3D modeling packages, texture mapping, drawing programs and CAD software.

e.      In the field of entertainment CG methods are now commonly used in making motion pictures. music videos and television shows.

f.        Computer-generated models of physical, financial and economic systems are often used as educational aids.

 

7.       What Are The Hardware Devices Used For Computer Graphics?

 

Answer : The hardware devices used for the computer graphics are

Input Devices: Keyboard, Mouse, Data tablet, Scanner, Light pen, Touch screen, Joystick

Output Devices: Raster Devices- CRT, LCD, LED, Plasma screens, Printers,Vector Devices- Plotters, Oscilloscopes

 

8.       Write down the DDA Algorithm with suitable steps to draw a line from (2,3) to (12,8).

Answer:

 


9.       Draw a circle using Bresenham’s Circle Agorithm for r=10.

Answer:


 

10.   Find the clipping cordinates for a line p1p2 where p1=(10,10) and p2=(60,30), against window with (xmin,ymin)=(15,15) and (xmax,ymax)=(25,25) using Liang and Bersky Line clipping algorithm.

Answer:

 



11.   A point (4,3) is rotated counterclockwise by an angle 45 degree. Find the rotation matrix and the resultant point.

 

 


12.   Derive the equation for rotation in two dimensional.


  

 

 

 

13.   Explain basic three transformation in 3D.


14.   Basic steps in Computer Graphics.





Computer Graphics Lab

·         graphicsDriver : It is a pointer to an integer specifying the graphics driver to be used. It tells the compiler that what graphics driver to use or to automatically detect the drive. In all our programs we will use DETECT macro of graphics.h library that instruct compiler for auto detection of graphics driver.
graphicsMode : It is a pointer to an integer that specifies the graphics mode to be used. If *gdriver is set to DETECT, then initgraph sets *gmode to the highest resolution available for the detected driver.
driverDirectoryPath : It specifies the directory path where graphics driver files (BGI files) are located. If directory path is not provided, then it will search for driver files in current working directory directory. In all our sample graphics programs, you have to change path of BGI directory accordingly where you Turbo C++ compiler is installed.

-------------------------------------------------------------

Program 1. C Implementation for DDA Line drawing algorithm. Download Code 
-------------------------------------------------------------
Program 13.a C Implementation for draw lines

// C++ Implementation for drawing line 

#include  

  

// driver code 

int main() 


    // gm is Graphics mode which is a computer display 
    // mode that generates image using pixels. 
    // DETECT is a macro defined in "graphics.h" header file 
    int gd = DETECT, gm; 
  
    // initgraph initializes the graphics system 
    // by loading a graphics driver from disk 
    initgraph(&gd, &gm, "c:\\tc\\bgi"); 
  
    // line for x1, y1, x2, y2 
    line(150, 150, 450, 150); 
  
    // line for x1, y1, x2, y2 
    line(150, 200, 450, 200); 
  
    // line for x1, y1, x2, y2 
    line(150, 250, 450, 250); 
  
    getch(); 
  
    // closegraph function closes the graphics 
    // mode and deallocates all memory allocated 
    // by graphics system . 
    closegraph(); 

--------------------------------------------------------------
Program 13.b C Implementation for drawing circle 
#include
#include
#include

//driver code
int main()
{
 // gm is Graphics mode which is
 // a computer display mode that
 // generates image using pixels.
 // DETECT is a macro defined in
 // "graphics.h" header file
 int gd = DETECT, gm;

 // initgraph initializes the
 // graphics system by loading a
 // graphics driver from disk
 initgraph(&gd, &gm, "c:\\tc\\bgi");

 // circle function
 circle(250, 200, 50);

 getch();

 // closegraph function closes the
 // graphics mode and deallocates
 // all memory allocated by
 // graphics system .
 closegraph();

 return 0;
}

---------------------------------------------------------------------------------

Program 13.c Draw a rectangle, circle, bar, line and ellipse.
#include
#include
#include
main()
{
   int gd = DETECT,gm,left=100,top=100,right=200,bottom=200,x= 300,y=150,radius=50;

   initgraph(&gd, &gm, "C:\\TC\\BGI");

   rectangle(left, top, right, bottom);
   circle(x, y, radius);
   bar(left + 300, top, right + 300, bottom);
   line(left - 10, top + 150, left + 410, top + 150);
   ellipse(x, y + 200, 0, 360, 100, 50);
   outtextxy(left + 100, top + 325, "My first C graphics program");

   getch();
   closegraph();
   return 0;
}


--------------------------------------------------------------------------------

Program 13.d Draw a rectangle, circle

//Include the graphics header file
#include
#include
#include

void main()
{
   //Initialize the variables for the graphics driver and mode
   int gd = DETECT, gm;
   clrscr();
   initgraph(&gd, &gm, "C:\\TURBOC3\\BGI");

   //Set the color of the object you want to draw.
   setcolor(BLUE);

   //Draw an object. For this example,drawing a rectangle using the rectangle function
   rectangle(50,50,100,100);

   getch();

   //unloads the graphics drivers
   closegraph();
}

-------------------------------------------------------------------------------

Program 14.a Draw a hut using Computer Graphics header file.
# include
# include
# include
# include

 void main()
 {
  int gd=DETECT,gm;
  initgraph(&gd,&gm,"");
  rectangle(200,170,450,420);
  line(200,170,170,170);
  line(450,170,480,170);
  line(170,170,220,100);
  line(480,170,420,100);
  line(420,100,220,100);
  rectangle(280,420,360,280);
  rectangle();
  getch();
 }

--------------------------------------------------------------------------------------

 Program 14.b. Text from left to right.
# include


            void main()
             {
                        int gd=DETECT,gm,i;
                        initgraph(&gd,&gm,"");
                        settextstyle(2,0,7);
                        for(i=0;i                       {
                                    outtextxy(i,80,"HI I m here ");
                                    delay(50);
                                    cleardevice();
                        }
                        getch();
             }
----------------------------------------------------------------------------------------

 Program 14.c. Triangle with different colors with delay time.
# include

            void main()
            {
                        int gd=DETECT,gm,i=0;
                        initgraph(&gd,&gm,"C:\\TC\\BGI");

                   for(i=1;i           { setcolor(i);
                   line(20,100,50,50);
                        line(50,50,80,100);
                        line(80,100,20,100);
                                    delay(2000);
                                    cleardevice();
                        }

                        getch();
                         closegraph();

            }

-----------------------------------------------------------------------------------------
Program 15.a. Balloon flying from bottom to up.
void main()
            {
                        int gd=DETECT,gm,i,ymax,ymin;
                        initgraph(&gd,&gm,"");
                        for(ymax=getmaxy();ymax>=0;ymax--)
                        {
                                    delay(30);
                                    cleardevice();
                                    line(320,ymax,320,ymax-100);
                                    setfillstyle(11,CYAN);
                                    fillellipse(320,ymax-150,25,50);
                        }
                        getch();
            }

-----------------------------------------------------------------------------------------
Program 15.b. Font Size for different text.
void main()
            {
                        int gd=DETECT,gm,i,ymax,ymin;
                        initgraph(&gd,&gm,"");
                        for(ymax=getmaxy();ymax>=0;ymax--)
                        {
                                    delay(30);
                                    cleardevice();
                                    line(320,ymax,320,ymax-100);
                                    setfillstyle(11,CYAN);
                                    fillellipse(320,ymax-150,25,50);
                        }
                        getch();
            }



Quiz -1

1. The number of pixels stored in the frame buffer of a graphics system is known as
a) Resolution
b) Depth
c) Resalution
d) Only a

Answer: a)

2. In graphical system, the array of pixels in the picture are stored in
a) Memory
b) Frame buffer
c) Processor
d) All of the mentioned

Answer: a
Explanation: Frame buffer is mainly used to store pixels.

3. Heat supplied to the cathode by directing a current through a coil of wire is called
a) Electron gun
b) Electron beam
c) Filament
d) Anode and cathode

Answer: c
Explanation: In CRT the filament is responsible for supply of power.

4. The process of digitizing a given picture definition into a set of pixel-intensity for storage in the frame buffer is 

called
a) Rasterization
b) Encoding
c) Scan conversion
d) True color system

Answer: c
Explanation: The digitization process is called scan conversion.

5. In LCD, the refresh rate of the screen is
a) 60 frames/sec
b) 80 frames/sec
c) 30 frames/sec
d) 100 frames/sec

Answer: a

6. The primary output device in a graphics system is_________
a) Scanner
b) Video monitor
c) Neither a nor b
d) Printer
Answer: b
                                                                                
                                                                               Quiz -2

1. A translation is applied to an object by
a) Repositioning it along with straight line path
b) Repositioning it along with circular path
c) Only b
d) All of the mentioned
Answer: a

2. The translation distances (dx, dy) is called as
a) Translation vector
b) Shift vector
c) Both a and b
d) Neither a nor b
Answer: c

3. _________ is a rigid body transformation that moves objects without deformation.
a) Rotation
b) Scaling
c) Translation
d) All of the mentioned
Answer: c

4. To change the position of a circle or ellipse we translate
a) Center coordinates
b) Center coordinates and redraw the figure in new location
c) Outline coordinates
d) All of the mentioned
Answer: b

5. The basic geometric transformations are
a) Translation
b) Rotation
c) Scaling
d) All of the mentioned
Answer: d

6. What is the primary use of clipping in computer graphics?
a) adding graphics
b) removing objects and lines
c) zooming
d) copying
Answer: b

7. A bitmap is collection of ___________________ that describes an image.
a) bits
b) colors
c) algorithms
d) pixels
Answer: d

8. In line clipping, the portion of line which is _____________ of window is cut and the portion that is _____________ the window is kept.
a) outside, inside
b) inside, outside
c) exact copy, different
d) different, an exact copy
Answer: a

9. The process of removal of hidden surfaces is termed as _______________
a) clipping
b) copying
c) culling
d) shorting
Answer: c

10. To generate a rotation , we must specify
a) Rotation angle Ï´
b) Distances dx and dy
c) Rotation distance
d) All of the mentioned
Answer: a

Quiz 3

1. Which of the following is the basic attribute of a character?
a) Font
b) Size and color
c) Orientation
d) All of the mentioned
Answer: d

2. When a character string is to be displayed, the which color is used to set the pixel value in frame buffer?
a) White color
b) Current color
c) Black color
d) Any color
Answer: b

3. The Character size is specified by
a) Printers
b) Compositors
c) Frame buffer
d) Both a and b
Answer: d

4. __________ is a single character that can be displayed in different colors and in different sizes.
a) String
b) Marker symbol
c) Only a
d) Symbols
Answer: b

5. Which of the following is a video editing tool that produces an animated text which can be inserted into video streams?
a) Character generator
b) Title generator
c) Video generator
d) Animation generator
Answer: a

6. Which method of character generation is also called Dot-matrix method?
a) Stroke method
b) Bitmap method
c) Starbust method
d) There isn’t that type of method
Answer: b

7. A translation is applied to an object by
a) Repositioning it along with straight line path
b) Repositioning it along with circular path
c) Only b
d) All of the mentioned
Answer: a

8. We translate a two-dimensional point by adding
a) Translation distances
b) Translation difference
c) X and Y
d) Only a
Answer: d

9. The translation distances (dx, dy) is called as
a) Translation vector
b) Shift vector
c) Both a and b
d) Neither a nor b
Answer: c

10. To change the position of a circle or ellipse we translate
a) Center coordinates
b) Center coordinates and redraw the figure in new location
c) Outline coordinates
d) All of the mentioned
Answer: b

Quiz-4

1. Cohen-Sutherland clipping is an example of _________________
a) polygon clipping
b) text clipping
c) line clipping
d) curve clipping

Answer: c

2. The Cohen-Sutherland algorithm divides the region into _____ number of spaces.
a) 8
b) 6
c) 7
d) 9

Answer: d

3. An outcode can have ____ bits for two-dimensional clipping and ____ bits for three-dimensional clipping.
a) 4,6
b) 6,8
c) 2,4
d) 1,3

Answer: a

4. The centre region of the screen and the window can be represented as________
a) 0000
b) 1111
c) 0110
d) 1001

Answer: a

5. If both codes are 0000, (bitwise OR of the codes yields 0000) line lies __________________ the window.
a) completely outside
b) half inside half outside
c) completely inside
d) can’t say anything

Answer: c

6. The 4-bit code of top-left region of the window is ____________
a) 1001
b) 1100
c) 0101
d) 1010

Answer: a

7. The logical ______ of the endpoint codes determines if the line is completely inside the window.
a) AND
b) OR
c) NOT
d) NOR

Answer: b

8. Liang–Barsky algorithm is a __________ clipping algorithm.
a) circle
b) text
c) line
d) pixel

Answer: c

9. The ideas of the Liang-Barsky algorithm are the same with which algorithm?
a) Cyrus Beck algorithm
b) Liam-Chopsky algorithm
c) Cohen Sutherland algorithm
d) All have the same

Answer: a

10. This algorithm uses the ____________ equations for a line and solves four inequalities.
a) linear
b) quadratic
c) cubic
d) parametric

Answer: d

GATE Notes

Intro to Soft Computing Objective Questions

  Question Statement         Solution with step wise marking "Select a 4-input neuron weighs 1, 2, 3, 4. The transfer function here...