Tongue picture normalization algorithm based on checkerboard

Through the normalization algorithm of tongue image based on checkerboard, the problem of volatile distortion of the tongue image collection is solved, the true color and brightness performance of the tongue image is realized, the accuracy of judgment is improved, and the morphological characteristics of the tongue image are retained.

CN120070282AActive Publication Date: 2025-05-30NAT REHABILITATION ASSISTIVE DEVICES RES CENT
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510143898.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-10
Publication Date
2025-05-30
Estimated Expiration
2045-02-10

AI Technical Summary

Technical Problem

The existing tongue image acquisition technology has problems such as distortion in form, which leads to inaccurate judgments, which are mainly reflected in the large amount of color space conversion calculation, difficulty in selecting correction parameters, histogram equalization may lead to loss of details, complex local contrast enhancement calculations and possible block effects, and feature point matching correction may destroy the morphological characteristics of tongue image.

Method used

The tongue image normalization algorithm based on the checkerboard is used to normalize the color and brightness of the tongue image through the white and black blocks in the checkerboard as the basis for normalization, and the deformity correction is performed in combination with the checkerboard corner point detection and lens parameter calibration.

Benefits of technology

The more realistic color and brightness performance of the tongue image is achieved, the accuracy of judgment is improved, and the morphological characteristics of the tongue image are retained through dedistortion processing, improving the overall quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120070282A_ABST
    Figure CN120070282A_ABST
Patent Text Reader

Abstract

The invention discloses a tongue picture normalization algorithm based on a checkerboard, and the algorithm comprises the steps: taking a white block and a black block in the checkerboard as the basis of normalization, placing a hard checkerboard at a position close to the oral cavity of a patient, and carrying out the shooting of a tongue picture, and obtaining a tongue picture image; a line of checkerboard, closest to a shooting window, in the tongue picture image is used as the basis of tongue picture normalization processing, normalization processing is carried out, and the process comprises tongue picture color normalization, tongue picture brightness normalization and tongue picture malformation correction. According to the invention, normalization processing is carried out on the tongue image, so that the method has the advantages that the image is more real and the judgment is relatively more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of tongue image diagnosis and processing, and in particular to a checkerboard-based tongue image normalization algorithm. Background Art

[0002] As one of the important methods of traditional Chinese medicine diagnosis, tongue diagnosis in traditional Chinese medicine infers the physiological and pathological changes inside the human body by observing the tongue image, and has the characteristics of non-invasive and convenient. The tongue image contains rich physiological and pathological information of the human body. However, during the acquisition and transmission of the tongue image, due to factors such as equipment differences, different lighting conditions, and shooting angles, problems such as inconsistent brightness, color deviation, and shape distortion may occur in the tongue image, which will interfere with the accurate extraction and analysis of subsequent tongue image features.

[0003] The color space of common images is RGB (red, green, blue), and the RGB color space of the original tongue image can be converted into a color space that is more suitable for color correction. In the Lab space, the L channel represents brightness, and the a channel and b channel represent color components from green to red and from blue to yellow respectively. By performing brightness correction on the L channel and color deviation correction on the a channel and b channel, the normalization of the tongue image color can be achieved.

[0004] However, color space conversion involves complex mathematical calculations and a large amount of computation. Moreover, different tongue images may require adjusting the correction parameters according to specific situations. Improper parameter selection may lead to overcorrection or undercorrection of color, affecting the true color performance of the tongue image.

[0005] Histogram equalization of the tongue image can effectively adjust the overall brightness distribution of the tongue image, making all parts of the tongue image clearly visible and facilitating subsequent feature analysis. However, histogram equalization may cause some details of the image to be lost because, during the process of enhancing the contrast, regions with similar gray values but different semantic information may become indistinguishable. At the same time, for tongue images with too large a brightness difference, over-enhancement may occur, making the visual effect of the tongue image unnatural.

[0006] The local contrast enhancement method focuses on enhancing the contrast of local regions of the image. It calculates the mean and standard deviation of local regions of the image, and then performs gray-scale adjustment on each pixel point based on local statistical information. For tongue images, this method can enhance the contrast between different parts of the tongue body without changing the overall brightness trend of the tongue image, highlighting the local features of the tongue coating and the tongue body. However, the computational complexity is relatively high, and it is necessary to divide and statistically calculate local regions of the image, resulting in a long processing time. Moreover, if the size of the local region is not selected properly, block effects may occur in the processed image, affecting the overall quality of the tongue image.

[0007] The camera lens used for photographing tongue images is usually composed of multiple lenses. When light passes through these lenses, due to the physical properties of the lenses, the degree of refraction of light at the edge part of the lens is different from that at the central part, resulting in image distortion. One correction method is feature point matching correction. Select some feature points in the tongue image, such as the edge points of the tongue body, the tip of the tongue, the root of the tongue, etc., and then determine the degree of image distortion by matching with the feature points of the standard tongue image, and perform corresponding correction. However, the tongue body often presents different shape characteristics, including enlarged tongue, slender tongue, etc. Forcibly matching the tongue image to the standard tongue shape will damage the morphological characteristics of the tongue image.

[0008] Therefore, when using the color space conversion method to process the color deviation of tongue images, the computational complexity is relatively high;

[0009] For different tongue images, the correction parameters need to be adjusted according to specific situations, which affects the true color performance of tongue images;

[0010] Using histogram equalization of tongue images to adjust the brightness distribution of tongue images may cause some details of the image to be lost, and for tongue images with too large brightness differences, over-enhancement may occur, making the visual effect of tongue images unnatural;

[0011] When using local contrast of tongue images to adjust the non-uniform brightness of tongue images, the computational complexity is relatively high, and it may also cause block effects in the processed image, affecting the overall quality of tongue images;

[0012] When using feature point matching to correct the deformation problem of tongue images, due to the large morphological differences of tongue images, the morphological characteristics of tongue images may be damaged.

[0013] In summary, there are problems in existing tongue image acquisition that the morphology is prone to distortion, resulting in inaccurate judgment. Summary of the Invention

[0014] The purpose of the present invention is to provide a checkerboard-based tongue image normalization algorithm. By normalizing the tongue image, the present invention has the advantages of more realistic images and relatively more accurate judgment.

[0015] The technical solution of the present invention: A checkerboard-based tongue image normalization algorithm, taking the white blocks and black blocks in the checkerboard as the basis for normalization, placing a rigid checkerboard near the patient's oral cavity to photograph the tongue image, and obtaining the tongue image; using the row of checkerboard closest to the shooting window in the tongue image as the basis for tongue image normalization processing, and performing normalization processing, the specific process is as follows:

[0016] A. Tongue image color normalization: Taking the white blocks of the checkerboard in the tongue image as reference points, perform color normalization on the tongue image. First, transform the RGB three-color channel values of the white blocks into the average value, obtain the gain coefficients of each color channel, and then perform a linear transformation on the entire tongue image;

[0017] B. Tongue image brightness normalization: Using the white and black blocks of the checkerboard as the adjustment reference, first calculate the average brightness of the black blocks in the checkerboard, subtract the average brightness of the black blocks from the brightness of the entire tongue image, and set it to 0 if it is less than the average; then calculate the average brightness of the white blocks in the checkerboard, calculate the stretching coefficient that stretches the average brightness of the white blocks to 255, multiply the brightness of the entire tongue image by the stretching coefficient, and set it to 255 if it exceeds 255;

[0018] C. Tongue image distortion correction: Detect the corner points of the checkerboard, obtain the coordinate correspondence between the world coordinate system and the image coordinate system, calculate the internal parameters, external parameters, and distortion parameters of the camera, perform distortion correction on the tongue image, and evaluate the quality of the correction result by calculating the reprojection error.

[0019] In the above-mentioned checkerboard-based tongue image normalization algorithm, the tongue image color normalization described in step A is as follows:

[0020] A1. Select the checkerboard area on the tongue image, traverse the points on a straight line in the checkerboard horizontally, and record the R, G, and B values of each white square pixel;

[0021] A2. Calculate the average value of each of the RGB color channels respectively

[0022]

[0023] A3. Obtain the average value a of the RGB color channels - ,

[0024]

[0025] A4. Calculate the gain coefficients k r , k g , k b ,

[0026]

[0027] A5. Traverse all pixel points in the tongue image, and multiply the RGB values of each pixel point by the corresponding gain coefficients of each color channel.

[0028] In the above-mentioned checkerboard-based tongue image normalization algorithm, the tongue image brightness normalization described in step B is as follows:

