Patent ID: 12200835

DESCRIPTION OF THE EMBODIMENTS

In order to make the purpose, technical solutions, and advantages of the disclosure more comprehensible, the disclosure is further described in detail below together with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the disclosure, and the embodiments are not used to limit the disclosure.

In the embodiments of the disclosure, words such as “exemplary” or “for example” are used to indicate examples, instances, or illustrations. Any embodiment or design described as “exemplary” or “for example” in the embodiments of the disclosure should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as “exemplary” or “for example” are intended to present the relevant concepts in a concrete fashion.

In the description of the embodiments of the disclosure, unless otherwise specified, the meaning of “multiple” refers to two or more than two. For example, multiple processing units refers to two or more processing units; and multiple elements refers to two or more elements.

Next, the technical solution provided in the embodiments of the disclosure is introduced.

FIG.1is the first flow chart of a LED light source recognition method based on deep learning provided by the disclosure. As shown inFIG.1, the executor of the method may be an electronic apparatus, such as a mobile terminal. The method includes step S101to step S105as follows.

Step S101. In an LED lighting environment, a spline frame is obtained through a CMOS camera, in which the spline frame is an image having dark stripes.

Specifically, each LED light source in the LED lighting environment performs lighting based on a switching frequency fiand a duty cycle, i represents a given number of the LED light source, different LED light sources use different switching frequencies, different LED light sources use different duty cycles, fi<W/S, S represents the shutter duration of the CMOS camera, the CMOS camera collects the image in a column-by-column scanning manner, and W represents the width of the image collected by the CMOS camera.

It should be understood that, the frequency of the LED light Liis set as fi<Width/S, and the limiting condition is to utilize the rolling shutter effect of the CMOS camera. When the CMOS camera senses light layer by layer, since Liis in an off state for part of a switching cycle, the CMOS camera does not sense light, and the image collected has black stripes.FIG.2is a schematic diagram of the spline frame provided by the disclosure. Since the indoor environment lighting is generally not from a single light source, the CMOS camera also senses light from other light sources. As shown inFIG.2, the image collected has dark stripes.

Step S102. The spline frame is input to a target detection model, a dark stripe detection result output by the target detection model is obtained, the dark stripe detection result includes multiple rectangular boxes and a predicted classification corresponding to each rectangular box, and the rectangular boxes are configured to mark dark stripe located areas or non-dark stripe located areas.

Specifically, the target detection model may be used to detect dark stripes in the spline frame and output the dark stripe detection result, and the predicted classification corresponding to the rectangular box is a dark stripe class or a non-dark stripe class.

Optionally, the target detection model may be a YOLOv8 model, and the spline frame may be input to the YOLOv8 model to obtain the dark stripe detection result output by the YOLOv8 model.

Step S103. The multiple rectangular boxes are preprocessed to obtain multiple preprocessed rectangular boxes, and the respective preprocessed rectangular boxes do not overlap with or separate from each other.

Step S104. Based on the predicted classification corresponding to each preprocessed rectangular box, an image feature encoding sequence of the spline frame is determined.

Step S105. The image feature encoding sequence is compared with a light source feature encoding sequence corresponding to each LED light source to determine the light source feature encoding sequence that best matches the spline frame.

Specifically, each LED light source in the LED lighting environment performs lighting based on the switching frequency fiand the duty cycle. The CMOS camera uses the column-by-column scanning method to collect the images. By setting the appropriate switching frequency fi(fi<W/S), spline frames having dark stripes may be collected under this LED lighting environment. The light source feature encoding sequence corresponding to the LED light source is determined based on the shutter duration, the image width, and the switching frequency and the duty cycle used by the LED light source. Since different LED light sources use different switching frequencies, different LED light sources use different duty cycles, thereby it is ensured that different LED light sources correspond to different light source feature encoding sequences, and the light source feature encoding sequence may uniquely mark the LED light source. After the spline frame is collected, the dark stripes in the spline frame may be detected by the target detection model to obtain the dark stripe detection result, and then each rectangular box in the dark stripe detection result may be preprocessed and the image feature encoding sequence of the spline frame is determined, then, the image feature encoding sequence may be compared with the light source feature encoding sequence corresponding to each LED light source to determine the light source feature encoding sequence that best matches the spline frame. Furthermore, it may be determined that the current position of the CMOS camera is near the LED light source marked by the best matching light source feature encoding sequence, so that LED lights may be efficiently used for indoor positioning, and assisted with other positioning technologies, precise positioning of the mobile terminal can be realized.

