IP Library › Granted Patent US 12,513,392
Granted Patent B2
US 12,513,392 · App. 18/293,893 · Granted Dec 30, 2025

Day-night switching method, electronic device, and storage medium

Inventor: Yingqing Yang (Hangzhou, CN)
Assignee: XI'AN UNIVIEW INFORMATION TECHNOLOGIES CO., LTD
H04N23/667H04N23/71H04N23/74
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,513,392
App. No.
18/293,893
Granted
Dec 30, 2025
Kind
B2
Abstract

A day-night switching method includes determining image illumination according to a photographed image acquired by a camera device; in the case where the image illumination is greater than the current black-to-color switching threshold, determining an image illumination influence factor according to the photographed image; in the case where the image illumination influence factor is environmental illumination, controlling the camera device to perform day-night switching according to the image illumination and the current black-to-color switching threshold; in the case where the image illumination influence factor is a fill light, determining a new black-to-color switching threshold according to the photographing parameter of the camera device and the photographed image; and controlling the camera device to perform day-night switching according to the image illumination and the new black-to-color switching threshold.

Claims (600)

1 . A day-night switching method, comprising:

determining image illumination according to a photographed image acquired by a camera device;

in response to the image illumination being greater than a current black-to-color switching threshold, determining an image illumination influence factor according to the photographed image;

in response to the image illumination influence factor being environmental illumination, controlling the camera device to perform day-night switching according to the image illumination and the current black-to-color switching threshold; and

in response to the image illumination influence factor being a fill light, determining a new black-to-color switching threshold according to a photographing parameter of the camera device and the photographed image, and controlling the camera device to perform day-night switching according to the image illumination and the new black-to-color switching threshold.

2 . The method according to claim 1 , before determining the image illumination influence factor according to the photographed image, further comprising:

determining whether the image illumination changes; and

in response to the image illumination not changing, controlling the camera device to perform the day-night switching according to the image illumination and the current black-to-color switching threshold,

wherein determining the image illumination influence factor according to the photographed image comprises:

in response to the image illumination changing, determining the image illumination influence factor according to the photographed image;

wherein determining whether the image illumination changes comprises:

calculating a change amplitude of the image illumination compared with historical image illumination acquired last time and determining whether the change amplitude is greater than or equal to a first change amplitude threshold;

in response to the image illumination not changing comprises:

in response to the change amplitude being less than the first change amplitude threshold; and

in response to the image illumination changing comprises:

in response to the change amplitude being greater than or equal to the first change amplitude threshold;

or

wherein determining whether the image illumination changes comprises:

calculating a change amplitude of the image illumination compared with an average value of historical image illumination acquired for previous N times and determining whether the change amplitude is greater than or equal to a second change amplitude threshold; and

in response to the image illumination not changing comprises:

in response to the change amplitude being less than the second change amplitude threshold; and

in response to the image illumination changing comprises:

in response to the change amplitude being greater than or equal to the second change amplitude threshold.

3 . The method according to claim 1 , wherein the method further comprising: predetermining an initial value of a black-to-color switching threshold according to the following manners:

in a dark room scenario, in a case where the camera device is configured to be in a night mode, and the fill light is turned on, environment brightness is increased; and in a case where image quality of an image acquired by the camera device satisfies a preset image quality requirement after removing a fill light factor, acquiring a current environmental illumination value as the initial value of the black-to-color switching threshold.

4 . The method according to claim 1 , wherein determining the image illumination influence factor according to the photographed image comprises:

determining a first attenuation factor used for indicating uniformity of brightness of a central region in the photographed image and brightness of an edge region in the photographed image according to the photographed image;

determining a second attenuation factor used for indicating uniformity of brightness of a center point in the photographed image and brightness of four corner positions in the photographed image according to the photographed image; and

determining the image illumination influence factor according to the first attenuation factor and the second attenuation factor.

5 . The method according to claim 1 , wherein determining the image illumination influence factor according to the photographed image comprises:

determining a first attenuation factor of the photographed image according to brightness of a central region in the photographed image and brightness of an edge region in the photographed image;

determining a second attenuation factor of the photographed image according to brightness of a center point in the photographed image and brightness of four corner positions in the photographed image;