[0029] B1. Select the checkerboard area on the tongue image, traverse the points on a straight line in the checkerboard horizontally, and record the r w , g w , b wThe r value of the value and the black square b and g b and b b values;

[0030] B2. Respectively calculate the average values of the three color channels of RGB for the white square and the black square

[0031]

[0032] B3. Set the brightness of the black block to zero

[0033]

[0034] B4. Linearly increase the brightness of the white block to 255

[0035]

[0036] In the aforementioned checkerboard-based tongue image normalization algorithm, the tongue image deformation correction described in step C is specifically as follows:

[0037] C1. Detect the checkerboard corner points; Take a set of checkerboard images at different angles for extracting lens parameters, convert the checkerboard images into grayscale images, and use the method of finding Harris corner points to find the checkerboard corner points that match the specified specifications in the grayscale images, and respectively store the coordinates of the checkerboard corner points in the world coordinate system and the corresponding corner point coordinates in the image coordinate system;

[0038] C2. Calibrate the lens parameters; Determine the internal parameters, external parameters, and distortion parameters of the camera through the coordinates of the checkerboard corner points in the world coordinate system and the corresponding corner point coordinates in the image coordinate system, and optimize the various parameters of the camera based on the least squares method according to the lens distortion model;

[0039] C3. Remove the image distortion; Read the tongue image to be undistorted, optimize the internal parameters and distortion coefficients according to the camera parameters and the image size to obtain the new camera internal parameter matrix and the region of interest; Perform image undistortion processing according to the original parameter matrix of the camera, the distortion parameters, and the new camera internal parameter matrix to obtain the undistorted image; Crop the undistorted image according to the region of interest to remove the unnecessary edge parts.

[0040] C4. Calculate the reprojection error; According to the new camera internal parameter matrix, the distortion parameters, the rotation matrix, and the translation vector, re-project the points in the world coordinate system into the image coordinate system to obtain the projected point coordinates;

[0041] Calculate the L 2 norm distance between the actual points and the projected points, and divide the distance by the number of projected points to obtain the error of each image;

[0042] Add up all the errors and divide by the number of images to calculate the back-projection error.

[0043] In the aforementioned checkerboard-based tongue image normalization algorithm, the specific content of step C1 is as follows:

[0044] By taking multiple checkerboard images, defining the number of interior points, and generating corresponding three-dimensional world coordinates; using cv2.findChessboardCorners in OpenCV to detect the corner positions in the images; if the detection is successful, perform sub-pixel optimization through cv2.cornerSubPix to improve the accuracy, and finally store the world coordinates and image coordinates of the corners into the world coordinate objpoints and image coordinate imgpoints lists respectively.

[0045] In the aforementioned checkerboard-based tongue image normalization algorithm, the specific content of step C2 is as follows:

[0046] Call the cv2.calibrateCamera function, input the objpoints and corresponding imgpoints of all images, and combine with the image resolution to calculate the internal parameter matrix mtx, distortion coefficients dist, and the external parameters of each image; the calibration process optimizes the parameters by minimizing the reprojection error, and finally outputs the calibration result.

[0047] In the aforementioned checkerboard-based tongue image normalization algorithm, the specific content of step C3 is as follows:

[0048] Use the distortion coefficients dist and internal parameter matrix mtx obtained from calibration to undistort a single image; first, optimize the internal parameter matrix mtx through cv2.getOptimalNewCameraMatrix to avoid excessive cropping of the image edges after undistortion; then use the cv2.undistort function to correct the image distortion, and crop the image according to the returned ROI area, and save the corrected result.

[0049] In the aforementioned checkerboard-based tongue image normalization algorithm, the specific content of step C4 is as follows:

[0050] Project the world coordinates of the corners in the world coordinate system back to the image plane according to the calibration parameters through cv2.projectPoints to obtain the theoretical pixel coordinates; calculate the Euclidean distance between them and the image coordinates of the actually detected corners, and obtain the average error of all images; this error value is used to evaluate the calibration accuracy, and the smaller the value, the more reliable the calibration result.

[0051] Compared with the prior art, the present invention has the following beneficial effects:

[0052] 1. After color normalization, the RGB values of the white blocks of the checkerboard are the same, and there is no color deviation in the white blocks at this time. When collecting the normalization coefficients, the RGB values of multiple white blocks are referred to;

