Image processing method and device, electronic equipment and computer readable storage medium
By determining the pixel type and performing targeted pixel value processing in the image acquisition system, the problem of random noise suppression is solved, achieving a simple and efficient image noise reduction effect, which is suitable for various shooting scenarios.
Patent Information
- Application Number
- CN202511085655.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-04
- Publication Date
- 2025-12-23
AI Technical Summary
Existing technologies struggle to effectively suppress random noise in image acquisition systems, leading to image blurring and loss of target details. Furthermore, existing methods are computationally complex or resource-intensive.
By determining the shooting scene based on shooting parameters, multiple consecutive image frames are captured for the target. The pixel type is determined based on the pixel value and spatial neighborhood information. Pixel value processing is then performed according to the shooting scene and pixel type to achieve targeted noise reduction in both the spatial and temporal domains.
It effectively suppresses random noise, preserves image details, and is simple, efficient, and suitable for any shooting scenario with low resource consumption.
Smart Images

Figure CN121190341A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of image processing, and particularly relates to an image processing method and device, an electronic device, and a computer readable storage medium. BACKGROUND
[0002] Temporal noise (TN) as a typical noise type in an image acquisition system has a great negative impact on imaging results, such as affecting the recognition degree of a small target and a target detection result.
[0003] Temporal noise suppression is an important part of image processing. Related technologies use frame averaging, adaptive weight, and other time domain filtering methods, which cannot effectively solve the problem of noise with large time domain fluctuations. Some related technologies use Gaussian filtering, mean filtering, guided filtering, and other spatial filtering methods, which inevitably cause image blurring, loss of target details, and other problems. SUMMARY
[0004] The present application aims to at least solve one of the technical problems in the related art. To this end, the present application provides an image processing method, device, electronic device, and computer readable storage medium, which maintains the original details of the image while suppressing random noise.
[0005] In a first aspect, the present application provides an image processing method, which comprises:
[0006] determining a shooting scene based on shooting parameters, and shooting a plurality of continuous image frames for a target; the shooting scene is any one of a dark field, a medium gray field, and a bright field;
[0007] For any position of a pixel point to be processed, determining a pixel type of the pixel point to be processed according to pixel values of the pixel point to be processed in each image frame and pixel values of each pixel point in a target region centered on the pixel point to be processed; the pixel type is any one of a non-noise type, a bright noise type, and a dark noise type;
[0008] performing value processing on the pixel values of the pixel point to be processed in each image frame according to the shooting scene and the pixel type of the pixel point to be processed, to obtain a target pixel value at a corresponding position of the pixel point to be processed; the target pixel value is any one of a maximum pixel value, a minimum pixel value, an average pixel value, and a median pixel value of the pixel point to be processed in each image frame;
[0009] outputting a target image according to the target pixel values at the corresponding positions of each pixel point to be processed.
[0010] According to the image processing method, the pixel type of the pixel point to be processed is determined according to the pixel value of each image frame and the pixel value of each pixel point in the target region centered on the pixel point to be processed, the pixel type is any one of non-noise type, bright noise type and dark noise type, multi-frame statistics is performed from the spatial domain, so as to determine the pixel point needing noise reduction, and then the pixel value of each image frame of the pixel point to be processed is processed according to the shooting scene and the pixel type of the pixel point to be processed, so as to obtain the target pixel value of the corresponding position of the pixel point to be processed, and the pixel value of the pixel point with noise is corrected from the time domain, so as to effectively suppress the random noise and maintain the original image details, which can meet any shooting scene, has a simple implementation, high real-time performance and processing efficiency, and occupies less resources.
[0011] According to an embodiment of the present application, the pixel type of the pixel point to be processed is determined according to the pixel value of each image frame and the pixel value of each pixel point in the target region centered on the pixel point to be processed, comprising:
[0012] For the pixel point to be processed in any image frame, the average pixel value of the target region centered on the pixel point to be processed is determined;
[0013] The pixel difference between the pixel point to be processed and the average pixel value is determined;
[0014] According to the pixel difference, the pixel mark of the pixel point to be processed in the image frame is determined; the pixel mark is used to indicate that the pixel point to be processed is a maximum value, a minimum value or an intermediate value in the target region;
[0015] Based on the pixel mark of the pixel point to be processed in each image frame, the number of each pixel mark is determined;
[0016] According to the number of each pixel mark, the pixel type of the pixel point to be processed is determined.
[0017] According to an embodiment of the present application, the pixel mark includes a first mark, a second mark and a third mark; the first mark is used to indicate that the pixel point to be processed is an intermediate value in the target region; the second mark is used to indicate that the pixel point to be processed is a maximum value in the target region; and the third mark is used to indicate that the pixel point to be processed is a minimum value in the target region;
[0018] According to the pixel difference, the pixel mark of the pixel point to be processed in the image frame is determined, comprising:
[0019] The target threshold range is obtained; the target threshold range is determined based on the standard deviation of the image frame or any region centered on the pixel point to be processed;
[0020] In the case that the pixel difference is in the target threshold range, the pixel mark of the pixel point to be processed in the image frame is determined as the first mark.
[0021] In a case where the pixel difference is greater than the maximum value of the target threshold range, the pixel flag of the pixel point to be processed in the image frame is determined as a second flag;
[0022] In a case where the pixel difference is less than the minimum value of the target threshold range, the pixel flag of the pixel point to be processed in the image frame is determined as a third flag.
[0023] According to an embodiment of the present application, the pixel type of the pixel point to be processed is determined according to the number of each pixel flag, comprising:
[0024] According to the number of each first flag, second flag and third flag, the proportion of each first flag, second flag and third flag is determined respectively;
[0025] In a case where the proportion of the first flag is equal to a first target proportion, or the proportion of the first flag is not equal to the first target proportion, but the proportion of the second flag or the third flag is higher than a second target proportion, the pixel type of the pixel point to be processed is determined as a non-noise type; the second target proportion is less than the first target proportion;
[0026] In a case where the proportion of the first flag is not equal to the first target proportion, and the proportion of the second flag and the third flag are both less than the second target proportion, a target proportion is determined from the proportion of the second flag and the proportion of the third flag according to the size relationship between the proportion of the second flag and the proportion of the third flag and a third target proportion; the third target proportion is less than the second target proportion;
[0027] In a case where the target proportion is the proportion of the second flag, the pixel type of the pixel point to be processed is determined as a bright noise type;
[0028] In a case where the target proportion is the proportion of the third flag, the pixel type of the pixel point to be processed is determined as a dark noise type.
[0029] According to an embodiment of the present application, the target proportion is determined from the proportion of the second flag and the proportion of the third flag according to the size relationship between the proportion of the second flag and the proportion of the third flag and a third target proportion, comprising:
[0030] In a case where the proportion of the second flag or the proportion of the third flag is the third target proportion, the larger value of the proportion of the second flag and the proportion of the third flag is determined as the target proportion;
[0031] In a case where the proportion of the second flag and the proportion of the third flag are both not the third target proportion, the smaller value of the proportion of the second flag and the proportion of the third flag is determined as the target proportion.
[0032] According to one embodiment of the present application, the pixel values of the to-be-processed pixel point in each image frame are processed according to the shooting scene and the pixel type of the to-be-processed pixel point, to obtain a target pixel value at the corresponding position of the to-be-processed pixel point, including:
[0033] In the case that the shooting scene is any one of a dark field, a medium gray field and a bright field, and the pixel type of the to-be-processed pixel point is a non-noise type, the average pixel value or the median pixel value of the to-be-processed pixel point in each image frame is taken as the target pixel value;
[0034] In the case that the shooting scene is a dark field or a medium gray field, and the pixel type of the to-be-processed pixel point is a bright noise type, the minimum pixel value of the to-be-processed pixel point in each image frame is taken as the target pixel value;
[0035] In the case that the shooting scene is a bright field or a medium gray field, and the pixel type of the to-be-processed pixel point is a dark noise type, the maximum pixel value of the to-be-processed pixel point in each image frame is taken as the target pixel value.
[0036] According to one embodiment of the present application, after continuously shooting a plurality of image frames for a target, the method further includes:
[0037] Correcting the response uniformity of the plurality of image frames based on a preset correction mode, the preset correction mode including at least one of flat field correction, bad pixel and bad line correction.
[0038] In a second aspect, the present application provides an image processing device, which includes:
[0039] A shooting module, configured to determine a shooting scene based on shooting parameters, and to continuously shoot a plurality of image frames for a target; the shooting scene being any one of a dark field, a medium gray field and a bright field;
[0040] A first processing module, configured to, for a to-be-processed pixel point at any position, determine a pixel type of the to-be-processed pixel point according to the pixel values of the to-be-processed pixel point in each image frame and the pixel values of each pixel point in a target region centered on the to-be-processed pixel point; the pixel type being any one of a non-noise type, a bright noise type and a dark noise type;
[0041] A second processing module, configured to process the pixel values of the to-be-processed pixel point in each image frame according to the shooting scene and the pixel type of the to-be-processed pixel point, to obtain a target pixel value at the corresponding position of the to-be-processed pixel point; the target pixel value being any one of a maximum pixel value, a minimum pixel value, an average pixel value and a median pixel value of the to-be-processed pixel point in each image frame;
[0042] An output module, configured to output a target image; the pixel value of each pixel point in the target image being a target pixel value at the corresponding position.
[0043] According to the image processing apparatus provided in the application, the pixel type of the pixel point to be processed is determined according to the pixel value of each image frame and the pixel value of each pixel point in the target region centered on the pixel point to be processed, the pixel type being any one of the non-noise type, the bright noise type and the dark noise type, the pixel point needing noise reduction is determined by multi-frame statistics from the spatial domain, the pixel value of each image frame of the pixel point to be processed is processed according to the shooting scene and the pixel type of the pixel point to be processed, the target pixel value of the corresponding position of the pixel point to be processed is obtained, the pixel value of the pixel point with noise is corrected from the time domain, the random noise is effectively suppressed, the original image details are kept, the method can meet any shooting scene, the implementation is simple, the real-time performance and processing efficiency are high, and the occupied resources are less.
[0044] In a third aspect, the application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the image processing method provided in the first aspect when executing the computer program.
[0045] In a fourth aspect, the application provides a non-transitory computer-readable storage medium having a computer program stored thereon, and the computer program is executable on a processor to implement the image processing method provided in the first aspect.
[0046] In a fifth aspect, the application provides a chip, including a processor and a communication interface, the communication interface is coupled with the processor, the processor is used to run a program or an instruction to implement the image processing method provided in the first aspect.
[0047] In a sixth aspect, the application provides a computer program product, including a computer program, and the computer program is executable on a processor to implement the image processing method provided in the first aspect.
[0048] The one or more technical solutions provided in the embodiments of the application have at least one of the following technical effects:
[0049] The pixel type of the pixel point to be processed is determined according to the pixel value of the pixel point to be processed in each image frame and the pixel value of each pixel point in the target region centered on the pixel point to be processed, the pixel type being any one of a non-noise type, a bright noise type and a dark noise type, so that multi-frame statistics are performed from the spatial domain, thereby determining the pixel point that needs to be denoised, and then the pixel value of the pixel point to be processed in each image frame is processed according to the shooting scene and the pixel type of the pixel point to be processed, so as to obtain the target pixel value of the corresponding position of the pixel point to be processed, thereby performing pixel value correction on the pixel point with noise from the time domain, so as to effectively suppress random noise and maintain the original image details, can satisfy any shooting scene, the implementation is relatively simple, has high real-time performance and processing efficiency, and occupies less resources.
[0050] Additional aspects and advantages of the application will be made apparent by the following description and the appended claims. BRIEF DESCRIPTION OF DRAWINGS
[0051] The above and / or additional aspects and advantages of the application will become apparent and be readily understood by considering the following description, taken in conjunction with the accompanying drawings, in which:
[0052] Figure 1 is a flowchart of an image processing method provided by an embodiment of the application;
[0053] Figure 2 is a structural schematic diagram of an image processing device provided by an embodiment of the application;
[0054] Figure 3 is a structural schematic diagram of an electronic device provided by an embodiment of the application. DETAILED DESCRIPTION
[0055] The technical solutions in the embodiments of the application will be clearly described below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are some, but not all, of the embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by a person of ordinary skill in the art belong to the scope of protection of the application.
[0056] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of a kind and do not limit the number of objects, for example, the first object can be one or more. In addition, "and / or" in the specification and claims indicates at least one of the connected objects, and the character " / " generally indicates that the front and rear associated objects are in an "or" relationship.
[0057] Temporal Noise (TN) is a typical noise type in image acquisition systems, mainly manifested as irregular fluctuations of pixel values in the time domain. Its distribution characteristics have non-periodicity and unpredictability, and present a global diffusion feature in the spatial dimension. From the physical cause analysis, such noise is mainly derived from the charge-voltage conversion process of CMOS image sensors, including but not limited to thermal noise of the readout circuit, amplifier noise, and quantization error in the analog-to-digital conversion process, etc.
[0058] In machine vision application scenarios, random noise has significant double harm to the imaging results: firstly, noise signals will be frequency domain aliasing with micro target features, resulting in a decrease in the signal-to-noise ratio (SNR) of the detection system, directly affecting the recognition of micro targets; secondly, abnormal fluctuations of gray values caused by noise may be misjudged as real targets, especially in high-precision detection systems, noise interference may cause systematic deviation of the detection results.
[0059] Random noise suppression is an important part of image processing. Existing traditional image processing methods can be divided into spatial-temporal domain filtering and transform domain filtering according to the processing domain. Common temporal filtering methods include frame averaging and adaptive weight, which cannot completely solve the problem of noise with large temporal fluctuations. Common spatial filtering methods include Gaussian filtering, mean filtering, and guided filtering, which inevitably cause image blurring and loss of target details. Transform domain filtering methods include wavelet transform and curvelet transform, which have complex calculation processes and defects in processing efficiency. Methods based on deep learning have higher requirements for training samples, resources and deployment costs, limiting their application in general scenarios.
[0060] To solve the above problems, the embodiments of the present application provide an image processing method, device, electronic equipment and computer readable storage medium.
[0061] The image processing method, device, electronic equipment and readable storage medium provided by the embodiments of the present application will be described in detail below in combination with the drawings, through specific embodiments and their application scenarios.
[0062] The image processing method can be applied to the terminal, and can be executed by the hardware or software in the terminal.
[0063] The image processing method provided in this application embodiment can be executed by an electronic device or a functional module or entity in an electronic device that can implement the image processing method. The electronic devices mentioned in this application embodiment include, but are not limited to, mobile phones, tablets, computers, cameras, and wearable devices. The image processing method provided in this application embodiment will be described below using an electronic device as the execution subject as an example.
[0064] like Figure 1 As shown in the figure, this application provides a flowchart of an image processing method, which includes steps 110, 120, 130 and 140.
[0065] Step 110: Determine the shooting scene based on the shooting parameters, and take multiple consecutive image frames for the target; the shooting scene can be any one of dark field, mid-gray field, and bright field.
[0066] Shooting parameters include, but are not limited to: shutter speed, aperture, image average, ISO sensitivity, focal length, and resolution.
[0067] This application embodiment can determine the shooting scene based on shooting parameters. The shooting parameters can be one or more of the above-mentioned parameters. For example, since the exposure time affects the sensitivity of the captured image frames, the shooting scene can be determined by the exposure time. Alternatively, the shooting scene can be determined by the image mean.
[0068] Shooting scenarios include, but are not limited to, dark scenes, mid-gray scenes, and bright scenes.
[0069] Dark areas refer to regions of low brightness in an image, typically represented as near-black or very dark areas. These areas are often underexposed or depict scenes shot in low-light conditions. Dark areas have low pixel values, usually close to 0 (black or very close to black).
[0070] Mid-grayscale areas refer to regions of moderate brightness in an image, neither too bright nor too dark, typically falling within the middle brightness range of a grayscale image. Mid-grayscale pixel values are usually located in the middle grayscale range, close to 128 (within the 8-bit grayscale value range of 0 to 255). This means that these areas in the image have moderate brightness, neither too dark nor too bright.
[0071] Bright field refers to a region with high brightness in an image, which usually appears as a region close to white or very bright. In these regions, there is sufficient light, or the camera is shooting in a bright environment. The pixel value of the bright field is high, usually close to 255 (white or very close to white).
[0072] In practical applications, the image processing method provided in the embodiments of the present application can be selected to be turned on or off according to different scene brightness, and after the function is turned on, the selection of the above shooting parameters, the switching of the shooting scene and the selection of the image capturing mode.
[0073] The embodiments of the present application need to collect N image frames (N≥2) for contact. The image capturing mode can be a multi-frame mode and a single-frame mode.
[0074] The multi-frame mode is to collect N image frames with a set exposure time set_exp, that is, to collect an image frame every exposure time set_exp.
[0075] The single-frame mode is to collect N image frames within a set exposure time set_exp. When shooting based on the single-frame mode, the pixel value of each pixel point is the product of the original pixel value and the preset exposure gain.
[0076] Step 120, for any position of the pixel point to be processed, the pixel type of the pixel point to be processed is determined according to the pixel value of the pixel point to be processed in each image frame and the pixel value of each pixel point in the target region centered on the pixel point to be processed. The pixel type is any one of non-noise type, bright noise type and dark noise type.
[0077] After collecting the above plurality of image frames, the response uniformity of the plurality of image frames can be corrected to improve the image response uniformity. The correction methods include but are not limited to flat field correction, bad point and bad line correction, etc. The parameters for correction can be stored in the imaging system through offline calibration, or calculated in real time online.
[0078] The pixel point to be processed can be a pixel point at any position (x, y), and the pixel value of the pixel point can be a gray value.
[0079] It can be understood that, for a target, N continuous image frames are shot, then the pixel point to be processed at the same position in the N image frames has multiple pixel values, which may be the same or different due to random noise. The pixel type of the pixel point to be processed needs to be determined in combination with the pixel value of the pixel point to be processed in each image frame and the pixel value of each pixel point in the target region centered on the pixel point to be processed.
[0080] For each image frame, the pixel type of the pixel point to be processed is determined by using the spatial neighborhood information of the pixel point to be processed.
[0081] Specifically, a target region centered on the pixel point to be processed can be determined, the target region is usually at least 3*3 in size, and then the average pixel value of the target region is determined, and the pixel difference between the pixel point to be processed and the average pixel value is determined.
[0082] According to the pixel difference, the pixel mark of the pixel point to be processed in the image frame is determined; the pixel mark is used to indicate that the pixel point to be processed is a maximum value, a minimum value or an intermediate value in the target region, such as setting the pixel mark to 0 to indicate the intermediate value, setting the pixel mark to 1 to indicate the maximum value, and setting the pixel mark to 2 to indicate the minimum value; according to the number of each pixel mark, the pixel type of the pixel point to be processed is determined, and the detailed determination process is described later.
[0083] The pixel type is non-noise type, bright noise type and dark noise type, wherein the non-noise type refers to a region or pixel point in the image without obvious noise interference.
[0084] The bright noise type refers to a region or pixel point in the image with abnormally high brightness due to a noise source, which is usually represented as over-brightness or bright spots. These abnormally bright pixel points are usually caused by faults of light sensing elements, low signal-to-noise ratio, excessive light or other environmental factors. These bright noises are usually represented as some unnatural bright spots or bright spots in the image, which are usually much brighter than the surrounding pixels. The pixel value of these pixel points can be close to the maximum value (such as 255).
[0085] The dark noise type refers to a region in the image with abnormally low brightness due to a noise source, which is usually represented as over-dark pixels or dark spots. These regions are usually much darker than the surrounding pixels. Dark noise is represented as dark spots or dark spots in the image, which are usually darker than the surrounding pixels, and the pixel value can be close to the minimum value (such as 0).
[0086] In step 130, according to the shooting scene and the pixel type of the pixel point to be processed, the pixel value of the pixel point to be processed in each image frame is processed to obtain the target pixel value of the corresponding position of the pixel point to be processed. The target pixel value is any one of the maximum pixel value, the minimum pixel value, the average pixel value and the median pixel value of the pixel point to be processed in each image frame.
[0087] After determining the pixel type of the pixel point to be processed, the pixel type can be further used for time domain processing to determine the target pixel value of the corresponding position of each pixel point to be processed, which is the pixel value after noise reduction.
[0088] The pixel value of the pixel point to be processed in each image frame can be processed in combination with the shooting scene and the pixel type of the pixel point to be processed to determine the target pixel value of the corresponding position of the pixel point to be processed.
[0089] Specifically, pixel values of the to-be-processed pixel point P(x, y) in the time domain N image frames can be sorted to obtain any one of a maximum pixel value maxNV(x, y), a minimum pixel value minNV(x, y) and a median pixel value midNV(x, y), and the N pixel values can also be averaged to obtain an average pixel value meanNV(x, y).
[0090] For an image frame in which the shooting scene is a dark field or a middle gray field, when there is a to-be-processed pixel point of the bright noise type, the minimum pixel value in the pixel values of the to-be-processed pixel point is usually taken as the target pixel value, so as to reduce the noise of the to-be-processed pixel point.
[0091] For an image frame in which the shooting scene is a bright field or a middle gray field, when there is a to-be-processed pixel point of the dark noise type, the maximum pixel value in the pixel values of the to-be-processed pixel point is usually taken as the target pixel value, so as to reduce the noise of the to-be-processed pixel point.
[0092] In addition, for a to-be-processed pixel point of the non-noise type, whether the shooting scene is a dark field, a middle gray field or a bright field, the average pixel value or the median pixel value in the pixel values of the to-be-processed pixel point can be taken as the target pixel value, and in some modes, a pixel value can also be randomly taken as the target pixel value, and this is not limited.
[0093] Step 140: outputting a target image according to the target pixel values of the corresponding positions of the to-be-processed pixel points.
[0094] The embodiments of the present application determine the target pixel points and then output the target image, so as to realize processing of multiple image frames into one target image.
[0095] The foregoing embodiments have described that in the multi-frame mode, one image is collected every set exposure time, in which case, the pixel value of each pixel point in the target image is the target pixel value of the corresponding position, and the output target pixel value also meets the set gray scale range requirement.
[0096] In the single-frame mode, the image collection device collects multiple images within the set exposure time, in which case, the target pixel value of the corresponding position of each to-be-processed pixel point needs to be multiplied by the exposure gain, and the pixel point of the output target image corresponds to the gain target pixel value, so as to meet the set gray scale range requirement.
[0097] The embodiment of the application determines the pixel type of the pixel point to be processed according to the pixel value of each image frame and the pixel value of each pixel point in the target region centered on the pixel point to be processed, the pixel type being any one of non-noise type, bright noise type and dark noise type, realizes multi-frame statistics from the spatial domain, thereby determining the pixel point that needs to be denoised, and then performs value processing on the pixel value of each image frame of the pixel point to be processed according to the shooting scene and the pixel type of the pixel point to be processed, to obtain the target pixel value of the corresponding position of the pixel point to be processed, realizes pixel value correction of the pixel point with noise from the time domain, thereby effectively suppressing random noise, meeting the requirement for any shooting scene, and having a relatively simple implementation, high real-time performance and processing efficiency, and less resource occupation.
[0098] In some embodiments, determining the pixel type of the pixel point to be processed according to the pixel value of each image frame and the pixel value of each pixel point in the target region centered on the pixel point to be processed comprises:
[0099] For the pixel point to be processed in any image frame, determining the average pixel value of the target region centered on the pixel point to be processed;
[0100] Determining the pixel difference between the pixel point to be processed and the average pixel value;
[0101] According to the pixel difference, determining the pixel flag of the pixel point to be processed in the image frame; the pixel flag is used to indicate that the pixel point to be processed is a maximum value, a minimum value or an intermediate value in the target region;
[0102] Based on the pixel flag of the pixel point to be processed in each image frame, determining the number of each pixel flag;
[0103] According to the number of each pixel flag, determining the pixel type of the pixel point to be processed.
[0104] It has been stated in the foregoing embodiments that the target region can be a region centered on the pixel point to be processed, and can be 3*3 size, 5*5 size or other size, the average pixel value of the target region can be determined, and after the pixel difference between the pixel point to be processed and the average pixel value is determined, the pixel difference and the target threshold range [-thrNV, thrNV] are compared, the target threshold range [-thrNV, thrNV] can be determined based on the standard deviation of the image frame or any region centered on the pixel point to be processed, for example, thrNV=2 times the standard deviation of the whole image.
[0105] The pixel flag of the pixel point to be processed in the image frame can be determined according to the comparison result; the pixel flag is used to indicate that the pixel point to be processed is a maximum value, a minimum value or an intermediate value in the target region.
[0106] In some embodiments, the pixel flag includes a first flag, a second flag and a third flag; the first flag is used to indicate that the to-be-processed pixel point is a middle value in the target region; the second flag is used to indicate that the to-be-processed pixel point is a maximum value in the target region; and the third flag is used to indicate that the to-be-processed pixel point is a minimum value in the target region.
[0107] According to the pixel difference, the pixel flag of the to-be-processed pixel point in the image frame is determined, including:
[0108] A target threshold range is obtained; the target threshold range is determined based on a standard deviation of the image frame or an arbitrary region centered on the to-be-processed pixel point;
[0109] In a case where the pixel difference is located in the target threshold range, the pixel flag of the to-be-processed pixel point in the image frame is determined as the first flag;
[0110] In a case where the pixel difference is greater than a maximum value of the target threshold range, the pixel flag of the to-be-processed pixel point in the image frame is determined as the second flag;
[0111] In a case where the pixel difference is less than a minimum value of the target threshold range, the pixel flag of the to-be-processed pixel point in the image frame is determined as the third flag.
[0112] It has been illustrated in the foregoing embodiments that the target threshold range [-thrNV, thrNV] can be determined based on a standard deviation of the image frame or an arbitrary region centered on the to-be-processed pixel point, such as thrNV = 2 times a standard deviation of the entire image, and the target threshold range has a maximum value and a minimum value.
[0113] The first flag, the second flag and the third flag in the embodiments of the present application can be represented by different characters.
[0114] Specifically, in a case where the pixel difference is located in the target threshold range, it is indicated that the to-be-processed pixel point is a uniform background, and the pixel flag of the to-be-processed pixel point in the image frame can be set as the first flag; the first flag can be specifically 0, and a binary representation can be 00.
[0115] In a case where the pixel difference is greater than a maximum value of the target threshold range, it is indicated that the to-be-processed pixel point is a local maximum value of the target region, and the pixel flag of the to-be-processed pixel point in the image frame can be set as the second flag; the first flag can be specifically 1, and a binary representation can be 01.
[0116] In a case where the pixel difference is less than a minimum value of the target threshold range, it is indicated that the to-be-processed pixel point is a local minimum value of the target region, and the pixel flag of the to-be-processed pixel point in the image frame is determined as the third flag; the first flag can be specifically 2, and a binary representation can be 11.
[0117] By setting different pixel flags for different types of pixel points, the prominent areas or change points in the image can be effectively distinguished.
[0118] After determining the pixel flags of the pixel point to be processed in each image frame, the number of each pixel flag can be counted, so as to determine the pixel type of the pixel point to be processed according to the number of each pixel flag.
[0119] In some embodiments, determining the pixel type of the pixel point to be processed according to the number of each pixel flag comprises:
[0120] According to the number of each of the first flag, the second flag and the third flag, the proportion of each of the first flag, the second flag and the third flag is determined respectively.
[0121] In the case where the proportion of the first flag is equal to the first target proportion, or the proportion of the first flag is not equal to the first target proportion, but the proportion of the second flag or the third flag is higher than the second target proportion, the pixel type of the pixel point to be processed is determined as the non-noise type; the second target proportion is less than the first target proportion.
[0122] In the case where the proportion of the first flag is not equal to the first target proportion, and the proportion of the second flag and the third flag is less than the second target proportion, a target proportion is determined from the proportion of the second flag and the proportion of the third flag according to the size relationship between the proportion of the second flag and the proportion of the third flag and the third target proportion; the third target proportion is less than the second target proportion.
[0123] In the case where the target proportion is the proportion of the second flag, the pixel type of the pixel point to be processed is determined as the bright noise type.
[0124] In the case where the target proportion is the proportion of the third flag, the pixel type of the pixel point to be processed is determined as the dark noise type.
[0125] After counting the number of the first flag, the second flag and the third flag, the proportion of each of the first flag, the second flag and the third flag can be determined respectively, which are uni_count, max_count and min_count.
[0126] The meanings of the three statistical values can be distinguished as follows: when there is no second flag or third flag (i.e. uni_count = 1), it can be considered that the pixel point to be processed P(x, y) is a background pixel without random noise interference; when there is a second flag or a third flag (i.e. uni_count ≠ 1), there are two cases: when the second flag or the third flag (max_count or min_count) is very large, the pixel point to be processed is most likely to be a target; when the second flag or the third flag exists but has the smallest proportion, it is considered that the pixel point to be processed is a background pixel disturbed by random noise.
[0127] Specifically, the classification label is marked with noiseS, 0 is a non-noise type, 1 is a bright noise type, and 2 is a dark noise type. The following cases exist:
[0128] (1) When the proportion of the first flag is equal to the first target proportion, the first target proportion can be 100%, that is, uni_count = 1, and it can be determined that the pixel to be processed is background, and the pixel type of the pixel to be processed is a non-noise type, that is, noiseS = 0.
[0129] (2) When the proportion of the first flag is not equal to the first target proportion, that is, uni_count ≠ 1, if the proportion of the second flag or the proportion of the third flag is higher than the second target proportion, that is, if max_count > percetT or min_count > percetT, it can be considered that the pixel to be processed is a target, and the pixel type of the pixel to be processed is a non-noise type, that is, noiseS = 0, percetT is the second target proportion, and percetT ∈ (0, 1). Generally, it can be set to 0.5 or more, indicating a large proportion.
[0130] (3) When the proportion of the first flag is not equal to the first target proportion, that is, uni_count ≠ 1, if the proportion of the second flag and the proportion of the third flag are both less than the second target proportion, that is, max_count < percetT and min_count < percetT, the target proportion can be determined from the proportion of the second flag and the proportion of the third flag according to the size relationship between the proportion of the second flag and the third target proportion.
[0131] In some embodiments, the target proportion is determined from the proportion of the second flag and the proportion of the third flag according to the size relationship between the proportion of the second flag and the third target proportion, comprising:
[0132] In the case where the proportion of the second flag or the proportion of the third flag is the third target proportion, the larger value of the proportion of the second flag and the proportion of the third flag is determined as the target proportion;
[0133] In the case where the proportion of the second flag and the proportion of the third flag are not the third target proportion, the smaller value of the proportion of the second flag and the proportion of the third flag is determined as the target proportion.
[0134] The target proportion extr_count is determined based on the following manner:
[0135] In the case of max_count = 0 or min_count = 0 (or max_count x min_count = 0), the larger value of max_count and min_count = 0 is the target proportion, that is, extr_count = max(max_count, min_count).
[0136] In the case of max_count ≠ 0 and min_count ≠ 0 (or max_count x min_count ≠ 0), the smaller value of max_count and min_count = 0 is the target proportion, that is, extr_count = min(max_count, min_count).
[0137] In the case of the target proportion being the proportion of the second flag, the pixel type of the pixel point to be processed is determined as the bright noise type; in the case of the target proportion being the proportion of the third flag, the pixel type of the pixel point to be processed is determined as the dark noise type, that is:
[0138] In the case of extr_count = max_count, noiseS = 1;
[0139] In the case of extr_count = min_count, noiseS = 2.
[0140] In addition, in some other embodiments, the association relationship between the first flag and the non-noise type can be established, the association relationship between the second flag and the bright noise type can be established, the association relationship between the third flag and the dark noise type can be established, and the pixel flag with the largest proportion can be taken as the target pixel flag, and the pixel type associated with the target pixel flag can be taken as the pixel type of the pixel point to be processed.
[0141] In some embodiments, according to the shooting scene and the pixel type of the pixel point to be processed, the pixel value of the pixel point to be processed in each image frame is taken, and a target pixel value of a corresponding position of the pixel point to be processed is obtained, including:
[0142] In the case of the shooting scene being any one of a dark field, a medium gray field and a bright field, and the pixel type of the pixel point to be processed being a non-noise type, the average pixel value or the median pixel value of the pixel point to be processed in each image frame is taken as the target pixel value;
[0143] In the case of the shooting scene being a dark field or a medium gray field, and the pixel type of the pixel point to be processed being a bright noise type, the minimum pixel value of the pixel point to be processed in each image frame is taken as the target pixel value;
[0144] In the case that the shooting scene is a bright field or a middle gray field and the pixel type of the pixel point to be processed is a dark noise type, the maximum pixel value of the pixel point to be processed in each image frame is taken as the target pixel value.
[0145] The foregoing embodiments have shown that the pixel values of the pixel point P(x, y) in the time domain N image frames can be sorted to obtain any one of the maximum pixel value maxNV(x, y), the minimum pixel value minNV(x, y) and the median pixel value midNV(x, y), and the N pixel values can also be averaged to obtain the average pixel value meanNV(x, y).
[0146] For the image frame in which the shooting scene is a dark field or a middle gray field, when there is a pixel point to be processed of a bright noise type, the minimum pixel value in each pixel value of the pixel point to be processed is usually taken as the target pixel value, thereby reducing the noise of the pixel point to be processed.
[0147] For the image frame in which the shooting scene is a bright field or a middle gray field, when there is a pixel point to be processed of a dark noise type, the maximum pixel value in each pixel value of the pixel point to be processed is usually taken as the target pixel value, thereby reducing the noise of the pixel point to be processed.
[0148] In addition, for the pixel point to be processed of a non-noise type, whether it is a dark field, a middle gray field or a bright field, the average pixel value or the median pixel value in each pixel value of the pixel point to be processed can be taken as the target pixel value, and in some modes, a pixel value can also be randomly taken as the target pixel value, which is not limited.
[0149] For example, for a middle gray field, a possible value mode is:
[0150] When noiseS=0, the target pixel value f(x, y)=midNV(x, y) or midNV(x, y);
[0151] When noiseS=1, the target pixel value f(x, y)=minNV(x, y);
[0152] When noiseS=2, the target pixel value f(x, y)=maxNV(x, y);
[0153] In some embodiments, after continuously shooting a plurality of image frames for a target, the method further comprises:
[0154] Correcting the response uniformity of the plurality of image frames based on a preset correction mode, the preset correction mode including at least one of flat field correction, bad pixel and bad line correction.
[0155] The foregoing embodiments have shown the response uniformity correction, which will not be described here.
[0156] The image processing method provided in this application can be executed by an image processing device. This application uses an image processing device executing the image processing method as an example to illustrate the image processing device provided in this application.
[0157] This application also provides an image processing apparatus.
[0158] like Figure 2 As shown, the image processing device includes: a shooting module 210, a first processing module 220, a second processing module 230, and an output module 240.
[0159] The shooting module 210 is used to determine the shooting scene based on the shooting parameters and to capture multiple consecutive image frames of the target; the shooting scene can be any one of dark field, mid-gray field, and bright field;
[0160] The first processing module 220 is used to determine the pixel type of a pixel to be processed at any position based on the pixel value of the pixel to be processed in each image frame and the pixel value of each pixel in the target area centered on the pixel to be processed; the pixel type can be any one of non-noise type, bright noise type and dark noise type.
[0161] The second processing module 230 is used to process the pixel values of the pixel to be processed in each image frame according to the shooting scene and the pixel type of the pixel to be processed, so as to obtain the target pixel value at the corresponding position of the pixel to be processed; the target pixel value is any one of the maximum pixel value, minimum pixel value, average pixel value and median pixel value of the pixel to be processed in each image frame.
[0162] The output module 240 is used to output the target image; the pixel value of each pixel in the target image is the target pixel value at the corresponding position.
[0163] The image processing apparatus provided in this application determines the pixel type of the pixel to be processed based on the pixel values of the pixel to be processed in each image frame and the pixel values of each pixel in the target region centered on the pixel to be processed. The pixel type can be any one of non-noise type, bright noise type, and dark noise type. This achieves multi-frame statistics from a spatial domain perspective to determine the pixels that need noise reduction. Then, based on the shooting scene and the pixel type of the pixel to be processed, the pixel values of the pixel to be processed in each image frame are processed to obtain the target pixel value at the corresponding position of the pixel to be processed. This achieves targeted pixel value correction for noisy pixels from a temporal domain perspective, thereby effectively suppressing random noise. It can meet the requirements of any shooting scene, has a relatively simple implementation method, high real-time performance and processing efficiency, and consumes fewer resources.
[0164] In some embodiments, the first processing module 220 is specifically configured to:
[0165] For a pixel point to be processed in any image frame, determine an average pixel value of a target region centered on the pixel point to be processed;
[0166] Determine a pixel difference between the pixel point to be processed and the average pixel value;
[0167] According to the pixel difference, determine a pixel mark of the pixel point to be processed in the image frame; the pixel mark is used to indicate that the pixel point to be processed is a maximum value, a minimum value or an intermediate value in the target region;
[0168] Based on the pixel marks of the pixel point to be processed in each image frame, determine the number of each pixel mark;
[0169] According to the number of each pixel mark, determine the pixel type of the pixel point to be processed.
[0170] In some embodiments, the pixel mark includes a first mark, a second mark and a third mark; the first mark is used to indicate that the pixel point to be processed is an intermediate value in the target region; the second mark is used to indicate that the pixel point to be processed is a maximum value in the target region; and the third mark is used to indicate that the pixel point to be processed is a minimum value in the target region;
[0171] The first processing module 220 is specifically configured to:
[0172] Obtain a target threshold range; the target threshold range is determined based on the standard deviation of the image frame or any region centered on the pixel point to be processed;
[0173] In the case that the pixel difference is within the target threshold range, the pixel mark of the pixel point to be processed in the image frame is determined as the first mark;
[0174] In the case that the pixel difference is greater than the maximum value of the target threshold range, the pixel mark of the pixel point to be processed in the image frame is determined as the second mark;
[0175] In the case that the pixel difference is less than the minimum value of the target threshold range, the pixel mark of the pixel point to be processed in the image frame is determined as the third mark.
[0176] In some embodiments, the first processing module 220 is specifically configured to:
[0177] According to the number of each of the first mark, the second mark and the third mark, respectively determine the proportion of each of the first mark, the second mark and the third mark;
[0178] In a case where the proportion of the first flag is equal to the first target proportion, or in a case where the proportion of the first flag is not equal to the first target proportion, but the proportion of the second flag or the third flag is higher than the second target proportion, the pixel type of the pixel point to be processed is determined as a non-noise type; the second target proportion is less than the first target proportion;
[0179] In a case where the proportion of the first flag is not equal to the first target proportion, and the proportions of the second flag and the third flag are both less than the second target proportion, a target proportion is determined from the proportions of the second flag and the third flag according to the size relationship between the proportions of the second flag and the third flag and the third target proportion; the third target proportion is less than the second target proportion;
[0180] In a case where the target proportion is the proportion of the second flag, the pixel type of the pixel point to be processed is determined as a bright noise type;
[0181] In a case where the target proportion is the proportion of the third flag, the pixel type of the pixel point to be processed is determined as a dark noise type.
[0182] In some embodiments, the first processing module 220 is specifically further configured to:
[0183] In a case where the proportion of the second flag or the proportion of the third flag is the third target proportion, the larger value of the proportion of the second flag and the proportion of the third flag is determined as the target proportion;
[0184] In a case where the proportion of the second flag and the proportion of the third flag are not the third target proportion, the smaller value of the proportion of the second flag and the proportion of the third flag is determined as the target proportion.
[0185] In some embodiments, the second processing module 230 is specifically configured to:
[0186] In a case where the shooting scene is any one of a dark field, a middle gray field and a bright field, and the pixel type of the pixel point to be processed is a non-noise type, the average pixel value or the median pixel value of the pixel point to be processed in each image frame is taken as the target pixel value;
[0187] In a case where the shooting scene is a dark field or a middle gray field, and the pixel type of the pixel point to be processed is a bright noise type, the minimum pixel value of the pixel point to be processed in each image frame is taken as the target pixel value;
[0188] In a case where the shooting scene is a bright field or a middle gray field, and the pixel type of the pixel point to be processed is a dark noise type, the maximum pixel value of the pixel point to be processed in each image frame is taken as the target pixel value.
[0189] In some embodiments, the image processing apparatus further comprises:
[0190] The uniformity correction module is configured to correct the response uniformity of the plurality of image frames based on a preset correction mode, and the preset correction mode includes at least one of flat field correction, bad pixel correction, and bad line correction.
[0191] The image processing apparatus in the embodiments of the present applicationapplicationbe an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic deviceapplicationbe a terminal or another device other than a terminal. For example, the electronic deviceapplicationbe a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), andapplicationbe a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, without limitation.
[0192] The image processing apparatus in the embodiments of the present applicationapplicationbe a device with an operating system. The operating systemapplicationbe a Windows operating system, an Android operating system, an IOS operating system, or another possible operating system, without limitation.
[0193] The image processing apparatus provided in the embodiments of the present applicationapplicationimplement the method embodiments. Figure 1 The processes implemented by the method embodimentsapplicationbe implemented by the image processing apparatus, and thus repeated details are not described herein.
[0194] In some embodiments, as shown in Figure 3 The electronic device 300applicationinclude a processor 301, a memory 302, and a computer program stored in the memory 302 and executable on the processor 301. When the computer program is executed by the processor 301, the processes of the above image processing method embodimentsapplicationbe implemented, and the same technical effectsapplicationbe achieved. Thus, repeated details are not described herein.
[0195] The processor 301 can be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. The processor 301 can implement or execute the various exemplary logical blocks, modules, and circuits described in connection with the disclosure. The processor 301 can also be a combination of computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
[0196] The memory 302 can be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, a magnetic disk storage medium, other magnetic storage device, or any other medium that can be used to carry or store computer programs and that can be accessed by a computer, without limitation.
[0197] The memory 302 is used to store computer programs for implementing the embodiments of the present application, and is controlled by the processor 301 to execute. The processor 301 is used to execute the computer programs stored in the memory 302 to implement the steps shown in the foregoing method embodiments.
[0198] It should be noted that the electronic device in the embodiments of the present application includes the mobile electronic device and the non-mobile electronic device described above.
[0199] The embodiments of the present application also provide a non-transitory computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement various processes of the above-mentioned image processing method embodiments and achieve the same technical effects. To avoid repetition, details are not described here.
[0200] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes a computer readable storage medium, such as a computer readable only memory (ROM), a random access memory (RAM), a magnetic disc or an optical disc, etc.
[0201] The embodiment of the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the image processing method.
[0202] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes a computer readable storage medium, such as a computer readable only memory (ROM), a random access memory (RAM), a magnetic disc or an optical disc, etc.
[0203] The embodiment of the present application further provides a chip, which comprises a processor and a communication interface, wherein the communication interface is coupled with the processor, the processor is used to run a program or an instruction, and realizes each process of the image processing method embodiment and achieves the same technical effects. To avoid repetition, details are not described herein.
[0204] It should be understood that the chip mentioned in the embodiment of the present application can also be referred to as a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0205] It should be noted that, in this document, the term "comprising" or "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or device. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the present application is not limited to the order of performing the functions as shown or discussed, but can also include performing the functions in a substantially simultaneous manner or in a reverse order, for example, the described method can be performed in an order different from that described, and various steps can be added, omitted or combined. In addition, the features described with reference to some examples can be combined in other examples.
[0206] Through the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned example methods can be realized by means of software and necessary general hardware platforms, and of course, can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a computer software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disk), and includes a plurality of instructions for causing a terminal (which can be a mobile phone, a computer, a server, or a network device) to execute the methods described in the various embodiments of the present application.
[0207] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific embodiments, and the above-mentioned specific embodiments are merely illustrative rather than limiting, and those of ordinary skill in the art can make many forms under the inspiration of the present application without departing from the purpose of the present application and the scope protected by the claims, all of which belong to the protection of the present application.
[0208] In the description of the present specification, the description of the terms "one embodiment", "some embodiments", "an illustrative embodiment", "an example", "a specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0209] Although the embodiments of the present application have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, replacements and variations can be made to the embodiments without departing from the principles and purposes of the present application, and the scope of the present application is defined by the claims and their equivalents.
Claims
1. An image processing method, characterized in that, include: The shooting scene is determined based on the shooting parameters, and multiple consecutive image frames are captured for the target; the shooting scene can be any one of dark field, mid-gray field, and bright field; For any pixel to be processed, the pixel type of the pixel to be processed is determined based on the pixel value of the pixel to be processed in each image frame and the pixel value of each pixel in the target region centered on the pixel to be processed. The pixel type can be any one of the following: no noise type, bright noise type, and dark noise type; Based on the shooting scene and the pixel type of the pixel to be processed, the pixel value of the pixel to be processed in each image frame is processed to obtain the target pixel value at the corresponding position of the pixel to be processed. The target pixel value is any one of the maximum pixel value, minimum pixel value, average pixel value, and median pixel value of the pixel to be processed in each image frame; The target image is output based on the target pixel value at the corresponding position of each pixel to be processed.
2. The image processing method according to claim 1, characterized in that, The step of determining the pixel type of the pixel to be processed based on the pixel values of the pixel to be processed in each image frame and the pixel values of each pixel in the target region centered on the pixel to be processed includes: For any pixel to be processed in any image frame, determine the average pixel value of the target region centered on the pixel to be processed; Determine the pixel difference between the pixel to be processed and the average pixel value; Based on the pixel difference, the pixel flag of the pixel to be processed in the image frame is determined; the pixel flag is used to indicate that the pixel to be processed is a maximum value, a minimum value, or a median value in the target area. Based on the pixel markers of the pixels to be processed in each image frame, determine the number of each pixel marker; The pixel type of the pixel to be processed is determined based on the number of each pixel flag.
3. The image processing method according to claim 2, characterized in that, The pixel flag includes a first flag, a second flag, and a third flag; the first flag is used to indicate that the pixel to be processed is an intermediate value in the target area; The first flag is used to indicate that the pixel to be processed is a maximum value in the target area; the first flag is used to indicate that the pixel to be processed is a minimum value in the target area. The step of determining the pixel marker of the pixel to be processed in the image frame based on the pixel difference includes: Obtain the target threshold range; the target threshold range is determined based on the standard deviation of the image frame or any region centered on the pixel to be processed. If the pixel difference is within the target threshold range, the pixel flag of the pixel to be processed in the image frame is determined to be the first flag; If the pixel difference is greater than the maximum value of the target threshold range, the pixel flag of the pixel to be processed in the image frame is determined to be the second flag; If the pixel difference is less than the minimum value of the target threshold range, the pixel flag of the pixel to be processed in the image frame is determined to be the third flag.
4. The image processing method according to claim 3, characterized in that, Determining the pixel type of the pixel to be processed based on the number of pixel markers includes: Based on the quantity of each of the first, second, and third symbols, determine the proportion of each of the first, second, and third symbols respectively; If the proportion of the first marker is equal to the proportion of the first target, or if the proportion of the first marker is not equal to the proportion of the first target, but the proportion of the second marker or the third marker is higher than the proportion of the second target, then the pixel type of the pixel to be processed is determined to be a non-noise type; the proportion of the second target is less than the proportion of the first target. When the proportion of the first marker is not equal to the first target proportion, and the proportions of the second marker and the third marker are both less than the second target proportion, the target proportion is determined from the proportions of the second marker and the third marker based on the relationship between the proportions of the second marker and the third marker and the third target proportion, respectively; the third target proportion is less than the second target proportion. When the target proportion is the proportion of the second flag, the pixel type of the pixel to be processed is determined to be bright noise type; When the target proportion is equal to the proportion of the third flag, the pixel type of the pixel to be processed is determined to be dark noise.
5. The image processing method according to claim 4, characterized in that, The step of determining the target proportion from the proportions of the second and third signs based on their respective relationships with the proportion of the third target includes: If the proportion of the second mark or the proportion of the third mark is equal to the third target proportion, the larger of the proportion of the second mark and the proportion of the third mark is determined to be the target proportion. If neither the percentage of the second marker nor the percentage of the third marker is equal to the third target percentage, the smaller of the percentage of the second marker and the percentage of the third marker is determined as the target percentage.
6. The image processing method according to claim 5, characterized in that, The step of processing the pixel values of the pixel to be processed in each image frame according to the shooting scene and the pixel type of the pixel to be processed, to obtain the target pixel value at the corresponding position of the pixel to be processed, includes: If the shooting scene is any one of dark field, mid-gray field, and bright field, and the pixel type of the pixel to be processed is non-noise type, the average pixel value or median pixel value of the pixel to be processed in each image frame is taken as the target pixel value. When the shooting scene is a dark field or a medium gray field, and the pixel type of the pixel to be processed is bright noise type, the minimum pixel value of the pixel to be processed in each image frame is taken as the target pixel value. When the shooting scene is a bright field or a mid-gray field, and the pixel type of the pixel to be processed is dark noise, the maximum pixel value of the pixel to be processed in each image frame is taken as the target pixel value.
7. The image processing method according to claim 1, characterized in that, After capturing multiple consecutive image frames of the target, the method further includes: The response uniformity of the multiple image frames is corrected based on a preset correction method, which includes at least one of flat field correction, bad pixel correction, and bad line correction.
8. An image processing apparatus, characterized in that, include: The shooting module is used to determine the shooting scene based on shooting parameters and to capture multiple consecutive image frames of the target; the shooting scene can be any one of dark field, mid-gray field, and bright field; The first processing module is used to determine the pixel type of a pixel to be processed at any position based on the pixel value of the pixel to be processed in each image frame and the pixel value of each pixel in the target region centered on the pixel to be processed. The pixel type can be any one of the following: no noise type, bright noise type, and dark noise type; The second processing module is used to process the pixel value of the pixel to be processed in each image frame according to the shooting scene and the pixel type of the pixel to be processed, so as to obtain the target pixel value at the corresponding position of the pixel to be processed. The target pixel value is any one of the maximum pixel value, minimum pixel value, average pixel value, and median pixel value of the pixel to be processed in each image frame; The output module is used to output the target image; The pixel value of each pixel in the target image is the target pixel value at the corresponding location.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the image processing method as described in any one of claims 1-7.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the image processing method as described in any one of claims 1-7.