in a case where the first attenuation factor of the photographed image is less than a pre-calibrated first attenuation factor of an image without fill light of the camera device, and the second attenuation factor of the photographed image is less than a pre-calibrated second attenuation factor of the image without the fill light of the camera device, determining that the image illumination influence factor is the fill light; and

in a case where the first attenuation factor of the photographed image is greater than or equal to the pre-calibrated first attenuation factor of the image without the fill light of the camera device, or the second attenuation factor of the photographed image is greater than or equal to the pre-calibrated second attenuation factor of the image without the fill light of the camera device, determining that the image illumination influence factor is the environmental illumination.

6 . The method according to claim 5 , wherein

the first attenuation factor D side of the photographed image is calculated in the following manner:

D

side

=

(

2

⁢

m

+

2

⁢

n

-

4

)

×

∑

i

=

-

1

1

⁢

∑

j

=

-

1

1

⁢

Y

(

(

m

2

+

i

)

,

(

n

2

+

j

)

)

9

×

(

∑

i

=

1

m

⁢

(

Y

i

⁢

1

+

Y

in

)

+

∑

j

=

1

n

⁢

(

Y

1

⁢

j

+

Y

mj

)

)

;

 and

the second attenuation factor D corner of the photographed image is calculated in the following manner:

D

corner

=

4

×

Y

m

/

2

,

n

/

2

∑

i

=

1

,

m

⁢

∑

j

=

1

,

n

⁢

Y

ij

,

wherein the photographed image is divided into m×n blocks, Y ij denotes average brightness of a block at an i-th row and a j-th column, and m and n are integers greater than 1.

7 . The method according to claim 5 , wherein determining the new black-to-color switching threshold according to the photographing parameter of the camera device and the photographed image comprises:

determining a first black-to-color switching threshold factor according to the first attenuation factor of the photographed image, the second attenuation factor of the photographed image, and a preset adjustment parameter;

determining a second black-to-color switching threshold factor according to brightness of the fill light and a device gain in the photographing parameter; and

determining the new black-to-color switching threshold according to the first black-to-color switching threshold factor, the second black-to-color switching threshold factor, and the current black-to-color switching threshold.

8 . The method according to claim 7 , wherein

the first black-to-color switching threshold factor φ(D side , D corner ) is determined according to the following formula:

φ

⁡

(

D

side

,

D

corner

)

=

1

(

α

⁡

(

D

side

❘

"\[LeftBracketingBar]"

D

max

side

-

D

min

side

❘

"\[RightBracketingBar]"

)

+

(

1

-

α

)

⁢

(

D

corner

❘

"\[LeftBracketingBar]"

D

max

corner

-

D

min

corner

❘

"\[RightBracketingBar]"

)

)

,

wherein D side denotes the first attenuation factor of the photographed image, D corner denotes the second attenuation factor of the photographed image, and α denotes the preset adjustment parameter, wherein 0≤α≤1;

Dmax side denotes a pre-calibrated first attenuation factor of a strongest fill light image of the camera device, and Dmin side denotes a pre-calibrated first attenuation factor of a weakest fill light image of the camera device;

Dmax corner denotes a pre-calibrated second attenuation factor of a strongest fill light image of the camera device, and Dmin corner denotes a pre-calibrated second attenuation factor of a weakest fill light image of the camera device; and

the second black-to-color switching threshold factor F(L, Gain) is determined according to the following attenuation function obtained by pre-fitting:

F

⁡

(

L

,

Gain

)

=

A

⁢

1

×

(

Gain

2

)

+

A

⁢

0

B

⁢

1

×

log

B

(

L

10

+

1

)

,

wherein L denotes the brightness of the fill light, Gain denotes the device gain, and A1, A0, B1, and B are constants obtained by pre-fitting, wherein A1<0, B>1, B1>0, and A0>0; and

the new black-to-color switching threshold is determined according to the following formula:

T

n

⁢

2

⁢

d

-

new

=

φ

⁡

(

D

side

,

D

corner

)

×

F

⁡

(

L

,

Gain

)

×

T

n

⁢

2

⁢

d

,

