Image processing method and device, image acquisition equipment, storage medium and product
By correcting the actual grayscale value of the photosensitive element of the image acquisition device, the problem of image quality degradation caused by aging of the photosensitive element is solved, and the image acquisition quality is improved without increasing hardware costs.
Patent Information
- Application Number
- CN202411215533.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-27
AI Technical Summary
In the prior art, aging of the photosensitive element of the image acquisition device leads to a decrease in image quality, and the cost is high by regularly replacing the photosensitive element.
By acquiring the actual grayscale value of the acquired image and the preset mask, the compensation voltage is determined based on the mapping relationship between the grayscale value and the voltage value, the actual grayscale value is corrected to achieve the target grayscale value, thereby improving the Image quality.
Without replacing the photosensitive element, the quality of the image is improved and maintenance costs are reduced.
Smart Images

Figure CN119211744A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to image processing methods, devices, image acquisition equipment, storage media and products. Background Art
[0002] Image acquisition devices need to use internal image sensors to capture images. However, in actual applications, the photosensitive elements (such as light-emitting diodes) in the image sensors will gradually age due to long-term use, which will affect the image quality of the captured images.
[0003] In the related art, the image quality of the captured images is guaranteed by regularly replacing the photosensitive elements, but this method is costly. Summary of the Invention
[0004] In view of this, the present invention provides an image processing method, apparatus, image acquisition device, storage medium and product to solve the problem of high cost caused by improving the quality of acquired images.
[0005] In a first aspect, the present invention provides an image processing method, comprising:
[0006] Acquire an acquired image, where the acquired image includes pixels of multiple color channels;
[0007] Determining an area to be compensated for pixel compensation based on an actual grayscale value of the captured image and a preset mask, wherein the number of masks is multiple, multiple color channels correspond to the masks, and the area to be compensated includes an area to be compensated corresponding to at least one color channel;
[0008] Determine the target grayscale value corresponding to the area to be compensated;
[0009] Determining a compensation voltage corresponding to the area to be compensated based on a preset mapping relationship between grayscale values and voltage values and a target grayscale value;
[0010] The actual grayscale value of the area to be compensated is corrected by the compensation voltage so that the actual grayscale value of the area to be compensated reaches the target grayscale value.
[0011] Beneficial effects: The image processing method provided by the present invention corrects the actual grayscale value of the area to be compensated by correcting the voltage, which can improve the quality of the collected image without replacing the photosensitive element, thereby effectively reducing costs.
[0012] In an optional embodiment, the multiple color channels include at least a red channel, a green channel, and a blue channel, and the captured image consists of a sub-image corresponding to the red channel, a sub-image corresponding to the green channel, and a sub-image corresponding to the blue channel.
[0013] In an optional embodiment, determining the area to be compensated for pixel compensation based on the actual grayscale value of the captured image and a preset mask includes:
[0014] Determine the regional position of the pixel of the current color channel in the acquired image through the mask of the current color channel;
[0015] Determine the maximum grayscale value of the pixel of the current color channel in the acquired image;
[0016] Based on the comparison result between the actual grayscale value and the maximum grayscale value of the region position, the region to be compensated corresponding to the current color channel is determined.
[0017] In an optional embodiment, determining the area to be compensated corresponding to the current color channel based on a comparison result between the actual grayscale value of the area position and the maximum grayscale value includes:
[0018] If the comparison result is that the actual grayscale value of the current pixel is less than the maximum grayscale value, the area corresponding to the current pixel is determined to be the area to be compensated, and the area to be compensated corresponding to the current color channel is obtained.
[0019] In an optional embodiment, determining the area to be compensated corresponding to the current color channel based on a comparison result between the actual grayscale value of the area position and the maximum grayscale value further includes:
[0020] If the comparison result is that the actual grayscale value of the current pixel is equal to the maximum grayscale value, then the area corresponding to the current pixel is determined to be a non-compensated area.
[0021] In an optional implementation, determining the compensation voltage corresponding to the area to be compensated based on a preset mapping relationship between grayscale values and voltage values and a target grayscale value includes:
[0022] Determine the acquisition voltage corresponding to the actual grayscale value of the area to be compensated;
[0023] Determine the target voltage resolution range corresponding to the collected voltage based on the collected voltage and the actual grayscale value of the area to be compensated;
[0024] Based on the mapping relationship between the preset grayscale value and the voltage resolution range, based on the target grayscale value and the target voltage resolution range, the target voltage value corresponding to the target grayscale value is determined, and the target voltage value is used as the compensation voltage corresponding to the area to be compensated.
[0025] In a second aspect, the present invention provides an image processing device, comprising:
[0026] An acquisition module is used to acquire an acquired image, where the acquired image includes pixels of multiple color channels;
[0027] A first determining module is configured to determine an area to be compensated for pixel compensation based on an actual grayscale value of the captured image and a preset mask, wherein the number of masks is multiple, multiple color channels correspond to the masks, and the area to be compensated includes an area to be compensated corresponding to at least one color channel;
[0028] A second determination module is used to determine a target grayscale value corresponding to the area to be compensated;
[0029] A third determining module is configured to determine a compensation voltage corresponding to the area to be compensated based on a preset mapping relationship between grayscale values and voltage values and a target grayscale value;
[0030] The correction module is used to correct the actual grayscale value of the area to be compensated by using the compensation voltage so that the actual grayscale value of the area to be compensated reaches the target grayscale value.
[0031] In a third aspect, the present invention provides an image acquisition device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the image processing method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0032] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the image processing method of the first aspect or any corresponding embodiment thereof.
[0033] In a fifth aspect, the present invention provides a computer program product comprising computer instructions for causing a computer to execute the image processing method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0035] Figure 1 is a flowchart of an image processing method according to an embodiment of the present invention;
[0036] Figure 2 is a schematic diagram of an image acquisition according to an embodiment of the present invention;
[0037] Figure 3 is a flowchart of another image processing method according to an embodiment of the present invention;
[0038] Figure 4 is a structural block diagram of an image processing apparatus according to an embodiment of the present invention;
[0039] Figure 5 Schematic diagram of the hardware structure of the image acquisition device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0040] To make the purpose, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of the present invention.
[0041] The aging degree of the photosensitive elements in the image sensor will affect the image acquisition quality, which will cause the generated captured image to differ from the brightness of the actual scene.
[0042] In the related art, to ensure the quality of collected images, the photosensitive elements are replaced regularly to overcome the aging problem of the photosensitive elements. When this method is used to ensure the quality of collected images, it will lead to high maintenance costs.
[0043] In view of this, an embodiment of the present invention provides an image processing method, comprising: acquiring a captured image; determining a region to be compensated for pixel compensation based on the actual grayscale value of the captured image and a preset mask; determining a target grayscale value corresponding to the region to be compensated; determining a compensation voltage corresponding to the region to be compensated based on a preset mapping relationship between grayscale values and voltage values and the target grayscale value; and correcting the actual grayscale value of the region to be compensated using the compensation voltage so that the actual grayscale value of the region to be compensated reaches the target grayscale value. Correcting the actual grayscale value of the region to be compensated using the correction voltage can improve the quality of the captured image without replacing the photosensitive element, thereby effectively reducing costs.
[0044] According to an embodiment of the present invention, an embodiment of an image processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0045] In this embodiment, an image processing method is provided, which can be used for image acquisition devices with built-in image sensors, such as endoscopes, cameras, etc. Figure 1 is a flow chart of an image processing method according to an embodiment of the present invention. Figure 1As shown, the process includes the following steps:
[0046] Step S101: Acquire a captured image.
[0047] In an embodiment of the present invention, when the photosensitive elements within an image sensor age, the grayscale values of the pixels in the captured image will be lower than when they were not aged, thereby affecting the image quality of the captured image. Therefore, to detect the aging of the photosensitive elements within the image sensor, a captured image acquired by the image sensor is obtained, and the actual grayscale values of each pixel in the captured image are used to detect whether the image quality has deteriorated. The captured image includes pixels from multiple color channels, and subsequent pixel compensation can more precisely adjust the brightness value corresponding to each grayscale level, more accurately restore color details, and thus enable the adjusted captured image to more accurately restore true color information.
[0048] Step S102 : determining an area to be compensated for pixel compensation based on the actual grayscale value of the captured image and a preset mask.
[0049] In an embodiment of the present invention, a preset mask is used to screen which local areas in the captured image require pixel compensation. Therefore, by matching the captured image with the mask and then combining it with the actual grayscale value of the captured image, the area to be compensated in the captured image that requires pixel compensation can be identified, so that targeted compensation can be performed when pixel compensation is subsequently performed. There are multiple masks, multiple color channels correspond to the masks, and the area to be compensated includes at least one area to be compensated corresponding to one color channel. That is, in order to make the obtained area to be compensated more accurate and more targeted, a correspondence between the mask and the color channel is established in advance, so that the compensation efficiency can be improved when pixel compensation is subsequently performed.
[0050] In some optional examples, a corresponding mask is configured for each color channel, and when the area to be compensated is subsequently determined, the occurrence of misidentification can be effectively reduced, thereby helping to improve the accuracy of determining the compensation voltage and effectively improving the image quality of the captured image.
[0051] Step S103: determining a target grayscale value corresponding to the area to be compensated.
[0052] In the embodiments of the present invention, the target grayscale value can be understood as the ideal optimal grayscale value corresponding to the area to be compensated when the photosensitive element has not aged. For example, if the captured image is a pure green image, the target grayscale value corresponding to the area to be compensated is the maximum grayscale value corresponding to the green channel. For example, if the pixel grayscale value in the green channel ranges from 0 to 255, the target grayscale value corresponding to the area to be compensated is 255.
[0053] In order to restore the image quality of the captured image, the target grayscale value corresponding to the area to be compensated is determined, so as to clarify the pixel compensation direction through the difference between the target grayscale value and the actual grayscale value.
[0054] Step S104 : determining a compensation voltage corresponding to the area to be compensated based on a preset mapping relationship between grayscale values and voltage values and a target grayscale value.
[0055] In this embodiment of the present invention, the grayscale value of a pixel depends on the voltage input to the photosensitive element. Therefore, to ensure that the actual pixel value of the area to be compensated reaches the target grayscale value without replacing the photosensitive element, a mapping relationship between preset grayscale values and voltage values is obtained. This mapping relationship is then used to determine the compensation voltage required to bring the pixel grayscale value to the target grayscale value. This is then combined with the voltage currently being captured to determine the compensation voltage corresponding to the area to be compensated.
[0056] Step S105 , correcting the actual grayscale value of the area to be compensated by using the compensation voltage so that the actual grayscale value of the area to be compensated reaches the target grayscale value.
[0057] In an embodiment of the present invention, by correcting the actual input voltage to the photosensitive element through the compensation voltage, the actual grayscale value of the area to be compensated can be changed, and the actual grayscale value of the area to be compensated can be made closer to or reach the target grayscale value, thereby effectively improving the image quality of the captured image without increasing the hardware cost.
[0058] The image processing method provided in this embodiment corrects the actual grayscale value of the area to be compensated by correcting the voltage, which can improve the quality of the captured image without replacing the photosensitive element, thereby effectively reducing costs.
[0059] In some optional embodiments, the multiple color channels include at least a red channel, a green channel, and a blue channel, and the captured image is composed of a sub-image corresponding to the red channel, a sub-image corresponding to the green channel, and a sub-image corresponding to the blue channel. Figure 2As shown, in order to better capture the pixel distribution and perform targeted correction on the grayscale value of each pixel, the sub-image corresponding to the red channel, the sub-image corresponding to the green channel, and the sub-image corresponding to the blue channel are arranged according to the Bayer template to achieve a smoother and more natural color transition, so that the grayscale value of the subsequently corrected captured image can be close to the grayscale value when the photosensitive element is not aged. In the figure, R represents the red channel, B represents the green channel, and G represents the green channel. To facilitate the distinction between the pixels of each color channel, R / G / B and a number are used for identification. In some optional implementation scenarios, in addition to the above-mentioned red channel, green channel, and blue channel, the multiple color channels may also include any one or more of the following color channels: cyan channel, magenta channel, yellow channel, luminance channel, alpha channel, etc. The type of actual color channel can be determined according to the actual image processing requirements and is not limited here.
[0060] In this embodiment, an image processing method is provided, which can be used for image acquisition devices with built-in image sensors, such as endoscopes, cameras, etc. Figure 3 is a flow chart of an image processing method according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:
[0061] Step S301: Acquire the captured image. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0062] Step S302 : determining an area to be compensated for pixel compensation based on the actual grayscale value of the captured image and a preset mask.
[0063] Specifically, the captured image includes pixels of multiple color channels, the number of masks is multiple, and different masks correspond to different color channels. The above step S302 includes:
[0064] Step S3021: Determine the regional position of the pixels of the current color channel in the captured image through the mask of the current color channel.
[0065] In an embodiment of the present invention, the mask of the current color channel is set according to the distribution of each pixel in the current color channel. Therefore, the regional position of the pixels of the current color channel in the captured image can be clearly determined through the mask of the current color channel.
[0066] In some optional implementation scenarios, the setting of the mask depends on the pixel distribution corresponding to the current color channel in the captured image. First, according to the resolution of the image sensor, a pixel matrix corresponding to the captured image is generated. For example: if the resolution of the image sensor is 1920*1080, a matrix of size 1920*1080 is generated. If the resolution of the image sensor is 4096*2160, a matrix of size 4096*2160 is generated. Taking the green channel as an example, the areas corresponding to all pixels corresponding to the green channel in the matrix are set to 1, and the areas corresponding to other pixels are set to 0, thereby obtaining the mask corresponding to the green channel. Similarly, the mask is set in the same way for the red channel and the blue channel, thereby obtaining the mask corresponding to each color channel.
[0067] Step S3022: Determine the maximum grayscale value of the pixels of the current color channel in the captured image.
[0068] In an embodiment of the present invention, in order to make the color of the captured image after pixel correction more balanced and avoid over-compensation, the maximum grayscale value of the pixels of the current color channel in the captured image is determined, so that the pixels under the current color channel are reasonably corrected according to the maximum grayscale value.
[0069] Step S3023 : determining the area to be compensated corresponding to the current color channel based on the comparison result between the actual grayscale value of the area position and the maximum grayscale value.
[0070] In an embodiment of the present invention, based on the comparison result of the actual grayscale value of the area position and the maximum grayscale value corresponding to the corresponding color channel, it can be determined which pixels correspond to areas that need pixel compensation, and then the area to be compensated corresponding to the current color channel can be obtained.
[0071] For example, if the comparison result shows that the actual grayscale value of the current pixel is less than the maximum grayscale value, then the brightness of the area where the current pixel is located is low and needs to be increased through pixel compensation. Therefore, the area where the pixel is located is determined as the area to be compensated, thereby obtaining the area to be compensated corresponding to the current color channel in the area position. Therefore, the area to be compensated corresponding to the current color channel includes at least one area corresponding to the pixel.
[0072] If the comparison result is that the actual grayscale value of the current pixel is equal to the maximum grayscale value, it indicates that the brightness of the area where the current pixel is located is normal and no correction is required. Therefore, it can be determined that the area corresponding to the current pixel is a non-compensated area.
[0073] Step S303: Determine the target grayscale value corresponding to the area to be compensated. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.
[0074] Step S304 : determining a compensation voltage corresponding to the area to be compensated based on a preset mapping relationship between grayscale values and voltage values and a target grayscale value.
[0075] Specifically, the above step S304 includes:
[0076] Step S3041 , determining the acquisition voltage corresponding to the actual grayscale value of the area to be compensated.
[0077] In this embodiment of the present invention, the grayscale value of a pixel is obtained by converting the collected voltage of the input photosensitive element through an analog-to-digital converter. Therefore, to facilitate targeted compensation, the collected voltage corresponding to the actual grayscale value of the area to be compensated is determined, and the compensation voltage range is narrowed based on this collected voltage.
[0078] Step S3042 : determining a target voltage resolution range corresponding to the collected voltage based on the collected voltage and the actual grayscale value of the area to be compensated.
[0079] In an embodiment of the present invention, the preset multiple voltage ranges are determined based on the voltage range of the analog-to-digital converter. When the analog-to-digital converter converts the voltage signal into a digital signal, it converts it in the form of a step function. Therefore, in different voltage resolution ranges of the analog-to-digital converter, the corresponding output grayscale values are the same. When the acquisition voltage is determined, the target voltage resolution range can be determined by the following formula:
[0080]
[0081] Among them, Gray p Represents the actual grayscale value, N represents the maximum number of voltage intervals of the analog-to-digital converter, which is consistent with the bit width of the analog-to-digital converter, T represents the voltage resolution of the analog-to-digital converter, and x represents the collected voltage.
[0082] Therefore, when the grayscale value and the sampling voltage are determined, the target voltage resolution range of the analog-to-digital converter when outputting the actual grayscale value can be determined by the above formula.
[0083] For example: Taking a pure green image as an example, the maximum voltage in the current voltage resolution range is assigned as the target voltage value, and then the corresponding grayscale value is calculated according to the above formula. If the calculated grayscale value is greater than the actual grayscale value, it indicates that the maximum voltage is not the acquisition voltage, and then the difference between the maximum voltage and the minimum voltage in the current voltage resolution range is used as the acquisition voltage. If the obtained grayscale value is still greater than the actual grayscale value, the traversal method is used to obtain the next voltage resolution range until the voltage resolution range whose grayscale value is less than or equal to the actual grayscale value is used as the target voltage resolution range.
[0084] Step S3043, based on the preset mapping relationship between grayscale values and voltage resolution intervals, based on the target grayscale value and the target voltage resolution interval, determine the target voltage value corresponding to the target grayscale value, and use the target voltage value as the compensation voltage corresponding to the area to be compensated.
[0085] In an embodiment of the present invention, the target voltage value is determined by the following formula:
[0086] Among them, Gray t represents the target grayscale value, and k is the compensation coefficient.
[0087] That is, when the target voltage resolution range is determined, the specific value of the compensation coefficient can be determined in combination with the target grayscale value, the target voltage resolution range and the acquisition voltage, and then the compensation voltage that can be used to perform targeted compensation on the area to be compensated can be obtained based on the product between the compensation coefficient and the acquisition voltage.
[0088] Step S305: Correct the actual grayscale value of the area to be compensated by using the compensation voltage so that the actual grayscale value of the area to be compensated reaches the target grayscale value. Figure 1 Step S105 of the illustrated embodiment will not be described in detail here.
[0089] The image processing method provided in this embodiment uses different masks for different color channels to determine the area to be compensated, which can effectively reduce the occurrence of misidentification and thereby improve the effectiveness of determining the compensation voltage, so that the corrected captured image can be more in line with the actual capture scene and effectively improve the image quality.
[0090] As one or more specific application embodiments of the embodiments of the present invention, an image sensor is used to perform image acquisition to obtain an acquired image. The acquired image is obtained by arranging multiple sub-images corresponding to the red channel, the green channel, and the blue channel according to a Bayer template. Pre-made masks corresponding to the respective color channels are used to determine the areas to be compensated corresponding to the colors of the respective channels in the acquired image. Furthermore, based on the actual grayscale values and target grayscale values corresponding to the areas to be compensated, compensation voltages corresponding to the areas to be compensated are determined, and targeted compensation is performed on the areas to be compensated. This allows the corrected acquired image to better fit the actual acquisition scenario without increasing costs, thereby achieving improved image quality.
[0091] This embodiment also provides an image processing device for implementing the above-mentioned embodiments and preferred implementations. Details already described will not be repeated. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0092] This embodiment provides an image processing device, such as Figure 4 As shown, including:
[0093] An acquisition module 401 is configured to acquire an acquired image, where the acquired image includes pixels of multiple color channels;
[0094] A first determining module 402 is configured to determine an area to be compensated for pixel compensation based on an actual grayscale value of the captured image and a preset mask, wherein the number of masks is multiple, and multiple color channels correspond to the masks, and the area to be compensated includes an area to be compensated corresponding to at least one color channel;
[0095] The second determining module 403 is used to determine the target grayscale value corresponding to the area to be compensated;
[0096] A third determining module 404 is configured to determine a compensation voltage corresponding to the area to be compensated based on a preset mapping relationship between grayscale values and voltage values and a target grayscale value;
[0097] The correction module 405 is configured to correct the actual grayscale value of the area to be compensated by using a compensation voltage, so that the actual grayscale value of the area to be compensated reaches a target grayscale value.
[0098] In some optional embodiments, the multiple color channels include at least a red channel, a green channel, and a blue channel, and the captured image consists of a sub-image corresponding to the red channel, a sub-image corresponding to the green channel, and a sub-image corresponding to the blue channel.
[0099] In some optional embodiments, the first determination module 402 includes: a first processing unit, used to determine the regional position of the pixels of the current color channel in the acquired image through the mask of the current color channel; a second processing unit, used to determine the maximum grayscale value of the pixels of the current color channel in the acquired image; and a comparison unit, used to determine the area to be compensated corresponding to the current color channel based on the comparison result of the actual grayscale value of the regional position and the maximum grayscale value.
[0100] In some optional embodiments, the comparison unit includes: a first execution unit, which is used to determine that the area corresponding to the current pixel is the area to be compensated if the comparison result is that the actual grayscale value of the current pixel is less than the maximum grayscale value, and obtain the area to be compensated corresponding to the current color channel.
[0101] In some optional embodiments, the comparison unit further includes: a second execution unit, configured to determine that the area corresponding to the current pixel is a non-compensation area if the comparison result is that the actual grayscale value of the current pixel is equal to the maximum grayscale value.
[0102] In some optional embodiments, the third determination module 404 includes: a third processing unit, used to determine the acquisition voltage corresponding to the actual grayscale value of the area to be compensated; a matching unit, used to determine the target voltage resolution interval corresponding to the acquisition voltage based on the acquisition voltage and the actual grayscale value of the area to be compensated; a fourth processing unit, used to determine the target voltage value corresponding to the target grayscale value based on the target grayscale value and the target voltage resolution interval based on the mapping relationship between the preset grayscale value and the voltage resolution interval, and use the target voltage value as the compensation voltage corresponding to the area to be compensated.
[0103] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0104] The image processing device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0105] The embodiment of the present invention also provides an image acquisition device having the above Figure 4 The image processing device shown.
[0106] See also Figure 5 , Figure 5 FIG. 1 is a structural diagram of an image acquisition device provided by an optional embodiment of the present invention, such as Figure 5 As shown, the image acquisition device includes: one or more processors 10, a memory 20, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed within the image acquisition device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple image acquisition devices can be connected, each device providing part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.
[0107] The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.
[0108] The memory 20 stores instructions that can be executed by at least one processor 10, so as to enable at least one processor 10 to execute the method shown in the above embodiment.
[0109] The memory 20 may include a program storage area and a data storage area. The program storage area may store an operating system and application programs required for at least one function; the data storage area may store data generated based on the use of the image acquisition device. Furthermore, the memory 20 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state memory device. In some optional embodiments, the memory 20 may optionally include a memory remotely located relative to the processor 10, and such remote memory may be connected to the image acquisition device via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0110] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0111] The image acquisition device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 can be connected via a bus or other means. Figure 5 The bus connection is taken as an example.
[0112] The input device 30 can receive input digital or character information and generate key signal input related to user settings and function control of the image acquisition device, such as a touch screen, a keypad, a mouse, a trackpad, a touch pad, a pointer, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 can include a display device, an auxiliary lighting device (e.g., an LED), and a tactile feedback device (e.g., a vibration motor). The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display, and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0113] The embodiment of the present invention also provides a computer-readable storage medium. The above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or implemented as a computer code that can be recorded in a storage medium, or implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the method shown in the above embodiment is implemented.
[0114] A portion of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the form in which the computer program instruction exists in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc. Accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium that can be accessed by the computer.
[0115] Although the embodiments of the present invention have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention. Such modifications and variations are all within the scope defined by the appended claims.
Claims
1. An image processing method, characterized in that: The method comprises: Acquire an acquired image, wherein the acquired image includes pixels of multiple color channels; Based on the actual grayscale value of the acquired image and a preset mask, determining an area to be compensated for pixel compensation, wherein the number of the masks is multiple, the multiple color channels correspond to the multiple masks, and the area to be compensated includes at least one area to be compensated corresponding to one color channel; Determining a target grayscale value corresponding to the area to be compensated; Determining a compensation voltage corresponding to the area to be compensated based on a preset mapping relationship between grayscale values and voltage values and the target grayscale value; The actual grayscale value of the area to be compensated is corrected by the compensation voltage so that the actual grayscale value of the area to be compensated reaches the target grayscale value.
2. The image processing method according to claim 1, characterized in that: The multiple color channels include at least a red channel, a green channel, and a blue channel, and the acquired image is composed of a sub-image corresponding to the red channel, a sub-image corresponding to the green channel, and a sub-image corresponding to the blue channel.
3. The image processing method according to claim 1, characterized in that: The determining of the area to be compensated for pixel compensation based on the actual grayscale value of the acquired image and the preset mask includes: Determining the regional position of the pixel of the current color channel in the acquired image through the mask of the current color channel; Determine the maximum grayscale value of the pixels of the current color channel in the acquired image; Based on the comparison result between the actual grayscale value of the area position and the maximum grayscale value, the area to be compensated corresponding to the current color channel is determined.
4. The image processing method according to claim 3, characterized in that: The determining the area to be compensated corresponding to the current color channel based on the comparison result between the actual grayscale value of the area position and the maximum grayscale value includes: If the comparison result is that the actual grayscale value of the current pixel is less than the maximum grayscale value, the area corresponding to the current pixel is determined to be the area to be compensated, and the area to be compensated corresponding to the current color channel is obtained.
5. The image processing method according to claim 4, characterized in that: The step of determining the area to be compensated corresponding to the current color channel based on a comparison result between the actual grayscale value of the area position and the maximum grayscale value further includes: If the comparison result is that the actual grayscale value of the current pixel is equal to the maximum grayscale value, then it is determined that the area corresponding to the current pixel is a non-compensation area.
6. The image processing method according to claim 1, characterized in that: The determining, based on a preset mapping relationship between grayscale values and voltage values and the target grayscale value, a compensation voltage corresponding to the area to be compensated includes: Determine the acquisition voltage corresponding to the actual grayscale value of the area to be compensated; Determining a target voltage resolution interval corresponding to the acquisition voltage based on the acquisition voltage and an actual grayscale value of the area to be compensated; Based on the mapping relationship between the preset grayscale value and the voltage resolution range, based on the target grayscale value and the target voltage resolution range, a target voltage value corresponding to the target grayscale value is determined, and the target voltage value is used as the compensation voltage corresponding to the area to be compensated.
7. An image processing device, characterized in that: The device comprises: An acquisition module, used for acquiring an acquired image, wherein the acquired image includes pixels of multiple color channels; A first determination module is used to determine a to-be-compensated area for pixel compensation based on an actual grayscale value of the acquired image and a preset mask, wherein the number of the masks is multiple, the multiple color channels correspond to the multiple masks, and the to-be-compensated area includes at least one to-be-compensated area corresponding to one color channel; A second determination module, used to determine a target grayscale value corresponding to the area to be compensated; A third determination module, configured to determine a compensation voltage corresponding to the area to be compensated based on a preset mapping relationship between grayscale values and voltage values and the target grayscale value; The correction module is used to correct the actual grayscale value of the area to be compensated by using the compensation voltage so that the actual grayscale value of the area to be compensated reaches the target grayscale value.
8. An image acquisition device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the image processing method according to any one of claims 1 to 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the image processing method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the image processing method according to any one of claims 1 to 6.
