1. An automatic recognition and calibration method of medical color and grayscale images, which takes different calibration methods based on different image color attributes wherein comprising the steps as follows: step 1. according to color component values of three channels R, G, B of each pixel of an original image, using a relationship of YUV and RGB color space to establish correspondence between the brightness and the color component values for the R, G, B channels, and expressing a corresponding pixel gray value of a pixel with brightness, thereby forming a grayscale image; step 2. forming a binary image by setting a global threshold T, and comparing each pixel gray value of the grayscale image with a global threshold of T, wherein if the pixel gray value is greater than T then using a foreground color of the pixel to form the binary image, otherwise using a background color of the pixel to form the binary image; step 3. scanning the binary image line by line, detecting and counting pixels of the binary image, wherein if a first consecutive occurrences of pixels of the binary image have a gray scale value of 255 and greater than a preset line segment threshold, then judging the first consecutive occurrences as a line segment and keeping the first consecutive occurrences in a new image A; and then scanning the binary image column by column, detecting and counting pixels of the binary image, wherein if a second consecutive occurrences of pixels of the binary image have a gray scale value of 255 and greater than the preset line segment threshold, then judging the second consecutive occurrences as a line segment and keeping the second consecutive occurrences in the image A, and finally, merging pixels of adjacent line segments respectively on a horizontal direction and a vertical direction in the image A; step 4. creating a new image named B, in which an original rectangle having an original length of a and an original width of b in image B is drawn; step 5. making an upper left corner of the image A correspond to an upper left corner of the original rectangle of the image B, the upper left corner of the original rectangle being denoted as (x1, y1), and increasing the length of a and the width of b continuously, and when a is increased to a′ and b is increased to b′ and the pixel grayscale value of coordinate (x1+a′, y1+b′) in the image A is 255, judging whether the pixel grayscale value located at each of coordinates (x1+a′+1, y1), (x1, y1+b′+1), (x1+a′+1, y1+b′+1) is 255, wherein when each of the pixel grayscale value located at coordinates (x1+a′+1, y1), (x1, y1+b′+1), (x1+a′+1, y1+b′+1) is not 255 recording a pixel grayscale value at a′ as a width, recording a pixel grayscale value at b′ as a height, recording coordinate (x1+a′, y1+b′) as (xn, yn), and restoring the pixel grayscale value at a′ to a and restoring the pixel grayscale value at b′ to b; step 6. making the upper left corner of the image A correspond to an upper left corner of the original rectangle of the image B, the upper left corner of the original rectangle being denoted as (x1, y1), and increasing the length of a and the width of b continuously, and when a is increased to a0 and b is increased to b0 and the pixel grayscale value of coordinate (x1+a0, y1+b0) in the image A is 255, judging whether the pixel grayscale value of each pixel located between coordinates (x1, y1+b0) and (x1+a0-1, y1+b0) is 255 as a first condition, and judging whether the pixel grayscale value values of each pixel located between coordinates (x1+a0, y1) and (x1+a0, y1+b0-1) is 255 as a second condition; when each of the first condition and the second condition is satisfied, then stopping the increase of a and b and recording a pixel grayscale value at a0 as w and recording a pixel grayscale value at b0 as h; when any one of the first condition and the second condition is not satisfied, then recording coordinate (x1+a0, y1+b0) as (x1_1, y1_1), and restoring the pixel grayscale value at a0 to a and restoring the pixel grayscale value at b0 to b; making coordinate (x1_1, y1_1) in the image A correspond to the upper left corner of the original rectangle of the image B, wherein steps 2-6 are iterated to obtain pixel grayscale value at a a1 location and to obtain a pixel grayscale value at a b1 location and recording the pixel grayscale value at a1 as w and recording the pixel grayscale value at b1 as h; step 7. using width/w, x1 and xn to determine a set of coordinates in the X direction as X_coord: (x1, x2,. .. , xp), wherein p is the number of image fields in a X direction; and using height/h, y1 and yn to determine a set of coordinates in a Y direction as Y_coord: (y1,y2. .. , yq), wherein q is the number of the image fields in the Y direction); meanwhile traversing the X_coord and the Y_coord to obtain a set of coordinates corresponding to a starting coordinate and an ending coordinate as Coord: {(xi,yj),(xi+1,yj+1)|1<=i<p and 1<=j<q} for each image field; step 8. determining which images within the starting coordinate and ending coordinate in each image field is a grayscale image or is a color image by randomly sampling pixels in each image field, wherein designating an image as a grayscale image when a ratio of a total number of color pixels relative to a total number of their effective pixels is less than a ratio threshold, this image to be a grayscale image, and otherwise designating the image as a color image; step 9. calibrating each image field determined to have a grayscale image by using a corresponding DICOM3.14 calibration curve, and calibrating each image field determined to have a color image by using a corresponding GAMMA calibration curve.