FIG.3is the second flow chart of the LED light source recognition method based on deep learning provided by the disclosure. As shown inFIG.3, the LED light source recognition method based on deep learning provided by the disclosure includes step S201to step S211as follows.

Step S201. Each LED light source is configured in the LED lighting environment.

Specifically, the LED light source Liis controlled by programming on a single chip microcomputer (0<i<N+1, and N is the quantity of LED lights), so that Lirealizes automatic switching using a lighting frequency fiand a duty cycle βias feature parameters, in which the duty cycle refers to a ratio of an on-state time to an off-state time in one switching cycle. Assuming that the shutter duration of the CMOS camera is S, the image width is Width, and the frequency fishould satisfy the condition fi<Width/S. This limiting condition is to utilize the rolling shutter effect of the CMOS camera so that the CMOS camera of the mobile terminal may obtain images with dark stripes in indoor environments. The lighting frequency and the duty cycle have to satisfy fi≠fiand βi≠βj(i≠j, 0<i<N+1, and 0<j<N+1). This limiting condition is to enable the CMOS camera to encode and sense different light source feature encoding sequences for different LED light sources. The values of fiand βiare based on the premise that there is no flicker that may be perceived by the naked eye in a normal lighting environment.

Step S202. The light source feature encoding sequence corresponding to each LED light source is configured. The light source feature encoding sequence corresponding to the LED light source is determined based on the shutter duration, the image width, and the switching frequency and the duty cycle used by the LED light source.

Specifically, a light source feature encoding sequence lSequenceiis generated according to the lighting frequency fiand the duty cycle βiof the LED light source Li. lSequenceicomprises

⌊Widthfi×S×βiβi+1⌋
consecutive 0s and

⌈Widthfi×S×1βi+1⌉
consecutive 1s.

It may be understood that the lighting features (the lighting frequency fiand the duty cycle βi) of the LED light source Liare reflected in the image collected by the CMOS camera (the shutter duration is S, and the image width is Width), and the features are expressed as a pixel width occupied by the dark stripe area and a pixel width occupied by the non-dark stripe area in a switching cycle. The pixel width occupied by the dark stripe area may be characterized by

⌈Widthfi×S×1βi+1⌉
consecutive 1s, and the pixel width occupied by the non-dark stripe area may be characterized by

⌊Widthfi×S×βiβi+1⌋
consecutive 0s.

In the context,

⌈Widthfi×S×1βi+1⌉
refers to the smallest integer larger than the equation

Widthfi×S×1βi+1,
and

⌊Widthfi×S×βiβi+1⌋
refers to the largest integer less than the equation

Widthfi×S×βiβi+1.

FIG.4is a schematic diagram of the light source feature encoding sequence corresponding to the LED light source provided by the disclosure. As shown inFIG.4, for a certain LED light source, the lighting frequency is fiand the duty cycle is βi=ai/bi. It may be determined by

⌊Widthfi×S×βiβi+1⌋
that the pixel width occupied by the non-dark stripe area in a switching cycle is represented by sixteen 0s, it may be determined by

⌈Widthfi×S×1βi+1⌉
that the pixel width occupied by the dark stripe area in a switching cycle is represented by seven Is, that is, the light source feature encoding sequence corresponding to the LED light source is “00000000000000001111111”.

Step S203. In the LED lighting environment, the spline frame is obtained by using the CMOS camera.

The CMOS camera of a mobile terminal App takes pictures in any direction in indoor lighting environments within the shutter time S to obtain a spline frame image with a width of Width and having dark stripes.

Step S204. A dark stripe detection is performed on the spline frame by using a YOLOv8 deep learning model to obtain a dark stripe detection result. The dark stripe detection result includes a box array of n rectangular boxes, and each box has a corresponding predicted classification. The box array refers to the box array of rectangular boxes in the output result of the YOLOv8 detection algorithm.

FIG.5is a schematic diagram of the dark stripe detection result output by the target detection model provided by the disclosure. As shown inFIG.5,FIG.5shows the dark stripe detection result output by the YOLOv8 model. In the result, unfilled boxes are used to mark the non-dark stripe located areas, and filled boxes are used to mark the dark stripe located areas.

Specifically, the target detection model is a trained YOLOv8 model. An initial YOLOv8 model may be trained based on a target loss function to obtain the trained YOLOv8 model. The intersection-over-union ratio used by a bounding box regression loss of the target loss function is the intersection-over-union ratio between the widths of box1 and box2 on the width coordinate axis, box1 is a real rectangular box of the sample, and box2 is a rectangular box predicted by the model for the sample.

The target loss function Loss of the model is formed by classification loss (LVFL) and the bounding box regression loss. The bounding box regression loss includes LDFLand LCIoU, VFL represents vairfocal loss, and DFL represents distribution focal loss, that is, Loss=LVFL+LDFL+LCIOU. In the formula, the following equations are satisfied.

LVFL=-1N⁢∑i=1N[qi×log⁢(pi)+(1-qi)×log⁢(1-pi)]

In the above equation, N represents the quantity of samples, qirepresents a binary classification label of the ith sample (for example, the dark stripe class is 1, and the non-dark stripe class is 0), pirepresents the probability that the model predicts the ith sample as a positive class (for example, the probability of predicting as a dark stripe class).

LDFL(Si,Si+1)=-((yi+1-y)×log⁢(Si)+(y-yi)×log⁢(Si+1))

In the above equation, y represents a target position label, yiand yi+1represent two predicted positions closest to the target position label y with one position on the left and one position on the right, Si(may be obtained by performing calculation on yithrough the sigmoid function) represents the probability corresponding to yi, Si+1(may be obtained by performing calculation on yi+1through the sigmoid function) represents the probability corresponding to yi+1; the role of DFL is to optimize the probabilities of the two positions, one position on the left and one position on the right, closest to the label y in the form of cross entropy, so that the network may focus on the distribution of the neighboring area of the target position more quickly.

LCIoU=1-IoU+ρ2(b,bgt)c2+α×v

In the above equation, IoU represents the intersection-over-union ratio between the widths of the real rectangular box box1 of the sample and the rectangular box box2 predicted by the model for the sample on the width coordinate axis (the intersection-over-union ratio between the widths of box1 and box2 is used instead of the intersection-over-union ratio between the areas of box1 and box2), bgtand b represent the center point of box1 and the center point of box2 respectively, ρ represents the Euclidean distance between box1 and box2, c represents the diagonal distance of the closed area between box1 and box2, v is used to characterize the consistency of the relative proportions between box1 and box2, and α is a weight coefficient.

FIG.6is a schematic diagram of the width intersection-over-union ratio provided by the disclosure. As shown inFIG.6, the intersection-over-union ratio between widths of the two boxes

IoU=(x⁢3-x⁢2)(x⁢4-x⁢1).

It may be understood that the intersection-over-union ratio used in the bounding box regression loss of the YOLOv8 model in the related art is the intersection-over-union ratio between the areas of box1 and box2 (the intersection area of the two boxes divided by the union area of the two boxes). The lighting features (the lighting frequency fiand the duty cycle βi) of the LED light source Liof the disclosure are reflected in the image collected by the CMOS camera (the shutter duration is S, and the image width is Width), and the features are expressed as the pixel width occupied by the dark stripe area and the pixel width occupied by the non-dark stripe area in a switching cycle. Accordingly, during the training process, the training is focused on improving the precision of the rectangular box predicted by the target detection model on the width coordinate axis. Therefore, the intersection-over-union ratio used in the bounding box regression loss of the YOLOv8 model in the disclosure is the width intersection-over-union ratio (on the width coordinate axis, the intersection length of the widths of the two boxes divided by the union length of the widths of the two boxes) between box1 and box2 on the width coordinate axis, so that the trained YOLOv8 model may more accurately detect the dark stripe area or the non-dark stripe area in the direction of the width coordinate axis.

Spline frame sample data may be labeled by using a labeling tool (such as Labelimg) to generate a txt file format. Category labels of the box are divided into two types (the dark stripe area or the non-dark stripe area). The labeling tool is used to mark the dark stripe area as 1, and to mark a rectangular area between two adjacent dark stripes (the non-dark stripe area) as 0. The samples are trained using the YOLOv8 model. Detection is performed on the spline frame by using the trained model to obtain a box array of n rectangular boxes. The output manner of box is box.xyxy (representing coordinates of two points at the diagonal corners of the box), and the coordinate values obtained are normalized values.

It should be understood that for the box array output by YOLOv8, the coordinate values of each box are normalized values, and there may be overlap or separation phenomenon between different boxes. Therefore, the box array may be preprocessed through subsequent steps S205, S206, S207, and S208.

Step S205. The normalized coordinates of the boxes in the box array are detected to convert into image coordinates.

Step S206. Along the x-axis (the image width coordinate axis), the boxes in the box array are sequentially arranged from small to large according to values of (box.x1+box.x2).

Step S207. Consecutive boxes of the same category in the box array are detected sequentially, and boxes with small mAP (mean average precision) values are removed.

FIG.7is a schematic diagram of the box array after removing boxes with small mean average precision provided by the disclosure. A rectangular box sequence after the removal process is shown inFIG.7.

Specifically, based on the rectangular box sequence (that is, the sequentially arranged box array), rectangular box removal process is performed, and a rectangular box sequence after the removal process is obtained. In the rectangular box removal process, for each target adjacent group, a rectangular box with a small mean average precision mAP in each target adjacent group is removed. The target adjacent group includes two adjacent rectangular boxes and the two rectangular boxes have the same predicted classification.

Step S208. The overlap and separation phenomena of adjacent boxes in the box array in the x-axis (that is, the width coordinate axis) direction are eliminated, and adjacent boxes are seamlessly tiled in the x-axis direction.

FIG.8is a schematic diagram of the box array after the overlapping and separation areas are eliminated provided by the disclosure, and the box array after the adjacent boxes are seamlessly tiled in the x-axis direction is shown inFIG.8.

Specifically, for any two adjacent rectangular boxes in the rectangular box sequence (the box array) after the removal process, when the two rectangular boxes overlap on the x-axis, the rear boundary of the former rectangular box of the two rectangular boxes is moved forward along mAPbefore the x-axis, and a distance moved forward is

Wo⁢v⁢e⁢r⁢l⁢a⁢p×mAPbeforemAPbefore+mAPafter.

The front boundary of the latter rectangular box of the two rectangular boxes is moved backward along the x-axis, and a distance moved backward is

Wo⁢v⁢e⁢r⁢l⁢a⁢p×mAPaftermAPbefore+mAPafter.

In the formula, Woverlaprepresents the width of the overlapping area between two rectangular boxes, mAPbefore represents the mean average precision of the former rectangular box, and mAPafter represents the mean average precision of the latter rectangular box.

Specifically, for any two adjacent rectangular boxes in the rectangular box sequence after the removal process, when the two rectangular boxes are separated on the x-axis, the rear boundary of the former rectangular box of the two rectangular boxes is moved backward along the x-axis, and a distance moved backward is

WS⁢e⁢p⁢a⁢r⁢a⁢t⁢i⁢o⁢n×mAPbeforemAPbefore+mAPafter.

The front boundary of the latter rectangular box of the two rectangular boxes is moved forward along the x-axis, and a distance moved forward is

WS⁢e⁢p⁢a⁢r⁢a⁢t⁢i⁢o⁢n×mAPaftermAPbefore+mAPafter.

In the formula, WSeparationrepresents the width of the separation area between two rectangular boxes, mAPbefore represents the mean average precision of the former rectangular box, and mAPafter represents the mean average precision of the latter rectangular box.

Step S209. According to the predicted classification corresponding to each box in the box array, an image feature encoding sequence pSequence is calculated.

Specifically, along the x-axis, the width of each preprocessed rectangular box is adjusted to obtain multiple width-adjusted rectangular boxes, the width adjustment is used to adjust the front and rear boundaries of the preprocessed rectangular box, box.

xn⁢e⁢w=box.xold×Wlength,
box.xoldis coordinates of the target boundary before the width of the preprocessed rectangular box is adjusted, box.xnewis coordinates of the target boundary after the width of the preprocessed rectangular box is adjusted, the target boundary is the front boundary or the rear boundary, W is the image width, and length represents coordinate values of the rear boundary of the last preprocessed rectangular box.

Based on the width and predicted classification corresponding to each width-adjusted rectangular box, a feature encoding sequence corresponding to each width-adjusted rectangular box is determined.

The feature encoding sequences corresponding to the respective width-adjusted rectangular boxes are integrated to determine the image feature encoding sequence of the spline frame.

It may be understood that the light source feature encoding sequence corresponding to the LED light source is determined based on the shutter duration, the image width, and the switching frequency and the duty cycle used by the LED light source. After adjusting the coordinates of the boxes in the previous stage, the sum of the widths of all boxes may not be completely consistent with the image width. Here, after adjusting the width of the boxes through box.

xn⁢e⁢w=box.xold×Wlength,
the sum of the widths of all boxes may be made consistent with the image width, thereby it is ensured that the image feature encoding sequence and the light source feature encoding sequence corresponding to each LED light source are compared under the same image width.

For example, for a width-adjusted rectangular box, when the category of the box is 1, [box.x2−box.x1] consecutive is are generated as the feature encoding sequence corresponding to the box; when the category of the box is 0, [box.x2−box.x1] consecutive 0s are generated as the feature encoding sequence corresponding to the box. Finally, all the consecutive 1s or consecutive 0s are concatenated (that is, the feature encoding sequences corresponding to the respective width-adjusted rectangular boxes are integrated), and the image feature encoding sequence is formed.

Step S210. The image feature encoding sequence is compared with the light source feature encoding sequence lSequenceicorresponding to each LED light source to obtain a light source feature encoding sequence iSequencemaxwith the greatest similarity (best match).

Specifically, for the light source feature encoding sequence lSequenceicorresponding to each LED light source, a similarity analysis is performed to determine the similarity between the light source feature encoding sequence lSequenceicorresponding to each LED light source and the image feature encoding sequence pSequence.

Based on the similarity between the light source feature encoding sequence lSequenceicorresponding to each LED light source and the image feature encoding sequence pSequence, the light source feature encoding sequence lSequencemaxthat best matches the spline frame is determined.

Specifically, the similarity analysis includes as follows.

For each target code in the light source feature encoding sequence lSequencei, the target code is aligned with the first code of the image feature encoding sequence pSequence, the light source feature encoding sequence lSequenceiis used as content of a sliding window, at each window position, each code in the sliding window is compared with the code at the corresponding position in the image feature encoding sequence pSequence to see if the codes are equal, the total quantity of times of the codes being equal is calculated and the total quantity is used as a similarity corresponding to the target code, the sliding window is used to slide from the current window position to the next window position according to the target step size, and the target step size is equal to the length of the light source feature encoding sequence lSequencei.

Based on the similarities corresponding to each target code in the light source feature encoding sequence lSequencei, the maximum similarity is selected as the similarity between the light source feature encoding sequence lSequenceiand the image feature encoding sequence pSequence.

FIG.9is a schematic diagram of the code in the light source feature encoding sequence provided by the disclosure aligning with the first code in the image feature encoding sequence. As shown inFIG.9, the first code of the image feature encoding sequence may be aligned with a first code code1(as the target code) in the light source feature encoding sequence, at each window position, each code in the sliding window is compared with the code at the corresponding position in the image feature encoding sequence pSequence to see if the codes are equal, the total quantity of times of the codes being equal is calculated and the total quantity is used as the similarity corresponding to code1; the first code of the image feature encoding sequence may be aligned with a second code code2(as the target code) in the light source feature encoding sequence, at each window position, each code in the sliding window is compared with the code at the corresponding position in the image feature encoding sequence pSequence to see if the codes are equal, the total quantity of times of the codes being equal is calculated and the total quantity is used as the similarity corresponding to code2; the first code of the image feature encoding sequence may be aligned with a third code code3(as the target code) in the light source feature encoding sequence, at each window position, each code in the sliding window is compared with the code at the corresponding position in the image feature encoding sequence pSequence to see if the codes are equal, the total quantity of times of the codes being equal is calculated and the total quantity is used as the similarity corresponding to code3; by analogy, the similarity corresponding to each target code in the light source feature encoding sequence lSequenceimay be determined.