[0053] After processing the tongue image with the present invention, the entire tongue image has completed color normalization. All tongue images use the same checkerboard, and the color normalization effect is the same;

[0054] 2. After brightness normalization, the RGB values of the white blocks of the checkerboard are all set to 255, and the RGB values of the black blocks are all set to 0. The brightness of the white blocks is the brightest area of the entire image, and the brightness of the black blocks is the darkest area of the entire image. The brightness of the entire image is linearly stretched, and the brightness normalization operation is completed. All tongue images use the same checkerboard, and the brightness normalization effect is the same;

[0055] 3. The same checkerboard is used. Based on the intersection points of the white and black blocks in the checkerboard, the lens parameters are calibrated. The lens parameters of all images are the same, and the distortion correction process is the same. After distortion correction, the back-projection error is 0.020320764365767737.

[0056] In summary, by performing normalization processing on the tongue image, the present invention has the advantages of more realistic images and relatively more accurate judgment.

[0057] Description of the Drawings

[0058] Figure 1 is a schematic diagram of an embodiment of the present invention;

[0059] Figure 2 is a flowchart of tongue image color normalization of the present invention;

[0060] Figure 3 is a flowchart of tongue image brightness normalization of the present invention;

[0061] Figure 4 is a flowchart of tongue image distortion correction of the present invention;

[0062] Figure 5 is an effect diagram of tongue image color normalization of the embodiment;

[0063] Figure 6 is an effect diagram of tongue image brightness normalization of the embodiment;

[0064] Figure 7 is a comparison diagram of tongue image distortion correction effects of the embodiment. Detailed Embodiments

[0065] The present invention will be further described below in conjunction with the description of the drawings and embodiments, but it shall not be used as a basis for limiting the present invention.

[0066] Embodiment. A checkerboard-based tongue image normalization algorithm, as Figure 1 shown, uses the white and black blocks in the checkerboard as the basis for normalization. A rigid checkerboard is placed near the patient's oral cavity for tongue image capture to obtain a tongue image; the row of checkerboard closest to the capture window in the tongue image is used as the basis for tongue image normalization processing for normalization, and the specific process is as follows:

[0067] A. Tongue image color normalization: Using the white blocks of the checkerboard in the tongue image as reference points, perform color normalization on the tongue image. First, transform the RGB three-color channel values of the white blocks into the average value to obtain the gain coefficients of each color channel, and then perform a linear transformation on the entire tongue image;

[0068] B. Tongue image brightness normalization: Using the white and black blocks of the checkerboard as the adjustment benchmarks, first calculate the average brightness of the black blocks in the checkerboard, subtract the average brightness of the black blocks from the brightness of the entire tongue image, and set it to 0 if it is less than the average value; then calculate the average brightness of the white blocks in the checkerboard, calculate the stretching coefficient that stretches the average brightness of the white blocks to 255, multiply the brightness of the entire tongue image by the stretching coefficient, and set it to 255 if it exceeds 255;

[0069] C. Tongue image distortion correction: Detect the checkerboard corner points, obtain the coordinate correspondence between the world coordinate system and the image coordinate system, calculate the internal parameters, external parameters, and distortion parameters of the camera to perform distortion correction on the tongue image, and evaluate the quality of the correction result by calculating the reprojection error.

[0070] The tongue image color normalization described in step A, as Figure 2 shown, the specific process is as follows:

[0071] A1. Select the checkerboard area on the tongue image, traverse the points on a straight line in the checkerboard horizontally, and record the R, G, B values of each white square pixel;

[0072] A2. Calculate the average value of the RGB three-color channels respectively

[0073]

[0074] A3. Obtain the average value a of the RGB three-color channels - ,

[0075]

[0076] A4. Calculate the gain coefficients k r 、k g 、k b ,

[0077]

[0078] A5. Traverse all the pixel points in the tongue image, and multiply the RGB values of each pixel point by the gain coefficients of the corresponding color channels respectively.

[0079] The effect of tongue image color normalization is as Figure 5 shown. After color normalization, the RGB values of the three channels of the white blocks in the checkerboard are the same. At this time, there is no color deviation in the white blocks. When collecting the normalization coefficients, the RGB values of multiple white blocks are referred to;

