Question
The task is to write a simple stand-alone program that converts the loaded source image in the negative one. Source image is located in the
The task is to write a simple stand-alone program that converts the loaded source image in the negative one. Source image is located in the file cameraman.tif. It is a monochrome image of size 256 x 256 points. The degrees of gray image points are coded using integers in the range [0, 225]. The number 0 means black, while the number 255, white.
Image transformation algorithm is given as follows:
Read the source image file cameraman.tif and save it in the array X
Display the read source image.
Determine the input image size
Declare an array to record output image
- Calculate the gray value for the output image points (negative) Y using given relation
y( i, j ) = 255 - x( i, j )
Display the output and input images, and their histograms.
The result of the program should be such as shown on Figure below.
1000 500 0 0 100 200 1000 500 0 o 100 200
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started