wherein T n2d denotes the current black-to-color switching threshold, and T n2d-new denotes the new black-to-color switching threshold.

9 . An electronic device, comprising:

at least one processor; and

a storage apparatus configured to store at least one program;

wherein when executing the at least one program, the at least one processor is instructed to perform a day-night switching method;

wherein the method comprising:

determining image illumination according to a photographed image acquired by a camera device;

in response to the image illumination being greater than a current black-to-color switching threshold, determining an image illumination influence factor according to the photographed image;

in response to the image illumination influence factor being environmental illumination, controlling the camera device to perform day-night switching according to the image illumination and the current black-to-color switching threshold; and

in response to the image illumination influence factor being a fill light, determining a new black-to-color switching threshold according to a photographing parameter of the camera device and the photographed image, and controlling the camera device to perform day-night switching according to the image illumination and the new black-to-color switching threshold.

10 . The electronic device according to claim 9 , wherein before determining the image illumination influence factor according to the photographed image, the method further comprising:

determining whether the image illumination changes; and

in response to the image illumination not changing, controlling the camera device to perform the day-night switching according to the image illumination and the current black-to-color switching threshold,

wherein determining the image illumination influence factor according to the photographed image comprises:

in response to the image illumination changing, determining the image illumination influence factor according to the photographed image;

wherein determining whether the image illumination changes comprises:

calculating a change amplitude of the image illumination compared with historical image illumination acquired last time and determining whether the change amplitude is greater than or equal to a first change amplitude threshold;

in response to the image illumination not changing comprises:

in response to the change amplitude being less than the first change amplitude threshold; and

in response to the image illumination changing comprises:

in response to the change amplitude being greater than or equal to the first change amplitude threshold;

or

wherein determining whether the image illumination changes comprises:

calculating a change amplitude of the image illumination compared with an average value of historical image illumination acquired for previous N times and determining whether the change amplitude is greater than or equal to a second change amplitude threshold; and

in response to the image illumination not changing comprises:

in response to the change amplitude being less than the second change amplitude threshold; and

in response to the image illumination changing comprises:

in response to the change amplitude being greater than or equal to the second change amplitude threshold.

11 . The electronic device according to claim 9 , wherein the method further comprising: predetermining an initial value of a black-to-color switching threshold according to the following manners:

in a dark room scenario, in a case where the camera device is configured to be in a night mode, and the fill light is turned on, environment brightness is increased; and in a case where image quality of an image acquired by the camera device satisfies a preset image quality requirement after removing a fill light factor, acquiring a current environmental illumination value as the initial value of the black-to-color switching threshold.

12 . The electronic device according to claim 9 , wherein determining the image illumination influence factor according to the photographed image comprises:

determining a first attenuation factor used for indicating uniformity of brightness of a central region in the photographed image and brightness of an edge region in the photographed image according to the photographed image;

determining a second attenuation factor used for indicating uniformity of brightness of a center point in the photographed image and brightness of four corner positions in the photographed image according to the photographed image; and

determining the image illumination influence factor according to the first attenuation factor and the second attenuation factor.

13 . The electronic device according to claim 9 , wherein determining the image illumination influence factor according to the photographed image comprises:

determining a first attenuation factor of the photographed image according to brightness of a central region in the photographed image and brightness of an edge region in the photographed image;

determining a second attenuation factor of the photographed image according to brightness of a center point in the photographed image and brightness of four corner positions in the photographed image;

in a case where the first attenuation factor of the photographed image is less than a pre-calibrated first attenuation factor of an image without fill light of the camera device, and the second attenuation factor of the photographed image is less than a pre-calibrated second attenuation factor of the image without the fill light of the camera device, determining that the image illumination influence factor is the fill light; and

in a case where the first attenuation factor of the photographed image is greater than or equal to the pre-calibrated first attenuation factor of the image without the fill light of the camera device, or the second attenuation factor of the photographed image is greater than or equal to the pre-calibrated second attenuation factor of the image without the fill light of the camera device, determining that the image illumination influence factor is the environmental illumination.

14 . The electronic device according to claim 13 , wherein

the first attenuation factor D side of the photographed image is calculated in the following manner:

D

side

=

(

2

⁢

m

+

2

⁢

n

-

4

)