FIG.10is a schematic diagram of multiple window positions provided by the disclosure. As shown inFIG.10, when the first code of the image feature encoding sequence is aligned with the first code code1(as the target code) in the light source feature encoding sequence, the light source feature encoding sequence lSequenceiis used as the content of the sliding window. The sliding window is used to slide from the current window position to the next window position according to the target step size. The target step size is equal to the length of the light source feature encoding sequence lSequencei. At a first window position, each code in the sliding window is compared with the code at the corresponding position in the image feature encoding sequence pSequence to see if the codes are equal, the quantity of times of the codes being equal at the current window position is calculated as 15. After sliding one step according to the target step size, at a second window position, each code in the sliding window is compared with the code at the corresponding position in the image feature encoding sequence pSequence to see if the codes are equal, the quantity of times of the codes being equal at the current window position is calculated as 15. By analogy, the quantity of times the codes being equal may be calculated at each window position, and the total quantity may be determined by accumulation and used as the similarity corresponding to the target code.

Step S211. According to the corresponding relationship between the LED light source and the light source feature encoding sequence, the LED light source corresponding to ISequencemaxis recognized.

It may be understood that the disclosure utilizes the mobile terminal to recognize the LED light source, and only the lighting frequency fiand the duty cycle βiof each LED light source are required, the requirement has nothing to do with the deployment layout of the LED light sources, and no additional hardware design is required for the LED light sources. The recognition method only relies on the mobile terminal to use the CMOS camera to collect scene images of a fixed width. The mobile terminal only needs to have simple model calculation capabilities and does not require additional design or loading of special hardware modules. The recognition method provided by the disclosure does not require setting additional parameters during execution. The computational complexity and space complexity in step S204depend on the YOLOv8 network structure, and the computational complexity and space complexity in step S205are O(|boxes|). The computational complexity and space complexity of the algorithm in step S206are O(|boxes|2). The computational complexity and space complexity of the algorithm in step S207to S209are O(|boxes|). Overall, the entire method process takes less than 20 ms to perform a detection and recognition on the mobile terminal, thereby the real-time performance is good. Therefore, the method proposed in the disclosure is suitable for positioning and navigation in any complex indoor scene (for example, large indoor scenes such as parking lots, shopping malls, exhibition halls, and museums) using LED lights as lighting sources, and the disclosure has the advantages of real-time, low power consumption, and low complexity.

An LED light source recognition device based on deep learning provided by the disclosure is described below. The LED light source recognition device based on deep learning described below and the LED light source recognition method based on deep learning described above may be referred to each other.

FIG.11is a schematic diagram of a structure of an LED light source recognition device based on deep learning provided by the disclosure. As shown inFIG.11, the device includes a sample collecting module10, a target detection module20, a preprocessing module30, an encoding module40, and a comparison module50. A description of the components are as follows.

The sample collecting module10is used to obtain a spline frame through a CMOS camera in an LED lighting environment, in which the spline frame is an image having dark stripes.

The target detection module20is used to input the spline frame to a target detection model to obtain a dark stripe detection result output by the target detection model, the dark stripe detection result includes multiple rectangular boxes and a predicted classification corresponding to each rectangular box, and the rectangular boxes are configured to mark dark stripe located areas or non-dark stripe located areas.

The preprocessing module30is used to preprocess the multiple rectangular boxes to obtain multiple preprocessed rectangular boxes, and the respective preprocessed rectangular boxes do not overlap with or separate from each other.

The encoding module40is used to determine the image feature encoding sequence of the spline frame based on the predicted classification corresponding to each preprocessed rectangular box.

The comparison module50is used to compare the image feature encoding sequence with the light source feature encoding sequence corresponding to each LED light source to determine a light source feature encoding sequence that best matches the spline frame, and the light source feature encoding sequence is used to mark the LED light source.

