C program to be changed
$10-30 USD
Pago na entrega
Description : You need to implement a program to generate a color histogram for each input image, and compute a color histogram difference between two input images.
o Input : The following values from keyboard.
First input image file name (square size, and .ppm format (P6)).
Second input image file name (square size - same size as the first image,
and .ppm format).
Histogram size factor value (2, 4, 8, or 16).
2 means (2x2x2), 4 means (4x4x4), 8 means (8x8x8), and 16 means (16x16x16). o Your program needs to do the following basically:
Get input values above.
Perform ‘ReadPPM’ for two input images.
Initialize all bin values of two histograms as 0.
Get each pixel value from the first input image, compute its proper bin
location, and increase the bin count, and get each pixel value from the second
input image, compute its proper bin location, and increase the bin count.
Compute a difference between two histograms using the following equation
(Chi-square Test), where M = Histogram size such as 8(=2x2x2), 64(=4x4x4), 512(=8x8x8), or 4096(=16x16x16), and n = Total number of pixels in two input images (i.e., total number of pixels in the first image + total number of pixels in the second image.)
o Output : The followings need to be displayed in the screen as output.
Total number of pixels in two input images (n),
Histogram size (M), and
Value of Chi-square Test, which is a result of the above equation. It needs to be
rounded to three decimal places.
Programming Language : You should use C and the related files provided.
Submission :
o You only need to submit C file that you implement. If your last name is ‘abcdefghi’, then the C file name should be abcde4.c, which is the first 5 letters of your last name combined with the number 4.
o In the beginning of your C file, you need to provide Assignment #, your name, which compiler (i.e., Tiny C, or Visual Studio, ...) used, and other comments using /* ... */.
Grading :
o If your C file is not compiled by either Tiny C or Visual Studio, then 50% will be taken
off.
o If your program is not providing correct output values, then 40% will be taken off. o If your C file is 50 % or more similar with other submitted C files, the scores of all
submissions will be ZERO %.
o If your C file is 50 % or more similar with any copies in the internet, the score of your
submissions will be ZERO %.
o If you do not use the related files provided in your program, then 20% will be taken
off even if your C file is compiled and generates correct outputs for fairness purpose.
ID do Projeto: #29688587