Question: IN C programming language, You only need to complete two functions, Partial implementation is given to start. void color(int image[IMAGE_SIZE][IMAGE_SIZE]) int cellCount(int image[IMAGE_SIZE][IMAGE_SIZE]) And test
IN C programming language, You only need to complete two functions, Partial implementation is given to start.
void color(int image[IMAGE_SIZE][IMAGE_SIZE])
int cellCount(int image[IMAGE_SIZE][IMAGE_SIZE])
And test your code for the given 2-d array in main().
===>Or in simple words, in the given 2-d array assign the set of numbers a same value that are connected horizontally ,vertically and diagonally for each case

![implementation is given to start. void color(int image[IMAGE_SIZE][IMAGE_SIZE]) int cellCount(int image[IMAGE_SIZE][IMAGE_SIZE]) And](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f51c92147c1_66566f51c9181964.jpg)
#include#include #define IMAGE_SIZE 10 // this function prints the array void printImgArray(int array[IMAGE_SIZE][IMAGE_SIZE]) { printf("------ Image Contents ------- "); int i, j; for (i=0; i We were able to write a code the reads this image and convert it to a two-dimensional array, where the blood cells in red are represented with 1 and the rest is represented with zero. Then we got a small sample of this two-dimensional array for which we need to write a code that counts the number of blood cells. A blood cell is a group of 1s that are connected horizontally, vertically, or diagonally. As shown in the left pictures below, where there are 7 blood cells. Task 1: For this task, you are going to complete two functions. One to label each blood cell (how is it defined?) with a unique number and another to count the number of the unique blood cells. 1. The first function gets a 10x10 two-dimensional array of Os and 1s, and labels each blood cell with a unique number. For example, if the given image (i.e., two-dimensional array) is something like the left picture below, one sample solution can be something like the right picture. It is not important how you choose the numbers for the cell, as long as it is not zero or a negative number. Also, the numbers do not need to be in a consecutive order. For example, one might label the cells in the example below with arbitrary numbers of 20, 3, 4, 8, 18, 7, 1. The signature of this function looks below: void color(int image [IMAGE_SIZE] [IMAGE_SIZE]); This function gets the 10x10 two-dimensional array (like the left picture) and label each group of 1s (a distinct cell) with a unique number (like the right picture). 2. Another function gets a 10x10 two-dimensional array that has been labelled, like in right picuture below, and return the number of distinct blood cells. This array represents each unique cell with a unique number. Please see the right picture below in which you can see there are 7 distinct cells, each represented with a unique number. If the right picture below is sent to this function, it should return 7, as there are 7 distinct groups of data. The signature of this function is as follow: int cellCount(int image [IMAGE_SIZE] [IMAGE_SIZE]); 0 0 1 1 0 0 1 0 0 1 1 0 1 1 0 0 1 1 0 1 1 0 0 1 1 0 1 1 0 1 1 1 0 0 0 0 0 0 0 0 1 0 0 1 1 1 0 0 1 0 0 0 0 0 1 0 0 1 1 0 0 0 1 0 0 1 0 1 0 0 0 0 1 1 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 1 0 1 1 0 0 0 1 1 1 1 0 0 2 2 0 0 3 0 0 4 8 0 2 2 0 0 3 3 0 4 80 0 2 2 0 3 3 0 4 8800000000 800 5 5 5 0 0 5 0 0 0 0 0 5 0 0 5 5 0 0 0 6 0 0 5 0 5 0 0 006600 50 00 00600000 77 0 6 6 OOO 7 7 7 7 To solve the problems, you are free to define as many helper functions as needed. To test your code, we only look at the return value and the content of the array, expecting that each blood cell is labeled with a unique number
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
