GCC is a C compiler. It does not do segmentation. It simply compiles C programs. That is, it reads a C program and produces a binary file that can be executed. There are several ways of declaring storage for an image in C (for example, char img[100][100]). The storage has to be initialised (you need to get the image data for that). Then one can do segmentation or any other operations on the image (by expressing them in C). In the example, the image pixels can be accessed as img[i][j].
You may want to obtain the original image from a file, or save the processing results to another file. Libraries may be helpful here (to decode and return the data in the file). Which library? It depends on the file formats you're interested in handling. If you want to support JPEG, look for a library that supports JPEG.
Keep in mind that Matlab handles operations such as matrix multiplication directly (so that one can write A*B+C, say, where A, B and C are matrices). In C, you would have to implement the operations one by one, or use a library. Consider using C++ instead and check a library such as armadillo, which enables you to do the same (A*B+C). The documentation for armadillo includes a sort of "dictionary" Armadillo / Matlab.
Thank you Paulo, i wanted to use the JPEG files and then do the other calculations on the image as per the requirement. I am searching in the link provided above.