You have an art history exam, but you pay more attention to computer science at school than to your art classes! You will need to write a program for the exam.
The exam will consist of several paintings. Each painting is an example of one of four distinctive styles, numbered 1, 2, 3, and 4. Style 1 contains neoplastic contemporary art. Style 2 contains impressionistic landscapes. Style 3 contains expressionist action pictures. Style 4 contains color field paintings.
Your task, taking into account the digital image of the picture, is to determine what style the painting belongs to.
The image will be presented as a grid of H Γ W pixels. The rows of the image are numbered 0, ..., (H 1) from top to bottom, and the columns are numbered 0, ..., W 1 from left to right. Pixels are described using two-dimensional arrays R, G and B, which give the number of red, green and blue colors, respectively, in each pixel of the image. These amounts range from 0 (no red, green, or blue) to 255 (maximum amount of red, green, or blue).
Implementation You must send a file that implements the style of the function (), as follows:
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]);
This function should determine the style of the image. Parameters :
- H: the number of lines of pixels in the image.
- W: number of columns of pixels in the image.
- R: A two-dimensional array of size H Γ W giving the amount of red in each pixel of the image.
- G: a two-dimensional array of size H Γ W, giving the amount of green in each pixel of the image.
- B: a two-dimensional array of size H Γ W, giving the number of blue in each pixel of the image.
I do not need a ready-made program. One hint or two to start me would be nice, because I do not know that this can be solved.