×

∑

i

=

-

1

1

⁢

∑

j

=

-

1

1

⁢

Y

(

(

m

2

+

i

)

,

(

n

2

+

j

)

)

9

×

(

∑

i

=

1

m

⁢

(

Y

i

⁢

1

+

Y

in

)

+

∑

j

=

1

n

⁢

(

Y

1

⁢

j

+

Y

mj

)

)

;

 and

the second attenuation factor D corner of the photographed image is calculated in the following manner:

D

corner

=

4

×

Y

m

/

2

,

n

/

2

∑

i

=

1

,

m

⁢

∑

j

=

1

,

n

⁢

Y

ij

,

wherein the photographed image is divided into m×n blocks, Y ij denotes average brightness of a block at an i-th row and a j-th column, and m and n are integers greater than 1.

15 . The electronic device according to claim 13 , wherein determining the new black-to-color switching threshold according to the photographing parameter of the camera device and the photographed image comprises:

determining a first black-to-color switching threshold factor according to the first attenuation factor of the photographed image, the second attenuation factor of the photographed image, and a preset adjustment parameter;

determining a second black-to-color switching threshold factor according to brightness of the fill light and a device gain in the photographing parameter; and

determining the new black-to-color switching threshold according to the first black-to-color switching threshold factor, the second black-to-color switching threshold factor, and the current black-to-color switching threshold.

16 . The electronic device according to claim 15 , wherein

the first black-to-color switching threshold factor φ(D side , D corner ) is determined according to the following formula:

φ

⁡

(

D

side

,

D

corner

)

=

1

(

α

⁡

(

D

side

❘

"\[LeftBracketingBar]"

D

max

side

-

D

min

side

❘

"\[RightBracketingBar]"

)

+

(

1

-

α

)

⁢

(

D

corner

❘

"\[LeftBracketingBar]"

D

max

corner

-

D

min

corner

❘

"\[RightBracketingBar]"

)

)

,

wherein D side denotes the first attenuation factor of the photographed image, D corner denotes the second attenuation factor of the photographed image, and α denotes the preset adjustment parameter, wherein 0≤α≤1;

Dmax side denotes a pre-calibrated first attenuation factor of a strongest fill light image of the camera device, and Dmin side denotes a pre-calibrated first attenuation factor of a weakest fill light image of the camera device;

Dmax corner denotes a pre-calibrated second attenuation factor of a strongest fill light image of the camera device, and Dmin corner denotes a pre-calibrated second attenuation factor of a weakest fill light image of the camera device; and

the second black-to-color switching threshold factor F(L, Gain) is determined according to the following attenuation function obtained by pre-fitting:

F

⁡

(

L

,

Gain

)

=

A

⁢

1

×

(

Gain

2

)

+

A

⁢

0

B

⁢

1

×

log

B

(

L

10

+

1

)

,

wherein L denotes the brightness of the fill light, Gain denotes the device gain, and A1, A0, B1, and B are constants obtained by pre-fitting, wherein A1<0, B>1, B1>0, and A0>0; and

the new black-to-color switching threshold is determined according to the following formula:

T

n

⁢

2

⁢

d

-

new

=

φ

⁡

(

D

side

,

D

corner

)

×

F

⁡

(

L

,

Gain

)

×

T

n

⁢

2

⁢

d

,

wherein T n2d denotes the current black-to-color switching threshold, and T n2d-new denotes the new black-to-color switching threshold.

17 . A non-transitory computer-readable storage medium, storing a computer program, wherein when executing the program, a processor is instructed to perform a day-night switching method;

wherein the method comprising:

determining image illumination according to a photographed image acquired by a camera device;

in response to the image illumination being greater than a current black-to-color switching threshold, determining an image illumination influence factor according to the photographed image;

in response to the image illumination influence factor being environmental illumination, controlling the camera device to perform day-night switching according to the image illumination and the current black-to-color switching threshold; and

in response to the image illumination influence factor being a fill light, determining a new black-to-color switching threshold according to a photographing parameter of the camera device and the photographed image, and controlling the camera device to perform day-night switching according to the image illumination and the new black-to-color switching threshold.

