Disclosure of Invention
In order to solve the problems in the prior art, on one hand, the invention provides a method for judging the safety of an optical label, which comprises the following steps:
collecting identification information of the optical label by using an imaging device;
obtaining the physical size information and legal position rule of the optical label through the identification information;
determining current position information of the optical label by reverse positioning based on the physical size information and the position information of the imaging device; and
comparing the current position information of the optical label with the legal position rule.
In another aspect, the present invention provides another optical tag security determination method, including:
collecting identification information of the optical label by using an imaging device;
obtaining physical size information of the optical label through the identification information;
determining current position information of the optical label by reverse positioning based on the physical size information and the position information of the imaging device; and
and sending the current position information of the optical label to a server to be compared with the legal position rule of the optical label stored on the server.
According to the optical label safety judgment method of the invention, preferably, the position information of the imaging device is obtained by a positioning module of the imaging device or is obtained based on the position reverse positioning of the reliable optical label.
According to the optical tag safety determination method of the present invention, preferably, if the current position information of the optical tag does not comply with the legal position rule, a warning is issued.
According to the optical tag security determination method of the present invention, preferably, the determining the current location information of the optical tag by reverse positioning includes:
calibrating a focal length of an imaging device of the imaging device to an optimal focal length;
obtaining an image of the optical label at an optimal focal distance;
calculating a distance between the optical label and the imaging device based on the optimal focal distance, a physical size of the optical label, and a size of an image of the optical label;
calculating a relative direction between the optical label and the imaging device according to a distortion degree of an image of the optical label; and
and determining the current position information of the optical label according to the position information of the imaging device, the distance between the optical label and the imaging device and the relative direction.
According to the optical tag security determination method of the present invention, it is preferable that the method further includes:
and acquiring recorded abnormal power failure information of the optical label by using an imaging device.
According to the optical tag safety determination method of the present invention, it is preferable that the abnormal power outage information is compared with a power outage rule of the optical tag.
According to the optical tag safety determination method of the present invention, preferably, if the abnormal power outage information does not comply with the power outage rule, a warning is issued.
In a further aspect, the invention provides an imaging device for optical label security decision comprising a processor and a memory, the memory having stored therein a computer program which, when executed by the processor, is operable to implement an optical label security decision method according to the invention.
In another aspect, the present invention provides a storage medium in which a computer program is stored, the computer program being capable of being used to implement the optical tag security decision method according to the present invention when executed.
The invention also provides a system for judging the safety of the optical label, which comprises the following components:
an image forming apparatus according to the present invention; and
and the server is used for storing the physical size information and the legal position rule of the optical label.
The optical tag security determination system according to the present invention preferably further includes:
the optical label is provided with a power failure recording module and is used for recording abnormal power failure information of the optical label;
wherein the server further stores the power-off rule of the optical label.
In the present invention, the optical label may include:
at least one light source; and
a controller configured to control each of the at least one light source to operate in at least two modes including a first mode for communicating first information and a second mode for communicating second information different from the first information,
wherein, for any one of the at least one light source, in the first mode, a property of light emitted by the light source is varied at a first frequency to present a streak on an image of the light source obtained when the light source is photographed by a CMOS image sensor, and in the second mode, the light emitted by the light source does not present a streak on the image of the light source obtained when the light source is photographed by a CMOS image sensor.
Preferably, the optical label further comprises one or more location indicators located in the vicinity of said light source.
Compared with the prior art, the invention prevents the illegal use of the optical label and improves the safety of the optical label.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail by embodiments with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Optical labels communicate information by emitting different lights, and the information communicated by optical labels may change over time. In the present description, optical labels suitable for the positioning method of the present invention are first detailed in the international application PCT/CN2017/099642 filed by the applicant on 30/8/2017, which is incorporated herein by reference in its entirety.
An optical label includes a light source and a controller configured to control the light source to operate in two or more modes including a first mode in which a property of light emitted by the light source changes at a first frequency to convey first information and a second mode in which the property of light emitted by the light source changes or does not change at a second frequency to convey second information different from the first information.
The property of light refers to any property that can be recognized by the CMOS imaging device, for example, it may be a property that is perceptible to the human eye, such as intensity, color, wavelength, etc., of light, or it may be another property that is not perceptible to the human eye, such as intensity, color, or wavelength change of electromagnetic wavelengths outside the visible range of the human eye, or any combination of the above properties. Thus, the change in the property of the light may be a change in a single property or a change in a combination of two or more properties. When selecting the intensity of the light as the property, this can be achieved simply by selecting the light source to be switched on or off. In the following, for simplicity, the light properties are changed by switching the light source on or off, but a person skilled in the art will understand that other ways for changing the light properties are also possible. It should be noted that the property of the light changing at the first frequency in the first mode may be the same as or different from the property of the light changing at the second frequency in the second mode. Preferably, the properties of the light that change in the first and second modes are the same.
When the light source operates in the first mode or the second mode, the light source may be imaged using a CMOS imaging device or a device having a CMOS imaging device (e.g., a cell phone, a tablet, smart glasses, etc.). Hereinafter, a mobile phone will be described as an example of a CMOS imaging device, as shown in fig. 1. The line scan direction of the handset is shown as vertical in fig. 1, but those skilled in the art will appreciate that the line scan direction may also be horizontal depending on the underlying hardware configuration.
The light source may be of various forms as long as some property thereof that is perceivable by the CMOS imager can be varied at different frequencies. For example, the light source may be one LED lamp, an array of a plurality of LED lamps, a display screen, or a part thereof, and even an irradiation area of light (for example, an irradiation area of light on a wall) may be used as the light source. The shape of the light source may be various shapes such as a circle, a square, a rectangle, a bar, an L-shape, etc. Various common optical devices may be included in the light source, such as light guide plates, diffuser plates, diffusers, and the like. In a preferred embodiment, the light source may be a two-dimensional array of a plurality of LED lights, one dimension of which is longer than the other, preferably with a ratio of about 6: 1-12: 1. for example, the LED lamp array may be constituted by a plurality of LED lamps arranged in a line. When illuminated, the LED light array may appear as a generally rectangular light source, and the operation of the light source is controlled by the controller.
Fig. 2 shows a light source according to an embodiment of the invention. When the light source shown in fig. 2 is imaged using a CMOS imaging device, it is preferable to make the long side of the light source shown in fig. 2 perpendicular or substantially perpendicular to the row direction of the CMOS imaging device (for example, the row scanning direction of the mobile phone shown in fig. 1) to image as many stripes as possible under the same other conditions. However, sometimes a user does not know the line scanning direction of his mobile phone, and in order to ensure that the mobile phone can recognize in various postures and can reach the maximum recognition distance in both the portrait screen and the landscape screen, the light source may be a combination of a plurality of rectangles, for example, an L-shaped light source as shown in fig. 3.
In another embodiment, the light source may not be limited to a planar light source, but may be implemented as a solid light source, for example, a bar-shaped cylindrical light source, a cubic light source, or the like. The light source may be placed on a square, suspended in the approximate center of an indoor location (e.g., a restaurant, a conference room, etc.), for example, so that nearby users in all directions may photograph the light source with a cell phone to obtain information conveyed by the light source.
Fig. 4 shows an imaging timing diagram for a CMOS imager device, where each row corresponds to a row of sensors for the CMOS imager device. In imaging each row of a CMOS imaging sensor array, two phases are mainly involved, exposure time and readout time, respectively. There is a possibility that the exposure times of the rows overlap, but the readout times do not overlap.
It should be noted that only a small number of rows are schematically shown in fig. 4, and in an actual CMOS imaging device, there are typically thousands of rows of sensors depending on the difference in resolution, for example, for a 1080p resolution, there are 1920 × 1080 pixels, numeral 1080 indicates 1080 scan lines, numeral 1920 indicates 1920 pixels per row, and for a 1080p resolution, the readout time for each row is approximately 8.7 microseconds (i.e., 8.7 × 10 microseconds)-6Seconds).
If the exposure time is too long, resulting in a large amount of overlap between the exposure times of adjacent rows, then a stripe may appear as a distinct transition in the imaging, e.g., a plurality of rows of pixels having different gray levels between a row of purely black pixels and a row of purely white pixels. The present invention contemplates that the pixel rows be rendered as sharp as possible, for which the exposure time of a CMOS imager device (e.g., a cell phone) may be set or adjusted (e.g., by an APP installed on the cell phone) to select a relatively short exposure time. In a preferred embodiment, the exposure time may be made approximately equal to or less than the readout time for each row. Taking 1080p resolution as an example, the readout time per line is approximately 8.7 microseconds, in which case it is contemplated to adjust the exposure time of the handset to approximately 8.7 microseconds or less. Fig. 5 shows an imaging timing chart of the CMOS imaging device in this case. In this case, the exposure times of the lines do not substantially overlap, or overlap is less, so that a streak having a clearer boundary can be obtained at the time of imaging, which is more easily recognized. It should be noted that fig. 5 is only a preferred embodiment of the present invention, and that longer (e.g., equal to or less than twice, three times, or four times the readout time per row, etc.) or shorter exposure times are also possible. For example, in the imaging process of the striped image shown in fig. 12 and 13 of the present application, the readout time per line is approximately 8.7 microseconds, and the exposure time per line is set to 14 microseconds. In addition, in order to exhibit the streak, the duration of one period of the light source may be set to about twice the exposure duration or longer, and preferably may be set to about four times the exposure duration or longer.
Fig. 6 shows an image on a CMOS imager at different stages when the controller is used to operate the light source in a first mode in which the properties of the light emitted by the light source are varied at a frequency, in this case turning the light source on and off.
The upper part of fig. 6 shows a state change diagram of the light source at different stages, and the lower part shows an imaging diagram of the light source on the CMOS imaging device at different stages, wherein the row direction of the CMOS imaging device is a vertical direction and scans from left to right. Since the image collected by the CMOS imaging device is scanned line by line, when a high-frequency flicker signal is captured, a portion of the obtained one-frame image corresponding to the imaging position of the light source may form a stripe as shown in the lower part of fig. 6, specifically, in a period 1, the light source is turned on, and the scanning line of the leftmost part exposed in the period shows a bright stripe; in a period 2, the light source is turned off, and the scanning line exposed in the period presents dark stripes; in a period 3, the light source is turned on, and the scanning line exposed in the period shows bright stripes; in period 4, the light source is turned off, and the scan line exposed in this period appears dark striped.
The width of the fringes that appear can be adjusted by setting the frequency at which the light source flashes, or the duration of each turn on and off of the light source, with longer on or off times generally corresponding to wider fringes. For example, in the case shown in fig. 5, if the time length of each turn-on and turn-off of the light source is set to be approximately equal to the exposure time of each line of the CMOS imaging device (the exposure time may be set by the APP mounted on the mobile phone or manually set), a stripe having a width of only one pixel may be presented at the time of imaging. In order to enable long-distance identification of the optical label, the narrower the stripe, the better. However, in practice, a stripe having a width of only one pixel may be less stable or less easily recognized due to light interference, synchronization, and the like, and therefore, in order to improve the stability of recognition, a stripe having a width of two pixels is preferably implemented. For example, in the case shown in fig. 5, a stripe having a width of about two pixels can be implemented by setting a time period for each turn-on or turn-off of the light source to be substantially equal to about 2 times an exposure time period for each line of the CMOS imaging device, as shown in fig. 8 in particular, where the signal in the upper part of fig. 8 is a light source control signal whose high level corresponds to the turn-on of the light source and low level corresponds to the turn-off of the light source. In the embodiment shown in fig. 8, the duty cycle of the light source control signal is set to about 50%, and the exposure time for each row is set to be approximately equal to the readout time for each row, but those skilled in the art will appreciate that other arrangements are possible as long as distinguishable fringes can be exhibited. For simplicity of description, fig. 7 uses synchronization between the light source and the CMOS imager such that the on and off times of the light source approximately correspond to the start or end times of the exposure duration of a row of the CMOS imager, but those skilled in the art will appreciate that even if the two are not synchronized as in fig. 7, significant stripes may appear on the CMOS imager, where there may be some transitional stripes, but there must be a row exposed when the light source is always off (i.e., the darkest stripe) and a row exposed when the light source is always on (i.e., the brightest stripe), separated by one pixel. Such a change in brightness (i.e., a streak) of a line of pixels can be readily detected (e.g., by comparing the brightness or gray scale of some pixels in the imaging area of the light source). Further, even if there is no line exposed when the light source is always off (i.e., the darkest stripe) and no line exposed when the light source is always on (i.e., the brightest stripe), if there are a line in which the light source-on portion t1 is less than a certain length of time or occupies a small proportion of the entire exposure time (i.e., the darker stripe) and a line in which the light source-on portion t2 is greater than a certain length of time or occupies a large proportion of the entire exposure time (i.e., the lighter stripe) during the exposure time, and t2-t1> the light-dark stripe difference threshold (e.g., 10 microseconds), or t2/t1> the light-dark stripe proportion threshold (e.g., 2), a change in brightness between these pixel lines. The light and shade stripe difference value threshold and the proportion threshold are related to the light intensity of the cursor label, the property of the photosensitive device, the shooting distance and the like. It will be appreciated by those skilled in the art that other thresholds are possible, as long as computer-resolvable fringes can be present. When a stripe is recognized, the information, e.g. binary data 0 or data 1, conveyed by the light source at that time can be determined.
The streak recognition method according to one embodiment of the present invention is as follows: obtaining an image of the optical label, and segmenting an imaging area of the light source by using a projection mode; collecting striped and non-striped pictures in different configurations (e.g., different distances, different light source blinking frequencies, etc.); all collected pictures are normalized uniformly to a specific size, for example 64 x 16 pixels; extracting each pixel feature as an input feature, and constructing a machine learning classifier; and performing classification judgment to judge whether the image is a stripe image or a non-stripe image. For the stripe recognition, any other method known in the art can be used for processing by those skilled in the art, and will not be described in detail.
For a strip light source with a length of 5 cm, when a camera is used with a resolution of 1080p, which is commonly used in the current market, and a camera is shot at a distance of 10 m (i.e., a distance of 200 times the length of the light source), the strip light source occupies 6 pixels in the length direction, and if each stripe has a width of 2 pixels, at least one distinct stripe is displayed in the width range of 6 pixels, and can be easily recognized. If a higher resolution is set, or optical zoom is used, the fringes can also be identified at a greater distance, for example a distance of 300 or 400 times the length of the light source.
The controller may also cause the light source to operate in the second mode. In one embodiment, in the second mode, the property of the light emitted by the light source is changed at another frequency than in the first mode, e.g. the light source is switched on and off. In one embodiment, the controller may increase the frequency of turning on and off the light source compared to the first mode. For the case shown in fig. 5, the light source may be configured to turn on and off at least once during the exposure time of each row of the CMOS imager device. Fig. 8 shows a case where the light source is turned on and off only once in the exposure time of each line, wherein the signal at the upper part of fig. 8 is a light source control signal, the high level of which corresponds to the turning on of the light source and the low level of which corresponds to the turning off of the light source. Since the light source is turned on and off once in the same manner during the exposure time of each row, the exposure intensity energy obtained during each exposure time is approximately equal, and therefore, the brightness of each pixel row of the final image of the light source does not have obvious difference, and stripes do not exist. It will be appreciated by those skilled in the art that higher on and off frequencies are also possible. In addition, for simplicity of description, synchronization between the light source and the CMOS imaging device is used in fig. 8 so that the turn-on time of the light source approximately corresponds to the start time of the exposure time period of a certain line of the CMOS imaging device, but those skilled in the art will appreciate that even if the two are not synchronized as in fig. 9, there is no significant difference in brightness between the respective pixel lines of the final imaging of the light source, and thus no streak exists. When the stripe cannot be recognized, the information transmitted by the light source at that time, for example, binary data 1 or data 0, can be determined. Because the human eyes have certain reaction time, the human eyes can not perceive any flickering phenomenon when the light source works in the first mode and the second mode. In addition, in order to avoid a flickering phenomenon that may be perceived by human eyes when switching between the first mode and the second mode, duty ratios of the first mode and the second mode may be set to be substantially equal, thereby achieving substantially the same luminous flux in the different modes.
In another embodiment, in the second mode, a direct current may be supplied to the light source so that the light source emits light whose properties are not substantially changed, and thus, no stripe is present on one frame image of the light source obtained when the light source is photographed by the CMOS image sensor. In addition, in this case, it is also possible to realize approximately the same luminous flux in the different modes to avoid a flickering phenomenon that may be perceived by the human eye when switching between the first mode and the second mode.
While fig. 7 above describes an embodiment in which the stripes are presented by varying the intensity of the light emitted by the light source (e.g., by turning the light source on or off), in another embodiment, the stripes may also be presented by varying the wavelength or color of the light emitted by the light source, as shown in fig. 9. In the embodiment shown in fig. 9, the light source includes a red light emitting red light and a blue light emitting blue light. The two signals in the upper part of fig. 9 are a red control signal and a blue control signal, respectively, where a high level corresponds to the turning on of the corresponding light source and a low level corresponds to the turning off of the corresponding light source. The red and blue control signals are phase shifted by 180, i.e., opposite in level. The light source can emit red light and blue light outwards alternately through the red light control signal and the blue light control signal, so that red and blue stripes can be presented when the CMOS imaging device is adopted to image the light source.
By determining whether or not a portion corresponding to the light source on one frame of image taken by the CMOS imaging device has a streak, information conveyed by each frame of image, such as binary data 1 or data 0, can be determined. Further, continuous multi-frame images of the light source are shot through the CMOS imaging device, an information sequence formed by binary data 1 and binary data 0 can be determined, and information transmission from the light source to the CMOS imaging device (such as a mobile phone) is achieved. In one embodiment, when a plurality of consecutive frames of images of the light source are captured by the CMOS imaging device, the controller may control the switching time interval between the operation modes of the light source to be equal to the time length of one complete frame imaging of the CMOS imaging device, so as to achieve frame synchronization between the light source and the imaging device, that is, 1-bit information is transmitted per frame. For a shooting speed of 30 frames/second, 30 bits of information can be transmitted every second, and the coding space reaches 230The information may include, for example, a start frame marker (header), an ID of an optical label, a password, a verification code, website address information, a timestamp, or various combinations thereof, and so forth. The data packet structure can be formed by setting the sequence relation of the various information according to a structuring method. Each time a complete packet structure is received, it is considered to obtain a complete set of data (one number)Packet) that can be subjected to data read and verification analysis. The following table shows a data packet structure according to one embodiment of the invention:
frame header
|
Attribute (8bit)
|
Data bit (32bit)
|
Check digit (8bit)
|
Frame end |
In the above description, the information conveyed by each frame image is determined by determining whether or not a streak is present in the frame image at the imaging position of the light source. In other embodiments, the different information conveyed by each frame of image may be determined by identifying different fringes in the frame of image at the imaging location of the light source. For example, in the first mode, the property of light emitted by the light source is changed at a first frequency, so that a first stripe can be presented on an image of the light source obtained when the light source is photographed by the CMOS image sensor; in the second mode, the property of the light emitted by the light source is varied at a second frequency, so that a second stripe different from the first stripe can be presented on an image of the light source obtained when the light source is photographed by the CMOS image sensor. The difference in stripes may be based, for example, on different widths, colors, brightness, etc., or any combination thereof, as long as the difference can be identified.
In one embodiment, stripes of different widths may be implemented based on different frequency of property changes, e.g., in a first mode, the light source may operate as shown in FIG. 7, thereby implementing a first type of stripe having a width of about two pixels; in the second mode, the durations of the high level and the low level in each period of the light source control signal in fig. 7 may be respectively modified to be twice as long as the original, as shown in fig. 10 in particular, thereby implementing the second stripe having a width of about four pixels.
In another embodiment, stripes of different colors may be implemented, for example, the light source may be set to include a red light capable of emitting red light and a blue light capable of emitting blue light, and in the first mode, the blue light may be turned off and the red light may be operated as shown in fig. 7, thereby implementing red-black stripes; in the second mode, the red lamp may be turned off and the blue lamp operated as shown in fig. 7, thereby implementing a blue-black stripe. In the above-described embodiment, the red-black stripes and the blue-black stripes are implemented using the same variation frequency in the first mode and the second mode, but it is understood that different attribute variation frequencies may be used in the first mode and the second mode.
In addition, it will be understood by those skilled in the art that more than two kinds of information may be further represented by implementing more than two kinds of stripes, for example, in the embodiment including the red light and the blue light in the light source described above, a third mode may be further provided in which the red light and the blue light are controlled in the manner shown in fig. 9 to implement the red-blue stripes, i.e., the third information. Obviously, optionally, another information, i.e. a fourth information, may also be further conveyed by not presenting stripes.
Fig. 11 shows stripes on an image obtained by an experiment in the case where a 1080p resolution imaging device was used for an LED lamp that blinks at 16000 times per second (duration of each period was 62.5 microseconds, where on-duration and off-duration were each about 31.25 microseconds), and exposure duration for each row was set to 14 microseconds. As can be seen in fig. 11, stripes of approximately 2-3 pixel width are present. Fig. 13 shows stripes on the experimentally obtained image with otherwise unchanged conditions after adjusting the LED lamp blinking frequency of fig. 11 to 8000 times per second (duration of each cycle being 125 microseconds, with the on and off durations each being about 62.5 microseconds). As can be seen in fig. 12, stripes of approximately 5-6 pixel width are present. Fig. 13 shows an image obtained by experiment with otherwise unchanged conditions after adjusting the LED lamp blinking frequency of fig. 11 to 64000 times per second (duration of each period is 15.6 microseconds, where the on-time and off-time are each about 7.8 microseconds), where no streaks are present, since one on-time and one off-time of the LED lamp are substantially covered in 14 microseconds per line of exposure time.
While one light source is described above, in some embodiments, two or more light sources may be used. The controller may control the operation of each light source independently. FIG. 14 is an image of an optical label employing three separate light sources, where the imaging locations of two light sources are striped and the imaging location of one light source is not striped, according to one embodiment of the invention, and this frame image of the group of light sources may be used to convey information, such as binary data 110.
In one embodiment, one or more location indicators, such as a light of a particular shape or color, may also be included in the optical label in proximity to the information-conveying light source, such as may be kept constantly on during operation. The location indicator may help a user of a CMOS imaging device (e.g., a cell phone) to easily find the optical label. In addition, when the CMOS imaging device is set to be in a mode of shooting the optical label, the positioning mark is obvious in imaging and easy to identify. Thus, one or more location markers disposed proximate to the information delivery light source can also facilitate the handset in quickly determining the location of the information delivery light source, thereby facilitating identification of whether a stripe is present in the imaging area corresponding to the information delivery light source. In one embodiment, in identifying whether a stripe is present, the locating mark may first be identified in the image, such that the approximate location of the optical label is found in the image. After the location indicator is identified, one or more regions in the image may be determined that encompass the imaging location of the information-conveying light source based on the relative positional relationship between the location indicator and the information-conveying light source. These regions can then be identified to determine whether or what streaks are present. FIG. 15 is an imaging view of an optical label including a location indicator according to one embodiment of the present invention, including three horizontally disposed information delivery light sources and two vertically disposed location indicator lights on either side of the information delivery light sources.
In one embodiment, an ambient light detection circuit may be included in the optical label, which may be used to detect the intensity of the ambient light. The controller may adjust the intensity of light emitted by the light source when turned on based on the detected intensity of the ambient light. For example, when the ambient light ratio is strong (e.g., daytime), the intensity of the light emitted by the light source is made larger, and when the ambient light ratio is weak (e.g., night), the intensity of the light emitted by the light source is made smaller.
In one embodiment, an ambient light detection circuit may be included in the optical label, which may be used to detect the frequency of the ambient light. The controller may adjust the frequency of light emitted by the light source when turned on based on the detected frequency of the ambient light. For example, when there is a co-frequency flickering light source in the ambient light, the light emitted by the light source is switched to another unoccupied frequency.
Compared with the identification distance of about 15 times of the two-dimensional code in the prior art, the identification distance of at least 200 times of the optical label has obvious advantages. The remote identification capability is particularly suitable for outdoor identification, and for a light source with a length of 50 cm arranged on a street, for example, a recognition distance of 200 times, a person within 100 meters of the light source can interact with the light source through a mobile phone. In addition, the scheme of the invention does not require that the CMOS imaging device is positioned at a fixed distance from the optical label, does not require time synchronization between the CMOS imaging device and the optical label, and does not need to accurately detect the boundary and the width of each stripe, so that the CMOS imaging device has extremely strong stability and reliability in actual information transmission.
The following discusses security decision methods and systems for optical labels.
In order to improve the security of the optical label, the physical size information and the legal position rule of the optical label may be registered in advance on, for example, a server. The optical label can transmit the identification information (for example, ID information) during the working process, and when the imaging device obtains the ID information of the optical label, the ID information is used to query the server, so as to obtain the physical size and legal position rule corresponding to the optical label. The physical size and legal position rules may be used to determine the current position of the optical tag and determine whether the current position complies with the legal position rules, thereby determining whether the optical tag is safe and authentic. Optionally, a power-off rule of the optical tag may be further registered on the server, and a further determination may be made using the power-off rule.
First embodiment
The embodiment provides a method and a system for judging safety of an optical label based on position information.
Referring to fig. 16, a flow chart of a location-based optical tag security decision is shown, which includes the following specific steps:
the method comprises the following steps: the ID information of the optical label is collected using an imaging device.
Step two: and querying a server by using the ID information to obtain the physical size information and legal position rules corresponding to the optical label.
Step three: determining current position information of the optical label using reverse positioning based on the physical size information and the position information of the imaging device. The imaging device is, for example, a mobile phone or the like, and has therein a positioning module (e.g., a GPS module) for providing position information of the imaging device; in an alternative embodiment, the position information of the imaging device is obtained based on a position reversal positioning of the reliable optical labels.
One specific method of operation for reverse positioning is as follows:
step 3-1: and taking a picture of the optical label by adopting the default focal length of the imaging equipment so as to obtain an image of the optical label. Due to the default focal length of the imaging device, the captured optical label image may be blurred, for example, as shown in fig. 17A, there is much texture information in extracting the edge feature after graying the image.
Step 3-2: the focal length of the imaging device is adjusted and optimized. For example, one may first try to increase the focal length based on the default focal length, continue to increase the focal length if the optical label image becomes sharp, and adjust in the opposite direction, i.e., decrease the focal length if the optical label image becomes blurred; and vice versa. During the adjustment process, the optical label image gradually becomes clear, as in fig. 17C, until the situation as shown in fig. 17E. In the process of adjusting the focal length, in order to determine the sharpness of the optical label image, texture feature extraction may be performed on the optical label image, and as shown in fig. 17B, 17D, and 17F which are texture information of the optical label image in fig. 17A, 17C, and 17E, respectively, it can be seen that the clearer the optical label image, the simpler the corresponding texture information, and the smaller the density of the texture, therefore, an optimal focal length parameter may be determined according to the density of the texture of the optical label image, and when a smaller texture density cannot be obtained after a plurality of iterations, it may be considered that the image with the minimum texture density is a clear image, and the focal length parameter corresponding to the obtained minimum texture density is taken as the optimal focal length parameter.
Step 3-3: the distance between the optical label and the imaging device (imaging device) is calculated based on the optimal focal length parameter of the imaging device, the physical size information of the optical label, and the size of the optical label image (i.e., the sharp image of the optical label) at the optimal focal length parameter.
Step 3-4: and determining the relative direction of the imaging device and the optical label according to the distortion degree of the optical label image. For example, an angle between a line connecting the imaging device and the center of the optical label and a normal of the optical label, i.e., a deviation angle between the optical label and the imaging device, may be calculated.
Step 3-5: the current position information of the optical label is determined based on the distance and relative direction between the optical label and the imaging device, and the position information of the imaging device.
Step four: and comparing the current position information of the optical label with a legal position rule to judge whether the optical label is safe and credible. For example, if the current location information of the optical tag conforms to the legal location rule, the optical tag may be considered safe and authentic; if the legal position rule is not met, a warning message is sent out.
In an alternative embodiment of the above embodiment, in step two, when querying the server using the ID information, the server may provide only the physical size information of the optical label to the image forming apparatus without providing the position rule of the optical label. Accordingly, after the imaging device determines the current location information of the optical label in step three, the current location information may be sent to the server in step four, and the server compares the current location information of the optical label with the legal location rule. The server may inform the user of the imaging device of the comparison result after the comparison is completed, for example, if the current position information of the optical label does not comply with the legal position rule, a warning message is issued to the user of the imaging device. The warning message may also be communicated to the optical label owner, who upon receipt of the warning message may perform a corresponding action, such as setting the optical label to invalid or reactivating the optical label.
An example of a legal location rule for an optical label registered on a server is as follows:
position rule 1: at position a at any time; or
Position rule 2: the first time period is at position 1, the second time period is at position 2, …, and the nth time period is at position n.
It is to be understood that the location rules 1 and 2 are only exemplary and not restrictive, and the application personnel can arbitrarily set the location rules and register them on the server according to the actual application scenario.
Second embodiment
In order to improve the accuracy of the safety determination, the embodiment adds the optical label safety determination based on the power-off record to the safety determination based on the position information of the first embodiment.
The optical label generally needs to be directly connected with a power supply, and if the optical label is moved, a power-off operation is usually needed. With this feature, the optical tag can be configured to record its power-off information (e.g., the time of power-off) and to transmit its power-off information when the optical tag is powered back on. In this manner, the power-off information can be obtained when the imaging device scans the optical label. This power down information may then be compared to the server registered power down rules to determine if the optical label is safe. The method comprises the following specific steps:
the method comprises the following steps: the optical label itself records the moment of power-off within one period of the power-off rule, e.g. 24 hours, preferably the optical label records the last several, e.g. 2, moments of power-off. In fact, the power failure of the optical label is divided into two cases, normal power failure, for example, power failure of normal shutdown, such as power failure of normal shutdown controlled by a remote controller, and abnormal power failure, which is all power failure cases except for normal power failure, such as forced power failure caused by directly plugging and unplugging a power supply. In a preferred embodiment, the optical label can judge normal power failure and abnormal power failure, so that only abnormal power failure is recorded, and therefore, the later processing procedure can be simplified.
Step two: the imaging device scans the optical label to obtain the ID information of the optical label and the recorded power-off time of the optical label;
step three: and transmitting the identification information and the recorded power-off time to a server to be compared with the power-off rule of the optical label, if the power-off rule is met, indicating that the optical label is safe, and if the power-off rule is not met, sending warning information to the imaging equipment. The warning message may also be communicated to the optical label owner, who may set the optical label to inactive or reactivate the optical label.
In an alternative embodiment of the above embodiment, the imaging device may also transmit only the ID information of the optical tag to the server in step two, and obtain the power-off rule of the optical tag from the server. In this way, it can be determined locally by the imaging device whether the recorded power-off instant of the optical label complies with its power-off rule.
The power-off rule of the optical tag registered on the server is, for example: 9: 00-22: 00 on, 22: 00-day 9: 00 is powered off. If the recorded abnormal power-off time in one power-off period of the optical label is 13: 00 and 23: 00, according to the outage rule, 23: 00 power-off is normal, 13: 00 power-off is abnormal, then a safety warning is given, each scanner is prompted that the optical label is invalid, and the owner of the optical label is informed to reactivate.
The skilled person can set the power-off rule according to the specific application scenario, and the period of the power-off rule can be changed accordingly.
Reference in the specification to "various embodiments," "some embodiments," "one embodiment," or "an embodiment," etc., means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment. Thus, appearances of the phrases "in various embodiments," "in some embodiments," "in one embodiment," or "in an embodiment," or the like, in various places throughout this specification are not necessarily referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. Thus, a particular feature, structure, or characteristic illustrated or described in connection with one embodiment may be combined, in whole or in part, with a feature, structure, or characteristic of one or more other embodiments without limitation, as long as the combination is not logical or operational. The various steps described in the method flow in a certain order do not have to be performed in that order, rather the order of execution of some of the steps may be changed and some steps may be performed concurrently, as long as implementation of the scheme is not affected. Additionally, the various elements of the drawings of the present application are merely schematic illustrations and are not drawn to scale.
Although the present invention has been described by way of preferred embodiments, the present invention is not limited to the embodiments described herein, and various changes and modifications may be made without departing from the scope of the present invention.