WO2022000856A1 - 测速方法及装置、电子设备及存储介质 - Google Patents

测速方法及装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2022000856A1
WO2022000856A1 PCT/CN2020/121491 CN2020121491W WO2022000856A1 WO 2022000856 A1 WO2022000856 A1 WO 2022000856A1 CN 2020121491 W CN2020121491 W CN 2020121491W WO 2022000856 A1 WO2022000856 A1 WO 2022000856A1
Authority
WO
WIPO (PCT)
Prior art keywords
transmission parameter
image
processed
size
pixel
Prior art date
Application number
PCT/CN2020/121491
Other languages
English (en)
French (fr)
Inventor
杨昆霖
侯军
伊帅
Original Assignee
上海商汤智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 上海商汤智能科技有限公司 filed Critical 上海商汤智能科技有限公司
Priority to KR1020217030375A priority Critical patent/KR20220004016A/ko
Priority to JP2021547718A priority patent/JP2022542205A/ja
Priority to US17/477,746 priority patent/US20220005208A1/en
Publication of WO2022000856A1 publication Critical patent/WO2022000856A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/246Analysis of motion using feature-based methods, e.g. the tracking of corners or segments
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Definitions

  • the present disclosure relates to the field of computer technology, and in particular, to a speed measurement method and device, an electronic device, and a storage medium.
  • the moving speed of the object is obtained based on the moving distance of the object in the image and the moving time of the object.
  • the accuracy of obtaining the moving speed of the object is low.
  • the present disclosure provides a speed measurement method and device, an electronic device and a storage medium.
  • a speed measurement method comprising:
  • first image to be processed and a second image to be processed wherein, the first image to be processed and the second image to be processed both include a first object; obtain the first object in the first image to be processed The first position in the first position, the second position of the first object in the second image to be processed, and the first transmission parameter of the first moving distance; wherein, the first moving distance is the difference between the first position and the the distance between the second positions; the first transmission parameter represents the conversion relationship between the first moving distance and the first physical distance; the first physical distance is the physical distance corresponding to the first moving distance distance; the first physical distance is negatively correlated with the scale of the first position in the first image to be processed, and/or the first physical distance and the second position are in the second The scales in the image to be processed are negatively correlated; according to the first moving distance, the first transmission parameter and the moving time, the speed of the first object is obtained; wherein, the moving time is based on the first to-be-processed The timestamp of the image and the timestamp of the
  • the speed measuring device obtains the speed of the first object according to the first transmission parameter, the first moving distance and the moving time, which can improve the accuracy of the speed.
  • the obtaining the speed of the first object according to the first moving distance, the first transmission parameter and the moving time includes: according to the first transmission parameter and the first transmission parameter A moving distance is obtained to obtain a second moving distance; and the speed is obtained according to the second moving distance and the moving time.
  • the acquiring the first transmission parameter of the first moving distance includes: acquiring the second transmission parameter of a third position; wherein the third position is the difference between the first position and the position on the connecting line of the second position; the second transmission parameter represents the conversion relationship between the size of the first pixel point and the size of the first object point; the first pixel point is based on the third position
  • the pixel point determined in the first image to be processed, the first pixel point may be the pixel point determined in the second image to be processed according to the third position;
  • the first object point is the pixel point determined in the second image to be processed
  • the first ratio is negatively correlated with the scale of the first pixel point in the image;
  • the first ratio is the size of the first pixel point and the first object point.
  • the ratio between the dimensions; the first transmission parameter is obtained according to the second transmission parameter; wherein, the first transmission parameter is positively correlated with the second transmission parameter.
  • the third position is an intermediate position between the first position and the second position.
  • the acquiring the second transmission parameter of the third position includes: performing object detection processing on the first image to be processed to obtain the position of the first object frame and the position of the second object frame;
  • the first object frame includes a first object;
  • the second object frame includes a second object; the first size of the first object is obtained according to the position of the first object frame, and the second object is obtained according to the position of the first object frame.
  • the position of the frame obtains the second size of the second object; the third transmission parameter is obtained according to the first size and the third size, and the fourth transmission parameter is obtained according to the second size and the fourth size; wherein, the The third size is the physical size of the first object; the third transmission parameter represents the conversion relationship between the fifth size and the sixth size; the fifth size is the size of the second pixel; the second The position of the pixel point in the first image to be processed is determined according to the position of the first object frame; the sixth size is the size of the object point corresponding to the second pixel point; the fourth size is the physical size of the second object; the fourth transmission parameter represents the conversion relationship between the seventh size and the eighth size; the seventh size is the size of the third pixel; the third pixel is in the The position in the second image to be processed is determined according to the position of the second object frame; the eighth size is the size of the object point corresponding to the third pixel point; the third transmission parameter and the fourth The transmission parameters are subjected to curve fitting processing to obtain a transmission parameter map of
  • the method further includes: acquiring A confidence map; wherein, the confidence map represents the mapping between the object type and the confidence of the transmission parameter; according to the object type of the first object and the confidence map, the third transmission parameter of the third transmission parameter is obtained.
  • the performing curve fitting processing on the third transmission parameter and the fourth transmission parameter to obtain a transmission parameter map of the image to be processed includes: according to the first confidence level and the first confidence level Three transmission parameters to obtain a fifth transmission parameter; wherein, the fifth transmission parameter is positively correlated with the first confidence level; curve fitting is performed on the fourth transmission parameter and the fifth transmission parameter to obtain the The transmission parameter map.
  • the method further includes: The pixel point area in the first object frame is subjected to feature extraction processing to obtain feature data; according to the feature data, the score of the first object is obtained; wherein, the score is positive with the confidence of the size of the first object correlation; obtaining the first confidence of the third transmission parameter according to the object type of the first object and the confidence mapping, including: according to the object type of the first object and the confidence mapping , obtain the second confidence level of the third transmission parameter; obtain the first confidence level according to the score and the second confidence level; wherein, the first confidence level is related to the score.
  • the obtaining the fifth transmission parameter according to the first confidence level and the third transmission parameter includes: determining a product of the first confidence level and the third transmission parameter, The fifth transmission parameter is obtained.
  • the method further includes: acquiring the first transmission parameter The depth image of the image to be processed; according to the depth image, the first depth information of the second pixel point and the second depth information of the third pixel point are obtained; according to the first depth information and the fifth depth information The transmission parameter obtains a first data point, and the second data point is obtained according to the second depth information and the fourth transmission parameter; the curve fitting processing is performed on the fourth transmission parameter and the fifth transmission parameter,
  • Obtaining the transmission parameter map includes: performing curve fitting processing on the first data point and the second data point to obtain the transmission parameter map.
  • the first image to be processed and the second image to be processed are acquired by the same imaging device, and the pose of the imaging device in the process of acquiring the first image to be processed The pose is the same as that of the imaging device in the process of acquiring the second image to be processed.
  • the first object is a human object; the human object belongs to a monitoring crowd, and the method further includes: in the case that the speed does not exceed a safe speed threshold, acquiring the image data of the imaging device. location; sending an alarm instruction including the location to the terminal; wherein the alarm instruction is used to instruct the terminal to output the alarm information that the crowd density of the monitored crowd is too large.
  • a speed measuring device comprising: a first acquiring unit, configured to acquire a first image to be processed and a second image to be processed; wherein the first image to be processed and the second image to be processed The images to be processed all include a first object; a second acquisition unit is configured to acquire the first position of the first object in the first image to be processed, the first object in the second image to be processed The first transmission parameter of the second position and the first moving distance; wherein, the first moving distance is the distance between the first position and the second position; the first transmission parameter represents the first transmission parameter A conversion relationship between a moving distance and a first physical distance; the first physical distance is a physical distance corresponding to the first moving distance; the first physical distance and the first position are in the first waiting distance
  • the scale in the processed image is negatively correlated, and/or the first physical distance is negatively correlated with the scale of the second position in the second to-be-processed image; the first processing unit is configured to, according to the The speed of the first object is obtained by
  • the first processing unit is configured to: obtain a second movement distance according to the first transmission parameter and the first movement distance; according to the second movement distance and the movement time to get the speed.
  • the second obtaining unit is configured to: obtain a second transmission parameter of a third position; wherein the third position is on the line connecting the first position and the second position position; the second transmission parameter represents the conversion relationship between the size of the first pixel point and the size of the first object point; the first pixel point is based on the third position in the first image to be processed
  • the first pixel is the pixel determined in the second image to be processed according to the third position; the first object is the object corresponding to the first pixel point; the first ratio is negatively correlated with the scale of the first pixel in the image; the first ratio is the ratio between the size of the first pixel and the size of the first object point; according to and obtaining the first transmission parameter from the second transmission parameter, wherein the first transmission parameter is positively correlated with the second transmission parameter.
  • the third position is an intermediate position between the first position and the second position.
  • the second acquisition unit is configured to: perform object detection processing on the first image to be processed to obtain the position of the first object frame and the position of the second object frame; wherein the The first object frame includes a first object; the second object frame includes a second object; the first size of the first object is obtained according to the position of the first object frame, and the first size of the first object is obtained according to the position of the second object frame The second size of the second object; the third transmission parameter is obtained according to the first size and the third size, and the fourth transmission parameter is obtained according to the second size and the fourth size; wherein, the third size is The physical size of the first object; the third transmission parameter represents the conversion relationship between the fifth size and the sixth size; the fifth size is the size of the second pixel; the second pixel is in the The position in the first image to be processed is determined according to the position of the first object frame; the sixth size is the size of the object point corresponding to the second pixel point; the fourth size is the second object The fourth transmission parameter represents the conversion relationship
  • the first acquisition unit is further configured to perform curve fitting processing on the third transmission parameter and the fourth transmission parameter to obtain the transmission parameter of the image to be processed Before the graph, a confidence map is obtained; wherein, the confidence map represents the mapping between the object type and the confidence of the transmission parameter;
  • the speed measurement device further includes: a second processing unit, which is used for according to the first object. The object type and the confidence level are mapped to obtain the first confidence level of the third transmission parameter; the second obtaining unit is used for: obtaining the fifth confidence level according to the first confidence level and the third transmission parameter Transmission parameter; wherein, the fifth transmission parameter is positively correlated with the first confidence level;
  • a curve fitting process is performed on the fourth transmission parameter and the fifth transmission parameter to obtain the transmission parameter map.
  • the speed measuring device further includes: a third processing unit, configured to obtain the third transmission parameter of the third transmission parameter in the mapping according to the object type of the first object and the confidence level. Before a confidence level, feature extraction processing is performed on the pixel area in the first object frame to obtain feature data; a fourth processing unit is configured to obtain the score of the first object according to the feature data; wherein, The score is positively correlated with the confidence of the size of the first object; the second processing unit is configured to: obtain the third transmission parameter according to the object type of the first object and the confidence map The second confidence level of ; according to the score and the second confidence level, the first confidence level is obtained; wherein, the first confidence level is related to the score.
  • a third processing unit configured to obtain the third transmission parameter of the third transmission parameter in the mapping according to the object type of the first object and the confidence level.
  • the second obtaining unit is configured to: determine the product of the first confidence level and the third transmission parameter to obtain the fifth transmission parameter.
  • the first obtaining unit is further configured to obtain, before the curve fitting process is performed on the fourth transmission parameter and the fifth transmission parameter to obtain the transmission parameter map the depth image of the first image to be processed;
  • the second obtaining unit is further configured to: obtain the first depth information of the second pixel point and the second depth information of the third pixel point according to the depth image depth information; obtaining a first data point according to the first depth information and the fifth transmission parameter, and obtaining a second data point according to the second depth information and the fourth transmission parameter; the second obtaining unit, It is also used for: performing curve fitting processing on the first data point and the second data point to obtain the transmission parameter map.
  • the first image to be processed and the second image to be processed are acquired by the same imaging device, and the pose of the imaging device in the process of acquiring the first image to be processed The pose is the same as that of the imaging device in the process of acquiring the second image to be processed.
  • the first object is a human object; the human object belongs to a monitoring crowd, and the first acquiring unit is further configured to acquire all the data when the speed does not exceed a safe speed threshold.
  • the location of the imaging device; the speed measuring device further includes: a sending unit, configured to send an alarm instruction including the location to the terminal; wherein the alarm instruction is used to instruct the terminal to output the crowd density excess of the monitored crowd. Big warning message.
  • a processor configured to execute the method according to the above-mentioned first aspect and any possible implementation manner thereof.
  • an electronic device comprising: a processor, a sending device, an input device, an output device, and a memory, the memory being used to store computer program codes, the computer program codes comprising computer instructions, and in the processing When the computer executes the computer instructions, the electronic device executes the method according to the first aspect and any one of possible implementations thereof.
  • a computer-readable storage medium where a computer program is stored in the computer-readable storage medium, and the computer program includes program instructions that, when the program instructions are executed by a processor, cause all The processor executes the method as described above in the first aspect and any possible implementation manner thereof.
  • a computer program product includes a computer program or an instruction, and when the computer program or instruction is run on a computer, the computer is made to perform the above-mentioned first aspect and any of them.
  • FIG. 1 is a schematic diagram of a crowd image according to an embodiment of the present disclosure
  • FIG. 2 is a schematic diagram of a pixel coordinate system according to an embodiment of the present disclosure
  • FIG. 3 is a schematic flowchart of a speed measurement method provided by an embodiment of the present disclosure.
  • FIG. 5 is a schematic diagram of a goal provided by an embodiment of the present disclosure.
  • FIG. 6 is a schematic structural diagram of a speed measuring device provided by an embodiment of the present disclosure.
  • FIG. 7 is a schematic diagram of a hardware structure of a speed measuring device according to an embodiment of the present disclosure.
  • At least one (item) refers to one or more
  • “multiple” refers to two or more
  • at least two (item) refers to two or three
  • "and/or” is used to describe the association relationship of related objects, indicating that three kinds of relationships can exist, for example, "A and/or B” can mean: only A exists, only B exists, and A exists at the same time and B three cases, where A, B can be singular or plural.
  • the character “/" can indicate that the related objects are an "or” relationship, which refers to any combination of these items, including any combination of a single item (a) or a plurality of items (a).
  • At least one (a) of a, b or c can mean: a, b, c, "a and b", “a and c", “b and c", or "a and b and c” ", where a, b, c can be single or multiple.
  • an object point refers to a point in the real world
  • a physical distance refers to a distance in the real world
  • a physical size refers to a size in the real world.
  • Object points correspond to pixels in the image.
  • image A is obtained by photographing a table with a camera.
  • the table includes the object point a, and the pixel point b in the image A is obtained by imaging the object point a, then the object point a corresponds to the pixel point b.
  • the physical area corresponds to the pixel area in the image.
  • image B is obtained by photographing a basketball court with a camera.
  • the pixel point area c in the image A is obtained by imaging the basketball court, then the basketball court corresponds to the pixel point area c.
  • a near object has a large scale in the image
  • a distant object has a small scale in the image.
  • far refers to the distance between the real object corresponding to the object in the image and the imaging device that collects the above-mentioned image
  • near refers to the distance between the real object corresponding to the object in the image and the imaging device that collects the above-mentioned image. distance is close.
  • the scale of a pixel is positively related to the size of the object corresponding to the pixel. Specifically, the larger the scale of a pixel point in the image, the larger the size of the object point corresponding to the pixel point.
  • image A includes pixel point a and pixel point b, wherein the object point corresponding to pixel point a is object point 1 , and the object point corresponding to pixel point b is object point 2 . If the scale of pixel point a in image A is larger than that of pixel point b in image A, the size of object point 1 is larger than the size of object point 2.
  • the scale of a location refers to the ratio between the size of an object at that location and the physical size of the object.
  • the scale of the position of character A is larger than that of the position of character B, and the size difference between people is small (that is, the difference between the physical sizes of different people is small)
  • the area of the pixel area covered by character A is larger than the area of the pixel area covered by character B.
  • the positions in the image all refer to the positions under the pixel coordinates of the image.
  • the abscissa of the pixel coordinate system is used to represent the number of columns where the pixel points are located
  • the ordinate in the pixel coordinate system is used to represent the number of rows where the pixel points are located.
  • the pixel coordinates are constructed with the upper left corner of the image as the coordinate origin O, the direction of the row parallel to the image as the direction of the X-axis, and the direction of the column parallel to the image as the direction of the Y-axis
  • the system is XOY.
  • the units of the abscissa and ordinate are pixels.
  • the coordinates of the pixel point A 11 in FIG. 2 are (1, 1)
  • the coordinates of the pixel point A 23 are (3, 2)
  • the coordinates of the pixel point A 42 are (2, 4)
  • the coordinates of the pixel point A 34 are (2, 4).
  • the coordinates are (4, 3).
  • the execution body of the embodiment of the present disclosure is a speed measuring device.
  • the speed measuring device may be one of the following: a mobile phone, a computer, a server, and a tablet computer.
  • FIG. 3 is a schematic flowchart of a speed measurement method provided by an embodiment of the present disclosure.
  • both the first image to be processed and the second image to be processed may contain any content.
  • the first image to be processed may contain people; the first image to be processed may also contain roads and car heads.
  • the second image to be processed may contain people; the second image to be processed may also contain animals.
  • the present disclosure does not limit the content contained in the first image to be processed and the content contained in the second image to be processed.
  • the first object may be one of the following: a person and an object.
  • the first object may be a person; the first object may also be a car; the first object may also be an animal.
  • Both the first image to be processed and the second image to be processed contain the first object.
  • the first image to be processed includes Zhang San
  • the second image to be processed also includes Zhang San.
  • both the first image to be processed and the second image to be processed include vehicle a.
  • the speed measuring device receives the first image to be processed input by the user through the input component.
  • the above input components include: keyboard, mouse, touch screen, touch pad, audio input and so on.
  • the speed measuring device receives the first image to be processed sent by the first terminal.
  • the first terminal may be any one of the following: a mobile phone, a computer, a tablet computer, a server, or a wearable device.
  • the speed measuring device is reproduced with a camera assembly, wherein the camera assembly includes a camera.
  • the speed measuring device acquires the first image to be processed by using the camera assembly to capture images.
  • the speed measuring device selects one frame of image from the acquired video stream as the first image to be processed.
  • the speed measuring device receives the second image to be processed input by the user through the input component.
  • the above input components include: keyboard, mouse, touch screen, touch pad, audio input and so on.
  • the speed measuring device receives the second image to be processed sent by the second terminal.
  • the second terminal may be any one of the following: a mobile phone, a computer, a tablet computer, a server, or a wearable device.
  • the speed measuring device is reproduced with a camera assembly, wherein the camera assembly includes a camera.
  • the speed measuring device acquires the second image to be processed by using the camera assembly to capture images.
  • the speed measuring device selects one frame of image from the acquired video stream as the second image to be processed.
  • the speed measuring device acquires the surveillance video stream collected by the surveillance camera through the communication connection, and selects two frames of images from the surveillance video stream as the first image to be processed and the second image to be processed.
  • the position of the first object in the first image to be processed may be the position of an object frame containing the first object in the first image to be processed; the position of the first object in the first image to be processed may be is the position of the pixel in the pixel area covered by the first object in the first image to be processed.
  • the position of the first object in the second image to be processed may be the position of the object frame containing the first object in the second image to be processed; the position of the first object in the second image to be processed may be covered by the first object The position of the pixel point in the pixel point area of in the second image to be processed.
  • the first moving distance is the distance between the first position and the second position, that is, the first moving distance is the distance in the pixel coordinate system.
  • the first position is (3, 5), that is, the position of the first object in the first image to be processed is (3, 5);
  • the second position is (7, 8), that is, the first object is in the second image to be processed.
  • the position in the processed image is (7, 8).
  • the first moving distance is:
  • the physical distance refers to the distance in the real world.
  • the physical distance corresponding to the first moving distance is the first physical distance.
  • the first transmission parameter represents the conversion relationship between the first moving distance and the first physical distance. For example, it is assumed that the timestamp of the first image to be processed is t 1 , the timestamp of the second image to be processed is t 2 , and the first object is Zhang San. If the first moving distance obtained by the speed measuring device according to the first position and the second position is d 1 , the speed measuring device can use the first transmission parameter to convert d 1 into the moving distance of Zhang San in the real world from t 1 to t 2 (ie the first physical distance). In some possible implementations, the first transmission parameter is a ratio between the first moving distance and the first physical distance.
  • the first physical distance is negatively correlated with the scale of the first position in the first image to be processed, and/or the first physical distance is negatively correlated with the scale of the second position in the second image to be processed related.
  • the correlation relationship includes at least one of the following situations:
  • the first physical distance obtained by the speed measuring device according to the first moving distance and the first transmission parameter is negatively correlated with the scale of the first position in the first image to be processed;
  • the first physical distance obtained by the speed measuring device according to the first moving distance and the first transmission parameter is negatively correlated with the scale of the first position in the first image to be processed, and the first physical distance and the second position are in The scales in the second image to be processed are negatively correlated.
  • the moving time is the time consumed by the first object moving the first moving distance.
  • the speed measuring device can obtain the moving time according to the time stamp of the first image to be processed and the time stamp of the second image to be processed.
  • the smaller time stamp among the time stamp of the first image to be processed and the time stamp of the second image to be processed is called a small time stamp
  • the time stamp of the first image to be processed and the time stamp of the second image to be processed are referred to as the small time stamp.
  • a large time stamp among the time stamps of the processed image is called a large time stamp.
  • the starting time of the moving time is the small timestamp
  • the ending time of the moving time is the large timestamp.
  • the timestamp of the first image to be processed is 16:54:30 on June 27, 2020
  • the timestamp of the second image to be processed is 16:54:33 on June 27, 2020.
  • the small timestamp is 16:54:30 on June 27, 2020
  • the large timestamp is 16:54:33 on June 27, 2020.
  • the speed of the first object is the speed of the first object in the real world.
  • the speed measuring device obtains the moving distance of the first object in the real world (hereinafter referred to as the second moving distance) according to the first transmission parameter and the first moving distance.
  • the speed measuring device can obtain the speed of the first object according to the first physical moving distance and the moving time. For example, assuming that the first transmission parameter represents the ratio between the first moving distance and the first physical distance, the first transmission parameter is 0.1 cm, the first moving distance is 10, and the moving time is 0.5 seconds.
  • the speed measuring device obtains the speed of the first object in the image (hereinafter referred to as virtual speed) according to the first moving distance and the moving time.
  • the speed measuring device obtains the speed of the first object in the real world according to the virtual speed and the first transmission parameter.
  • the speed measuring device obtains the speed of the first object according to the first transmission parameter, the first moving distance and the moving time, which can improve the accuracy of the speed.
  • the speed measuring device obtains the first transmission parameter by performing the following steps:
  • the third position is a position on the line connecting the first position and the second position. It should be understood that although the first position is the position in the first image to be processed, and the second position is the position in the second image to be processed, because in the embodiment of the present disclosure, the pixel coordinate system of the first image to be processed is the same as the position in the first image to be processed. The pixel coordinate systems of the two images to be processed are the same, and the speed measuring device can determine the third position in the pixel coordinate system according to the first position and the second position.
  • the third position may be a position in the first image to be processed, and the third position may also be a position in the second image to be processed.
  • the first position is (3, 4) and the second position is (7, 8).
  • the third position is the middle position between the first position and the second position: (5, 6).
  • the third position may represent the pixel point in the 5th row and the 6th column in the first image to be processed, and the third position may also represent the pixel point in the 5th row and 6th column in the second image to be processed.
  • the speed measuring device may determine the pixel point in the first image to be processed according to the third position, and the speed measuring device may also determine the pixel point in the second image to be processed at the third position.
  • the pixel point determined by the speed measuring device according to the third position is called the first pixel point
  • the second transmission parameter represents the conversion relationship between the size of the first pixel point and the size of the first object point, wherein the first object point is the first pixel point.
  • the second transmission parameter represents the conversion relationship between the length of the first pixel point and the length of the first object point.
  • the second transmission parameter represents a conversion relationship between the height of the first pixel point and the height of the first object point.
  • the second transmission parameter represents the conversion relationship between the width of the first pixel point and the width of the first object point.
  • the ratio between the size of the first pixel point and the size of the first object point is referred to as the first ratio.
  • the first ratio is negatively correlated with the size of the first pixel in the image.
  • the first pixel belongs to the first image to be processed, and if the first ratio is the ratio of the length of the first pixel to the first object point, the larger the scale of the first pixel in the first image to be processed, the A ratio is smaller.
  • the length of any two pixels in the first image to be processed is the same, that is to say, the length of the first pixel is unchanged, then the larger the scale of the first pixel, the longer the first object point is.
  • the smaller it is, that is, the size of the first object point is negatively correlated with the size of the first pixel point.
  • the first ratio is the ratio of the length of the first pixel to the first object point
  • the first pixel belongs to the second image to be processed
  • the larger the scale of the first pixel in the second image to be processed The first ratio is smaller.
  • the second transmission parameter carries the scale information of the first pixel point.
  • the speed measuring device receives the second transmission parameter input by the user through the input component.
  • the above input components include: keyboard, mouse, touch screen, touch pad, audio input and so on.
  • the speed measuring device receives the second transmission parameter sent by the third terminal.
  • the third terminal may be any one of the following: a mobile phone, a computer, a tablet computer, a server, and a wearable device.
  • the third terminal and the first terminal may be the same or different.
  • the scale of the pixel point is linearly related to the abscissa of the pixel point, and/or the scale of the pixel point is linearly related to the ordinate of the pixel point.
  • the scale of the third position is linearly related to the scale of the first position, and/or the scale of the third position is linearly related to the scale of the second position. Therefore, the speed measuring device can determine the transmission parameter of the first moving distance according to the transmission parameter of the intermediate position between the first position and the second position, that is, determine the first transmission parameter according to the second transmission parameter.
  • the third position is an intermediate position between the first position and the second position.
  • the first transmission parameter is positively correlated with the second transmission parameter.
  • b 1 and b 2 satisfy formula (1):
  • b 1 , b 2 satisfy formula (3):
  • FIG. 4 is a schematic flowchart of a possible implementation method of step 1 provided by an embodiment of the present disclosure.
  • the object detection processing detects objects whose size is in the vicinity of the determined value.
  • the average length of a human face is 20 cm
  • the detection object of the object detection process may be a human face.
  • the average height of a person is 1.65 meters
  • the detection object of the object detection processing may be a human body.
  • the heights of the goals shown in FIG. 5 are all determined (for example, 2.44 meters), and the detection object of the object detection processing may be the goal.
  • the object frame may be any shape, and the present disclosure does not limit the shape of the object frame (including the above-mentioned first object frame and second object frame).
  • the shape of the object frame includes at least one of the following: rectangle, diamond, circle, ellipse, and polygon.
  • the position of the object frame (including the position of the first object frame and the position of the second object frame) is used to determine the pixel area included in the object frame, that is, the position of the object frame in the image to be processed .
  • the position of the object frame may include coordinates of any pair of diagonal corners in the rectangle, wherein a pair of diagonal corners refers to two vertices on the diagonal of the rectangle.
  • the position of the object frame may include: the position of the geometric center of the rectangle, the length of the rectangle, and the width of the rectangle.
  • the position of the object frame may include: the position of the center of the object frame and the radius of the object frame.
  • the number of objects to be detected in the object detection process is not less than one.
  • the detection object when the detection object is a human face, the position of the face frame including the human face can be obtained by performing object detection processing on the image to be processed.
  • the detection object when the detection object includes a face and a human body, by performing object detection processing on the image to be processed, the position of the face frame including the face and the position of the human frame including the human body can be obtained.
  • the detection object includes a face, a human body and a screw
  • the detection objects of the object detection process include at least one of the following: a human face, a human foot, a human body, a screw, and a goal.
  • the object detection processing on the image to be processed can be implemented by a convolutional neural network.
  • the convolutional neural network is trained by using the image with annotation information as the training data, so that the trained convolutional neural network can complete the object detection processing on the image.
  • the annotation information of the images in the training data is the position information of the object frame, and the object frame contains the detection object of the object detection process.
  • the object detection processing may be implemented by an object detection algorithm, wherein the object detection algorithm may be one of the following: a look-only algorithm (you only look once, YOLO), a target detection algorithm ( deformable part model, DMP), single shot multiBox detector (SSD), Faster-RCNN algorithm, etc.
  • a look-only algorithm you only look once, YOLO
  • a target detection algorithm deformable part model, DMP
  • SSD single shot multiBox detector
  • Faster-RCNN algorithm etc.
  • the present disclosure does not limit the object detection algorithm for implementing object detection processing.
  • the speed measuring device obtains the position of the first object frame including the first object and the position of the second object frame including the second object by performing object detection processing on the first image to be processed.
  • the detection object included in the first object frame is different from the detection object included in the second object frame.
  • the detection object included in the first object frame is the face of Zhang San
  • the detection object included in the second object frame is the face of Li Si.
  • the detection object included in the first object frame is Zhang San's face
  • the detection object included in the second object frame is a sign.
  • the speed measuring device can determine the size of the detection object contained in the object frame according to the position of the object frame. For example, when the shape of the object frame is a rectangle, the speed measuring device can determine the length and width of the object frame according to the position of the object frame, and then determine the length and width of the detection object in the object frame.
  • the speed measuring device can obtain the first size of the first object according to the position of the first object frame, and obtain the second size of the second object according to the position of the second object frame.
  • the third size is the physical size of the first object
  • the fourth size is the physical size of the second object.
  • the third dimension may be the height of the human (eg, 170 cm).
  • the detection object contained in the second object frame is a human face
  • the third size may be the length of the human face (eg, 20 cm).
  • the speed measuring device can determine a pixel (ie, a second pixel) in the first image to be processed according to the position of the first object frame. For example, when the shape of the first object frame is a rectangle, the speed measuring device determines the position of the geometric center of the first object frame according to the position of the first object frame, and uses the pixel corresponding to the geometric center as the second pixel. For another example, when the shape of the first object frame is a rectangle, the speed measuring device determines the position of any vertex of the first object frame according to the position of the first object frame, and uses the pixel corresponding to the vertex as the second pixel. .
  • the speed measuring device determines the position of the center of the circle of the first object frame according to the position of the first object frame, and uses the pixel point corresponding to the center of the circle as the second pixel point.
  • the speed measuring device may determine a pixel point, that is, a third pixel point, in the first image to be processed according to the position of the second object frame.
  • the size of the second pixel is referred to as the fifth size
  • the size of the object point corresponding to the second pixel is referred to as the sixth size
  • the size of the third pixel is referred to as the seventh size
  • the size of the third pixel is referred to as the seventh size
  • the size of the object point corresponding to the third pixel point is called the eighth size.
  • the conversion relationship between the fifth size and the sixth size is referred to as the third transmission parameter
  • the conversion relationship between the seventh size and the eighth size is referred to as the fourth transmission parameter.
  • the speed measuring device can obtain the third transmission parameter according to the first size and the third size, and can obtain the fourth transmission parameter according to the second size and the fourth size.
  • the first dimension is s 1
  • the second dimension is s 2
  • the third dimension is s 3
  • the fourth dimension is s 4
  • the third transmission parameter is b 3
  • the fourth transmission parameter is b 4 .
  • s 1 , s 3 , b 3 satisfy formula (4):
  • s 1 , s 3 , b 3 satisfy formula (6):
  • s 1 , s 3 , b 3 satisfy formula (8):
  • the speed measuring device passes the third transmission parameter and the fourth
  • the transmission parameters are subjected to curve fitting processing, and a transmission parameter map of the first image to be processed can be obtained. According to the pixel value in the transmission parameter map, the transmission parameter of any pixel in the first image to be processed can be determined.
  • the speed measuring device can determine the conversion relationship between the size of the fourth pixel point (ie, the ninth size) and the tenth size according to the first pixel value, wherein the tenth size is the size of the object point corresponding to the fourth pixel point.
  • the ninth size is s 5
  • the tenth size is s 6 .
  • p 1 , s 5 , s 6 satisfy formula (10):
  • p 1 , s 5 , and s 6 satisfy formula (11):
  • p 1 , s 5 , and s 6 satisfy formula (12):
  • the speed measuring device can determine the transmission parameter of any pixel point except the fourth pixel point in the first image to be processed according to the transmission parameter map.
  • the speed measuring device may determine the reference pixel value from the transmission parameter map according to the third position, wherein the position of the pixel point corresponding to the reference pixel value in the transmission parameter map Same as the third position.
  • the speed measuring device can further obtain the second transmission parameter according to the reference pixel value.
  • the speed measuring device obtains the third transmission parameter according to the first size and the third size, and obtains the fourth transmission parameter according to the second size and the fourth size.
  • a transmission parameter map is obtained, and then the transmission parameter of any pixel point in the first image to be processed can be determined according to the transmission parameter map.
  • the distance measuring device can obtain a transmission parameter map of the second image to be processed by performing object detection processing on the second image to be processed. Further, the second transmission parameter is determined.
  • the speed measuring device before performing step 404, the speed measuring device further performs the following steps:
  • the precision of the transmission parameter of a pixel is positively correlated with the precision of the size of the object point corresponding to the pixel.
  • the precision of the transmission parameter map is related to the precision of the size of the first object and the size of the second object. positive correlation.
  • the accuracy of the size of an object with a fixed size is higher than that of an object whose size is in the floating range.
  • a standard soccer goal has a width of 7.32 meters and a height of 2.44 meters. 90% of people's height is between 1.4 meters and 2 meters. The accuracy of the dimensions of a soccer goal is higher than that of a person's height.
  • the height of a standard basketball hoop is 3.05 meters. 95% of human faces are between 17 cm and 30 cm in length. The accuracy of the height of the basketball hoop is higher than the accuracy of the length of the face.
  • Another example is a screw with a fixed length. 95% of people's feet are between 20 cm and 35 cm long. The precision of the length of a screw with a fixed length is higher than that of a human foot.
  • the above-mentioned object with a fixed size may be an object with a fixed size in a specific scene. For example, boarding signs in the departure lounge. Another example is the chairs in the gym. Another example is a desk in an office.
  • the confidence map represents the mapping between the object type and the confidence of the transmission parameter. For example, see Table 1 for the confidence map.
  • the speed measuring device receives the confidence map input by the user through the input component.
  • the above input components include: keyboard, mouse, touch screen, touch pad, audio input and so on.
  • the speed measuring apparatus receives the confidence map sent by the fourth terminal.
  • the fourth terminal may be any one of the following: a mobile phone, a computer, a tablet computer, a server, and a wearable device.
  • the fourth terminal and the first terminal may be the same or different.
  • the first confidence of the third transmission parameter can be obtained according to the confidence map and the object type of the first object. For example, suppose that the reliability map is set as the above Table 1, and the object type of the first object is a human body. At this time, the first confidence level is 0.9.
  • the speed measuring device may determine the object type of the first object by performing feature extraction processing on the pixel area included in the first object frame.
  • the speed measuring device may determine the transmission parameters corresponding to the objects in each object frame respectively according to the object type of the objects in each object frame. For example, the speed measuring device may obtain the confidence level of the fourth transmission parameter (which will be referred to as the third confidence level in this embodiment of the present application) according to the object type of the second object and the confidence level map.
  • the speed measuring device After obtaining the first confidence level, the speed measuring device performs the following steps in the process of executing step 404:
  • the fifth transmission parameter is positively correlated with the first confidence level.
  • the first confidence level is c 1 and the fifth transmission parameter is b 5 .
  • c 1 , b 5 satisfy formula (13):
  • c 1 , b 5 satisfy formula (14):
  • c 1 , b 5 satisfy formula (15):
  • the speed measuring device can improve the accuracy of the transmission parameter map by performing curve fitting processing on the fourth transmission parameter and the fifth transmission parameter.
  • the speed measuring device in the case that the speed measuring device obtains the third confidence level by performing step 4, and obtains the sixth transmission parameter according to the third confidence level and the fourth transmission parameter, the speed measuring device can pass A curve fitting process is performed on the fifth transmission parameter and the sixth transmission parameter to obtain a transmission parameter map.
  • the distance measuring device can obtain the transmission parameter map of the second image to be processed based on the confidence map, so as to improve the transmission parameter map of the second image to be processed accuracy.
  • the speed measuring device before performing step 4, the speed measuring device further performs the following steps:
  • the feature extraction processing may be convolution processing, pooling processing, or a combination of convolution processing and pooling processing.
  • the feature extraction process may be implemented by a trained convolutional neural network or a feature extraction model, which is not limited in the present disclosure.
  • the speed measuring device can extract the semantic information in the pixel point area in the object frame by performing feature extraction processing on the pixel point area in the object frame, and obtain the characteristic data of the object frame.
  • convolution processing is performed on the pixel point area in the first object frame layer by layer through at least two convolution layers to complete the first object frame.
  • Feature extraction processing of the pixel area within the object frame The convolutional layers in at least two convolutional layers are connected in series in sequence, that is, the output of the previous convolutional layer is the input of the next convolutional layer, and the semantic information extracted by each convolutional layer is different.
  • the feature extraction process abstracts the features of the pixel area in the first object frame step by step, and also gradually discards relatively minor feature data, wherein the relatively minor feature information refers to, except for the features that can be used for Feature information other than the feature information of the object type of the object of the first object frame is determined. Therefore, the size of the feature data extracted later is smaller, but the semantic information is more concentrated.
  • Convolution processing is performed on the pixel point area in the first object frame step by step through the multi-layer convolution layer, so that semantic information of the pixel point area in the first object frame can be obtained.
  • the speed measuring device may perform feature extraction processing on the pixel point area in each object frame, respectively, to obtain feature data of the pixel point area in each object frame.
  • the state of the object is determined according to the feature data of the object, and then a confidence score for characterizing the size of the object is obtained, wherein the score of the object is There is a positive correlation with the confidence in the size of the object.
  • the object is a human body and the size of the object is the height of the person.
  • the height of the person is equal to the person's real height.
  • the confidence of the person's height is the highest; when the person is in a walking state, the height of the person is equal to the person's real height.
  • the confidence of the person's height is second; when the person is in a state of bowing his head (such as looking down at the mobile phone), there is a small error between the person's height and the person's true height, at this time , the confidence level of the person's height is lower than that of the person in the walking state; in the case of the person sitting, there is a large error between the person's height and the person's real height. At this time, the person's height of low confidence.
  • the speed measuring device may determine the score of the object in the object frame according to the feature data extracted from the pixel area in the object frame.
  • the speed measuring device may use a classifier (eg, support vector machine, softmax function) to process the feature data of the object frame to obtain a score of the objects in the object frame.
  • a classifier eg, support vector machine, softmax function
  • the speed measuring device may use a neural network to process the pixel point area in the object frame to obtain the score of the object in the object frame.
  • the speed measuring device uses the labeled image set as training data to train the neural network to obtain the trained neural network.
  • the unlabeled image set is processed using the trained neural network to obtain the label of the unlabeled image set.
  • the trained neural network is trained using the labels of the labeled image set, the unlabeled image set, and the unlabeled image set to obtain an image processing neural network.
  • the information carried by the tag includes the position of the object frame in the image and the score of the object in the object frame.
  • the speed measuring device can obtain the score of the first object according to the characteristic data of the first object.
  • the speed measuring device may obtain a score for each object in the first image to be processed, respectively.
  • the speed measuring device performs the following steps in the process of executing step 4:
  • the implementation process of this step can refer to step 4, but in this step, the speed measuring device obtains not the first confidence degree but the second confidence degree according to the object type of the first object and the confidence degree mapping.
  • the first confidence level is related to the score.
  • the first confidence level is c 1
  • the second confidence level is c 2
  • the score is s.
  • c 1 , c 2 , s satisfy formula (16):
  • c 1 , c 2 , s satisfy formula (17):
  • c 1 , c 2 , s satisfy formula (18):
  • the speed measuring device obtains the first confidence level according to the score of the first object and the second confidence level, which can improve the accuracy of the first confidence level.
  • the speed measuring device may obtain the fourth confidence level of the fourth transmission parameter by performing step 9, and the speed measuring device may obtain the above-mentioned third confidence level according to the score of the second object and the fourth confidence level.
  • the speed measuring device before performing step 6, the speed measuring device also performs the following steps:
  • the depth image of the first image to be processed carries the depth information of the pixels in the first image to be processed.
  • the speed measuring device receives the depth image input by the user through the input component.
  • the above input components include: keyboard, mouse, touch screen, touch pad, audio input and so on.
  • the speed measuring device is loaded with an RGB camera and a depth camera. During the process of using the RGB camera to collect the first image to be processed, the speed measuring device uses the depth camera to collect the depth image of the first image to be processed.
  • the depth camera may be any one of the following: a structured light (structured light) camera, a TOF camera, and a binocular stereo vision camera.
  • the speed measuring device receives the depth image sent by the fifth terminal, where the fifth terminal includes a mobile phone, a computer, a tablet computer, a server, and the like.
  • the fifth terminal and the first terminal may be the same or different.
  • the depth image carries the depth information of the pixels in the first image to be processed.
  • the speed measuring device can determine the depth information of the second pixel (ie the first depth information) and the depth information of the third pixel (ie the second depth information) according to the depth image.
  • the abscissa of the first data point is the first depth information
  • the abscissa of the second data point is the second depth information
  • the ordinate of the first data point is the fifth transmission parameter
  • the second The ordinate of the data point is the fourth transmission parameter. That is, the speed measuring device takes the depth information of the pixel point as the abscissa, and the transmission parameter of the pixel point as the ordinate.
  • the ordinate of the first data point is the first depth information
  • the ordinate of the second data point is the second depth information
  • the abscissa of the first data point is the fifth transmission parameter
  • the second The abscissa of the data points is the fourth transmission parameter. That is, the speed measuring device takes the depth information of the pixel point as the ordinate and the transmission parameter of the pixel point as the abscissa.
  • the speed measuring device After obtaining the first data point and the second data point, the speed measuring device performs the following steps in the process of performing step 6:
  • both the first data point and the second data point carry the depth information of the pixel point.
  • the transmission parameter map obtained by the speed measuring device also carries depth information.
  • the speed measuring device obtains the transmission parameter map by performing step 14, which can improve the accuracy of the size of the pixel in the first image to be processed.
  • the precision of the transmission parameter map can further improve the precision of the transmission parameters of the pixels in the first image to be processed, thereby improving the precision of the speed of the first object.
  • the speed measuring device can obtain the transmission parameter map of the second image to be processed based on the depth map of the second image to be processed, thereby improving the Accuracy of speed.
  • the first image to be processed and the second image to be processed are acquired by the same imaging device, and the pose of the imaging device in the process of acquiring the first image to be processed is the same as that of the imaging device
  • the poses in the process of acquiring the second image to be processed are the same.
  • the pixel points at the same position in the first image to be processed and the second image to be processed have the same scale.
  • pixel a belongs to the first image to be processed
  • pixel b belongs to the second image to be processed
  • the position of pixel a in the first image to be processed is the same as the position of pixel b in the second image to be processed.
  • the scale of the pixel point a in the first image to be processed is the same as the scale of the pixel point b in the second image to be processed.
  • the imaging device is a surveillance camera.
  • the embodiments of the present disclosure also provide a possible application scenario.
  • surveillance camera equipment in order to enhance the safety in work, life or social environment, surveillance camera equipment will be installed in various public places to perform security protection according to video stream information.
  • the technical solutions provided by the embodiments of the present disclosure to process the video stream collected by the surveillance camera device, the density of people in the public place can be determined, thereby effectively preventing the occurrence of public accidents.
  • the above-mentioned first object is a human object, and the human object belongs to a monitoring crowd, where the monitoring crowd refers to a crowd in a monitoring picture of a monitoring camera.
  • the monitoring crowd refers to a crowd in a monitoring picture of a monitoring camera.
  • crowd density the distance between people is smaller, which in turn leads to slower movement of people. Therefore, it can be determined by the speed of the first object whether the crowd density of the monitored crowd is too large.
  • the speed measuring device determines that the crowd density of the monitored crowd is too large.
  • the speed measuring device further obtains the location of the imaging device (the location of the imaging device carries at least one of the following information: the serial number of the imaging device, the longitude and latitude information of the imaging device), and sends an alarm instruction including the location to the terminal of the relevant manager to remind the manager
  • the crowd density of the monitoring crowd is too large, thereby reducing the probability of public safety accidents.
  • the alarm instruction may instruct the terminal to output alarm information that the crowd density of the monitored crowd is too large in at least one of the following ways: light, voice, text, and vibration.
  • the writing order of each step does not mean a strict execution order but constitutes any limitation on the implementation process, and the specific execution order of each step should be based on its function and possible Internal logic is determined.
  • FIG. 6 is a schematic structural diagram of a speed measuring device provided by an embodiment of the present disclosure.
  • the speed measuring device includes: a first obtaining unit 11, a second obtaining unit 12, and a first processing unit 13, wherein: the first obtaining unit 13
  • the unit 11 is used to acquire the first image to be processed and the second image to be processed; wherein, the first image to be processed and the second image to be processed both include a first object;
  • the second acquisition unit 12 is used to acquire the first position of the first object in the first image to be processed, the second position of the first object in the second image to be processed, and the first transmission parameters of the first moving distance; wherein,
  • the first moving distance is the distance between the first position and the second position;
  • the first transmission parameter represents the conversion relationship between the first moving distance and the first physical distance;
  • a physical distance is a physical distance corresponding to the first moving distance; the first physical distance is negatively correlated with the scale of the first position in the first image to be processed, and/or the first physical distance is The physical distance
  • the first processing unit 13 is configured to:
  • the speed is obtained according to the second moving distance and the moving time.
  • the second obtaining unit 12 is used for:
  • the second transmission parameter of the third position is the position on the connecting line between the first position and the second position; wherein, the second transmission parameter represents the size of the first pixel point and the A conversion relationship between the sizes of object points;
  • the first pixel point is a pixel point determined in the first image to be processed according to the third position, and the first pixel point may be a pixel point determined according to the third position in the first image to be processed.
  • the first object point is the object point corresponding to the first pixel point; the first ratio and the scale of the first pixel point in the image Negative correlation;
  • the first ratio is the ratio between the size of the first pixel point and the size of the first object point;
  • the first transmission parameter is obtained; wherein, the first transmission parameter is positively correlated with the second transmission parameter.
  • the third position is an intermediate position between the first position and the second position.
  • the second obtaining unit 12 is used for:
  • the first object frame includes the first object
  • the second object frame includes the second object frame object
  • the third transmission parameter is obtained according to the first size and the third size
  • the fourth transmission parameter is obtained according to the second size and the fourth size
  • the third size is the physical size of the first object
  • the third transmission parameter represents the conversion relationship between the fifth size and the sixth size
  • the fifth size is the size of the second pixel
  • the position of the second pixel in the first image to be processed is based on The position of the first object frame is determined
  • the sixth size is the size of the object point corresponding to the second pixel point
  • the fourth size is the physical size of the second object
  • the fourth transmission parameter Indicates the conversion relationship between the seventh size and the eighth size
  • the seventh size is the size of the third pixel
  • the position of the third pixel in the second image to be processed depends on the second object
  • the position of the frame is determined
  • the eighth size is the size of the object point corresponding to the third pixel point
  • the conversion relationship between the ninth size and the tenth size is based on the transmission parameter
  • the first pixel value in the figure is determined; the ninth size is the size of the fourth pixel in the first image to be processed; the tenth size is the size of the object point corresponding to the fourth pixel;
  • the first pixel value is the pixel value of the fifth pixel point; the fifth pixel point is the pixel point corresponding to the fourth pixel point in the transmission parameter map;
  • the second transmission parameter is obtained according to the pixel value corresponding to the third position in the transmission parameter map.
  • the first acquisition unit 11 is further configured to perform curve fitting processing on the third transmission parameter and the fourth transmission parameter to obtain the transmission of the image to be processed Before the parameter map, obtain a confidence map;
  • the confidence map represents the mapping between the object type and the confidence of the transmission parameter;
  • the speed measuring device further includes: a second processing unit 14, configured to obtain the first confidence level of the third transmission parameter according to the object type of the first object and the confidence level mapping; the second obtaining unit 12, for: obtaining a fifth transmission parameter according to the first confidence level and the third transmission parameter; wherein the fifth transmission parameter is positively correlated with the first confidence level; for the fourth transmission parameter
  • the parameters and the fifth transmission parameter are subjected to curve fitting processing to obtain the transmission parameter map.
  • the speed measuring device 1 further includes: a third processing unit 15, configured to obtain the third transmission parameter in the mapping according to the object type of the first object and the confidence level Before the first confidence level of , perform feature extraction processing on the pixel area in the first object frame to obtain feature data; the fourth processing unit 16 is configured to obtain the score of the first object according to the feature data ; wherein, the score is positively correlated with the confidence of the size of the first object; the second processing unit 14 is used for: according to the object type of the first object and the confidence map, obtain the The second confidence level of the third transmission parameter; the first confidence level is obtained according to the score and the second confidence level; wherein, the first confidence level is related to the score.
  • the second obtaining unit 12 is configured to: determine the product of the first confidence level and the third transmission parameter to obtain the fifth transmission parameter.
  • the first obtaining unit is further configured to obtain, before the curve fitting process is performed on the fourth transmission parameter and the fifth transmission parameter to obtain the transmission parameter map
  • the depth image of the first image to be processed; the second obtaining unit 12 is further configured to: obtain the first depth information of the second pixel point and the first depth information of the third pixel point according to the depth image 2 depth information; a first data point is obtained according to the first depth information and the fifth transmission parameter, and a second data point is obtained according to the second depth information and the fourth transmission parameter; the second obtaining unit 12. It is further used for: performing curve fitting processing on the first data point and the second data point to obtain the transmission parameter map.
  • the first image to be processed and the second image to be processed are acquired by the same imaging device, and the pose of the imaging device in the process of acquiring the first image to be processed The pose is the same as that of the imaging device in the process of acquiring the second image to be processed.
  • the first object is a human object; the human object belongs to a monitoring crowd, and the first obtaining unit 11 is further configured to obtain the speed when the speed does not exceed a safe speed threshold.
  • the position of the imaging device; the speed measuring device further includes: a sending unit 17, configured to send an alarm instruction including the position to the terminal; wherein, the alarm instruction is used to instruct the terminal to output the crowd of the monitored crowd Warning information about excessive density.
  • the speed measuring device obtains the speed of the first object according to the first transmission parameter, the first moving distance and the moving time, which can improve the accuracy of the speed.
  • the functions or modules included in the apparatuses provided in the embodiments of the present disclosure may be used to execute the methods described in the above method embodiments.
  • FIG. 7 is a schematic diagram of a hardware structure of a speed measuring device according to an embodiment of the present disclosure.
  • the speed measuring device 2 includes a processor 21 , a memory 22 , an input device 23 and an output device 24 .
  • the processor 21 , the memory 22 , the input device 23 , and the output device 24 are coupled through a connector, and the connector includes various types of interfaces, transmission lines, or buses, which are not limited in this embodiment of the present disclosure. It should be understood that, in various embodiments of the present disclosure, coupling refers to mutual connection in a specific manner, including direct connection or indirect connection through other devices, such as various interfaces, transmission lines, and buses.
  • the processor 21 may be one or more graphics processing units (graphics processing units, GPUs).
  • the GPU may be a single-core GPU or a multi-core GPU.
  • the processor 21 may be a processor group composed of multiple GPUs, and the multiple processors are coupled to each other through one or more buses.
  • the processor may also be a processor of other object types, etc., which is not limited in this embodiment of the present disclosure.
  • the memory 22 may be used to store computer program instructions, as well as various types of computer program code, including program code for implementing the disclosed aspects.
  • the memory includes, but is not limited to, random access memory (RAM), read-only memory (read-only memory, ROM), erasable programmable read-only memory (erasable programmable read only memory, EPROM) ), or a portable read-only memory (compact disc read-only memory, CD-ROM), which is used for related instructions and data.
  • RAM random access memory
  • ROM read-only memory
  • EPROM erasable programmable read only memory
  • CD-ROM compact disc read-only memory
  • the input device 23 is used for inputting data and/or signals
  • the output device 24 is used for outputting data and/or signals.
  • the input device 23 and the output device 24 may be independent devices or may be an integral device.
  • the memory 22 can not only be used to store related instructions, but also can be used to store related data.
  • the memory 22 can be used to store the first image to be processed obtained through the input device 23, or the memory 22 can also It can be used to store the speed of the first object obtained by the processor 21, etc., and the embodiment of the present disclosure does not limit the data specifically stored in the memory.
  • FIG. 7 only shows a simplified design of a speed measuring device.
  • the speed measuring device may also include other necessary components, including but not limited to any number of input/output devices, processors, memories, etc., and all speed measuring devices that can implement the embodiments of the present disclosure are included in the disclosure. within the scope of protection.
  • the disclosed system, apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned embodiments it may be implemented in whole or in part by software, hardware, firmware or any combination thereof.
  • software it can be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted over a computer-readable storage medium.
  • the computer instructions can be sent from a website site, computer, server, or data center via wired (eg, coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.) another website site, computer, server or data center for transmission.
  • the computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, or the like that includes an integration of one or more available media.
  • the available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, digital versatile disc (DVD)), or semiconductor media (eg, solid state disk (SSD)) )Wait.
  • the process can be completed by instructing the relevant hardware by a computer program, and the program can be stored in a computer-readable storage medium.
  • the program When the program is executed , which may include the processes of the foregoing method embodiments.
  • the aforementioned storage medium includes: read-only memory (read-only memory, ROM) or random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program codes.
  • the present disclosure discloses a speed measurement method and device, an electronic device and a storage medium.
  • the method includes: acquiring a first image to be processed and a second image to be processed; both the first image to be processed and the second image to be processed include a first object; processing the first position in the image, the second position of the first object in the second image to be processed, and the first transmission parameter of the first moving distance; according to the first moving distance, the first transmission parameters and moving time to obtain the speed of the first object; the moving time is obtained according to the timestamp of the first image to be processed and the timestamp of the second image to be processed.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Human Computer Interaction (AREA)
  • Image Analysis (AREA)

Abstract

一种测速方法及装置、电子设备及存储介质。该方法包括:获取第一待处理图像和第二待处理图像;所述第一待处理图像和所述第二待处理图像均包括第一对象;获取所述第一对象在所述第一待处理图像中的第一位置、所述第一对象在所述第二待处理图像中的第二位置和第一移动距离的第一透射参数;依据所述第一移动距离、所述第一透射参数和移动时间,得到所述第一对象的速度;所述移动时间依据所述第一待处理图像的时间戳和所述第二待处理图像的时间戳得到。

Description

测速方法及装置、电子设备及存储介质
相关申请的交叉引用
本公开基于申请号为202010613426.x、申请日为2020年06月30日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本公开作为参考。
技术领域
本公开涉及计算机技术领域,尤其涉及一种测速方法及装置、电子设备及存储介质。
背景技术
随着计算机视觉技术的发展,计算机视觉技术的应用越来越广,众多应用之中包括基于计算机视觉技术测量对象(比如,人和物)的移动速度。
在相关技术中,通过基于对象在图像中的移动距离和对象的移动时间,得到对象的移动速度。但由于图像中的移动距离与对象的物理移动距离之间存在较大的差异,导致得到对象的移动速度的精度低。
发明内容
本公开提供一种测速方法及装置、电子设备及存储介质。
第一方面,提供了一种测速方法,所述方法包括:
获取第一待处理图像和第二待处理图像;其中,所述第一待处理图像和所述第二待处理图像均包括第一对象;获取所述第一对象在所述第一待处理图像中的第一位置、所述第一对象在所述第二待处理图像中的第二位置和第一移动距离的第一透射参数;其中,所述第一移动距离为所述第一位置与所述第二位置之间的距离;所述第一透射参数表征所述第一移动距离与第一物理距离之间的转换关系;所述第一物理距离为所述第一移动距离对应的物理距离;所述第一物理距离与所述第一位置在所述第一待处理图像中的尺度呈负相关,和/或,所述第一物理距离与所述第二位置在所述第二待处理图像中的尺度呈负相关;依据所述第一移动距离、所述第一透射参数和移动时间,得到所述第一对象的速度;其中,所述移动时间依据所述第一待处理图像的时间戳和所述第二待处理图像的时间戳得到。
在该方面中,由于第一透射参数携带第一位置的尺度信息和/或第二位置的尺度信息。测速装置依据第一透射参数、第一移动距离和移动时间得到第一对象的速度,可提高速度的精度。
结合本公开任一实施方式,所述依据所述第一移动距离、所述第一透射参数和移动时间,得到所述第一对象的速度,包括:依据所述第一透射参数和所述第一移动距离,得到第二移动距离;依据所述第二移动距离和所述移动时间,得到所述速度。
结合本公开任一实施方式,所述获取所述第一移动距离的第一透射参数,包括:获取第三位置的第二透射参数;其中,所述第三位置为所述第一位置与所述第二位置连线上的位置;所述第二透射参数表征第一像素点的尺寸与第一物点的尺寸之间的转换关系;所述第一像素点为依据所述第三位置在所述第一待处理图像中确定的像素点,所述第一像素点或为依据所述第三位置在所述第二待处理图像中确定的像素点;所述第一物点为所述第一像素点对应的物点;第一比值与所述第一像素点在图像中的尺度呈负相关;所述第一比值为所述第一像素点的尺寸与所述第一物点的尺寸之间的比值;依据所述第二透射参数,得到所述第一透射参数;其中,所述第一透射参数与所述第二透射参数呈正相关。
结合本公开任一实施方式,所述第三位置为所述第一位置与所述的第二位置之间的中间位置。
结合本公开任一实施方式,所述获取第三位置的第二透射参数,包括:对所述第一待处理图像进行物体检测处理,得到第一物体框的位置和第二物体框的位置;其中,所述第一物体框包含第一物体;所述第二物体框包含第二物体;依据所述第一物体框的位置得到所述第一物体的第一尺寸,依据所述第二物体框的位置得到所述第二物体的第二尺寸;依据所述第一尺寸和第三尺寸得到第三透射参数,依据所述第二尺寸和第四尺寸得到第四透射参数;其中,所述第三尺寸为所述第一物体的物理 尺寸;所述第三透射参数表征第五尺寸与第六尺寸之间的转换关系;所述第五尺寸为第二像素点的尺寸;所述第二像素点在所述第一待处理图像中的位置依据所述第一物体框的位置确定;所述第六尺寸为所述第二像素点对应的物点的尺寸;所述第四尺寸为所述第二物体的物理尺寸;所述第四透射参数表征第七尺寸与第八尺寸之间的转换关系;所述第七尺寸为第三像素点的尺寸;所述第三像素点在所述第二待处理图像中的位置依据所述第二物体框的位置确定;所述第八尺寸为所述第三像素点对应的物点的尺寸;对所述第三透射参数和所述第四透射参数进行曲线拟合处理,得到所述第一待处理图像的透射参数图;第九尺寸与第十尺寸之间的转换关系依据所述透射参数图中的第一像素值确定;所述第九尺寸为所述第一待处理图像中的第四像素点的尺寸;所述第十尺寸为所述第四像素点对应的物点的尺寸;所述第一像素值为第五像素点的像素值;所述第五像素点为所述透射参数图中与所述第四像素点对应的像素点;依据所述透射参数图中与所述第三位置对应的像素值,得到所述第二透射参数。
结合本公开任一实施方式,在所述对所述第三透射参数和所述第四透射参数进行曲线拟合处理,得到所述待处理图像的透射参数图之前,所述方法还包括:获取置信度映射;其中,所述置信度映射表征物体类型与透射参数的置信度之间的映射;依据所述第一物体的物体类型和所述置信度映射,得到所述第三透射参数的第一置信度;所述对所述第三透射参数和所述第四透射参数进行曲线拟合处理,得到所述待处理图像的透射参数图,包括:依据所述第一置信度和所述第三透射参数,得到第五透射参数;其中,所述第五透射参数与所述第一置信度呈正相关;对所述第四透射参数和所述第五透射参数进行曲线拟合处理,得到所述透射参数图。
结合本公开任一实施方式,在所述依据所述第一物体的物体类型和所述置信度映射,得到所述第三透射参数的第一置信度之前,所述方法还包括:对所述第一物体框内的像素点区域进行特征提取处理,得到特征数据;依据所述特征数据,得到所述第一物体的分数;其中,所述分数与所述第一物体的尺寸的置信度呈正相关;所述依据所述第一物体的物体类型和所述置信度映射,得到所述第三透射参数的第一置信度,包括:依据所述第一物体的物体类型和所述置信度映射,得到所述第三透射参数的第二置信度;依据所述分数与所述第二置信度,得到所述第一置信度;其中,所述第一置信度与所述分数呈相关。
结合本公开任一实施方式,所述依据所述第一置信度和所述第三透射参数,得到第五透射参数,包括:确定所述第一置信度与所述第三透射参数的乘积,得到所述第五透射参数。
结合本公开任一实施方式,在所述对所述第四透射参数和所述第五透射参数进行曲线拟合处理,得到所述透射参数图之前,所述方法还包括:获取所述第一待处理图像的深度图像;依据所述深度图像,得到所述第二像素点的第一深度信息以及所述第三像素点的第二深度信息;依据所述第一深度信息和所述第五透射参数得到第一数据点,依据所述第二深度信息和所述第四透射参数得到第二数据点;所述对所述第四透射参数和所述第五透射参数进行曲线拟合处理,得到所述透射参数图,包括:对所述第一数据点和所述第二数据点进行曲线拟合处理,得到所述透射参数图。
结合本公开任一实施方式,所述第一待处理图像和所述第二待处理图像由同一成像设备采集得到,且所述成像设备在采集所述第一待处理图像的过程中的位姿与所述成像设备在采集所述第二待处理图像的过程中的位姿相同。
结合本公开任一实施方式,所述第一对象为人物对象;所述人物对象属于监测人群,所述方法还包括:在所述速度未超过安全速度阈值的情况下,获取所述成像设备的位置;向终端发送包含所述位置的告警指令;其中,所述告警指令用于指示所述终端输出所述监测人群的人群密度过大的告警信息。
第二方面,提供了一种测速装置,所述装置包括:第一获取单元,用于获取第一待处理图像和第二待处理图像;其中,所述第一待处理图像和所述第二待处理图像均包括第一对象;第二获取单元,用于获取所述第一对象在所述第一待处理图像中的第一位置、所述第一对象在所述第二待处理图像中的第二位置和第一移动距离的第一透射参数;其中,所述第一移动距离为所述第一位置与所述第二位置之间的距离;所述第一透射参数表征所述第一移动距离与第一物理距离之间的转换关系;所述第一物理距离为所述第一移动距离对应的物理距离;所述第一物理距离与所述第一位置在所述第一待处 理图像中的尺度呈负相关,和/或,所述第一物理距离与所述第二位置在所述第二待处理图像中的尺度呈负相关;第一处理单元,用于依据所述第一移动距离、所述第一透射参数和移动时间,得到所述第一对象的速度;其中,所述移动时间依据所述第一待处理图像的时间戳和所述第二待处理图像的时间戳得到。
结合本公开任一实施方式,所述第一处理单元,用于:依据所述第一透射参数和所述第一移动距离,得到第二移动距离;依据所述第二移动距离和所述移动时间,得到所述速度。
结合本公开任一实施方式,所述第二获取单元,用于:获取第三位置的第二透射参数;其中,所述第三位置为所述第一位置与所述第二位置连线上的位置;所述第二透射参数表征第一像素点的尺寸与第一物点的尺寸之间的转换关系;所述第一像素点为依据所述第三位置在所述第一待处理图像中确定的像素点,所述第一像素点或为依据所述第三位置在所述第二待处理图像中确定的像素点;所述第一物点为所述第一像素点对应的物点;第一比值与所述第一像素点在图像中的尺度呈负相关;所述第一比值为所述第一像素点的尺寸与所述第一物点的尺寸之间的比值;依据所述第二透射参数,得到所述第一透射参数;其中,所述第一透射参数与所述第二透射参数呈正相关。
结合本公开任一实施方式,所述第三位置为所述第一位置与所述的第二位置之间的中间位置。
结合本公开任一实施方式,所述第二获取单元,用于:对所述第一待处理图像进行物体检测处理,得到第一物体框的位置和第二物体框的位置;其中,所述第一物体框包含第一物体;所述第二物体框包含第二物体;依据所述第一物体框的位置得到所述第一物体的第一尺寸,依据所述第二物体框的位置得到所述第二物体的第二尺寸;依据所述第一尺寸和第三尺寸得到第三透射参数,依据所述第二尺寸和第四尺寸得到第四透射参数;其中,所述第三尺寸为所述第一物体的物理尺寸;所述第三透射参数表征第五尺寸与第六尺寸之间的转换关系;所述第五尺寸为第二像素点的尺寸;所述第二像素点在所述第一待处理图像中的位置依据所述第一物体框的位置确定;所述第六尺寸为所述第二像素点对应的物点的尺寸;所述第四尺寸为所述第二物体的物理尺寸;所述第四透射参数表征第七尺寸与第八尺寸之间的转换关系;所述第七尺寸为第三像素点的尺寸;所述第三像素点在所述第二待处理图像中的位置依据所述第二物体框的位置确定;所述第八尺寸为所述第三像素点对应的物点的尺寸;对所述第三透射参数和所述第四透射参数进行曲线拟合处理,得到所述第一待处理图像的透射参数图;第九尺寸与第十尺寸之间的转换关系依据所述透射参数图中的第一像素值确定;所述第九尺寸为所述第一待处理图像中的第四像素点的尺寸;所述第十尺寸为所述第四像素点对应的物点的尺寸;所述第一像素值为第五像素点的像素值;所述第五像素点为所述透射参数图中与所述第四像素点对应的像素点;依据所述透射参数图中与所述第三位置对应的像素值,得到所述第二透射参数。
结合本公开任一实施方式,所述第一获取单元,还用于在所述对所述第三透射参数和所述第四透射参数进行曲线拟合处理,得到所述待处理图像的透射参数图之前,获取置信度映射;其中,所述置信度映射表征物体类型与透射参数的置信度之间的映射;所述测速装置还包括:第二处理单元,用于依据所述第一物体的物体类型和所述置信度映射,得到所述第三透射参数的第一置信度;所述第二获取单元,用于:依据所述第一置信度和所述第三透射参数,得到第五透射参数;其中,所述第五透射参数与所述第一置信度呈正相关;
对所述第四透射参数和所述第五透射参数进行曲线拟合处理,得到所述透射参数图。
结合本公开任一实施方式,所述测速装置还包括:第三处理单元,用于在所述依据所述第一物体的物体类型和所述置信度映射,得到所述第三透射参数的第一置信度之前,对所述第一物体框内的像素点区域进行特征提取处理,得到特征数据;第四处理单元,用于依据所述特征数据,得到所述第一物体的分数;其中,所述分数与所述第一物体的尺寸的置信度呈正相关;所述第二处理单元,用于:依据所述第一物体的物体类型和所述置信度映射,得到所述第三透射参数的第二置信度;依据所述分数与所述第二置信度,得到所述第一置信度;其中,所述第一置信度与所述分数呈相关。
结合本公开任一实施方式,所述第二获取单元,用于:确定所述第一置信度与所述第三透射参数的乘积,得到所述第五透射参数。
结合本公开任一实施方式,所述第一获取单元,还用于在所述对所述第四透射参数和所述第五透 射参数进行曲线拟合处理,得到所述透射参数图之前,获取所述第一待处理图像的深度图像;所述第二获取单元,还用于:依据所述深度图像,得到所述第二像素点的第一深度信息以及所述第三像素点的第二深度信息;依据所述第一深度信息和所述第五透射参数得到第一数据点,依据所述第二深度信息和所述第四透射参数得到第二数据点;所述第二获取单元,还用于:对所述第一数据点和所述第二数据点进行曲线拟合处理,得到所述透射参数图。
结合本公开任一实施方式,所述第一待处理图像和所述第二待处理图像由同一成像设备采集得到,且所述成像设备在采集所述第一待处理图像的过程中的位姿与所述成像设备在采集所述第二待处理图像的过程中的位姿相同。
结合本公开任一实施方式,所述第一对象为人物对象;所述人物对象属于监测人群,所述第一获取单元,还用于在所述速度未超过安全速度阈值的情况下,获取所述成像设备的位置;所述测速装置还包括:发送单元,用于向终端发送包含所述位置的告警指令;其中,所述告警指令用于指示所述终端输出所述监测人群的人群密度过大的告警信息。
第三方面,提供了一种处理器,所述处理器用于执行如上述第一方面及其任意一种可能实现的方式的方法。
第四方面,提供了一种电子设备,包括:处理器、发送装置、输入装置、输出装置和存储器,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,在所述处理器执行所述计算机指令的情况下,所述电子设备执行如上述第一方面及其任意一种可能实现的方式的方法。
第五方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,所述计算机程序包括程序指令,在所述程序指令被处理器执行的情况下,使所述处理器执行如上述第一方面及其任意一种可能实现的方式的方法。
第六方面,提供了一种计算机程序产品,所述计算机程序产品包括计算机程序或指令,在所述计算机程序或指令在计算机上运行的情况下,使得所述计算机执行上述第一方面及其任一种可能的实现方式的方法。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开。
附图说明
为了更清楚地说明本公开实施例或背景技术中的技术方案,下面将对本公开实施例或背景技术中所需要使用的附图进行说明。
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。
图1为本公开实施例提供的一种人群图像示意图;
图2为本公开实施例提供的一种像素坐标系示意图;
图3为本公开实施例提供的一种测速方法的流程示意图;
图4为本公开实施例提供的另一种测速方法的流程示意图;
图5为本公开实施例提供的一种球门示意图;
图6为本公开实施例提供的一种测速装置的结构示意图;
图7为本公开实施例提供的一种测速装置的硬件结构示意图。
具体实施方式
为了使本技术领域的人员更好地理解本公开方案,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。
本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而 是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其他步骤或单元。
应当理解,在本公开中,“至少一个(项)”是指一个或者多个,“多个”是指两个或两个以上,“至少两个(项)”是指两个或三个及三个以上,“和/或”,用于描述关联对象的关联关系,表示可以存在三种关系,例如,“A和/或B”可以表示:只存在A,只存在B以及同时存在A和B三种情况,其中A,B可以是单数或者复数。字符“/”可表示前后关联对象是一种“或”的关系,是指这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b或c中的至少一项(个),可以表示:a,b,c,“a和b”,“a和c”,“b和c”,或“a和b和c”,其中a,b,c可以是单个,也可以是多个。字符“/”还可表示数学运算中的除号,例如,a/b=a除以b;6/3=2。“以下至少一项(个)”或其类似表达。
在本文中提及(实施例)意味着,结合实施例描述的特定特征、结构或特性可以包含在本公开的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。
首先对下文将要出现的一些概念进行定义。本公开实施例中,物点指真实世界下的点、物理距离指真实世界下的距离、物理尺寸指真实世界下的尺寸。
物点与图像中像素点对应。例如,使用相机对桌子进行拍摄得到图像A。桌子包括物点a,图像A中的像素点b由物点a成像得到,那么物点a与像素点b对应。
物理区域与图像中的像素点区域对应。例如,使用相机对篮球场进行拍摄得到图像B。图像A中的像素点区域c由篮球场成像得到,那么篮球场与像素点区域c对应。
本公开实施例中,近处的物体在图像中尺度大,远处的物体在图像中尺度小。本公开实施例中的“远”指图像中物体对应的真实物体与采集上述图像的成像设备之间的距离远,“近”指图像中物体对应的真实物体与采集上述图像的成像设备之间的距离近。
在图像中,像素点的尺度与该像素点对应的物点的尺寸呈正相关。具体而言,像素点在图像中的尺度越大,与该像素点对应的物点的尺寸就越大。例如,图像A包含像素点a和像素点b,其中,与像素点a对应的物点为物点1,与像素点b对应的物点为物点2。若像素点a在图像A中的尺度比像素点b在图像A中的尺度大,则物点1的尺寸比物点2的尺寸大。
在图像中,位置的尺度指在该位置处的物体的尺寸与该物体的物理尺寸之间的比值。例如,在图1中,由于人物A所处位置的尺度比人物B所处位置的尺度大,且人与人之间的尺寸差异较小(即不同人的物理尺寸之间的差异较小),人物A覆盖的像素点区域的面积比人物B覆盖的像素点区域的面积大。
本公开实施例中,图像中的位置均指图像的像素坐标下的位置。本公开实施例中的像素坐标系的横坐标用于表示像素点所在的列数,像素坐标系下的纵坐标用于表示像素点所在的行数。例如,在图2所示的图像中,以图像的左上角为坐标原点O、平行于图像的行的方向为X轴的方向、平行于图像的列的方向为Y轴的方向,构建像素坐标系为XOY。横坐标和纵坐标的单位均为像素点。例如,图2中的像素点A 11的坐标为(1,1),像素点A 23的坐标为(3,2),像素点A 42的坐标为(2,4),像素点A 34的坐标为(4,3)。
本公开实施例的执行主体为测速装置。在一些可能的实现方式中,测速装置可以是以下中的一种:手机、计算机、服务器、平板电脑。下面结合本公开实施例中的附图对本公开实施例进行描述。
下面结合本公开实施例中的附图对本公开实施例进行描述。请参阅图3,图3是本公开实施例提供的一种测速方法的流程示意图。
301、获取第一待处理图像和第二待处理图像,其中,上述第一待处理图像和上述第二待处理图像均包括第一对象。
本公开实施例中,第一待处理图像和第二待处理图像均可以包含任意内容。例如,第一待处理图像可以包含人物;第一待处理图像也可以包含道路和汽车人头。第二待处理图像可以包含人物;第二 待处理图像也可以包含动物。本公开对第一待处理图像所包含的内容和第二待处理图像所包含的内容不做限定。
本公开实施例中,第一对象可以是以下中的一种:人物、物体。例如,第一对象可以是人;第一对象也可以是汽车;第一对象还可以是动物。
第一待处理图像和第二待处理图像均包含第一对象。例如,第一待处理图像包含张三,第二待处理图像也包含张三。又例如,第一待处理图像和第二待处理图像均包含车辆a。
在一种获取第一待处理图像的实现方式中,测速装置接收用户通过输入组件输入的第一待处理图像。上述输入组件包括:键盘、鼠标、触控屏、触控板和音频输入器等。
在另一种获取第一待处理图像的实现方式中,测速装置接收第一终端发送的第一待处理图像。在一些可能的实现方式中,第一终端可以是以下任意一种:手机、计算机、平板电脑、服务器或可穿戴设备。
在又一种获取第一待处理图像的实现方式中,测速装置转载有摄像组件,其中,摄像组件包括摄像头。测速装置通过使用摄像组件采集图像获取第一待处理图像。
在又一种获取第一待处理图像的实现方式中,测速装置从获取到的视频流中选取一帧图像作为第一待处理图像。
在一种获取第二待处理图像的实现方式中,测速装置接收用户通过输入组件输入的第二待处理图像。上述输入组件包括:键盘、鼠标、触控屏、触控板和音频输入器等。
在另一种获取第二待处理图像的实现方式中,测速装置接收第二终端发送的第二待处理图像。在一些可能的实现方式中,第二终端可以是以下任意一种:手机、计算机、平板电脑、服务器或可穿戴设备。
在又一种获取第二待处理图像的实现方式中,测速装置转载有摄像组件,其中,摄像组件包括摄像头。测速装置通过使用摄像组件采集图像获取第二待处理图像。
在又一种获取第二待处理图像的实现方式中,测速装置从获取到的视频流中选取一帧图像作为第二待处理图像。
作为一种在一些可能的实现方式中实施方式,测速装置与监控摄像头之间具有通信连接。测速装置通过该通信连接获取监控摄像头采集到的监控视频流,并从该监控视频流中选取两帧图像,分别作为第一待处理图像和第二待处理图像。
302、获取上述第一对象在上述第一待处理图像中的第一位置、上述第一对象在上述第二待处理图像中的第二位置和第一移动距离的第一透射参数。
本公开实施例中,第一对象在第一待处理图像中的位置可以是包含第一对象的对象框在第一待处理图像中的位置;第一对象在第一待处理图像中的位置可以是第一对象所覆盖的像素点区域内的像素点在第一待处理图像中的位置。第一对象在第二待处理图像中的位置可以是包含第一对象的对象框在第二待处理图像中的位置;第一对象在第二待处理图像中的位置可以是第一对象所覆盖的像素点区域内的像素点在第二待处理图像中的位置。
本公开实施例中,第一移动距离为第一位置与第二位置之间的距离,即第一移动距离为像素坐标系下的距离。例如,第一位置为(3,5),即第一对象在第一待处理图像中的位置为(3,5);第二位置为(7,8),即第一对象在第二待处理图像中的位置为(7,8)。此时,第一移动距离为:
Figure PCTCN2020121491-appb-000001
本公开实施例中,物理距离(包括上述第一物理距离)指真实世界下的距离。第一移动距离对应的物理距离为第一物理距离。第一透射参数表征第一移动距离与第一物理距离之间的转换关系。例如,假设:第一待处理图像的时间戳为t 1,第二待处理图像的时间戳为t 2,第一对象为张三。若测速装置依据第一位置和第二位置得到的第一移动距离为d 1,测速装置使用第一透射参数可将d 1转换为,张三在t 1至t 2内在真实世界下的移动距离(即第一物理距离)。在一些可能的实现方式中,第一透射参数为第一移动距离与第一物理距离之间的比值。
本公开实施例中,第一物理距离与第一位置在第一待处理图像中的尺度呈负相关,和/或,第一物理距离与第二位置在第二待处理图像中的尺度呈负相关。该相关性关系包括以下至少一种情况:
(1)测速装置依据第一移动距离和第一透射参数得到的第一物理距离,与第一位置在第一待处理图像中的尺度呈负相关;
(2)测速装置依据第一移动距离和第一透射参数得到的第一物理距离,与第二位置在第二待处理图像中的尺度呈负相关;
(3)测速装置依据第一移动距离和第一透射参数得到的第一物理距离,与第一位置在第一待处理图像中的尺度呈负相关,且该第一物理距离与第二位置在第二待处理图像中的尺度呈负相关。
303、依据上述第一移动距离、上述第一透射参数和移动时间,得到上述第一对象的速度。
本公开实施例中,移动时间为第一对象的移动第一移动距离所消耗的时间。测速装置依据第一待处理图像的时间戳和第二待处理图像的时间戳,可得到的该移动时间。
在一种可能实现的方式中,将第一待处理图像的时间戳和第二待处理图像的时间戳中小的时间戳称为小时间戳,将第一待处理图像的时间戳和第二待处理图像的时间戳中大的时间戳称为大时间戳。移动时间的起始时间为小时间戳、移动时间的终止时间为大时间戳。例如,第一待处理图像的时间戳为2020年6月27日16点54分30秒,第二待处理图像的时间戳为2020年6月27日16点54分33秒。此时,小时间戳为2020年6月27日16点54分30秒,大时间戳为2020年6月27日16点54分33秒。
本公开实施例中,第一对象的速度为第一对象在真实世界下的速度。在一种得到第一对象的速度的实现方式中,测速装置依据第一透射参数和第一移动距离得到第一对象在真实世界下的移动距离(下文将称为第二移动距离)。测速装置依据第一物理移动距离和移动时间,可得到第一对象的速度。例如,假设第一透射参数表征第一移动距离与第一物理距离之间比值,第一透射参数为0.1厘米,第一移动距离为10,移动时间为0.5秒。测速装置依据下式可得到第二移动距离:10/0.1厘米=100厘米=1米。测速装置依据下式可得到第一对象在真实世界下的速度:1/0.5米/秒=2米/秒。
在另一种可能实现的方式中,测速装置依据第一移动距离和移动时间得到第一对象在图像中的速度(下文将称为虚拟速度)。测速装置依据虚拟速度和第一透射参数得到第一对象的在真实世界下的速度。
由于第一透射参数携带第一位置的尺度信息和/或第二位置的尺度信息。测速装置依据第一透射参数、第一移动距离和移动时间得到第一对象的速度,可提高速度的精度。
作为一种在一些可能的实现方式中实施方式,测速装置通过执行以下步骤获取第一透射参数:
1、获取第三位置的第二透射参数。
本公开实施例中,第三位置为第一位置与第二位置连线上的位置。应理解,虽然第一位置为第一待处理图像中的位置,第二位置为第二待处理图像中的位置,但由于在本公开实施例中,第一待处理图像的像素坐标系与第二待处理图像的像素坐标系相同,测速装置依据第一位置和第二位置,可确定像素坐标系下的第三位置。第三位置可以是第一待处理图像中的位置,第三位置也可以是第二待处理图像中的位置。例如,第一位置为(3,4),第二位置为(7,8)。假设第三位置为第一位置与第二位置的中间位置:(5,6)。此时,第三位置可表示第一待处理图像中处于第5行第6列的像素点,第三位置也表示第二待处理图像中处于第5行第6列的像素点。
本公开实施例中,测速装置可依据第三位置在第一待处理图像中确定像素点,测速装置也可以第三位置在第二待处理图像中确定像素点。将测速装置依据第三位置确定的像素点称为第一像素点,第二透射参数表征第一像素点的尺寸与第一物点的尺寸之间的转换关系,其中,第一物点为第一像素点对应的物点。例如,第二透射参数表征第一像素点的长与第一物点的长之间的转换关系。又例如,第二透射参数表征第一像素点的高与第一物点的高之间的转换关系。再例如,第二透射参数表征第一像素点的宽与第一物点的宽之间的转换关系。
将第一像素点的尺寸与第一物点的尺寸之间的比值称为第一比值,本公开实施例中,第一比值与第一像素点在图像中的尺度呈负相关。例如,第一像素点属于第一待处理图像,假设第一比值为第一 像素点的长与第一物点的比值,则第一像素点在第一待处理图像中的尺度越大,第一比值越小。考虑到第一待处理图像中任意两个像素点的长均相同,也就是说,第一像素点的长是不变的,那么第一像素点的尺度越大,第一物点的长就越小,即第一物点的尺寸与第一像素点的尺度呈负相关。
又例如,假设第一比值为第一像素点的长与第一物点的比值,第一像素点属于第二待处理图像,则第一像素点在第二待处理图像中的尺度越大,第一比值越小。考虑到第二待处理图像中任意两个像素点的长均相同,也就是说,第一像素点的长是不变的,那么第一像素点的尺度越大,第一物点的长就越小,即第一物点的尺寸与第一像素点的尺度呈负相关。
由上可知,由于第一物点的尺寸依据第一像素点的尺寸和第二透射参数得到,而第一像素点的尺寸为定值,第二透射参数携带第一像素点的尺度信息。在一种获取第三位置的第二透射参数的实现方式中,测速装置接收用户通过输入组件输入的第二透射参数。上述输入组件包括:键盘、鼠标、触控屏、触控板和音频输入器等。
在另一种获取第三位置的第二透射参数的实现方式中,测速装置接收第三终端发送的第二透射参数。在一些可能的实现方式中,第三终端可以是以下任意一种:手机、计算机、平板电脑、服务器、可穿戴设备。第三终端与第一终端可以相同,也可以不同。
2、依据上述第二透射参数,得到上述第一透射参数。
在一种可能实现的方式中,像素点的尺度与像素点的横坐标线性相关,和/或,像素点的尺度与像素点的纵坐标线性相关。第三位置的尺度与第一位置的尺度呈线性相关,和/或,第三位置的尺度与第二位置的尺度呈线性相关。因此,测速装置可依据第一位置与第二位置的中间位置的透射参数确定第一移动距离的透射参数,即依据第二透射参数确定第一透射参数。作为一种在一些可能的实现方式中实施方式,第三位置为第一位置与第二位置之间的中间位置。
本公开实施例中,第一透射参数与第二透射参数呈正相关。假设第一透射参数为b 1,第二透射参数为b 2,在一种可能实现的方式中,b 1、b 2满足公式(1):
b 2=k×b 1     (1);
其中,k为正数。在一些可能的实现方式中,k=1。
在另一种可能实现的方式中,b 1、b 2满足公式(2):
b 2=k×b 1+c     (2);
其中,k为正数、c为实数。在一些可能的实现方式中,k=1,c=0。
在又一种可能实现的方式中,b 1、b 2满足公式(3):
Figure PCTCN2020121491-appb-000002
其中,k为正数、c为实数。在一些可能的实现方式中,k=1,c=0。
请参阅图4,图4是本公开实施例提供的步骤1的一种可能实现的方法的流程示意图。
401、对上述第一待处理图像进行物体检测处理,得到第一物体框的位置和第二物体框的位置。
本公开实施例中,物体检测处理的检测对象的尺寸处于确定值附近的物体。例如,人脸的平均长度为20厘米,物体检测处理的检测对象可以为人脸。又例如,人的平均身高为1.65米,物体检测处理的检测对象可以为人体。再例如,在足球场内,图5所示的球门的高度均为确定的(如2.44米),物体检测处理的检测对象可以为球门。
本公开实施例中,物体框可以是任意形状,本公开对物体框(包括上述第一物体框和第二物体框)的形状不做限定。在一些可能的实现方式中,物体框的形状包括以下至少一种:矩形、菱形、圆形、 椭圆形、多边形。
本公开实施例中,物体框的位置(包括上述第一物体框的位置和上述第二物体框的位置)用于确定物体框所包含的像素点区域,即物体框在待处理图像中的位置。例如,在物体框的形状为矩形的情况下,物体框的位置可以包括矩形中任意一对对角的坐标,其中,一对对角指过矩形的对角线上的两个顶点。又例如,在物体框的形状为矩形的情况下,物体框的位置可以包括:矩形的几何中心的位置、矩形的长和矩形的宽。再例如,在体框的形状为圆形的情况下,物体框的位置可以包括:物体框的圆心的位置、物体框的半径。
本公开实施例中,物体检测处理的检测对象的数量不少于1。例如,在检测对象为人脸的情况下,通过对待处理图像进行物体检测处理,可得到包含人脸的人脸框的位置。又例如,在检测对象包括人脸和人体的情况下,通过对待处理图像进行物体检测处理,可得到包含人脸的人脸框的位置和包含人体的人体框的位置。再例如,在检测对象包括人脸、人体和螺钉的情况下,通过对待处理图像进行物体检测处理,可得到包含人脸的人脸框的位置、包含人体的人体框的位置和包含螺钉的螺钉框的位置。在一些可能的实现方式中,物体检测处理的检测对象包括以下至少一个:人脸、人脚、人体、螺钉、球门。
在一种可能实现的方式中,对待处理图像进行物体检测处理可通过卷积神经网络实现。通过将带有标注信息的图像作为训练数据,对卷积神经网络进行训练,使训练后的卷积神经网络可完成对图像的物体检测处理。训练数据中的图像的标注信息为物体框的位置信息,该物体框包含物体检测处理的检测对象。
在另一种可能实现的方式中,物体检测处理可通过物体检测算法实现,其中,物体检测算法可以是以下中的一种:只需一眼算法(you only look once,YOLO)、目标检测算法(deformable part model,DMP)、单张图像多目标检测算法(single shot multiBox detector,SSD)、Faster-RCNN算法等等,本公开对实现物体检测处理的物体检测算法不做限定。
测速装置通过对第一待处理图像进行物体检测处理,得到包含第一物体的第一物体框的位置以及包含第二物体的第二物体框的位置。第一物体框所包含的检测对象与第二物体框所包含的检测对象不同。例如,第一物体框所包含的检测对象为张三的人脸,第二物体框所包含的检测对象为李四的人脸。又例如,第一物体框所包含的检测对象为张三的人脸,第二物体框所包含的检测对象为指示牌。
402、依据所述第一物体框的位置得到第一物体的第一尺寸,依据所述第二物体框的位置得到第二物体的第二尺寸。
测速装置依据物体框的位置可确定物体框所包含的检测对象的尺寸。例如,在物体框的形状为矩形的情况下,测速装置依据物体框的位置可确定物体框的长和宽,进而确定物体框内的检测对象的长和宽。
测速装置依据第一物体框的位置可得到第一物体的第一尺寸,依据第二物体框的位置得到第二物体的第二尺寸。
403、依据上述第一尺寸和第三尺寸得到第三透射参数,依据上述第二尺寸和第四尺寸得到第四透射参数。
本公开实施例中,第三尺寸为第一物体的物理尺寸,第四尺寸为第二物体的物理尺寸。例如,第一物体框所包含的检测对象为人体,则第三尺寸可以是人的身高(如170厘米)。又例如,第二物体框所包含的检测对象为人脸,第三尺寸可以是人脸的长度(如20厘米)。
测速装置依据第一物体框的位置可在第一待处理图像中确定一个像素点(即第二像素点)。例如,在第一物体框的形状为矩形的情况下,测速装置依据第一物体框的位置确定第一物体框的几何中心的位置,并将几何中心对应的像素点作为第二像素点。又例如,在第一物体框的形状为矩形的情况下,测速装置依据第一物体框的位置确定第一物体框的任意一个顶点的位置,并将该顶点对应的像素点作为第二像素点。再例如,在第一物体框的形状为圆形的情况下,测速装置依据第一物体框的位置确定第一物体框的圆心的位置,并将圆心对应的像素点作为第二像素点。同理,测速装置可依据第二物体框的位置在第一待处理图像中确定一个像素点,即第三像素点。
本公开实施例中,将第二像素点的尺寸称为第五尺寸,将第二像素点对应的物点的尺寸称为第六尺寸,将第三像素点的尺寸称为第七尺寸,将第三像素点对应的物点的尺寸称为第八尺寸。将第五尺寸与第六尺寸之间的转换关系称为第三透射参数,将第七尺寸与第八尺寸之间的转换关系称为第四透射参数。
测速装置可依据第一尺寸和第三尺寸得到第三透射参数,并可依据第二尺寸和第四尺寸得到第四透射参数。假设第一尺寸为s 1,第二尺寸为s 2,第三尺寸为s 3,第四尺寸为s 4,第三透射参数为b 3,第四透射参数为b 4
在一种可能实现的方式中,s 1、s 3、b 3满足公式(4):
b 3=r×s 1/s 3      (4);
s 2、s 4、b 4满足公式(5):
b 4=r×s 2/s 4    (5);
其中,r为正数。在一些可能的实现方式中,r=1。
在另一种可能实现的方式中,s 1、s 3、b 3满足公式(6):
b 3=r×s 1/s 3+c   (6);
s 2、s 4、b 4满足公式(7):
b 4=r×s 2/s 4+c    (7);
其中,r为正数,c为实数。在一些可能的实现方式中,r=1,c=0。
在又一种可能实现的方式中,s 1、s 3、b 3满足公式(8):
Figure PCTCN2020121491-appb-000003
s 2、s 4、b 4满足公式(9):
Figure PCTCN2020121491-appb-000004
其中,r为正数,c为实数。在一些可能的实现方式中,r=1,c=0。
404、对上述第三透射参数和上述第四透射参数进行曲线拟合处理,得到上述第一待处理图像的透射参数图。
由于在第一待处理图像中,像素点的尺度与像素点的横坐标线性相关,和/或,像素点的尺度与像素点的纵坐标线性相关,测速装置通过对第三透射参数和第四透射参数进行曲线拟合处理,可得到第一待处理图像的透射参数图。依据透射参数图中的像素值,可确定第一待处理图像中任意一个像素点的透射参数。
以透射参数图中的第五像素点为例。假设第五像素点的像素值为第一像素值,第五像素点在透射 参数图中的位置与第四像素点在第一待处理图像中的位置相同,即第五像素点为第一透射参数图中与第四像素点对应的像素点。则测速装置可依据第一像素值,确定第四像素点的尺寸(即第九尺寸)与第十尺寸之间的转换关系,其中,第十尺寸为第四像素点对应的物点的尺寸。
假设第一像素值为p 1,第九尺寸为s 5,第十尺寸为s 6。在一种可能实现的方式中,p 1、s 5、s 6满足公式(10):
p 1=μ×s 5/s 6   (10);
其中,μ为正数。在一些可能的实现方式中,μ=1。
在另一种可能实现的方式中,p 1、s 5、s 6满足公式(11):
p 1=μ×s 5/s 6+y  (11);
其中,μ为正数,y为实数。在一些可能的实现方式中,μ=1,y=0。
在又一种可能实现的方式中,p 1、s 5、s 6满足公式(12):
Figure PCTCN2020121491-appb-000005
其中,μ为正数,y为实数。在一些可能的实现方式中,μ=1,y=0。。
同理,测速装置可依据透射参数图确定第一待处理图像中除第四像素点之外的任意一个像素点的透射参数。
405、依据上述透射参数图和上述第三位置在上述待处理图像中的位置,得到上述第二透射参数。
在第三位置表示第一待处理图像中的位置的情况下,测速装置可依据第三位置从透射参数图中确定参考像素值,其中,参考像素值对应的像素点在透射参数图中的位置与第三位置相同。测速装置进而可依据参考像素值,得到第二透射参数。
本公开实施例中,测速装置依据第一尺寸和第三尺寸得到第三透射参数,依据第二尺寸和第四尺寸得到第四透射参数。通过对第三透射参数和第四透射参数进行曲线拟合处理,得到透射参数图,进而可依据透射参数图确定第一待处理图像中任意一个像素点的透射参数。
应理解,在第三位置表示第二待处理图像中的位置的情况下,测距装置可通过对第二待处理图像进行物体检测处理,以得到第二待处理图像的透射参数图。进而确定第二透射参数。
作为一种在一些可能的实现方式中实施方式中,在执行步骤404之前,测速装置还执行以下步骤:
3、获取置信度映射。
本公开实施例中,像素点的透射参数的精度与该像素点对应的物点的尺寸的精度呈正相关,相应的,透射参数图的精度与第一物体的尺寸的精度和第二物体的尺寸呈正相关。
显然,具有固定尺寸的物体的尺寸的精度高于尺寸处于浮动区间的物体的尺寸的精度。
例如,标准足球球门的宽度为7.32米、高度为2.44米。90%的人的身高处于1.4米~2米之间。足球球门的尺寸的精度高于人的身高的精度。
又例如,标准篮球架的高度为3.05米。95%的人脸的长度处于17厘米~30厘米之间。篮球架的高度的精度高于人脸的长度的精度。
再例如,具有固定长度的螺钉。95%的人的脚长处于20厘米~35厘米之间。具有固定长度的螺钉的长度的精度高于人脚的精度。
在一些可能的实现方式中,上述具有固定尺寸的物体可以是,在特定场景下具有固定尺寸的物体。例如,候机室内的登机指示牌。又例如,体育馆内的椅子。再例如,办公室内的办公桌。
本公开实施例中,置信度映射表征物体类型与透射参数的置信度之间的映射。例如,该置信度映射可参见表1。
物体类型 置信度
球门、篮球架、登机指示牌 0.9
人体 0.8
人脸 0.7
人脚 0.65
表1
在一种获取置信度映射的实现方式中,测速装置接收用户通过输入组件输入的置信度映射。上述输入组件包括:键盘、鼠标、触控屏、触控板和音频输入器等。
在另一种获取置信度映射的实现方式中,测速装置接收第四终端发送的置信度映射。在一些可能的实现方式中,第四终端可以是以下任意一种:手机、计算机、平板电脑、服务器、可穿戴设备。第四终端与第一终端可以相同,也可以不同。
4、依据上述第一物体的物体类型和上述置信度映射,得到上述第三透射参数的第一置信度。
在测速装置获取到置信度映射后,可依据置信度映射和第一物体的物体类型,得到第三透射参数的第一置信度。例如,假设置信度映射为上述表1,第一物体的物体类型为人体。此时,第一置信度为0.9。
在一些可能的实现方式中,测速装置可通过对第一物体框所包含的像素点区域进行特征提取处理,以确定第一物体的物体类型。
作为一种在一些可能的实现方式中实时方式,测速装置可分别依据每个物体框内的物体的物体类型,确定每个物体框内的物体对应的透射参数。例如,测速装置可依据第二物体的物体类型和置信度映射,得到第四透射参数的置信度(在本申请实施例中将称为第三置信度)。
在得到第一置信度后,测速装置在执行步骤404的过程中执行以下步骤:
5、依据上述第一置信度和上述第三透射参数,得到第五透射参数。
本公开实施例中,第五透射参数与第一置信度呈正相关。假设第一置信度为c 1,第五透射参数为b 5。在一种可能实现的方式中,c 1、b 5满足公式(13):
b 5=a×c 1  (13);
其中,a为正数。在一些可能的实现方式中,a=1。
在另一种可能实现的方式中,c 1、b 5满足公式(14):
b 5=a×c 1+e  (14);
其中,a为正数、e为实数。在一些可能的实现方式中,a=1,e=0。
在又一种可能实现的方式中,c 1、b 5满足公式(15):
Figure PCTCN2020121491-appb-000006
其中,a为正数、e为实数。在一些可能的实现方式中,a=1,e=0。
6、对上述第四透射参数和上述第五透射参数进行曲线拟合处理,得到上述透射参数图。
测速装置通过对第四透射参数和第五透射参数进行曲线拟合处理,可提高透射参数图的精度。
作为一种在一些可能的实现方式中实施方式,在测速装置通过执行步骤4得到第三置信度,并依据第三置信度和第四透射参数得到第六透射参数的情况下,测速装置可通过对第五透射参数和第六透射参数进行曲线拟合处理,得到透射参数图。
应理解,在第三位置表示第二待处理图像中的位置的情况下,测距装置可基于置信度映射得到第二待处理图像的透射参数图,以提高第二待处理图像的透射参数图的精度。
作为一种在一些可能的实现方式中实施方式,在执行步骤4之前,测速装置还执行以下步骤:
7、对上述第一物体框内的像素点区域进行特征提取处理,得到特征数据。
本公开实施例中,特征提取处理可以是卷积处理,也可以是池化处理,还可以是卷积处理和池化处理的结合。在一些可能的实现方式中,特征提取处理可通过已训练的卷积神经网络实现,也可通过特征提取模型实现,本公开对此不做限定。
测速装置通过对物体框内的像素点区域进行特征提取处理,可提取出物体框内的像素点区域中的语义信息,得到物体框的特征数据。
在一种对第一物体框内的像素点区域进行特征提取处理的实现方式中,通过至少两层卷积层对第一物体框内的像素点区域逐层进行卷积处理,完成对第一物体框内的像素点区域的特征提取处理。至少两层卷积层中的卷积层依次串联,即上一层卷一层的输出为下一层卷积层的输入,每层卷积层提取出的语义信息均不一样。具体表现为,特征提取处理一步步地将第一物体框内的像素点区域的特征抽象出来,同时也将逐步丢弃相对次要的特征数据,其中,相对次要的特征信息指,除可用于确定第一物体框的物体的物体类型的特征信息之外的特征信息。因此,越到后面提取出的特征数据的尺寸越小,但语义信息越浓缩。通过多层卷积层逐级对第一物体框内的像素点区域进行卷积处理,可得到第一物体框内的像素点区域的语义信息。
在一些可能的实现方式中,测速装置可分别对每个物体框内的像素点区域进行特征提取处理,得到每个物体框内的像素点区域的特征数据。
8、依据上述特征数据,得到上述第一物体的分数。
考虑到不具有固定尺寸的物体的实际尺寸可能会改变,本公开实施例中,依据物体的特征数据确定物体的状态,进而得到用于表征物体的尺寸的置信度的分数,其中,物体的分数与该物体的尺寸的置信度呈正相关。
例如,假设物体为人体、物体的尺寸为人的身高。在人处于笔直站立状态的情况下,人的高度与该人的真实身高相等,此时,人的身高的置信度最高;在人处于行走的状态下,人的高度与该人的真实身高之间存在较小误差,此时,人的身高的置信度次之;在人处于低头的状态下(如低头看手机),人的高度与该人的真实身高之间存在较小误差,此时,人的身高的置信度比行走状态下的人的身高的置信度低;在人坐着的情况下,人的高度与该人的真实身高之间存在较大误差,此时,人的身高的置信度较低。
本公开实施例中,测速装置可依据从物体框内的像素点区域中提取出的特征数据,确定物体框内的物体的分数。
作为一种在一些可能的实现方式中实施方式,测速装置可使用分类器(如支持向量机、softmax函数)对物体框的特征数据进行处理,得到物体框内的物体的分数。
在一些可能的实现方式中,测速装置可使用神经网络对物体框内的像素点区域进行处理,得到物体框内的物体的分数。例如,测速装置使用已标注图像集作为训练数据,对神经网络进行训练,得到训练后的神经网络。使用训练后的神经网络对未标注图像集进行处理,得到未标注图像集的标签。使用已标注图像集、未标注图像集、未标注图像集的标签对训练后的神经网络进行训练,得到图像处理神经网络。其中,标签携带的信息包括包含图像中的物体框的位置以及物体框内的物体的分数。
测速装置依据第一物体的特征数据可得到第一物体的分数。在一些可能的实现方式中,测速装置可分别得到第一待处理图像中每个物体的分数。
在得到第一物体的分数的情况下,测速装置在执行步骤4的过程执行以下步骤:
9、依据上述第一物体的物体类型和上述置信度映射,得到上述第三透射参数的第二置信度。
本步骤的实现过程可参见步骤4,但在本步骤中,测速装置依据第一物体的物体类型和置信度映射,得到的不是第一置信度而是第二置信度。
10、依据上述分数与上述第二置信度,得到上述第一置信度。
本公开实施例中,第一置信度与分数呈相关。假设第一置信度为c 1,第二置信度为c 2,分数为s。在一种可能实现的方式中,c 1、c 2、s满足公式(16):
c 2=α×s×c 1  (16);
其中,α为正数。在一些可能的实现方式中,α=1。
在另一种可能实现的方式中,c 1、c 2、s满足公式(17):
c 2=α×s×c 1+σ  (17);
其中,α为正数、σ为实数。在一些可能的实现方式中,α=1,σ=0。
在又一种可能实现的方式中,c 1、c 2、s满足公式(18):
Figure PCTCN2020121491-appb-000007
其中,α为正数、σ为实数。在一些可能的实现方式中,α=1,σ=0。
测速装置依据第一物体的分数和第二置信度,得到第一置信度,可提高第一置信度的精度。
在一些可能的实现方式中,测速装置通过执行步骤9可得到第四透射参数的第四置信度,测速装置可依据第二物体的分数和第四置信度,得到上述第三置信度。
作为一种在一些可能的实现方式中实施方式,在执行步骤6之前,测速装置还执行以下步骤:
11、获取上述第一待处理图像的深度图像。
本公开实施例中,第一待处理图像的深度图像携带第一待处理图像中的像素点的深度信息。在一种可能实现的方式中,测速装置接收用户通过输入组件输入的深度图像。上述输入组件包括:键盘、鼠标、触控屏、触控板和音频输入器等。
在另一种可能实现的方式中,测速装置装载有RGB摄像头和深度摄像头。测速装置在使用RGB摄像头采集第一待处理图像的过程中,使用深度摄像头采集第一待处理图像的深度图像。其中,深度摄像头可以是以下任意一种:结构光(structured light)摄像头、TOF摄像头、双目立体视觉(binocular stereo vision)摄像头。
在又一种可能实现的方式中,测速装置接收第五终端发送的深度图像,其中,第五终端包括手机、计算机、平板电脑、服务器等。本实施例中,第五终端与第一终端可以相同,也可以不同。
12、依据上述深度图像,得到上述第二像素点的第一深度信息以及上述第三像素点的第二深度信息。
如上所述,深度图像携带第一待处理图像中的像素点的深度信息。测速装置在获取到深度图像后,可依据深度图像确定第二像素点的深度信息(即第一深度信息)以及第三像素点的深度信息(即第二深度信息)。
13、依据上述第一深度信息和上述第五透射参数得到第一数据点,依据上述第二深度信息和上述第四透射参数得到第二数据点。
在一种可能实现的方式中,第一数据点的横坐标为第一深度信息,第二数据点的横坐标为第二深度信息,第一数据点的纵坐标为第五透射参数,第二数据点的纵坐标为第四透射参数。即测速装置将 像素点的深度信息作为横坐标,将像素点的透射参数作为纵坐标。
在一种可能实现的方式中,第一数据点的纵坐标为第一深度信息,第二数据点的纵坐标为第二深度信息,第一数据点的横坐标为第五透射参数,第二数据点的横坐标为第四透射参数。即测速装置将像素点的深度信息作为纵坐标,将像素点的透射参数作为横坐标。
在得到第一数据点和第二数据点之后,测速装置在执行步骤6的过程中执行以下骤:
14、对上述第一数据点和上述第二数据点进行曲线拟合处理,得到上述透射参数图。
由于第一数据点和第二数据点均携带像素点的深度信息。测速装置通过对第一数据点和第二数据点进行曲线拟合处理,得到的透射参数图也携带深度信息。
因为依据像素点的深度信息确定像素点在第一待处理图像中的尺度,可提高像素点在第一待处理图像中的尺度的精度,所以测速装置通过执行步骤14得到透射参数图,可提高透射参数图的精度,进而可提高第一待处理图像中的像素点的透射参数的精度,从而提高第一对象的速度的精度。
应理解,在第三位置表示第二待处理图像中的位置的情况下,测速装置可基于第二待处理图像的深度图,得到第二待处理图像的透射参数图,从而提高第一对象的速度的精度。
作为一种在一些可能的实现方式中实施方式,第一待处理图像和第二待处理图像由同一成像设备采集得到,且成像设备在采集第一待处理图像的过程中的位姿与成像设备在采集第二待处理图像的过程中的位姿相同。这样,第一待处理图像和第二待处理图像中相同位置的像素点的尺度相同。例如,像素点a属于第一待处理图像,像素点b属于第二待处理图像,且像素点a在第一待处理图像中的位置与像素点b在第二待处理图像中的位置相同。则像素点a在第一待处理图像中的尺度与像素点b在第二待处理图像中的尺度相同。在一些可能的实现方式中,成像设备为监控摄像头。
基于本公开实施例提供的技术方案,本公开实施例还提供了一种可能的应用场景。
如上所述,在公共场所常因人流量过多导致人群过于密集的情况的发生,进而发生一些公共事故,如何确定公共场所的人群密度就具有非常大的意义。
在相关技术中,为了增强工作、生活或者社会环境中的安全性,会在各个公共场所内安装监控摄像设备,以便根据视频流信息进行安全防护。使用本公开实施例提供的技术方案对监控摄像设备采集到的视频流进行处理,可确定公共场所的人数密度,进而可有效预防公共事故的发生。
作为一种在一些可能的实现方式中实施方式,上述第一对象为人物对象,该人物对象属于监测人群,其中,监测人群指监控摄像头的监控画面中的人群。在人群密度的情况下,人与人之间的距离较小,进而导致人的移动速度较慢。因此,可通过第一对象的速度判断监测人群的人群密度是否过大。
在一种可能实现的方式中,第一对象的速度未超过安全速度阈值的情况下,测速装置确定监测人群的人群密度过大。测速装置进而获取成像设备的位置(成像设备的位置携带以下至少一个信息:成像设备的编号、成像设备的经纬度信息),并向相关管理人员的终端发送包含该位置的告警指令,以提示管理人员监测人群的人群密度过大,从而降低公共安全事故发生的概率。
在一些可能的实现方式中,告警指令可指示终端通过以下至少一种方式输出监测人群的人群密度过大的告警信息:光、语音、文字和震动。
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。
上述详细阐述了本公开实施例的方法,下面提供了本公开实施例的装置。
请参阅图6,图6为本公开实施例提供的一种测速装置的结构示意图,该测速装置包括:第一获取单元11、第二获取单元12、第一处理单元13,其中:第一获取单元11,用于获取第一待处理图像和第二待处理图像;其中,所述第一待处理图像和所述第二待处理图像均包括第一对象;第二获取单元12,用于获取所述第一对象在所述第一待处理图像中的第一位置、所述第一对象在所述第二待处理图像中的第二位置和第一移动距离的第一透射参数;其中,所述第一移动距离为所述第一位置与所述第二位置之间的距离;所述第一透射参数表征所述第一移动距离与第一物理距离之间的转换关系;所述第一物理距离为所述第一移动距离对应的物理距离;所述第一物理距离与所述第一位置在所述第一待处理图像中的尺度呈负相关,和/或,所述第一物理距离与所述第二位置在所述第二待处理图像 中的尺度呈负相关;第一处理单元13,用于依据所述第一移动距离、所述第一透射参数和移动时间,得到所述第一对象的速度;其中,所述移动时间依据所述第一待处理图像的时间戳和所述第二待处理图像的时间戳得到。
结合本公开任一实施方式,所述第一处理单元13,用于:
依据所述第一透射参数和所述第一移动距离,得到第二移动距离;
依据所述第二移动距离和所述移动时间,得到所述速度。
结合本公开任一实施方式,所述第二获取单元12,用于:
获取第三位置的第二透射参数;所述第三位置为所述第一位置与所述第二位置连线上的位置;其中,所述第二透射参数表征第一像素点的尺寸与第一物点的尺寸之间的转换关系;所述第一像素点为依据所述第三位置在所述第一待处理图像中确定的像素点,所述第一像素点或为依据所述第三位置在所述第二待处理图像中确定的像素点;所述第一物点为所述第一像素点对应的物点;第一比值与所述第一像素点在图像中的尺度呈负相关;所述第一比值为所述第一像素点的尺寸与所述第一物点的尺寸之间的比值;
依据所述第二透射参数,得到所述第一透射参数;其中,所述第一透射参数与所述第二透射参数呈正相关。
结合本公开任一实施方式,所述第三位置为所述第一位置与所述的第二位置的中间位置。
结合本公开任一实施方式,所述第二获取单元12,用于:
对所述第一待处理图像进行物体检测处理,得到第一物体框的位置和第二物体框的位置;所述第一物体框包含第一物体;其中,所述第二物体框包含第二物体;
依据所述第一物体框的位置得到所述第一物体的第一尺寸,依据所述第二物体框的位置得到所述第二物体的第二尺寸;
依据所述第一尺寸和第三尺寸得到第三透射参数,依据所述第二尺寸和第四尺寸得到第四透射参数;其中,所述第三尺寸为所述第一物体的物理尺寸;所述第三透射参数表征第五尺寸与第六尺寸之间的转换关系;所述第五尺寸为第二像素点的尺寸;所述第二像素点在所述第一待处理图像中的位置依据所述第一物体框的位置确定;所述第六尺寸为所述第二像素点对应的物点的尺寸;所述第四尺寸为所述第二物体的物理尺寸;所述第四透射参数表征第七尺寸与第八尺寸之间的转换关系;所述第七尺寸为第三像素点的尺寸;所述第三像素点在所述第二待处理图像中的位置依据所述第二物体框的位置确定;所述第八尺寸为所述第三像素点对应的物点的尺寸;
对所述第三透射参数和所述第四透射参数进行曲线拟合处理,得到所述第一待处理图像的透射参数图;第九尺寸与第十尺寸之间的转换关系依据所述透射参数图中的第一像素值确定;所述第九尺寸为所述第一待处理图像中的第四像素点的尺寸;所述第十尺寸为所述第四像素点对应的物点的尺寸;所述第一像素值为第五像素点的像素值;所述第五像素点为所述透射参数图中与所述第四像素点对应的像素点;
依据所述透射参数图中与所述第三位置对应的像素值,得到所述第二透射参数。
结合本公开任一实施方式,所述第一获取单元11,还用于在所述对所述第三透射参数和所述第四透射参数进行曲线拟合处理,得到所述待处理图像的透射参数图之前,获取置信度映射;所述置信度映射表征物体类型与透射参数的置信度之间的映射;
所述测速装置还包括:第二处理单元14,用于依据所述第一物体的物体类型和所述置信度映射,得到所述第三透射参数的第一置信度;所述第二获取单元12,用于:依据所述第一置信度和所述第三透射参数,得到第五透射参数;其中,所述第五透射参数与所述第一置信度呈正相关;对所述第四透射参数和所述第五透射参数进行曲线拟合处理,得到所述透射参数图。
结合本公开任一实施方式,所述测速装置1还包括:第三处理单元15,用于在所述依据所述第一物体的物体类型和所述置信度映射,得到所述第三透射参数的第一置信度之前,对所述第一物体框内的像素点区域进行特征提取处理,得到特征数据;第四处理单元16,用于依据所述特征数据,得到所述第一物体的分数;其中,所述分数与所述第一物体的尺寸的置信度呈正相关;所述第二处理单 元14,用于:依据所述第一物体的物体类型和所述置信度映射,得到所述第三透射参数的第二置信度;依据所述分数与所述第二置信度,得到所述第一置信度;其中,所述第一置信度与所述分数呈相关。
结合本公开任一实施方式,所述第二获取单元12,用于:确定所述第一置信度与所述第三透射参数的乘积,得到所述第五透射参数。
结合本公开任一实施方式,所述第一获取单元,还用于在所述对所述第四透射参数和所述第五透射参数进行曲线拟合处理,得到所述透射参数图之前,获取所述第一待处理图像的深度图像;所述第二获取单元12,还用于:依据所述深度图像,得到所述第二像素点的第一深度信息以及所述第三像素点的第二深度信息;依据所述第一深度信息和所述第五透射参数得到第一数据点,依据所述第二深度信息和所述第四透射参数得到第二数据点;所述第二获取单元12,还用于:对所述第一数据点和所述第二数据点进行曲线拟合处理,得到所述透射参数图。
结合本公开任一实施方式,所述第一待处理图像和所述第二待处理图像由同一成像设备采集得到,且所述成像设备在采集所述第一待处理图像的过程中的位姿与所述成像设备在采集所述第二待处理图像的过程中的位姿相同。
结合本公开任一实施方式,所述第一对象为人物对象;所述人物对象属于监测人群,所述第一获取单元11,还用于在所述速度未超过安全速度阈值的情况下,获取所述成像设备的位置;所述测速装置还包括:发送单元17,用于向终端发送包含所述位置的告警指令;其中,所述告警指令用于指示所述终端输出所述监测人群的人群密度过大的告警信息。
本实施中,由于第一透射参数携带第一位置的尺度信息和/或第二位置的尺度信息。测速装置依据第一透射参数、第一移动距离和移动时间得到第一对象的速度,可提高速度的精度。
在一些实施例中,本公开实施例提供的装置具有的功能或包含的模块可以用于执行上文方法实施例描述的方法,其具体实现可以参照上文方法实施例的描述,为了简洁,这里不再赘述。
图7为本公开实施例提供的一种测速装置的硬件结构示意图。该测速装置2包括处理器21,存储器22,输入装置23,输出装置24。该处理器21、存储器22、输入装置23和输出装置24通过连接器相耦合,该连接器包括各类接口、传输线或总线等等,本公开实施例对此不作限定。应当理解,本公开的各个实施例中,耦合是指通过特定方式的相互联系,包括直接相连或者通过其他设备间接相连,例如可以通过各类接口、传输线、总线等相连。
处理器21可以是一个或多个图形处理器(graphics processing unit,GPU),在处理器21是一个GPU的情况下,该GPU可以是单核GPU,也可以是多核GPU。在一些可能的实现方式中,处理器21可以是多个GPU构成的处理器组,多个处理器之间通过一个或多个总线彼此耦合。在一些可能的实现方式中,该处理器还可以为其他物体类型的处理器等等,本公开实施例不作限定。
存储器22可用于存储计算机程序指令,以及用于执行本公开方案的程序代码在内的各类计算机程序代码。可选地,存储器包括但不限于是随机存储记忆体(random access memory,RAM)、只读存储器(read-only memory,ROM)、可擦除可编程只读存储器(erasable programmable read only memory,EPROM)、或便携式只读存储器(compact disc read-only memory,CD-ROM),该存储器用于相关指令及数据。
输入装置23用于输入数据和/或信号,以及输出装置24用于输出数据和/或信号。输入装置23和输出装置24可以是独立的器件,也可以是一个整体的器件。可理解,本公开实施例中,存储器22不仅可用于存储相关指令,还可用于存储相关数据,如该存储器22可用于存储通过输入装置23获取的第一待处理图像,又或者该存储器22还可用于存储通过处理器21得到的第一对象的速度等等,本公开实施例对于该存储器中具体所存储的数据不作限定。
可以理解的是,图7仅仅示出了一种测速装置的简化设计。在实际应用中,测速装置还可以分别包含必要的其他元件,包含但不限于任意数量的输入/输出装置、处理器、存储器等,而所有可以实现本公开实施例的测速装置都在本公开的保护范围之内。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤, 能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本公开的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。所属领域的技术人员还可以清楚地了解到,本公开各个实施例描述各有侧重,为描述的方便和简洁,相同或类似的部分在不同实施例中可能没有赘述,因此,在某一实施例未描述或未详细描述的部分可以参见其他实施例的记载。
在本公开所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。另外,在本公开各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本公开实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者通过所述计算机可读存储介质进行传输。所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,数字通用光盘(digital versatile disc,DVD))、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:只读存储器(read-only memory,ROM)或随机存储存储器(random access memory,RAM)、磁碟或者光盘等各种可存储程序代码的介质。
工业实用性
本公开公开了一种测速方法及装置、电子设备及存储介质。该方法包括:获取第一待处理图像和第二待处理图像;所述第一待处理图像和所述第二待处理图像均包括第一对象;获取所述第一对象在所述第一待处理图像中的第一位置、所述第一对象在所述第二待处理图像中的第二位置和第一移动距离的第一透射参数;依据所述第一移动距离、所述第一透射参数和移动时间,得到所述第一对象的速度;所述移动时间依据所述第一待处理图像的时间戳和所述第二待处理图像的时间戳得到。

Claims (14)

  1. 一种测速方法,所述方法包括:
    获取第一待处理图像和第二待处理图像;其中,所述第一待处理图像和所述第二待处理图像均包括第一对象;
    获取所述第一对象在所述第一待处理图像中的第一位置、所述第一对象在所述第二待处理图像中的第二位置和第一移动距离的第一透射参数;其中,所述第一移动距离为所述第一位置与所述第二位置之间的距离;所述第一透射参数表征所述第一移动距离与第一物理距离之间的转换关系;所述第一物理距离为所述第一移动距离对应的物理距离;所述第一物理距离与所述第一位置在所述第一待处理图像中的尺度呈负相关,和/或,所述第一物理距离与所述第二位置在所述第二待处理图像中的尺度呈负相关;
    依据所述第一移动距离、所述第一透射参数和移动时间,得到所述第一对象的速度;其中,所述移动时间依据所述第一待处理图像的时间戳和所述第二待处理图像的时间戳得到。
  2. 根据权利要求1所述的方法,所述依据所述第一移动距离、所述第一透射参数和移动时间,得到所述第一对象的速度,包括:
    依据所述第一透射参数和所述第一移动距离,得到第二移动距离;
    依据所述第二移动距离和所述移动时间,得到所述速度。
  3. 根据权利要求1或2所述的方法,所述获取所述第一移动距离的第一透射参数,包括:
    获取第三位置的第二透射参数;其中,所述第三位置为所述第一位置与所述第二位置连线上的位置;所述第二透射参数表征第一像素点的尺寸与第一物点的尺寸之间的转换关系;所述第一像素点为依据所述第三位置在所述第一待处理图像中确定的像素点,所述第一像素点或为依据所述第三位置在所述第二待处理图像中确定的像素点;所述第一物点为所述第一像素点对应的物点;第一比值与所述第一像素点在图像中的尺度呈负相关;所述第一比值为所述第一像素点的尺寸与所述第一物点的尺寸之间的比值;
    依据所述第二透射参数,得到所述第一透射参数;其中,所述第一透射参数与所述第二透射参数呈正相关。
  4. 根据权利要求3所述的方法,所述第三位置为所述第一位置与所述的第二位置之间的中间位置。
  5. 根据权利要求3或4所述的方法,所述获取第三位置的第二透射参数,包括:
    对所述第一待处理图像进行物体检测处理,得到第一物体框的位置和第二物体框的位置;其中,所述第一物体框包含第一物体;所述第二物体框包含第二物体;
    依据所述第一物体框的位置得到所述第一物体的第一尺寸,依据所述第二物体框的位置得到所述第二物体的第二尺寸;
    依据所述第一尺寸和第三尺寸得到第三透射参数,依据所述第二尺寸和第四尺寸得到第四透射参数;其中,所述第三尺寸为所述第一物体的物理尺寸;所述第三透射参数表征第五尺寸与第六尺寸之间的转换关系;所述第五尺寸为第二像素点的尺寸;所述第二像素点在所述第一待处理图像中的位置依据所述第一物体框的位置确定;所述第六尺寸为所述第二像素点对应的物点的尺寸;所述第四尺寸为所述第二物体的物理尺寸;所述第四透射参数表征第七尺寸与第八尺寸之间的转换关系;所述第七尺寸为第三像素点的尺寸;所述第三像素点在所述第二待处理图像中的位置依据所述第二物体框的位置确定;所述第八尺寸为所述第三像素点对应的物点的尺寸;
    对所述第三透射参数和所述第四透射参数进行曲线拟合处理,得到所述第一待处理图像的透射参数图;第九尺寸与第十尺寸之间的转换关系依据所述透射参数图中的第一像素值确定;所述第九尺寸为所述第一待处理图像中的第四像素点的尺寸;所述第十尺寸为所述第四像素点对应的物点的尺寸; 所述第一像素值为第五像素点的像素值;所述第五像素点为所述透射参数图中与所述第四像素点对应的像素点;
    依据所述透射参数图中与所述第三位置对应的像素值,得到所述第二透射参数。
  6. 根据权利要求5所述的方法,在所述对所述第三透射参数和所述第四透射参数进行曲线拟合处理,得到所述待处理图像的透射参数图之前,所述方法还包括:
    获取置信度映射;其中,所述置信度映射表征物体类型与透射参数的置信度之间的映射;
    依据所述第一物体的物体类型和所述置信度映射,得到所述第三透射参数的第一置信度;
    所述对所述第三透射参数和所述第四透射参数进行曲线拟合处理,得到所述待处理图像的透射参数图,包括:
    依据所述第一置信度和所述第三透射参数,得到第五透射参数;其中,所述第五透射参数与所述第一置信度呈正相关;
    对所述第四透射参数和所述第五透射参数进行曲线拟合处理,得到所述透射参数图。
  7. 根据权利要求6所述的方法,在所述依据所述第一物体的物体类型和所述置信度映射,得到所述第三透射参数的第一置信度之前,所述方法还包括:
    对所述第一物体框内的像素点区域进行特征提取处理,得到特征数据;
    依据所述特征数据,得到所述第一物体的分数;其中,所述分数与所述第一物体的尺寸的置信度呈正相关;
    所述依据所述第一物体的物体类型和所述置信度映射,得到所述第三透射参数的第一置信度,包括:
    依据所述第一物体的物体类型和所述置信度映射,得到所述第三透射参数的第二置信度;
    依据所述分数与所述第二置信度,得到所述第一置信度;其中,所述第一置信度与所述分数呈相关。
  8. 根据权利要求5或6所述的方法,所述依据所述第一置信度和所述第三透射参数,得到第五透射参数,包括:
    确定所述第一置信度与所述第三透射参数的乘积,得到所述第五透射参数。
  9. 根据权利要求6至8中任一项所述的方法,在所述对所述第四透射参数和所述第五透射参数进行曲线拟合处理,得到所述透射参数图之前,所述方法还包括:
    获取所述第一待处理图像的深度图像;
    依据所述深度图像,得到所述第二像素点的第一深度信息以及所述第三像素点的第二深度信息;
    依据所述第一深度信息和所述第五透射参数得到第一数据点,依据所述第二深度信息和所述第四透射参数得到第二数据点;
    所述对所述第四透射参数和所述第五透射参数进行曲线拟合处理,得到所述透射参数图,包括:
    对所述第一数据点和所述第二数据点进行曲线拟合处理,得到所述透射参数图。
  10. 根据权利要求1至9中任一项所述的方法,所述第一待处理图像和所述第二待处理图像由同一成像设备采集得到,且所述成像设备在采集所述第一待处理图像的过程中的位姿与所述成像设备在采集所述第二待处理图像的过程中的位姿相同。
  11. 根据权利要求10所述的方法,所述第一对象为人物对象;所述人物对象属于监测人群,所述方法还包括:
    在所述速度未超过安全速度阈值的情况下,获取所述成像设备的位置;
    向终端发送包含所述位置的告警指令;其中,所述告警指令用于指示所述终端输出所述监测人群的人群密度过大的告警信息。
  12. 一种测速装置,所述装置包括:
    第一获取单元,用于获取第一待处理图像和第二待处理图像;所述第一待处理图像和所述第二待处理图像均包括第一对象;
    第二获取单元,用于获取所述第一对象在所述第一待处理图像中的第一位置、所述第一对象在所 述第二待处理图像中的第二位置和第一移动距离的第一透射参数;其中,所述第一移动距离为所述第一位置与所述第二位置之间的距离;所述第一透射参数表征所述第一移动距离与第一物理距离之间的转换关系;所述第一物理距离为所述第一移动距离对应的物理距离;所述第一物理距离与所述第一位置在所述第一待处理图像中的尺度呈负相关,和/或,所述第一物理距离与所述第二位置在所述第二待处理图像中的尺度呈负相关;
    第一处理单元,用于依据所述第一移动距离、所述第一透射参数和移动时间,得到所述第一对象的速度;其中,所述移动时间依据所述第一待处理图像的时间戳和所述第二待处理图像的时间戳得到。
  13. 一种电子设备,包括:处理器和存储器,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,在所述处理器执行所述计算机指令的情况下,所述电子设备执行如权利要求1至11中任一项所述的方法。
  14. 一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,所述计算机程序包括程序指令,在所述程序指令被处理器执行的情况下,使所述处理器执行权利要求1至11中任一项所述的方法。
PCT/CN2020/121491 2020-06-30 2020-10-16 测速方法及装置、电子设备及存储介质 WO2022000856A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
KR1020217030375A KR20220004016A (ko) 2020-06-30 2020-10-16 속도 측정 방법 및 장치, 전자 기기 및 저장 매체
JP2021547718A JP2022542205A (ja) 2020-06-30 2020-10-16 速度測定方法及び装置、電子デバイス並びに記憶媒体
US17/477,746 US20220005208A1 (en) 2020-10-16 2021-09-17 Speed measurement method and apparatus, electronic device, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010613426.XA CN111739098B (zh) 2020-06-30 2020-06-30 测速方法及装置、电子设备及存储介质
CN202010613426.X 2020-06-30

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/477,746 Continuation US20220005208A1 (en) 2020-10-16 2021-09-17 Speed measurement method and apparatus, electronic device, and storage medium

Publications (1)

Publication Number Publication Date
WO2022000856A1 true WO2022000856A1 (zh) 2022-01-06

Family

ID=72653708

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/121491 WO2022000856A1 (zh) 2020-06-30 2020-10-16 测速方法及装置、电子设备及存储介质

Country Status (3)

Country Link
CN (1) CN111739098B (zh)
TW (1) TWI735367B (zh)
WO (1) WO2022000856A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111739098B (zh) * 2020-06-30 2024-05-24 上海商汤智能科技有限公司 测速方法及装置、电子设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101877174A (zh) * 2009-09-29 2010-11-03 杭州海康威视软件有限公司 车速测量方法、监控机及车速测量系统
CN108957024A (zh) * 2017-05-22 2018-12-07 阿里巴巴集团控股有限公司 一种速度测量的方法、装置以及电子设备
CN109979206A (zh) * 2017-12-28 2019-07-05 杭州海康威视系统技术有限公司 车辆测速方法、装置、系统、电子设备及存储介质
CN110824188A (zh) * 2019-10-17 2020-02-21 浙江大华技术股份有限公司 高速公路车辆的测速方法、装置、编解码器及存储装置
CN111739098A (zh) * 2020-06-30 2020-10-02 上海商汤智能科技有限公司 测速方法及装置、电子设备及存储介质

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE112007003284T5 (de) * 2007-01-26 2009-12-24 Trimble Jena Gmbh Optisches Instrument und Verfahren zum Erhalten von Abstands- und Bildinformation
TW201013214A (en) * 2008-09-17 2010-04-01 Altek Corp Photography device and method for sensing the moving speed of the photographed object
JP2015025657A (ja) * 2011-10-07 2015-02-05 川崎重工業株式会社 速度計測装置及び方法
US10586339B2 (en) * 2015-03-18 2020-03-10 Riken Device for measuring rotation of spherical body, measurement method, and program
CN107255812A (zh) * 2017-06-30 2017-10-17 努比亚技术有限公司 基于3d技术的测速方法、移动终端、及存储介质
CN107462741B (zh) * 2017-07-26 2019-12-31 武汉船用机械有限责任公司 一种运动物体速度及加速度测量装置
CN110889890B (zh) * 2019-11-29 2023-07-28 深圳市商汤科技有限公司 图像处理方法及装置、处理器、电子设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101877174A (zh) * 2009-09-29 2010-11-03 杭州海康威视软件有限公司 车速测量方法、监控机及车速测量系统
CN108957024A (zh) * 2017-05-22 2018-12-07 阿里巴巴集团控股有限公司 一种速度测量的方法、装置以及电子设备
CN109979206A (zh) * 2017-12-28 2019-07-05 杭州海康威视系统技术有限公司 车辆测速方法、装置、系统、电子设备及存储介质
CN110824188A (zh) * 2019-10-17 2020-02-21 浙江大华技术股份有限公司 高速公路车辆的测速方法、装置、编解码器及存储装置
CN111739098A (zh) * 2020-06-30 2020-10-02 上海商汤智能科技有限公司 测速方法及装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN111739098B (zh) 2024-05-24
TW202202845A (zh) 2022-01-16
CN111739098A (zh) 2020-10-02
TWI735367B (zh) 2021-08-01

Similar Documents

Publication Publication Date Title
TWI752466B (zh) 影像處理方法、處理器、電子設備、儲存媒介
US10121076B2 (en) Recognizing entity interactions in visual media
US11430265B2 (en) Video-based human behavior recognition method, apparatus, device and storage medium
CN105051754B (zh) 用于通过监控系统检测人的方法和装置
US9996731B2 (en) Human head detection in depth images
WO2022135511A1 (zh) 运动物体的定位方法、装置、电子设备及存储介质
US10922536B2 (en) Age classification of humans based on image depth and human pose
US20220351390A1 (en) Method for generating motion capture data, electronic device and storage medium
WO2021097750A1 (zh) 人体姿态的识别方法、装置、存储介质及电子设备
EP4050305A1 (en) Visual positioning method and device
US20240104744A1 (en) Real-time multi-view detection of objects in multi-camera environments
CN104484814A (zh) 一种基于视频地图的广告方法及系统
WO2022000856A1 (zh) 测速方法及装置、电子设备及存储介质
CN111177811A (zh) 一种应用于云平台的消防点位自动布图的方法
CN109816628B (zh) 人脸评价方法及相关产品
WO2021238151A1 (zh) 图像标注方法、装置、电子设备、存储介质及计算机程序
CN114005140A (zh) 一种人员识别方法、装置、设备、行人监控系统及存储介质
US20220005208A1 (en) Speed measurement method and apparatus, electronic device, and storage medium
CN109785439A (zh) 人脸素描图像生成方法及相关产品
CN111739086A (zh) 测量面积的方法及装置、电子设备及存储介质
US20230089845A1 (en) Visual Localization Method and Apparatus
WO2023273154A1 (zh) 图像处理方法、装置、设备、介质及程序
JP2022542205A (ja) 速度測定方法及び装置、電子デバイス並びに記憶媒体
TWI739601B (zh) 圖像處理方法、電子設備和儲存介質
CN111739097A (zh) 测距方法及装置、电子设备及存储介质

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2021547718

Country of ref document: JP

Kind code of ref document: A

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20942674

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 521431113

Country of ref document: SA

122 Ep: pct application non-entry in european phase

Ref document number: 20942674

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 05.07.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 20942674

Country of ref document: EP

Kind code of ref document: A1