18 . The non-transitory computer-readable storage medium according to claim 17 , before determining the image illumination influence factor according to the photographed image, further comprising:

determining whether the image illumination changes; and

in response to the image illumination not changing, controlling the camera device to perform the day-night switching according to the image illumination and the current black-to-color switching threshold,

wherein determining the image illumination influence factor according to the photographed image comprises:

in response to the image illumination changing, determining the image illumination influence factor according to the photographed image;

wherein determining whether the image illumination changes comprises:

calculating a change amplitude of the image illumination compared with historical image illumination acquired last time and determining whether the change amplitude is greater than or equal to a first change amplitude threshold;

in response to the image illumination not changing comprises:

in response to the change amplitude being less than the first change amplitude threshold; and

in response to the image illumination changing comprises:

in response to the change amplitude being greater than or equal to the first change amplitude threshold;

or

wherein determining whether the image illumination changes comprises:

calculating a change amplitude of the image illumination compared with an average value of historical image illumination acquired for previous N times and determining whether the change amplitude is greater than or equal to a second change amplitude threshold; and

in response to the image illumination not changing comprises:

in response to the change amplitude being less than the second change amplitude threshold; and

in response to the image illumination changing comprises:

in response to the change amplitude being greater than or equal to the second change amplitude threshold.

19 . The non-transitory computer-readable storage medium according to claim 17 , wherein the method further comprising: predetermining an initial value of a black-to-color switching threshold according to the following manners:

in a dark room scenario, in a case where the camera device is configured to be in a night mode, and the fill light is turned on, environment brightness is increased; and in a case where image quality of an image acquired by the camera device satisfies a preset image quality requirement after removing a fill light factor, acquiring a current environmental illumination value as the initial value of the black-to-color switching threshold.

20 . The non-transitory computer-readable storage medium according to claim 17 , wherein determining the image illumination influence factor according to the photographed image comprises:

determining a first attenuation factor used for indicating uniformity of brightness of a central region in the photographed image and brightness of an edge region in the photographed image according to the photographed image;

determining a second attenuation factor used for indicating uniformity of brightness of a center point in the photographed image and brightness of four corner positions in the photographed image according to the photographed image; and

determining the image illumination influence factor according to the first attenuation factor and the second attenuation factor.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 25, 2024
From: YANG, YINGQING
To: XI'AN UNIVIEW INFORMATION TECHNOLOGIES CO., LTD
Reel/Frame 067220/0206 →
Priority Claims (1)
CN 202110892573.X · Aug 4, 2021 · national
Continuity (1)
Related Publication 20240334049A1 · Oct 3, 2024
References Cited (21)
US 10586351B1 · Brailovskiy · 2020 [cited by examiner]
US 20060244583A1 · Kawada · 2006 [cited by examiner]
US 20130194469A1 · Nakata et al. · 2013 [cited by applicant]
US 20160127659A1 · Kawasaki · 2016 [cited by applicant]
US 20160330386A1 · Sasao et al. · 2016 [cited by applicant]
US 20160366337A1 · Duran et al. · 2016 [cited by applicant]
US 20190364187A1 · Kawasaki · 2019 [cited by examiner]
US 20200126378A1 · Van Cleave · 2020 [cited by examiner]
US 20210084209A1 · Kawasaki · 2021 [cited by applicant]
US 20210195108A1 · Wang · 2021 [cited by examiner]
US 20210306546A1 · Jönsson · 2021 [cited by examiner]
US 20220182525A1 · Lv · 2022 [cited by examiner]
CN 104301616A · 2015 [cited by applicant]
CN 110225257A · 2019 [cited by applicant]
CN 110536051A · 2019 [cited by applicant]
CN 111669510A · 2020 [cited by applicant]
CN 111726514A · 2020 [cited by applicant]
CN 112672042A · 2021 [cited by applicant]
International Search Report in Application No. PCT/2022/106849, dated Sep. 23, 2022, 4 pages, including translation. [cited by applicant]
First Office Action in Chinese Application No. 202110892573.X dated Nov. 22, 2023, 9 pages, including translation. [cited by applicant]
Extended European Search Report for Application No. 22851905.4, dated Jun. 23, 2025, 12 pages. [cited by applicant]