CN-116563122-B - Image processing method, data set acquisition method and image processing device
Abstract
The image processing method comprises the steps of enabling a high-resolution high-definition image to act with a calibration blur kernel to obtain a blurred image, injecting calibration noise to form a first noise image, degrading the first noise image into a low-resolution image by adopting a downsampling method, conducting lossy compression on the low-resolution image to obtain a compressed image, adding random noise points in an analog transmission process into the compressed image to form a second noise image, conducting lossy compression on the second noise image to obtain a low-definition image, wherein the high-definition image is an image formed by taking an internal organ of a body by adopting a capsule endoscope, and the calibration blur kernel and the calibration noise are results obtained by fitting the high-definition image shooting process. According to the method, the influence of blurring caused by camera movement and noise caused by image formation when the capsule endoscope shoots in vivo is added, so that the image processing is closer to the actual degradation process, and the accurate high-definition-low-definition image corresponding relation is obtained, so that an accurate data set is established.
Inventors
- JIN FAN
- ZHANG HAO
- YANG DAITIANYI
Assignees
- 安翰科技(武汉)股份有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20220127
Claims (12)
- 1. An image processing method, comprising: the obtained high-resolution high-definition image is subjected to the action of a calibrated fuzzy kernel to obtain a fuzzy image; injecting calibration noise into the blurred image to form a first noise image; degrading the first noise image into a low-resolution image by adopting a downsampling method; Performing lossy compression on the low-resolution image to obtain a compressed image; Simulating random noise in the transmission process, and adding random noise points into the compressed image to form a second noise image; the second noise image is subjected to lossy compression and then is stored, so as to obtain a low-resolution low-definition image, The high-definition image is an image formed by shooting an in-vivo organ by adopting a capsule endoscope, and the calibration fuzzy core and the calibration noise are results obtained in a shooting process of fitting the high-definition image; the calibration blur kernel comprises a flash focus blur kernel and a motion blur kernel, the flash focus blur kernel represents image blur caused by distortion and flash focus in the process of shooting the high-definition image by a camera of the capsule endoscope, and the motion blur kernel represents image blur caused by motion of the camera in a body; the calibration noise comprises dark current noise and Gaussian noise, wherein the dark current noise represents noise generated in a signal conversion process of a picture acquired by a camera of the capsule endoscope, and the Gaussian noise represents noise generated in a RGB image forming process of the picture; And performing double downsampling operation on the first noise image by adopting a bicubic interpolation downsampling method to obtain the low-resolution image.
- 2. The image processing method according to claim 1, wherein the blurred image is a result obtained by operating the high-definition image with the flash blur kernel and the motion blur kernel at the same time.
- 3. The image processing method according to claim 1, wherein the step of calibrating the flash blur kernel includes: Adopting the camera to shoot an inclined line of a standard color card, and acquiring pixel value change curves at two sides of the inclined line as pulse signals; Calculating an edge function corresponding to the pulse signal and a line propagation function obtained by differentiating the edge function; Rotating the standard color card at fixed angles to obtain a plurality of line propagation functions corresponding to a plurality of inclined lines; synthesizing a plurality of the line propagation functions into a three-dimensional space after rotating the line propagation functions for one circle to form a point propagation function, and And normalizing the point propagation function to obtain the flash focus fuzzy core.
- 4. The image processing method according to claim 1, wherein the motion blur kernel is simulated with a gaussian blur kernel comprising an isotropic blur kernel and an anisotropic blur kernel.
- 5. The image processing method according to claim 1, wherein the dark current noise calibration step includes: Setting data of an initial image, placing the data in black cloth environments with different camera gains, and respectively counting pixel mean values, horizontal pixel mean values and longitudinal pixel mean values of a full image of the initial image under three RGB channels after polishing for fixed time; calculating the variance of the full image under each channel under the different camera gains; Acquiring a full image pixel value of the initial image under the fixed camera gain, and manufacturing a histogram of the image pixel value according to the full image pixel value; respectively making histograms under various different function distributions according to the pixel mean value and the variance; and comparing the fitting degree of the histogram under the multiple different function distributions and the histogram of the image pixel value, and selecting the most coincident function distribution as the distribution of the dark current noise.
- 6. The image processing method of claim 5, wherein the plurality of different function distributions includes a gaussian distribution, a poisson distribution, and a gamma distribution, and the most-fit function distribution is a gamma distribution.
- 7. The image processing method according to claim 1, wherein the step of calibrating the gaussian noise includes: setting data of an initial image and a plurality of different camera gains; after the initial image is placed in darkroom environments with different camera gains for lighting for fixed time, respectively counting the pixel mean value and variance of the full image of the image under three RGB channels; a graph of the pixel mean and the variance is manufactured according to the relation between the pixel mean and the variance; acquiring a pixel mean value of an image shot by the camera, searching a variance of the image according to the curve graph, and And generating Gaussian noise at zero pixel mean according to the acquired variance, wherein the Gaussian noise accords with Gaussian distribution.
- 8. The image processing method according to claim 1, wherein the step of injecting calibration noise into the blurred image to form a first noise image includes: respectively acquiring function distribution corresponding to the dark current noise and the Gaussian noise; And injecting the dark current noise and the Gaussian noise into the blurred image according to the corresponding function distribution respectively to form a first noise image.
- 9. The image processing method according to claim 1, wherein the lossy compression coefficients employed in compressing the low-resolution image into a compressed image and in compressing the second noise image into a low-definition image are 70 and 90, respectively.
- 10. The image processing method of claim 9, wherein the step of lossy compressing the image comprises: converting the image from RGB data to YUV data while performing 4:2:0 chroma sampling; dividing the image in the YUV data format into 8x8 cells, and performing discrete cosine change on each cell; after the discrete cosine change is executed, carrying out quantization processing on the image and discarding high-frequency region data; and performing entropy coding on the matrix corresponding to the quantized image to form a compressed image.
- 11. A method of data set acquisition, comprising: performing the image processing method according to any one of claims 1 to 10, and Storing the high-definition image and the low-definition image corresponding to the high-definition image as a pair of image data pairs; A plurality of image data pairs are acquired to produce a training data set.
- 12. An image processing apparatus for implementing the image processing method of any one of claims 1 to 10, the image processing apparatus comprising: the image blurring unit is used for obtaining a blurred image by the action of the obtained high-resolution high-definition image and a calibrated blurring kernel; the first noise injection unit is used for injecting calibration noise into the blurred image to form a first noise image; a downsampling unit for degrading the first noise image into a low resolution image by downsampling, and The first compression unit is used for carrying out lossy compression on the low-resolution image and reducing the storage space to obtain a compressed image; The second noise injection unit is used for simulating random noise in the transmission process, and adding random noise points into the compressed image to form a second noise image; a second compression unit for performing lossy compression on the second noise image and then storing the second noise image to obtain a low-resolution low-definition image, The high-definition image is an image formed by shooting an in-vivo organ by using a capsule endoscope, and the calibration blur kernel and the calibration noise are results obtained in the shooting process of fitting the high-definition image.
Description
Image processing method, data set acquisition method and image processing device Technical Field The present invention relates to the field of image processing technologies, and in particular, to an image processing method, a data set acquisition method, and an image processing apparatus. Background With the development of technology, there is an increasing demand for high-definition and high-resolution images, especially in the field of medical imaging, which can greatly facilitate the main doctor to analyze the condition of a patient and make a diagnosis. Currently, a method of performing a gastrointestinal internal examination using a magnetically controlled capsule endoscope has been widely used, in which the inside of the capsule endoscope includes a magnet, and the movement of the endoscope in the body is controlled by the interaction between the magnet and an external magnet to take images of the stomach and the inner wall of the intestine, and a doctor can analyze the health condition of the stomach wall and the intestinal wall of a user based on the images. Limited by the hardware limitation of the image transmission tool, the resolution of the image obtained by shooting is low in many times, and the detailed textures on the stomach wall and the inner side of the intestinal tract are blurred, so that great obstruction is brought to the analysis and diagnosis of doctors. Therefore, it is necessary to use image super-resolution (Image Super Resolution, restoring high resolution images from a low resolution image or image sequence) to increase the resolution of these images and restore the detail texture of the images. The existing image super-resolution technology is divided into a traditional method and a method based on deep learning, the development time of the traditional method is long, the resolution of an input image is generally improved by adopting a spatial spline interpolation (bilinear) mode, but the blurring of a generated high-resolution image is heavy, noise is amplified, and the overall quality of the image is low. The deep learning-based method depends on the quality of training data, and if the training data is poorly designed, the trained model often cannot achieve a good effect. In general, the data set manufacturing method in the deep learning method is to acquire a high-definition image, then downsample the high-resolution image to obtain a corresponding low-resolution image, and use the low-definition-high-definition image pair as a training data set. The obtained data set is simpler, the degradation process of the image can not be comprehensively expressed, and the effect of a model trained by the data set is often unsatisfactory in practical application, so that the model is built according to the data set obtained by the current deep learning method, the obtained high-resolution image is still not very clear, the image recovery effect is poor, and the analysis and judgment of the image are affected. Disclosure of Invention In view of the above problems, an object of the present invention is to provide an image processing method, a data set acquisition method, and an image processing apparatus that acquire a high-definition-low-definition image data pair of high quality by simulating a degradation process of a high-definition image captured in vivo by a capsule endoscope to obtain a low-definition image of low resolution, so as to solve the problems in the prior art. According to a first aspect of the present invention, there is provided an image processing method comprising: the obtained high-resolution high-definition image is subjected to the action of a calibrated fuzzy kernel to obtain a fuzzy image; injecting calibration noise into the blurred image to form a first noise image; degrading the first noise image into a low resolution image by downsampling, and Performing lossy compression on the low-resolution image, and reducing the storage space to obtain a compressed image; Simulating random noise in the transmission process, and adding random noise points into the compressed image to form a second noise image; the second noise image is subjected to lossy compression and then is stored, so as to obtain a low-resolution low-definition image, The high-definition image is an image formed by shooting an in-vivo organ by using a capsule endoscope, and the calibration blur kernel and the calibration noise are results obtained in the shooting process of fitting the high-definition image. Optionally, the calibration blur kernel includes a flash focus blur kernel that characterizes image blur caused by distortion and flash focus in the process of capturing the high definition image by the camera of the capsule endoscope, and a motion blur kernel that characterizes image blur caused by in vivo motion of the camera. Optionally, the blurred image is a result obtained by calculating the high-definition image, the flash focus blur kernel and the motion blur kernel at the same time. O