Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please make both for C language code. #include #include #include #define ROWS 512 #define COLUMNS 512 #define sqr(x) ((x)*(x)) int main( int argc, char **argv

image text in transcribedPlease make both for C language code.

#include #include #include

#define ROWS 512 #define COLUMNS 512

#define sqr(x) ((x)*(x))

int main( int argc, char **argv ) {

int i, j, k; int threshold[3], A; FILE *fp; char *ifile, *ofile; unsigned char image[ROWS][COLUMNS], bimage[ROWS][COLUMNS], head[32]; char filename[9][50], ch; float xbar, ybar;

strcpy(filename[0], "image1.raw"); strcpy(filename[1], "image1-b.ras"); strcpy(filename[2], "image1.ras"); strcpy(filename[3], "image2.raw"); strcpy(filename[4], "image2-b.ras"); strcpy(filename[5], "image2.ras"); strcpy(filename[6], "image3.raw"); strcpy(filename[7], "image3-b.ras"); strcpy(filename[8], "image3.ras"); header ( ROWS, COLUMNS, head );

printf("Filename: Threshold Area X Y ");

for ( k = 0; k

/* Read the image */ if (( fp = fopen( ifile, "rb" )) == NULL ) { fprintf( stderr, "error: couldn't open %s ", ifile ); exit( 1 ); }

for ( i = 0; i Area and Center A Area A = ExZyb(x, y) b(x,y) has value 0 or 1 Center Xo = Ex Ey xb(x,y), Yo = PEx Ey y(X,Y), Indicate the center using a small cross or 10x10 patch with gray level 128 Origin of the (x,y) coordinate system is at the bottom left corner of the image Area and Center A Area A = ExZyb(x, y) b(x,y) has value 0 or 1 Center Xo = Ex Ey xb(x,y), Yo = PEx Ey y(X,Y), Indicate the center using a small cross or 10x10 patch with gray level 128 Origin of the (x,y) coordinate system is at the bottom left corner of the image

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learn To Program Databases With Visual Basic 6

Authors: John Smiley

1st Edition

1902745035, 978-1902745039

More Books

Students also viewed these Databases questions

Question

Find dy/dt. y = 3t+ V2 + V1 - t

Answered: 1 week ago

Question

2. Identify the purpose of your speech

Answered: 1 week ago