[0080] Therefore, it can be considered that after processing the tongue image with the normalization coefficients, the entire tongue image has completed color normalization; the same checkerboard is used for all tongue images, and the color normalization effect is the same; after normalization processing, collect the white blocks on the tongue image photo; the RGB values of the three channels are shown in Figure 5 , the RGB values of the three channels of the white blocks are the same, and the color normalization of the tongue image is completed.

[0081] The tongue image brightness normalization described in step B is as Figure 3 shown, and the specific process is as follows:

[0082] B1. Select the checkerboard area on the tongue image, traverse the points on a straight line in the checkerboard in the horizontal direction, and record the r w , g w , b w values of the white squares and the r b , g b , b b values of the black squares;

[0083] B2. Calculate the average values of the RGB three color channels of the white squares and the black squares respectively

[0084]

[0085] B3. Set the brightness of the black blocks to zero,

[0086]

[0087] B4. Linearly increase the brightness of the white blocks to 255,

[0088]

[0089] The effect of tongue image brightness normalization is as Figure 6As shown, after brightness normalization, the RGB values of the white squares of the checkerboard are all set to 255, and the RGB values of the black squares are all set to 0; at this time, the brightness of the white squares is the brightest area of the entire image, and the brightness of the black squares is the darkest area of the entire image; the brightness of the entire image is linearly stretched to complete the brightness normalization operation; all tongue images use the same checkerboard, and the brightness normalization effect is the same.

[0090] The tongue image deformation correction described in step C, as Figure 4 shown, the specific process is as follows:

[0091] C1. Detect the checkerboard corners; Take a set of checkerboard images at different angles for extracting lens parameters, convert the checkerboard images to grayscale images, and use the method of finding Harris corners to find the checkerboard corners that match the specified specifications in the grayscale images, and store the coordinates of the checkerboard corners in the world coordinate system and the corresponding corner coordinates in the image coordinate system respectively;

[0092] C2. Calibrate the lens parameters; Determine the internal parameters, external parameters, and distortion parameters of the camera through the coordinates of the checkerboard corners in the world coordinate system and the corresponding corner coordinates in the image coordinate system, and optimize the parameters of the camera based on the least squares method according to the lens distortion model;

[0093] C3. Remove image distortion; Read the tongue image to be undistorted, optimize the internal parameters and distortion coefficients according to the camera parameters and image size to obtain the new camera internal parameter matrix and the region of interest; Perform image undistortion processing according to the original parameter matrix, distortion parameters, and new camera internal parameter matrix of the camera to obtain the undistorted image; Crop the undistorted image according to the region of interest to remove the unnecessary edge parts.

[0094] C4. Calculate the reprojection error; According to the new camera internal parameter matrix, distortion parameters, rotation matrix, and translation vector, re-project the points in the world coordinate system into the image coordinate system to obtain the projected point coordinates;

[0095] Calculate the L 2 norm distance between the actual points and the projected points, divide the distance by the number of projected points to obtain the error of each image;

[0096] Add up all the errors and divide by the number of images to calculate the reprojection error.

[0097] The specific content of step C1 is as follows:

[0098] By taking multiple checkerboard images, defining the number of interior points, and generating corresponding three-dimensional world coordinates (points on the plane where Z = 0); use cv2.findChessboardCorners in OpenCV to detect the corner positions in the images; if the detection is successful, perform sub-pixel optimization through cv2.cornerSubPix to improve the accuracy, and finally store the world coordinates and image coordinates of the corners into the world coordinate objpoints and image coordinate imgpoints lists respectively.

[0099] The specific content of step C2 is as follows:

[0100] Call the cv2.calibrateCamera function, input the objpoints and corresponding imgpoints of all images, combine with the image resolution, and calculate the internal parameter matrix mtx of the camera (including focal length and principal point), distortion coefficients dist (such as radial and tangential distortion parameters), and the external parameters (rotation vector rvecs and translation vector tvecs) of each image; the calibration process optimizes the parameters by minimizing the reprojection error, and finally outputs the calibration result.

[0101] The specific content of step C3 is as follows:

[0102] Use the distortion coefficients dist and internal parameter matrix mtx obtained by calibration to undistort a single image (such as 1_big.jpg); first, optimize the internal parameter matrix mtx through cv2.getOptimalNewCameraMatrix to avoid excessive cropping of the image edges after undistortion; then use the cv2.undistort function to correct the image distortion, and crop the image according to the returned ROI area, and save the corrected result (such as 1_calibresult_big.jpg).

