[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN115205144A - Image shadow removing method and device, computing equipment and storage medium - Google Patents

Image shadow removing method and device, computing equipment and storage medium Download PDF

Info

Publication number
CN115205144A
CN115205144A CN202210787222.7A CN202210787222A CN115205144A CN 115205144 A CN115205144 A CN 115205144A CN 202210787222 A CN202210787222 A CN 202210787222A CN 115205144 A CN115205144 A CN 115205144A
Authority
CN
China
Prior art keywords
shadow
target image
image
pixel
component
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210787222.7A
Other languages
Chinese (zh)
Inventor
刘白皓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Gree Electric Appliances Inc of Zhuhai
Original Assignee
Gree Electric Appliances Inc of Zhuhai
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Gree Electric Appliances Inc of Zhuhai filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN202210787222.7A priority Critical patent/CN115205144A/en
Publication of CN115205144A publication Critical patent/CN115205144A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/80Geometric correction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Engineering & Computer Science (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

The invention provides an image shadow removing method, an image shadow removing device, computing equipment and a storage medium, wherein the method comprises the following steps: acquiring a target image of a YCbCr space; dividing the target image into a non-shadow area and a shadow area based on a preset shadow area brightness threshold value; and determining a pixel compensation value for the shadow area according to the brightness difference between the non-shadow area and the shadow area, and respectively compensating the brightness component, the blue chrominance component and the red chrominance component of the shadow area by using the pixel compensation value so as to remove the shadow in the target image. The algorithm of the invention has low complexity, low requirements on hardware storage and CPU frequency, good definition, fine detail expression and good image quality and overall vision, can meet the requirements of real-time processing application, and is suitable for being deployed on the MCU at the edge end.

Description

Image shadow removing method and device, computing equipment and storage medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image shadow removal method, an image shadow removal device, a computing device, and a storage medium.
Background
Shadow detection and removal of images are a very important technology in the field of image processing, can be used for restoring scenes, extracting features and detecting specific targets, and play an important role in aerospace, intelligent navigation, industrial production, target detection, target identification and the like. Images containing shadows can interfere with digital image processing, such as when performing image segmentation and feature extraction, the shadows can prevent accurate segmentation or extraction of the complete features of the target object. In order to solve the problem of image degradation caused by shadows and enhance the visibility of an image, it is necessary to remove the shadows in the image.
At present, some achievements have been made on the research of image shadow detection and removal methods, but the randomness, diversity and complexity of shadow generation bring certain challenges to the algorithm. In the related art, the image shadow removal method has high algorithm complexity, large calculation amount and poor robustness, and needs a high-performance SOC (System on Chip) to run the algorithm, so that the method is not suitable for being deployed on an edge MCU (Micro Control Unit), has high hardware cost and has limitation in application.
Therefore, a new method for removing image shadows is needed.
Disclosure of Invention
The invention mainly aims to provide an image shadow removing method, an image shadow removing device, a computing device and a storage medium, so as to remove image shadows by a relatively simple and effective algorithm.
The invention provides an image shadow removing method, which comprises the following steps: acquiring a target image of a YCbCr space; dividing the target image into a non-shadow area and a shadow area based on a preset shadow area brightness threshold value; and determining a pixel compensation value for the shadow area according to the brightness difference between the non-shadow area and the shadow area, and respectively compensating the brightness component, the blue chrominance component and the red chrominance component of the shadow area by using the pixel compensation value so as to remove the shadow in the target image.
In one embodiment, acquiring a target image of YCbCr space includes: decoding the original target image to obtain a target image of an RGB space; and converting the target image in the RGB space into the target image in the YCbCr space.
In one embodiment, the step of determining the preset shadow region brightness threshold comprises: determining a shadow region brightness threshold according to the brightness component of the target image.
In one embodiment, determining the shadow region luminance threshold from the luminance component of the target image comprises: determining a pixel mean value and a pixel standard deviation of a brightness component of a target image; and determining the brightness threshold of the shadow area according to the pixel mean value and the pixel standard deviation of the brightness component of the target image and a preset algorithm.
In one embodiment, determining the shadow region brightness threshold according to a preset algorithm based on the pixel mean and the pixel standard deviation of the brightness component of the target image comprises: determining a shadow region luminance threshold using:
Figure BDA0003729183350000021
where thold denotes a shadow region luminance threshold value, ybmp _ mean denotes a pixel mean value of a luminance component of the target image, and ybmp _ std denotes a pixel standard deviation of the luminance component of the target image.
In one embodiment, the pixel compensation value comprises a first pixel compensation value and a second pixel compensation value; determining a pixel compensation value for a shadow region according to a luminance difference between a non-shadow region and the shadow region, comprising: determining a first pixel mean value of a non-shadow area and a second pixel mean value of a shadow area; and taking the difference value of the first pixel mean value and the second pixel mean value as a first pixel compensation value, and taking the ratio of the first pixel mean value and the second pixel mean value as a second pixel compensation value.
In one embodiment, the pixel compensation value is used to compensate the luminance component, the blue chrominance component and the red chrominance component of the shadow region respectively, and comprises: compensating the luminance component of the shadow region with a first pixel compensation value: the method comprises the following steps: adding the first pixel compensation value to a luminance component of the shadow region; respectively compensating the blue chrominance component and the red chrominance component of the shadow region by using a second pixel compensation value, comprising: the second pixel compensation values are added to the blue chrominance components and the red chrominance components of the shaded areas, respectively.
In one embodiment, before determining the pixel compensation value for the shadow region based on a difference in brightness between the non-shadow region and the shadow region, the method further comprises: and performing expansion operation and erosion operation on the brightness component of the target image divided into the non-shadow area and the shadow area.
In one embodiment, after respectively compensating the luminance component, the blue chrominance component and the red chrominance component of the shadow region using the pixel compensation value, the method further comprises: and performing mean filtering processing on the compensated target image, and taking the target image after the mean filtering processing as the target image after the shadow is removed.
The present invention provides an image shadow removal device, comprising: the image acquisition module is used for acquiring a target image of the YCbCr space; the area dividing module is used for dividing the target image into a non-shadow area and a shadow area based on a preset shadow area brightness threshold value; and the pixel compensation module is used for determining a pixel compensation value for the shadow area according to the brightness difference between the non-shadow area and the shadow area, and respectively compensating the brightness component, the blue chrominance component and the red chrominance component of the shadow area by using the pixel compensation value so as to remove the shadow in the target image.
The invention provides a computing device comprising a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, carries out the steps of the image shadow removal method as described above.
The present invention provides a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the image shadow removal method as described above.
The algorithm of the invention has low complexity, low requirements on hardware storage and CPU frequency, good definition, fine detail expression and good image quality and overall vision, can meet the requirements of real-time processing application, and is suitable for being deployed on the MCU at the edge end.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments of the invention and, together with the description, serve to explain the invention and not to limit the invention, in which:
FIG. 1 is a flow diagram of an image shadow removal method according to an exemplary embodiment of the present application;
FIG. 2 is a flow chart of an image shadow removal method according to an embodiment of the present application;
FIG. 3 is a target image according to one embodiment of the present application;
FIG. 4A is a target image of YCbCr space according to an embodiment of the present application;
fig. 4B is an image of a luminance component of a target image of the YCbCr space separated from fig. 4;
fig. 4C is an image of a blue chrominance component of the target image of the YCbCr space separated from fig. 4;
fig. 4D is an image of a red chrominance component of the target image of the YCbCr space separated from fig. 4;
fig. 5A is an image after the shadow is removed from the target image of the YCbCr space of fig. 4A when the shadow region luminance threshold is ybmp _ mean;
fig. 5B is an image after removing shading from the target image of the YCbCr space of fig. 4A when the shadow region luminance threshold is (ybmp _ mean-ybmp _ std);
fig. 5C is an image after removing shading from the target image of the YCbCr space of fig. 4A when the shaded region luminance threshold is [ ybmp _ mean- (ybmp _ std/5) ];
fig. 5D is an image after removing shading from the target image of the YCbCr space of fig. 4A when the shaded region luminance threshold is [ ybmp _ mean- (ybmp _ std/8) ];
fig. 6A is an image after the shadow is removed from the target image of the YCbCr space of fig. 4A when the first pixel compensation value is 0;
fig. 6B is an image after the shadow is removed from the target image of the YCbCr space of fig. 4A when the first pixel compensation value is 50;
fig. 6C is an image in which the shadow is removed from the target image of the YCbCr space of fig. 4A when the first pixel compensation value is 150;
fig. 7A is an image after the shadow is removed from the target image of the YCbCr space of fig. 4A when the second pixel compensation value is 5;
fig. 7B is an image after the shadow is removed from the target image of the YCbCr space of fig. 4A when the second pixel compensation value is 10;
fig. 7C is an image in which the shadow is removed from the target image of the YCbCr space of fig. 4A when the second pixel compensation value is 30.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present invention will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Example one
The present embodiment provides an image shadow removal method, and fig. 1 is a flowchart of an image shadow removal method according to an exemplary embodiment of the present application. As shown in fig. 1, the method of this embodiment may include:
s100: and acquiring a target image of the YCbCr space.
S200: and dividing the target image into a non-shadow area and a shadow area based on a preset shadow area brightness threshold value.
S300: and determining a pixel compensation value for the shadow area according to the brightness difference between the non-shadow area and the shadow area, and respectively compensating the brightness component, the blue chrominance component and the red chrominance component of the shadow area by using the pixel compensation value so as to remove the shadow in the target image.
In the present embodiment, for a target image in the YCbCr space, the target image is first divided into a non-shadow region and a shadow region according to the luminance magnitude, and then luminance compensation, blue chrominance compensation, and red chrominance compensation are performed on the shadow region according to the luminance difference between the non-shadow region and the shadow region, thereby removing the shadow in the target image.
According to the method, the operation complexity for removing the image shadow is low, the requirements on hardware storage and CPU performance are low, the method is suitable for being deployed on the edge end MCU, and the method is good in practicability and high in efficiency; meanwhile, the image without the shadow can keep better scene outline definition and color softness, and the image has stronger overall structure sense, fine detail performance and better image visual effect.
In one example, acquiring a target image of YCbCr space may include: decoding the original target image to obtain a target image of an RGB space; and converting the target image in the RGB space into the target image in the YCbCr space.
Of course, for the original target image, other feasible color spaces may be decoded, as long as the target image of the YCbCr space is obtained, and the decoding is not particularly limited herein.
In one example, the step of determining the preset shadow region brightness threshold may comprise: determining a shadow region brightness threshold according to the brightness component of the target image.
The shadow region brightness threshold is determined according to the brightness component of the target image, and can be set according to the specific situation of the target image, so that the shadow region brightness threshold can be adapted to the target image. Of course, the shadow area brightness threshold may also be set to a fixed value, or may be set according to other factors, and is not limited herein.
In one example, determining the shadow region brightness threshold from the brightness component of the target image may include: determining a pixel mean value and a pixel standard deviation of a brightness component of a target image; and determining the brightness threshold of the shadow area according to the pixel mean value and the pixel standard deviation of the brightness component of the target image and a preset algorithm.
Of course, the maximum value, the minimum value, the median and other relevant parameters of the pixels of the luminance component of the target image may also be calculated, and then the luminance threshold of the shadow area may be determined according to the calculated relevant parameters, and those skilled in the art may select and calculate the luminance threshold according to the needs, and the preset algorithm may also flexibly select the luminance threshold according to the needs.
In one example, determining the shadow region brightness threshold according to a preset algorithm according to the pixel mean and the pixel standard deviation of the brightness component of the target image may include: the shadow region brightness threshold is determined using the following equation:
Figure BDA0003729183350000051
where thold denotes a shadow region luminance threshold value, ybmp _ mean denotes a pixel mean value of a luminance component of the target image, and ybmp _ std denotes a pixel standard deviation of the luminance component of the target image.
The calculation in this example is only one of many possible algorithms, and one skilled in the art can set other calculations to determine the shadow region brightness threshold as needed.
In one example, the pixel compensation value may include a first pixel compensation value and a second pixel compensation value; determining a pixel compensation value for the shadow area according to a luminance difference between the non-shadow area and the shadow area may include: determining a first pixel mean value of a non-shadow area and a second pixel mean value of a shadow area; and taking the difference value of the first pixel mean value and the second pixel mean value as a first pixel compensation value, and taking the ratio of the first pixel mean value and the second pixel mean value as a second pixel compensation value.
In other examples, the first and second pixel compensation values may also be determined according to parameters such as maximum, minimum and median of brightness difference between non-shadow and shadow regions, which may be selected by one of ordinary skill in the art as needed.
In one example, respectively compensating the luminance component, the blue chrominance component, and the red chrominance component of the shadow region using the pixel compensation value may include: compensating the luminance component of the shadow region with a first pixel compensation value: the method comprises the following steps: adding the first pixel compensation value to a luminance component of the shadow region; respectively compensating the blue chrominance component and the red chrominance component of the shadow region by using a second pixel compensation value, comprising: the second pixel compensation values are added to the blue chrominance components and the red chrominance components of the shaded areas, respectively.
In other examples, the luminance component, the blue chrominance component, and the red chrominance component of the shadow region may be compensated using only the first or second pixel compensation values, and the luminance component, the blue chrominance component, and the red chrominance component may be compensated using three pixel compensation values, respectively.
In other examples, the method of compensation may not be limited to summation, such as multiplication, division, etc., and may be selected by one skilled in the art as required.
In one example, before determining the pixel compensation value for the shadow region according to the luminance difference of the non-shadow region and the shadow region, the method may further include: and performing expansion operation and erosion operation on the brightness component of the target image divided into the non-shadow area and the shadow area.
By the dilation and the multiple operation, a region that is erroneously divided when dividing a non-shadow region and a shadow region can be removed.
In one example, after respectively compensating the luminance component, the blue chrominance component, and the red chrominance component of the shadow region using the pixel compensation value, the method may further include: and performing mean filtering processing on the compensated target image, and taking the target image after the mean filtering processing as the target image after the shadow is removed.
And through the mean filtering processing, the smoothing processing of the target image is realized so as to eliminate the noise in the target image after the shadow is removed.
Example two
The present embodiment provides an image shadow removal apparatus, which may include: the image acquisition module is used for acquiring a target image of the YCbCr space; the area dividing module is used for dividing the target image into a non-shadow area and a shadow area based on a preset shadow area brightness threshold value; and the pixel compensation module is used for determining a pixel compensation value for the shadow area according to the brightness difference between the non-shadow area and the shadow area, and respectively compensating the brightness component, the blue chrominance component and the red chrominance component of the shadow area by using the pixel compensation value so as to remove the shadow in the target image.
In an example, the image shadow removal apparatus of the present embodiment may further include a processor and a memory, wherein the processor is configured to execute the image obtaining module, the area dividing module and the pixel compensation module stored in the memory.
EXAMPLE III
The present embodiment provides a specific embodiment of an image shadow removal method, and fig. 2 is a flowchart of an image shadow removal method according to an embodiment of the present application. As shown in fig. 2, the method of the present embodiment may include the following steps:
1. reading a frame of shaded image as a target image, wherein the image can be shadow _320 \240. Bmp (the format can be bmp, jpg, png and the like) acquired by a high-definition camera, as shown in fig. 3.
First, a target image may be decoded into an image of BGR format using a function imread. The target image is then switched to YCbCr space, as shown in fig. 4A. The pseudo code for the image color space conversion process is as follows:
origin_image=imread('shadow_320_240.bmp')
ybmp_cb_cr_image=cvtColor(origin_img,COLOR_BGR2YCrCb)
where Y represents the luminance component in the YCbCr color system, and Cb and Cr represent the blue chrominance component and the red chrominance component, respectively.
2. The Y, cb, cr channels are separated for the image ybmp _ Cb _ Cr _ image, and fig. 4B is an image of the luminance component of the target image in the YCbCr space separated from fig. 4; fig. 4C is an image of a blue chrominance component of the target image of the YCbCr space separated from fig. 4; fig. 4D is an image of a red chrominance component of the target image of the YCbCr space separated from fig. 4.
Pseudo codes for calculating the pixel mean value ybmp _ mean and the pixel standard deviation ybmp _ std of the luminance component of the target image are as follows:
bin_mask=np.copy(ybmp_cb_cr_image)
ybmp _ mean = np.mean (split (ybmp _ cb _ cr _ image) [0 ]) # calculates ybmp _ mean
Std (split (ybmp _ cb _ cr _ image) [0 ]) # calculates the standard deviation ybmp _ std
3. The shadow region luminance threshold values of the non-shadow region and the shadow region are set, for example, the shadow region luminance threshold value thold = ybmp _ mean- (ybmp _ std/5). Subsequently, the two-dimensional image data ybmp _ cb _ cr _ image is traversed, and a region having a pixel value smaller than the threshold thold is determined as a shadow region, and a region having a pixel value not smaller than the threshold thold is determined as a non-shadow pixel. The pseudo code for dividing the non-shadow area and the shadow area is as follows:
Figure BDA0003729183350000081
of course, if the shadow region luminance threshold is different, the finally obtained image after the shadow removal is also different, and fig. 5A is the image after the shadow removal for the target image in the YCbCr space of fig. 4A when the shadow region luminance threshold is ybmp _ mean; fig. 5B is an image after removing shading from the target image of the YCbCr space of fig. 4A when the shadow region luminance threshold is (ybmp _ mean-ybmp _ std); fig. 5C is an image after removing shading from the target image of the YCbCr space of fig. 4A when the shaded region luminance threshold is [ ybmp _ mean- (ybmp _ std/5) ]; fig. 5D is an image in which the shadow is removed from the target image in the YCbCr space of fig. 4A when the shadow region luminance threshold is [ ybmp _ mean- (ybmp _ std/8) ]. It can be seen that the effect of fig. 5C is relatively good.
4. And sequentially performing expansion and corrosion treatment on the image divided into the non-shadow area and the shadow area to remove the pixels which are divided by errors. Morphological processes (including dilation and erosion) are used to remove isolated pixels.
The dilation operation is to convolve the image a with a structural element B of an arbitrary shape, slide the structural element B over the image a (i.e., a convolution process), and assign the maximum value of the pixel points of the B coverage area to the pixel specified by the reference point. For example, the size of the structural element B may be a 3*3 matrix.
The erosion operation is the opposite of the dilation operation, taking a local minimum during convolution.
After the morphological process, an image marked with non-shaded and shaded regions is output. The pseudocode for the morphological process is as follows:
one ((3,3), np.uint 8) # generates a kernel window 3*3 matrix
exposure = exposure (binding _ mask, kernel, iterations = 1) # expansion and corrosion
5. Traversing the target image after the morphological process, and calculating the total value spi _ s of the brightness pixel values of the shadow area and the total number n _ s of the pixels; the sum of luminance pixel values spi _ la, the total number of pixels n _ la of the non-shaded area is calculated. The pseudo code for this process is as follows:
Figure BDA0003729183350000091
6. the average value avg _ ld of the luminance pixels of the non-shaded area and the average value avg _ le of the luminance pixels of the shaded area are calculated. The difference yi _ diff and ratio _ as _ al of the luminance pixel average of the non-shadow area to the luminance pixel average of the shadow area are calculated as follows:
avg_ld=spi_la/n_la
avg_le=spi_s/n_s
yi_diff=avg_ld-avg_le
rat_as_al=avg_ld/avg_le
of course, the first pixel compensation value may be directly set, and fig. 6A is an image obtained by removing shadow from the target image in the YCbCr space in fig. 4A when the first pixel compensation value is 0; fig. 6B is an image after the shadow is removed from the target image of the YCbCr space of fig. 4A when the first pixel compensation value is 50; fig. 6C is an image in which the shadow is removed from the target image of the YCbCr space of fig. 4A when the first pixel compensation value is 150. The first pixel compensation values are different, and the brightness of the shadow area of the image after shadow removal is different.
Similarly, the second pixel compensation value may be directly set, and fig. 7A is an image obtained by removing the shadow from the target image in the YCbCr space in fig. 4A when the second pixel compensation value is 5; fig. 7B is an image after the shadow is removed from the target image of the YCbCr space of fig. 4A when the second pixel compensation value is 10; fig. 7C is an image in which the shadow is removed from the target image of the YCbCr space of fig. 4A when the second pixel compensation value is 30. The second pixel compensation values are different, and the chroma of the shadow area of the image after shadow removal is different.
7. Pixel compensation is performed to remove image shadows.
The difference of the average value of the luminance pixels of the non-shadow area of the image and the average value of the luminance pixels of the shadow area is added to the luminance component, and the ratios of the average value of the luminance pixels of the non-shadow area of the image and the average value of the luminance pixels of the shadow area are added to the blue chrominance component and the red chrominance component, respectively. Correcting only the intensity of the shadow pixels does not remove the shadow, and the chrominance values need to be corrected. The pseudo code for this compensation step is as follows:
Figure BDA0003729183350000101
the first pixel compensation value (i.e., the difference between the average value of the luminance pixels of the non-shaded area and the average value of the luminance pixels of the shaded area) of fig. 5C is 99.6, and the second pixel compensation value (i.e., the ratio of the average value of the luminance pixels of the non-shaded area to the average value of the luminance pixels of the shaded area) is 2.15.
8. After compensation, the image may be subjected to an average filtering process to obtain a shadow-removed image, as shown in fig. 5C.
Example four
The present embodiment provides a computing device comprising a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, implements the steps of the image shadow removal method as described above.
In one embodiment, the computing device may include one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory, random Access Memory (RAM) and/or non-volatile memory in a computer-readable medium, such as Read Only Memory (ROM) or FLASH memory (FLASH RAM). Memory is an example of a computer-readable medium.
EXAMPLE five
The present embodiment provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the image shadow removal method as described above.
The computer program may employ any combination of one or more storage media. The storage medium may be a readable signal medium or a readable storage medium.
A readable storage medium may include, for example, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the above. More specific examples (a non-exhaustive list) of the readable storage medium may include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
Readable signal media may include a propagated data signal with a readable computer program embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, and may include, for example, an electromagnetic signal, an optical signal, or any suitable combination of the foregoing. A readable signal medium may also be any storage medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer program embodied on the storage medium may be transmitted using any appropriate medium, including by way of example, wirelessly, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
A computer program for carrying out operations of the present invention may be written in any combination of one or more programming languages. The programming languages may include an object oriented programming language such as Java, C + +, or the like, and may also include a conventional procedural programming language such as the "C" language or similar programming languages. The computer program may execute entirely on the user's computing device, partly on the user's device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device over any kind of network (which may include, for example, a local area network or a wide area network), or may be connected to an external computing device (which may be connected over the internet, for example, using an internet service provider).
It is noted that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof, but are not intended to limit the embodiments.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the accompanying drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances.
It should be understood that the exemplary embodiments herein may be embodied in many different forms and should not be construed as limited to only the embodiments set forth herein. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions. These embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art, and should not be construed as limiting the present invention.
While the spirit and principles of the invention have been described with reference to several particular embodiments, it is to be understood that the invention is not limited to the disclosed embodiments, nor is the division of aspects, which is for convenience only as the features in such aspects may not be combined to benefit. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims (12)

1. An image shadow removal method, comprising:
acquiring a target image of a YCbCr space;
dividing a target image into a non-shadow area and a shadow area based on a preset shadow area brightness threshold;
and determining a pixel compensation value for the shadow area according to the brightness difference between the non-shadow area and the shadow area, and respectively compensating the brightness component, the blue chrominance component and the red chrominance component of the shadow area by using the pixel compensation value so as to remove the shadow in the target image.
2. The method according to claim 1, wherein acquiring the target image of the YCbCr space includes:
decoding the original target image to obtain a target image of an RGB space;
and converting the target image in the RGB space into the target image in the YCbCr space.
3. The image shadow removal method according to claim 1, wherein the step of determining the preset shadow region brightness threshold value comprises:
determining a shadow region brightness threshold according to the brightness component of the target image.
4. The image shadow removal method of claim 3, wherein determining the shadow region brightness threshold based on the brightness component of the target image comprises:
determining a pixel mean value and a pixel standard deviation of a brightness component of a target image;
and determining the brightness threshold of the shadow area according to the pixel mean value and the pixel standard deviation of the brightness component of the target image and a preset algorithm.
5. The image shadow removal method according to claim 4, wherein determining the shadow region brightness threshold value according to a preset algorithm based on the pixel mean and the pixel standard deviation of the brightness component of the target image comprises:
determining a shadow region luminance threshold using:
Figure FDA0003729183340000011
where thold denotes a shadow region luminance threshold value, ybmp _ mean denotes a pixel mean value of a luminance component of the target image, and ybmp _ std denotes a pixel standard deviation of the luminance component of the target image.
6. The image shading removal method according to claim 1, wherein the pixel compensation value includes a first pixel compensation value and a second pixel compensation value;
determining a pixel compensation value for a shadow region according to a luminance difference between a non-shadow region and the shadow region, comprising:
determining a first pixel mean value of a non-shadow area and a second pixel mean value of a shadow area;
and taking the difference value of the first pixel mean value and the second pixel mean value as a first pixel compensation value, and taking the ratio of the first pixel mean value to the second pixel mean value as a second pixel compensation value.
7. The method of claim 6, wherein the compensating the luminance component, the blue chrominance component, and the red chrominance component of the shadow region using the pixel compensation value comprises:
compensating the luminance component of the shadow region with a first pixel compensation value: the method comprises the following steps: adding the first pixel compensation value to a luminance component of the shadow region;
respectively compensating the blue chrominance component and the red chrominance component of the shadow region by using a second pixel compensation value, wherein the compensation comprises the following steps: the second pixel compensation values are added to the blue chrominance components and the red chrominance components of the shaded areas, respectively.
8. The image shadow removal method of claim 1, wherein before determining the pixel compensation value for the shadow region according to the brightness difference of the non-shadow region and the shadow region, the method further comprises:
and performing expansion operation and erosion operation on the brightness component of the target image divided into the non-shadow area and the shadow area.
9. The image shadow removal method of claim 1, wherein after the luminance component, the blue chrominance component and the red chrominance component of the shadow region are respectively compensated by the pixel compensation value, the method further comprises:
and performing mean filtering processing on the compensated target image, and taking the target image after the mean filtering processing as the target image after the shadow is removed.
10. An image shadow removal apparatus, comprising:
the image acquisition module is used for acquiring a target image of the YCbCr space;
the area dividing module is used for dividing the target image into a non-shadow area and a shadow area based on a preset shadow area brightness threshold value;
and the pixel compensation module is used for determining a pixel compensation value for the shadow area according to the brightness difference between the non-shadow area and the shadow area, and respectively compensating the brightness component, the blue chrominance component and the red chrominance component of the shadow area by using the pixel compensation value so as to remove the shadow in the target image.
11. A computing device, characterized by comprising a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, carries out the steps of the image shadow removal method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that a computer program is stored which, when being executed by a processor, carries out the steps of the image shadow removal method according to any one of claims 1 to 9.
CN202210787222.7A 2022-07-04 2022-07-04 Image shadow removing method and device, computing equipment and storage medium Pending CN115205144A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210787222.7A CN115205144A (en) 2022-07-04 2022-07-04 Image shadow removing method and device, computing equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210787222.7A CN115205144A (en) 2022-07-04 2022-07-04 Image shadow removing method and device, computing equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115205144A true CN115205144A (en) 2022-10-18

Family

ID=83578791

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210787222.7A Pending CN115205144A (en) 2022-07-04 2022-07-04 Image shadow removing method and device, computing equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115205144A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117745621A (en) * 2023-12-18 2024-03-22 优视科技(中国)有限公司 Training sample generation method and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117745621A (en) * 2023-12-18 2024-03-22 优视科技(中国)有限公司 Training sample generation method and electronic equipment
CN117745621B (en) * 2023-12-18 2024-09-24 优视科技(中国)有限公司 Training sample generation method and electronic equipment

Similar Documents

Publication Publication Date Title
EP3621034A1 (en) Method and apparatus for calibrating relative parameters of collector, and storage medium
US20160253787A1 (en) Methods and systems for denoising images
Fredembach et al. Simple shadow remova
CN106920221A (en) Take into account the exposure fusion method that Luminance Distribution and details are presented
CN110866881B (en) Image processing method and device, storage medium and electronic equipment
CN109214996B (en) Image processing method and device
CN111862110A (en) Green curtain image matting method, system, equipment and readable storage medium
KR20150031241A (en) A device and a method for color harmonization of an image
CN114025089B (en) A video image acquisition jitter processing method and system
AU2011265380B2 (en) Determining transparent fills based on a reference background colour
US20120144304A1 (en) System and method for reducing artifacts in images
US20140092116A1 (en) Wide dynamic range display
CN108234826B (en) Image processing method and device
Soma et al. Implementation of a novel, fast and efficient image de-hazing algorithm on embedded hardware platforms
CN115205144A (en) Image shadow removing method and device, computing equipment and storage medium
CN110175963B (en) Dual-purpose image enhancement method and device suitable for underwater image and atmospheric dark image
JP2008028626A (en) Image processor, image processing method, and program
CN113132639B (en) Image processing method and device, electronic equipment and storage medium
JP2019165434A (en) Method and apparatus for generating hdr image with reduced clipped area
CN114596210A (en) Noise estimation method, device, terminal equipment and computer readable storage medium
CN113379629B (en) Satellite image denoising method, device, computer equipment and storage medium
CN117575976B (en) Image shadow processing method, device, equipment and storage medium
CN113962870A (en) Image pot cover effect inhibition method and device, electronic equipment and storage medium
Teng et al. High-speed hardware accelerator based on brightness improved by light-dehazenet
Kaur et al. Hand gesture image enhancement for improved recognition and subsequent analysis

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination