Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Example 1
The embodiment 1 of the application provides an image serial number determining method, which is used for providing a scheme for determining an image serial number. The execution subject of the method may be, but is not limited to, at least one of a mobile phone, a tablet Computer, a Personal Computer (PC), and the like, which can be configured to execute the method provided in the embodiments of the present Application, or the execution subject of the method may also be an operating system or an Application (APP), or the execution subject of the method may also be a server, and the like.
For the sake of clear description of the method provided in embodiment 1 of the present application, the method provided in the embodiment of the present application will be described in detail below by taking an execution subject of the method as a PC with a camera as an example. Those skilled in the art will understand that the execution subject of the method is a PC with a camera, which is only an exemplary illustration and is not a specific limitation to the execution subject of the method.
Specifically, an implementation flow diagram of the image sequence number determining method provided in embodiment 1 is shown in fig. 1a, and includes the following main steps:
step 11, the PC with a camera determines the number of first preset image features included in the first image (for the sake of a differentiated description, this number will be referred to as a first number hereinafter);
the first image is the image of the serial number of the image to be identified. For example, it may be a certain frame of image in a video image frame sequence played by the user terminal.
The first image may be preset in the PC; or the serial number of the first image is required to be determined and sent to the PC by the server; the image can also be obtained by shooting, scanning or intercepting an image displayed by certain image display equipment (such as a mobile phone) by using the camera through a PC; and so on. The source of the first image is not limited in the embodiment of the present application.
The first preset image feature is an image feature preset in the first image, that is, an image feature vector.
In this embodiment of the application, the first preset image feature in the first image may be a feature that can be recognized by using an image recognition method. Generally, image features that can be visually displayed when the first image is displayed may be recognized by image recognition. Such as human face features or size (or shape) features of the boundary of a target object having a specified shape (e.g., a bar), etc., such features can be generally recognized by image recognition.
The first preset image feature in the first image may be previously set in the first image according to a serial number of the first image. For example, the first preset image feature may be a multi-dimensional feature vector formed by a color value, a shape value (for example, a value of a shape feature corresponding to a "circle" or a value of a shape feature corresponding to a "rectangle") and a size value of a "white bar" (in the embodiment of the present application, the "white bar" may be referred to as a "watermark"), and if the sequence number of the first image is 1, 1 such white bar may be set in the first image; if the serial number of the first image is 2, 2 such white stripes may be set in the first image; and so on. That is, the number of features set in the first preset image has a mapping relation with the serial number of the first image.
In the embodiment of the present application, the specific implementation manner of step 11 may include at least the following two manners:
the first mode is as follows: determining whether the first image contains the same image characteristics as the pre-stored first preset image characteristics or not by adopting a mode of carrying out image recognition on the first image by a PC (personal computer) with a camera; if so, determining the number (i.e. the first number) of the first preset image features contained in the first image.
The first preset image feature pre-stored by the PC with the camera may be, for example, pre-set in the PC, or may be sent by the server to the PC for storage, or may be input by the user into the PC. The embodiment of the present application does not limit the source and the obtaining time of the first preset image feature stored in the PC.
With reference to the scenario described in the background art, a second specific implementation manner of step 11 may include: determining a second number of specified image features contained in the second image; and determining the second number as the first number.
Here, the second image is an image related to the first image. Specific association means, for example, may include but are not limited to: the second image is an image obtained by photographing, scanning, or image-cutting the first image.
Further, the specified image feature referred to herein is the same image feature as the first preset image feature. When the first preset image feature is an image feature that can be recognized by an image recognition method, the specified image feature is often an image feature that can also be recognized by an image recognition method.
In order to facilitate the intuitive understanding of the second specific implementation manner, the second specific implementation manner is described in detail below with reference to fig. 1 b.
In the scenario shown in fig. 1b, two devices are included, namely an image display device 01 and a PC (labeled PC02 in fig. 1 b) with a camera (labeled camera 05 in fig. 1 b) as described in step 11.
In fig. 1b, an image display device 01 is configured to play a video image frame sequence, that is, sequentially display each frame of video image included in the video image frame sequence according to a certain frame rate; the PC02 with a camera 05 is used for shooting a video image frame sequence played by the image display device 01 by using the camera 05, identifying a first preset image feature contained in the shot image by means of image identification, and counting the number of the first preset image feature in the image containing the first preset image feature in each frame when the shot image is identified to contain the first preset image feature.
As shown in fig. 1b, the sequence of video image frames played by the image display device 01 is assumed to be an image (i.e., a first image) to which a first preset image characteristic is set in advance. In the scene shown in fig. 1b, the first preset image feature specifically refers to a multi-dimensional feature vector formed by color values, shape values, and size values of a single watermark 04 in a watermark presentation area 03 at the upper left corner of an image displayed by the image display device 01. It should be noted that the boundary of the watermark display area 03 in fig. 1b is drawn for the convenience of understanding of the reader, and in practical applications, the boundary of the watermark display area 03 in fig. 1b may not be visible in the image. The PC02 can determine the position of the watermark display area 03 in the image according to the coordinate value of the watermark display area 03 in the image coordinate system, thereby performing image recognition on the watermark display area 03 in a targeted manner.
After the PC02 shoots a certain sequence of video image frames played by the image display device 01 to obtain a corresponding image to be subjected to image feature recognition (i.e. a second image associated with the first image), it determines whether a feature vector identical to a saved multi-dimensional feature vector can be recognized from the second image according to the pre-saved multi-dimensional feature vector of a single watermark; if yes, counting the number of the feature vectors which are identified from the second image and are the same as the saved multi-dimensional feature vectors; further, the PC02 determines the number (equivalent to the second number) as the number (equivalent to the first number) of the multi-dimensional feature vectors in the certain frame image played by the image display device 01.
It should be noted that, since the second image is obtained by shooting the video image frame sequence played by the image display device 01, the second image generally includes image features identical to first preset image features of corresponding images (first images) in the video image frame sequence, and the second number of the first preset image features included in the second image is generally identical to the first number of the first preset image features included in the first image played by the image display device 01. It can be seen that, if the first number of the first preset image features in the first image is set according to the serial number of the first image, the second number of the first preset image features included in the second image may be determined as the first number of the first preset image features included in the corresponding image, and then the serial number of the video image frame sequential image is determined according to the first number.
Step 12, determining a serial number of the first image according to the first number determined by executing step 11.
Based on the foregoing description, the first number of the first preset image features set in the first image generally has a mapping relation with the serial number of the first image. Therefore, after the first number is determined, the serial number mapped to the first number can be determined as the serial number of the first image according to the mapping relation.
Specifically, taking the scene shown in fig. 1b as an example, after counting the number of feature vectors (second number) identified from the second image and identical to the saved multi-dimensional feature vector, the PC02 may determine the second number as the first number; and determining the serial number mapped with the first number according to the mapping relation between the serial number of the image and the number of the first preset image characteristics in the video image frame sequence image played by the image display device 01 according to the first number.
The determined serial number is the serial number of the second image captured by the PC02 and the serial number of the frame of video image frame sequence image played by the image display device 01.
By adopting the method adopted by the embodiment of the application, the serial number of the image can be determined according to the number of the first preset image features contained in the image, so that a scheme for effectively determining the serial number of the image is provided.
It should be noted that in the embodiment of the present application, in addition to setting the first preset image feature in the first image, the auxiliary identification information may also be set in the first image. The auxiliary identification information may be used as a first amount of supplementary information of the first preset image feature, and is used as a basis for determining the serial number of the first image together with the first preset image feature.
For example, taking the first preset image feature as the aforementioned multi-dimensional feature vector of the watermark as an example, in the application scenario shown in fig. 1b, for a certain video image frame sequence played by the image display device 01, if it is assumed that:
the sequence numbers of the 1 st frame to the 40 th frame images included in the video image frame sequence are 1, 2, and 40 in sequence, and are marked as Ni, and the value range of i is [1, 40 ];
for the 1 st to 40 th frames of images, the number of first preset image features respectively set for the 1 st to 40 th frames of images is Xi, and the value range of i is [1, 40 ];
for the 1 st to 40 th frame images, the mapping relation between Xi and Ni is as follows: xi is Ni, i has a value in the range of [1, 40 ].
If it is further assumed that Ni is 40, that is, i is 40, the number of watermarks displayed in the watermark display area 03 shown in fig. 1b is the largest (as shown in fig. 1 c), how to set a preset image feature capable of uniquely identifying the serial number of an image in an image with the serial number >40 included in the video image frame sequence becomes a problem to be solved urgently.
In order to solve the problem, in the embodiment of the present application, for the first image, another image feature different from the first preset image feature may be further set in the first image according to the serial number of the first image. For the purpose of distinguishing the description, the other image feature set in the first image will be referred to as a second preset image feature hereinafter.
Still taking the scene shown in fig. 1b as an example, when the image played by the image display device 01 at the current moment is the 40 th frame image of the video image frame sequence, so that the situation that the number of watermarks displayed by the watermark display area 03 reaches the maximum as shown in fig. 1c occurs, the watermark display area 06 as shown in fig. 1d may be set in the image from the 41 th frame image included in the video image frame sequence. In fig. 1c, the dots shown in the watermark presentation area 03 represent the watermark 04 which is omitted from fig. 1c and is not shown.
FIG. 1d is described in detail below:
the target object 07 shown in the watermark display area 06 in fig. 1d is a red stripe with a color of red, a width of 10 pixels and a height of 20 pixels. The color value and the size value of the red stripe can jointly form a feature vector as the second preset image feature. The red stripe may also be considered a watermark. It should be noted that the boundary of the watermark exhibiting area 06 in fig. 1d is drawn for the convenience of the reader, and in practical applications, the boundary of the watermark exhibiting area 06 in fig. 1d may not be visible in the image. The PC02 can determine the position of the watermark display area 06 in the image according to the coordinate value of the watermark display area 06 in the image coordinate system, thereby performing image recognition on the watermark display area 06 in a targeted manner.
Based on the second preset image feature, the watermarks displayed in the watermark display area 03 and the watermark display area 06 in the 41 th frame image included in the video image frame sequence may be as shown in fig. 1 d; the watermarks displayed in the watermark display area 03 and the watermark display area 06 in the 42 th frame image included in the video image frame sequence may be as shown in fig. 1 e; and so on.
In fig. 1d and 1e, the feature vector of the red stripe (i.e. the second predetermined image feature) is mapped to the sequence number carry amount H under a predetermined carry system. Specifically, the feature vectors of the red stripes shown in fig. 1d and 1e are mapped to the sequence number carry amount "1" in 40. The sequence number carry amount as used herein generally refers to a number of all carry bits of a sequence number in a predetermined system. Taking a serial number "42" in the 10-system as an example, after the serial number is converted into a serial number in the 40-system, the number on the carry bit of the serial number in the 40-system is "1", and the number on the carry bit, that is, the carry amount of the serial number, may be mapped to a certain second preset image feature x; taking a serial number '87' under a 10-system scale as an example, after the serial number is converted into a serial number under a 40-system scale, the number on the carry bit of the serial number under the 40-system scale is '2', and the carry bit quantity '2' of the serial number can map a certain second preset image characteristic y; and so on.
Continuing with fig. 1d and 1e as an example, it can be expected that a problem occurs in that, from the 81 st frame image included in the video image frame sequence, the serial number of the image cannot be uniquely represented by a red bar and a white bar. In view of such a problem, in the embodiment of the present application, from the 81 st frame image, the second preset image feature may be changed such that the second preset image feature set in the 41 st to 80 th frame images is different from the second preset image feature set in the 81 st to 120 th frame images.
For example, taking the 81 st frame image as an example, a green stripe with a color of green, a width of 10 pixels, and a height of 20 pixels may be set in the 81 st frame image. The green stripe may be regarded as a watermark and is located in the watermark presenting area 03. The color value and the size value of the green stripe can jointly form a feature vector as a second preset image feature of the 81 th frame image.
For another example, still taking the 81 st frame image as an example, a red stripe with a color of red, a width of 20 pixels, and a height of 20 pixels may be set in the 81 st frame image. Since the width value of the red stripe is different from the width values of the red stripes provided in the 41 st to 80 th frames, a feature vector formed by the size value (including the width value) and the color value of the red stripe provided in the 81 th frame image is different from the second preset image feature provided in the 41 st to 80 th frames.
For the situation that the first image includes both the first preset image feature and the second preset image feature, in the embodiment of the present application, after the second preset image feature is determined from the first image, H may be determined according to a mapping relationship between the second preset image feature and H; and according to the mapping relation between the first number of the first preset image characteristics and the unit digit of the serial number of the first image under the preset carry system, the unit digit (assumed as H') mapped with the first number can be determined. In this case, the serial number of the first image is (H × a predetermined carry system base) + H'. Taking fig. 1d as an example, the serial number in 10 of the image shown in fig. 1d (H × 40 mapped to red stripes) + (H' mapped to the total number of white stripes) is 40+1, 41.
How to determine the sequence number carry quantity H under the predetermined carry system mapped with the second preset image feature contained in the first image is described below with reference to a practical application scenario:
in combination with an actual application scene, when each second preset image feature is a width value of a rectangular watermark that is a target object set in a first image, determining a sequence number carry amount H under the predetermined carry system that is mapped to a second preset image feature included in the first image in the following manner:
and determining the serial number carry amount under the preset carry system, which is mapped with the width value of the first watermark contained in the first image, according to the preset mapping relation between each width value and the serial number carry amount under the preset carry system. In the preset mapping relationship, different width values map different serial number carry quantities H under the predetermined carry system.
In combination with an actual application scene, when each second preset image feature is a color value and a width value of a rectangular watermark as a target object arranged in a first image, the sequence number carry amount H under the predetermined carry system mapped with the second preset image feature included in the first image may be determined in the following manner:
and determining the serial number carry amount H under the preset carry system, which is mapped with the color value and the width value of the first watermark contained in the first image, according to the mapping relation between the characteristic element combination formed by each color value and each width value and the serial number carry amount under the preset carry system. In the preset mapping relationship, different feature element combinations map different serial number carry quantities under the predetermined carry system.
In combination with an actual application scene, when each second preset image feature is a color value of a rectangular watermark that is a target object set in a first image, the following manner may be adopted to determine the sequence number carry amount H under the predetermined carry system that is mapped to the second preset image feature included in the first image:
and determining the serial number carry amount H under the preset carry system, which is mapped with the color value of the first watermark contained in the first image, according to the preset mapping relation between each color value and the serial number carry amount under the preset carry system. In the preset mapping relationship, different color values map different serial number carry quantities under the predetermined carry system.
It should be particularly noted that, in view of the method provided by the embodiment of the present application, the method is suitable for testing a scene of an FPS in a manner of shooting a video image frame sequence by using a high-speed camera, where a first image in the scene is often an image in the video image frame sequence, and a preset image feature is set for an image in the video image frame sequence, where details that need special attention are provided.
In this embodiment of the application, when the first image is an image included in a sequence of video image frames, the first preset image feature included in the first image may be set in the following manner:
respectively executing a first specific operation for each image frame subsequence sequentially contained in the video image frame sequence;
the first specific operation includes: according to a first preset image characteristic setting mode, respectively executing the following steps for each frame of image in the image frame subsequence: setting the first preset image characteristic in the image according to the serial number of the image;
wherein the first preset image feature setting mode satisfies: and sequentially increasing or decreasing the number of the first preset image features respectively set for each frame of image included in the image frame subsequence, and enabling the difference between the number of the first preset image features respectively set for two adjacent frames of image in the image frame subsequence to be smaller than a preset threshold value. The predetermined threshold value is for example 2.
It should be noted that the image frame sub-sequence includes the same number of images as the preset expected number of frames. The expected number of frames may be, for example, the maximum number of target objects (such as the aforementioned white bars) having the first preset image feature that can be displayed in the feature display region for displaying the first preset image feature.
When a device or software is used to set first preset image features in each frame image sequentially included in the video image frame sequence, the count value of the image for which the first preset image feature setting is completed may be updated every time the first preset image feature setting for one frame image is completed from the 1 st frame image included in the sequence, so as to obtain an updated count value. The steps further executed after updating the count value are shown in fig. 1 f. It should be noted that, the finishing of setting the first preset image feature for one frame of image here refers to finishing the setting of each first preset image feature in one frame of image.
As shown in fig. 1f, if the count value does not reach the expected frame number and the video image frame sequence further includes an image without a first preset image feature, setting a first preset image feature for images without the first preset image feature sequentially included in the video image frame sequence, and if the count value does not reach the expected frame number and the video image frame sequence does not include an image without the first preset image feature, ending the setting flow of the first preset image feature;
if the counting value reaches the expected frame number, judging whether the video image frame sequence also comprises an image without a first preset image characteristic;
if the counting value reaches the expected frame number, judging that the video image frame sequence does not contain the image without the first preset image characteristic, and ending the setting process of the first preset image characteristic;
if the counting value reaches the expected frame number, judging that the video image frame sequence also comprises images without the first preset image characteristic, clearing the counting value, sequentially setting the first preset image characteristic for the images without the first preset image characteristic in the video image frame sequence after clearing, and updating the counting value of the images with the first preset image characteristic after finishing setting the first preset image characteristic for one frame of image to obtain the updated counting value. When the counting value reaches the expected frame number, the operation of judging whether the video image frame sequence contains the image without the first preset image characteristic is executed.
By adopting the first preset image feature setting mode, when the preset threshold is smaller, the difference of the number of the first preset image features in two adjacent frames of images in the video image frame sequence can be smaller.
In particular, when the first preset image feature is the multi-dimensional feature vector composed of the size value and the color value of the white stripe described above, it is expected that: if the image played by the high-speed camera and provided with the white long bar is shot by the high-speed camera, even if the FBS when the high-speed camera is used for shooting is larger than the FBS when the video image frame sequence playing device is used for playing the video image frame sequence, and thus the multi-dimensional feature vector of the changed white long bar (for example, when the played image is switched from the current frame to the next frame, the white long bar newly added to the current frame in the next frame is the changed white watermark) may not be accurately identified, if the absolute value of the difference between the numbers of the first preset image features of two adjacent frame images is small (for example, the absolute value of the difference between the numbers is 1), even if the number of the multi-dimensional feature vectors of the white long bar in the previous frame image is determined as the number of the vectors in the next frame image, and thus the number of the vectors in the next frame image is determined to be an error, but the error will not be too large and will fall within the acceptable range.
For the second preset image feature, in the embodiment of the present application, the second preset image feature may be set in the following manner:
in this embodiment of the application, when the first image is an image included in a sequence of video image frames, the second preset image feature included in the first image may be set in the following manner:
respectively executing a second specific operation for each image frame subsequence sequentially contained in the video image frame sequence;
the second specific operation includes: according to a second preset image characteristic setting mode, respectively executing the following steps for each frame of image in the image frame subsequence: setting the second preset image characteristic in the image according to the serial number of the image;
wherein the second preset image feature setting mode satisfies: such that second preset image features set for different image frame sub-sequences in the sequence of video image frames are different from each other. In addition, in order to avoid confusion between the first preset image feature and the second preset image feature when the image features are identified, in the embodiment of the present application, the second preset image feature is generally different from the first preset image feature.
The embodiment of the application also provides two devices for implementing the method to provide a scheme for determining the serial number of the image, based on the same inventive concept as the method. These two devices may be referred to as an image serial number determination device and an intelligent device, respectively.
The following describes the device provided by the embodiment of the present application in detail.
Referring to fig. 2, a schematic diagram of a specific structure of an image serial number determining apparatus provided in an embodiment of the present application mainly includes a first number determining unit 21 and a serial number determining unit 22. Wherein:
a first number determining unit 21 is configured to determine a first number of first preset image features included in the first image.
A serial number determining unit 22, configured to determine a serial number of the first image according to the first number determined by the first number determining unit 21.
In the embodiment of the application, a first image can be directly acquired, and a first number of first preset image features contained in the first image is determined; alternatively, a second image associated with the first image may be acquired, and the sequence packet of the first image may be determined according to a second number of first preset image features included in the second image. In the latter case, it may be specifically realized by the first number determining unit 21. The specific implementation process comprises the following steps:
determining a second number of specified image features contained in the second image;
determining the second number as the first number.
The specified image feature is the same as the first preset image feature, and the specified image feature can be recognized from the second image in an image recognition mode.
In some implementation scenarios, the second image may be an image obtained by shooting, scanning, or image-capturing the first image.
For a specific functional implementation manner of the serial number determining unit 22, when the first image does not include the second preset image feature, the serial number determining unit 22 may determine the serial number of the first image according to the first number and a preset mapping relationship between the number of the first preset image features and the serial number of the image.
When the first image includes the second preset image feature, the image serial number determination apparatus provided in the embodiment of the present application may further include a feature determination unit. The feature determination unit is configured to determine a second preset image feature included in the first image. In the case that the apparatus further includes a feature determining unit, the serial number determining unit 22 may determine the serial number of the first image according to the first number and a second number corresponding to a feature of a second preset image included in the first image determined by the feature determining unit. For example, the serial number determining unit 22 may determine the serial number carry amount under the predetermined carry system, which is mapped with the second preset image feature included in the first image, according to a preset mapping relationship between each second preset image feature and the serial number carry amount under the predetermined carry system; determining a product of the serial number carry quantity and a cardinal number of the predetermined carry system as a second quantity according to the determined serial number carry quantity and the predetermined carry system; and determining a serial number of the first image according to the first number and the second number.
Determining a specific implementation manner of the sequence number of the first image according to the first number and the determined second number, for example, may include: calculating a sum of the first number and the second number as a sequence number of the first image.
For the apparatus, how to set the first preset image feature and the second preset image feature in the first image according to the serial number of the first image may refer to the foregoing detailed description, and details are not described here.
It should be noted that, when the second preset image feature is a width value of a rectangular first watermark, determining, according to the preset mapping relationship, a sequence number carry amount under the predetermined carry system mapped with the second preset image feature included in the first image may include:
determining the serial number carry amount under the preset carry system, which is mapped with the width value of the first watermark contained in the first image, according to the preset mapping relation between the characteristics of each second preset image and the serial number carry amount under the preset carry system;
in the preset mapping relation, different width values map different serial number carry quantities under the preset carry system.
It should be noted that, when the second preset image feature includes the color value and the width value of the first watermark, determining, according to the preset mapping relationship, the sequence number carry amount under the predetermined carry system mapped with the second preset image feature included in the first image may include:
determining the serial number carry-in amount under the preset carry system, which is mapped with the color value and the width value of the first watermark contained in the first image, according to the mapping relation between the characteristic element combination formed by each color value and each width value and the serial number carry-in amount under the preset carry system;
in the preset mapping relation, different feature element combinations map different serial number carry quantities under the preset carry system.
By adopting the image serial number determining device provided by the embodiment of the application, the serial number of the image can be determined according to the number of the first preset image features contained in the image, so that a scheme for effectively determining the serial number of the image is provided.
Referring to fig. 3, a schematic diagram of a specific structure of an intelligent device provided in the embodiment of the present application mainly includes a memory 31 and a processor 32. Wherein:
a memory 31 for storing computer program instructions;
a processor 32, coupled to the memory 31, for reading the computer program instructions stored by the memory 31 and, in response, performing the steps of:
determining a first number of first preset image features contained in a first image;
determining a sequence number of the first image according to the first number.
In this embodiment of the application, how the processor 32 determines the first number of the first preset image features included in the first image, and how to determine the sequence number of the first image according to the first number may refer to the related description above, and details are not repeated here.
For the meanings of the terms in the steps executed by the processor 32, please refer to the above explanations, which will not be repeated herein.
The above is only a brief description of the functions of the processor 32, and reference may be made to the related description in embodiment 1, where nothing is specified.
By adopting the intelligent equipment provided by the embodiment of the application, the serial number of the image can be determined according to the number of the first preset image features contained in the image, so that a scheme for effectively determining the serial number of the image is provided.
Example 2
Embodiment 2 of the present application provides a method for setting image features, which is used to provide a scheme for setting image features according to an image serial number. The execution subject of the method may be, but is not limited to, at least one of a user terminal such as a mobile phone, a tablet computer, a PC, and the like, or the execution subject of the method may also be an application program running in the user terminal, or the execution subject of the method may also be a server.
Since the embodiment 1 has described in detail how to set the first preset image feature and the second preset image feature in the first image, the following only provides some brief descriptions of the setting method of the image feature provided in the embodiment of the present application. For what is not described in detail below, reference may be made to the description relating to example 1.
Specifically, an implementation flow diagram of the setting method of image features provided in embodiment 2 is shown in fig. 4, and includes the following main steps:
step 41, determining a first number of first preset image features to be set in the image according to the serial number of the image;
the sequence number of the picture may refer to a frame number indicating a position of the picture in the video picture frame sequence, and the like. In this form, the serial number may be a number in a predetermined carry system, such as a number 1, 2,. 100 in a 10-carry system, and so on.
In the embodiment of the application, a mapping relationship between the serial numbers of different images and the number of the first preset image features may be established, so that the number of the first preset image features mapped with the serial number of a certain image, that is, the first number, may be determined according to the mapping relationship when the serial number of the certain image is known. The mapping relationship may be a simple functional relationship or a relatively complex mapping relationship. For example, if the serial number of the first image is 1, it may be determined that the first number is 1; if the sequence number of the first image is 2, it may be determined that the first number is 2; and so on.
The first preset image feature may be a one-dimensional feature vector, or a multi-dimensional feature vector formed by combining a plurality of feature elements. For example, the first preset image feature may be a multi-dimensional feature vector formed by color values, shape values, and size values of the single watermark 04 in fig. 1 b.
The first preset image feature may be a feature that can be recognized by an image recognition method, such as a face feature, a two-dimensional code feature, or a size (or shape) feature of a boundary of a target object having a specified shape (e.g., a long bar), and the like.
Step 42, setting a first number of first preset image features in the image according to the first number determined by executing step 41.
For example, a certain watermark of the first number may be set in the image according to the first number, where the image feature of a single certain watermark is the first preset image feature.
In addition, in the embodiment of the present application, in addition to setting the first preset image feature in the image, the auxiliary identification information may also be set in the image. The auxiliary identification information may be supplementary information of a first number of the first preset image features, and map a serial number of the image together with the first preset image features.
The auxiliary identification information may be, for example, the second preset image feature described in embodiment 1. In this embodiment of the application, when the serial number is a number under a predetermined carry system, determining, according to the serial number of the image, a first number of first preset image features to be set in the image, and determining second preset image features to be set in the image may specifically include:
judging whether the serial number is larger than the maximum number of first preset image features allowed to be arranged in the image or not;
if so, determining a serial number carry quantity of the serial number under the preset carry system (the serial number carry quantity is a number on other digits except the lowest digit under the preset carry system), and determining second preset image features mapped with the determined serial number carry quantity according to the determined serial number carry quantity and a preset mapping relation between each second preset image feature and the serial number carry quantity under the preset carry system to serve as second preset image features to be set in the image; further, determining a number of the serial number at a lowest number of the predetermined carry system as the first number;
if not, determining the sequence number as the first number.
It should be noted that, setting a second preset image feature in the first image may specifically refer to setting a target object having the second preset image feature in the image. The target object, which may be a rectangular watermark, has at least one of the following features:
a size value; a color value.
Taking the watermark with the rectangular target object as an example, when the second preset image features include the size value, the preset mapping relationship between each second preset image feature and the serial number carry amount under the preset carry system includes: the preset mapping relation between each width value of the first watermark and the serial number carry amount under the preset carry system; when the second preset image features include the size value and the color value, a preset mapping relationship between each second preset image feature and the serial number carry amount under the preset carry system includes: mapping relation between characteristic element combination composed of each color value and each width value and serial number carry amount under the preset carry system; when the second preset image features include the color values, a preset mapping relationship between each second preset image feature and the serial number carry amount under the preset carry system includes: and mapping relation between the characteristic element combination formed by each color value and each width value and the serial number carry amount under the preset carry system.
Since the detailed description of how to set the second preset image feature in the image has been already given in embodiment 1, the detailed description of this is not repeated in embodiment 2. For details which are not described in detail, reference is made to the description in example 1.
By adopting the technical scheme provided by embodiment 2 of the present application, a certain number of first preset image features can be set in an image according to the serial number of the image, and when the serial number of the image is mapped uniquely according to the first preset image features, the technical scheme can be adopted to enable follow-up according to the serial number of the image.
The embodiment of the application also provides two devices for implementing the method to provide a scheme for determining the serial number of the image, based on the same inventive concept as the method. These two devices may be respectively referred to as an image feature setting device and an intelligent device.
The following describes the device provided by the embodiment of the present application in detail.
Referring to fig. 5, a schematic diagram of a specific structure of an image feature setting device provided in the embodiment of the present application mainly includes a determining unit 51 and a preset image feature setting unit 52. Wherein:
a determining unit 51, configured to determine, according to a sequence number of an image, a first number of first preset image features to be set in the image;
a preset image feature setting unit 52 configured to set a first number of first preset image features in the image according to the first number determined by the determining unit 51.
In the embodiment of the application, besides the first preset image feature can be set in the first image, the auxiliary identification information can be set in the first image. The auxiliary identification information may be a first amount of supplementary information of the first preset image feature, and uniquely maps the serial number of the first image together with the first preset image feature. The auxiliary identification information may be, for example, a second predetermined image feature.
To implement setting a second preset image feature, the determining unit 51 may be further configured to determine a second preset image feature to be set in the image according to the serial number; the preset image feature setting unit 52 may be further configured to set the second preset image feature determined by the second determining unit in the image. For example, a target object having the second preset image feature may be set in the image.
For example, the second preset image feature may include at least one feature element of:
a size value; a color value.
In one embodiment, when the serial number is a number under a predetermined carry system; the determining unit 51 may specifically be configured to: judging whether the serial number is larger than the maximum number of first preset image features allowed to be arranged in the image or not;
if so, determining a serial number carry quantity of the serial number under the preset carry system (the serial number carry quantity is a number on other digits except the lowest digit under the preset carry system), and determining second preset image features mapped with the determined serial number carry quantity according to the determined serial number carry quantity and a preset mapping relation between each second preset image feature and the serial number carry quantity under the preset carry system to serve as second preset image features to be set in the image; further, determining a number of the serial number at a lowest number of the predetermined carry system as the first number;
if not, determining the sequence number as the first number.
It should be noted that, setting a second preset image feature in the first image may specifically refer to setting a target object having the second preset image feature in the image. The target object, which may be a rectangular watermark, has at least one of the following features:
a size value; a color value.
Taking the watermark with the rectangular target object as an example, when the second preset image features include the size value, the preset mapping relationship between each second preset image feature and the serial number carry amount under the preset carry system includes: the preset mapping relation between each width value of the first watermark and the serial number carry amount under the preset carry system; when the second preset image features include the size value and the color value, a preset mapping relationship between each second preset image feature and the serial number carry amount under the preset carry system includes: mapping relation between characteristic element combination composed of each color value and each width value and serial number carry amount under the preset carry system; when the second preset image features include the color values, a preset mapping relationship between each second preset image feature and the serial number carry amount under the preset carry system includes: and mapping relation between the characteristic element combination formed by each color value and each width value and the serial number carry amount under the preset carry system.
In addition, the intelligent device provided by the embodiment of the application is used for setting image features in an image according to the serial number setting of the image. The specific structure of the smart device is similar to that of fig. 3, and includes a memory and a processor. Wherein:
a memory for storing computer program instructions;
a processor, coupled to the memory, for reading computer program instructions stored by the memory and, in response, performing the following:
determining a first number of first preset image features to be set in an image according to a sequence number of the image;
setting the first number of first preset image features in the image according to the first number.
The processor may be further configured to: determining a second preset image characteristic to be set in the image according to the serial number; and setting the determined second preset image characteristic in the image.
How to determine the second preset image feature to be set in the image according to the sequence number and how to set the determined second preset image feature in the image may refer to the related description above, and details are not repeated here.
The above is only a brief introduction to the function of the processor, and reference may be made to the related description in embodiment 1, where nothing is specified.
By adopting the device or the intelligent equipment provided by the embodiment 2 of the application, a certain number of first preset image characteristics can be set in the image according to the serial number of the image, and when the serial number of the image is mapped uniquely according to the first preset image characteristics, the technical scheme can be adopted, so that the follow-up process can be carried out according to the serial number of the image.
Example 3
This embodiment 3 will take a test scenario as an example, and comprehensively describe the practical application flows of the image serial number determining method provided in embodiment 1 and the image feature setting method provided in embodiment 2.
Specifically, the test scene described in this embodiment 3 is a scene for testing an FPS of a video image frame sequence playing device. The apparatus involved in this scenario may be as shown in fig. 1b, comprising an image display device 01 for playing a sequence of video image frames, and a PC02 for testing the FPS.
Under the test scenario provided in embodiment 3, an implementation flowchart for testing an FPS of a video image frame sequence playing device is shown in fig. 6, and includes the following steps:
step 61, the image display device 01 sets preset original features for the images in the video image frame sequence to be played respectively according to the serial numbers of the images;
of course, other devices may also be used to set the original features for the image, and this is not limited in this embodiment of the application.
In the embodiment of the present application, the sequence number of the image may be a sequence number of the image in the video image frame sequence. The preset original features may be two kinds, one is a first preset image feature, and the other is a second preset image feature. Each preset original feature may be a feature vector composed of several feature elements, namely, a shape feature of a boundary of a target object, a size value of the boundary of the target object, and a color value of the target object. For example, the first preset image feature and the second preset image feature are different.
It should be noted that, in the embodiment of the present application, taking an image of a certain frame in a video image frame sequence as an example, a serial number of the image is split into two parts, where a first part is, for example, a number in a unit bit in the 10-bit system, and a second part is, for example, a number in another unit bit higher than the unit bit in the 10-bit system.
After the serial number of the image is split to obtain the first part, the number of the first preset image features mapped by the first part can be determined according to a preset mapping relation between the number of bits under a 10-bit system and the number of the first preset image features. As to what kind of feature the first preset image feature is, it may be predetermined.
After the serial number of the image is split to obtain the second part, according to a preset mapping relation between the number of other bits except the single-digit number under the 10-bit system and a second preset image feature, a second preset image feature mapped by the second part can be determined.
After determining the number of the first part mapped and the second preset image feature mapped by the second part, the number of the first preset image features and the second preset image feature mapped by the second part may be set in the frame image.
Specific setting modes may include, for example: a watermark P is set in a designated image area (e.g., an area in the upper left corner of the image) in the frame image. Wherein the total number of watermarks P set in the designated image area is equal to the number to which the first portion is mapped. A single watermark P having a single said first predetermined image characteristic.
Further, in the designated image area, a watermark Q having a second preset image characteristic to which the second part is mapped is set.
For each frame image included in the video image frame sequence described in embodiment 3 of the present application, the above-described manner may be adopted to implement setting of the first preset image feature and the second preset image feature in the image.
In particular, when the values of the other bits except the value of the single digit in the 10-bit system of the serial number of the image are all 0, the second preset image feature may not be set in the image.
For convenience of description, it is assumed in the embodiment of the present application that the first preset image feature and the second preset image feature are set in each image in the video image frame sequence by performing step 61.
Step 62, the image display device 01 plays the video image frame sequence after finishing the first preset image feature and the second preset image feature of each frame of image in the video image frame sequence; the PC02 captures a sequence of video image frames played by the image display device 01;
the PC02 captures a sequence of video image frames played by the image display device 01, and the captured images correspond to the second images described above. The image corresponding to the second image in the video image frame sequence played by the image display device 01 is equivalent to the first image described above.
Step 63, the PC02 recognizes the number of the first preset image features and the second preset image features included in the second image by adopting an image recognition mode, and determines the serial number of the first image corresponding to the second image according to the recognition result. In this manner, the PC02 can determine the serial number of each first image corresponding to each captured image (corresponding to each second image). Since the foregoing has described in detail how to determine the serial number of the image according to the number of the first preset image features and the second preset image features, details are not repeated here.
Further, the PC02 may determine the total number M of different images included in the video image frame sequence played by the image display apparatus 01 based on the determined serial numbers of the respective first images.
In the embodiment of the present application, the calculation method of M may be that M is a serial number of the last image obtained by capturing a sequence of video image frames played by the image display device 01 — a serial number of the first image obtained by capturing a sequence of video image frames played by the image display device 01.
In step 64, the PC02 calculates the FBS of the image display apparatus 01 based on M calculated by executing step 63.
The specific calculation formula is as follows:
total playing time T of M/video image frame sequence
By adopting the image serial number determining method provided by the embodiment of the application, the serial number of the image can be determined according to the number of the first preset image features and the second preset image features in the image, so that an effective scheme for determining the image serial number is provided.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.