[0103] The specific content of step C4 is as follows:

[0104] Project the world coordinates of the corners in the world coordinate system back to the image plane according to the calibration parameters (internal parameters, distortion coefficients, external parameters) through cv2.projectPoints to obtain the theoretical pixel coordinates (imgpoints2); calculate the Euclidean distance between it and the image coordinates (imgpoints) of the actually detected corners, and obtain the average error of all images; this error value (usually should be less than 0.5 pixels) is used to evaluate the calibration accuracy, and the smaller the value, the more reliable the calibration result.

[0105] The specific code is as follows:

[0106] import cv2

[0107] import numpy as np

[0108] import glob

[0109] criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001)

[0110] w = 18 # Number of inner corner points horizontally (number of columns - 1)

[0111] h = 12 # Number of inner corner points vertically (number of rows - 1)

[0112] objp = np.zeros((w * h, 3), np.float32)

[0113] objp[:, :2] = np.mgrid[0:w, 0:h].T.reshape(-1, 2)

[0114] objpoints = [] # 3D points in the world coordinate system

[0115] imgpoints = [] # 2D points in the image coordinate system

[0116] images = glob.glob('*.jpg') # Read all.jpg files in the current directory

[0117] for fname in images:

[0118] img = cv2.imread(fname)

[0119] gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

[0120] ret, corners = cv2.findChessboardCorners(gray, (w, h), None)

[0121] if ret:

[0122] # Sub-pixel precise corner points

[0123] cv2.cornerSubPix(gray, corners, (11, 11), (-1, -1), criteria)

[0124] objpoints.append(objp)

[0125] imgpoints.append(corners)

[0126] # Visual corner points

[0127] cv2.drawChessboardCorners(img, (w, h), corners, ret)

[0128] cv2.imshow('findCorners', img)

[0129] cv2.waitKey(1000)

[0130] cv2.destroyAllWindows()