Following the above, each LED light source in the LED lighting environment performs lighting based on the switching frequency fiand the duty cycle, i represents the given number of the LED light source, different LED light sources use different switching frequencies, different LED light sources use different duty cycles, fi<W/S, S represents the shutter duration of the CMOS camera, the CMOS camera collects the image in a column-by-column scanning manner, and W represents the width of the image collected by the CMOS camera, and the light source feature encoding sequence corresponding to the LED light source is determined based on the shutter duration, the image width, and the switching frequency and the duty cycle used by the LED light source.

It should be understood that the device is used to execute the method in the above-mentioned embodiments. The implementation principle and technical effect of the corresponding program module in the device are similar to the description in the method, the working process of the device may be referred to the corresponding process in the method, so details will not be repeated here.

Based on the method in the embodiments, an electronic apparatus is provided according to an embodiment of the disclosure. The device may include at least one storage configured to store a program and at least one processor configured to execute the program stored in the storage. When the program stored in the storage is executed, the processor is used to execute the method described in the embodiments.

Based on the method in the embodiments, a computer-readable storage medium is provided according to an embodiment of the disclosure. The computer-readable storage medium stores a computer program, and when the computer program runs on a processor, the processor executes the method in the embodiments.

Based on the method in the embodiments, a computer program product is provided according to an embodiment of the disclosure. When the computer program product runs on a processor, the processor executes the method in the embodiments.

It should be understood that the processor in the embodiments of the disclosure may be a central processing unit (CPU), may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuit (ASIC), field programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components or combinations thereof. A general purpose processor may be a microprocessor or any conventional processor.

The steps of the method in the embodiments of the disclosure may be implemented by hardware, or by a processor executing software commands. The software commands may comprise corresponding software modules, and the software modules may be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), electrically EPROM (EEPROM), register, hard disk, mobile hard disk, CD-ROM, or any other form of storage media known in the art. An exemplary storage medium is coupled to the processor such that the processor may read information from, and write information to, the storage medium. Certainly, the storage medium may also be an integral part of the processor. The processor and the storage medium may reside in an ASIC.

In the embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the implementation may be in the form of a computer program product. The computer program product comprises one or more computer commands. When the computer program commands are loaded and executed on a computer, the process or function described in the embodiments of the disclosure is generated in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device. The computer commands may be stored in the computer-readable storage medium or transmitted via the computer-readable storage medium. The computer commands may be sent from a website, computer, server, or data center via a wired (for example, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (for example, infrared, wireless, microwave) manner to another website, computer, server, or data center. The computer-readable storage medium may be any available medium that may be accessed by a computer or may be a data storage device such as a server or a data center including one or more available media. The available medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).

In general, the above technical solution conceived by the disclosure has beneficial effects as follows compared with the related art.

Each LED light source in the LED lighting environment performs lighting based on the switching frequency fiand the duty cycle. The CMOS camera uses the column-by-column scanning method to collect the images. By setting the appropriate switching frequency fi(fi<W/S), spline frames having dark stripes may be collected under this LED lighting environment. The light source feature encoding sequence corresponding to the LED light source is determined based on the shutter duration, the image width, and the switching frequency and the duty cycle used by the LED light source. Since different LED light sources use different switching frequencies, different LED light sources use different duty cycles, thereby it is ensured that different LED light sources correspond to different light source feature encoding sequences, and the light source feature encoding sequence may uniquely mark the LED light source. After the spline frame is collected, the dark stripes in the spline frame may be detected by the target detection model to obtain the dark stripe detection result, and then each rectangular box in the dark stripe detection result may be preprocessed and the image feature encoding sequence of the spline frame is determined, then, the image feature encoding sequence may be compared with the light source feature encoding sequence corresponding to each LED light source to determine the light source feature encoding sequence that best matches the spline frame. Furthermore, it may be determined that the current position of the CMOS camera is near the LED light source marked by the best matching light source feature encoding sequence, so that LED lights may be efficiently used for indoor positioning, and assisted with other positioning technologies, precise positioning of the mobile terminal can be realized.

It should be understood that the various numerical numbers involved in the embodiments of the disclosure are only used for the convenience of description and are not used to limit the scope of the embodiments of the disclosure.

It is understood by persons skilled in the art that the above description is only preferred embodiments of the disclosure and the embodiments are not intended to limit the disclosure. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the disclosure should be included in the protection scope of the disclosure.