[0131] ret, mtx, dist, rvecs, tvecs = cv2.calibrateCamera(

[0132]

[0133] After distortion correction, the effect is as Figure 7 shown, and the reprojection error is 0.020320764365767737. The closer it is to 0, the closer the corrected line segment is to a straight line.

Claims

1. A tongue image normalization algorithm based on chessboard, characterized in that: The white and black blocks in the chessboard are used as the basis for normalization. A hard chessboard is placed near the patient's mouth to shoot the tongue and obtain the tongue image. The row of chessboards closest to the shooting window in the tongue image is used as the basis for tongue normalization. The specific process is as follows: A. Tongue color normalization: Take the white block of the checkerboard in the tongue image as the reference point, perform color normalization on the tongue image, transform the values ​​of the three color channels of RGB of the white block into the average value, obtain the gain coefficient of each color channel, and perform linear transformation on the entire tongue image; B. Normalization of tongue brightness: Taking the white and black blocks of the chessboard as the adjustment basis, calculate the average brightness of the black blocks in the chessboard, subtract the average brightness of the black blocks from the brightness of the entire tongue image, and set it to 0 if it is less than the average; calculate the average brightness of the white blocks in the chessboard and the stretching factor that stretches the average brightness of the white blocks to 255, multiply the brightness of the entire tongue image by the stretching factor, and set it to 255 if it exceeds 255; C. Tongue deformity correction: Detect the corner points of the chessboard, obtain the coordinate correspondence between the world coordinate system and the image coordinate system, calculate the camera's intrinsic parameters, extrinsic parameters and distortion parameters, dedistort the tongue image, and evaluate the correction result by calculating the back projection error.

2. The checkerboard-based tongue image normalization algorithm according to claim 1, characterized in that: The specific process of normalizing the tongue color described in step A is as follows: A1. Select the checkerboard area on the tongue image, traverse the points on a straight line in the checkerboard in the horizontal direction, and record the R, G, and B values ​​of each white square pixel; A2. Calculate the average value of the three color channels RGB respectively A3. Find the average value of the three color channels RGB - , A4. Calculate the gain coefficient k of the three color channels r , k g , k b , A5. Traverse all the pixels in the tongue image, and multiply the RGB value of each pixel by the gain coefficient of each color channel.

3. The checkerboard-based tongue image normalization algorithm according to claim 1, characterized in that: The specific process of normalizing the brightness of the tongue image described in step B is as follows: B1. Select the checkerboard area on the tongue image, traverse the points on a straight line in the checkerboard horizontally, and record the r of the white squares. w , g w 、b w Value and r of black square b , g b 、b b value; B2. Calculate the average value of the three color channels of RGB for the white square and the black square respectively. B3, set the brightness of the black block to zero, B4, linearly increase the brightness of the white block to 255, 4. The checkerboard-based tongue image normalization algorithm according to claim 1, characterized in that: The specific process of tongue deformity correction described in step C is as follows: C1. Detecting checkerboard corner points: Shoot a set of checkerboard images at different angles to extract lens parameters, convert the checkerboard images into grayscale images, use the Harris corner point search method to find checkerboard corner points that match the specified specifications in the grayscale image, and store the checkerboard corner point coordinates in the world coordinate system and the corresponding corner point coordinates in the image coordinate system respectively; C2. Calibrate lens parameters. Determine the camera's internal parameters, external parameters, and distortion parameters through the coordinates of the chessboard's corner points in the world coordinate system and the corresponding corner point coordinates in the image coordinate system. Based on the least squares method and the lens distortion model, optimize the camera's parameters. C3, removing image distortion; reading the tongue image to be dedistorted, optimizing the internal parameters and distortion coefficients according to the camera parameters and image size, obtaining the new camera internal parameter matrix and the region of interest; performing image dedistortion processing according to the original camera parameter matrix, distortion parameters and the new camera internal parameter matrix, and obtaining the dedistorted image; The dedistorted image is cropped according to the region of interest to remove unnecessary edge portions. C4. Calculate the back-projection error. According to the new camera intrinsic parameter matrix, distortion parameters, rotation matrix and translation vector, reproject the point in the world coordinate system into the image coordinate system to obtain the coordinates of the projected point. Calculate the L2 norm distance between the actual point and the projected point, divide the distance by the number of projected points to get the error of each image; The back-projection error is calculated by adding all the errors and dividing by the number of images.

5. The checkerboard-based tongue image normalization algorithm according to claim 4, characterized in that: The specific contents of step C1 are as follows: By taking multiple chessboard images, the number of inner corner points is defined and the corresponding three-dimensional world coordinates are generated; the positions of the corner points in the image are detected, and sub-pixel optimization is performed to improve the accuracy. Finally, the world coordinates and image coordinates of the corner points are stored in the world coordinate and image coordinate lists respectively.

6. The checkerboard-based tongue image normalization algorithm according to claim 4, characterized in that: The specific contents of step C2 are as follows: Input the world coordinates and corresponding image coordinates of all images, and calculate the camera's intrinsic parameter matrix mtx, distortion coefficient dist, and extrinsic parameters of each image based on the image resolution; The calibration process optimizes the parameters by minimizing the reprojection error and finally outputs the calibration results.

7. The checkerboard-based tongue image normalization algorithm according to claim 4, characterized in that: The specific content of step C3 is as follows: The single image is dedistorted using the calibrated distortion coefficient dist and the intrinsic parameter matrix mtx. The intrinsic parameter matrix mtx is optimized to avoid excessive cropping of the image edge after dedistortion. The image distortion is then corrected, and the image is cropped according to the returned ROI area, and the corrected result is saved.

8. The checkerboard-based tongue image normalization algorithm according to claim 4, characterized in that: The specific content of step C4 is as follows: The world coordinates of the corner points in the world coordinate system are projected back to the image plane according to the calibration parameters to obtain the theoretical pixel coordinates; the difference between the theoretical pixel coordinates and the image coordinates of the corner points actually detected is calculated. The Euclidean distance of all images is used to calculate the average error of all images; this error value is used to evaluate the calibration accuracy. The smaller the value, the more reliable the calibration result.

Citation Information

Patent Citations

  • K-PLS regression model based traditional Chinese medicine tongue image color correction method

    CN104572538A

  • Projector calibration method

    CN104732539A

  • Mirror surface quality analysis method based on 2D structured light

    CN110567918A

  • Tongue image enhancement method

    CN110910317A

  • Checkerboard corner detection method based on neural network and application thereof

    CN111640157A