Method and device for measuring area, electronic device and storage medium

By acquiring and fitting transmission parameters, combining object detection and feature extraction, the problem of low accuracy caused by the difference in area between the pixel point area and the physical area in the image is solved, and the accuracy of area measurement is improved.

CN111739086BActive Publication Date: 2024-12-10SHANGHAI SENSETIME INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010612699.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-30
Publication Date
2024-12-10
Estimated Expiration
2040-06-30

AI Technical Summary

Technical Problem

When measuring area in the prior art, due to the large difference between the area of ​​the pixel point area in the image and the area of ​​the physical area, the area accuracy is low.

Method used

By obtaining the transmission parameters of the pixel point area to be measured, and combining object detection and feature extraction processing, curve fitting is performed to determine the conversion relationship between the pixel point and the object point, thereby improving the accuracy of area measurement.

Benefits of technology

The accuracy of the physical area corresponding to the pixel area to be measured is improved, and the accuracy of area measurement is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111739086B_ABST
    Figure CN111739086B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for measuring area, an electronic device and a storage medium. The method includes: obtaining a first transmission parameter of a pixel point region to be measured and a first pixel point; the first pixel point belongs to the pixel point region to be measured; the first transmission parameter represents the conversion relationship between the size of the first pixel point and the size of the first object point; the first object point is the object point corresponding to the first pixel point; determining the area sum of at least one object point corresponding to at least one pixel point in the pixel point region to be measured, and obtaining the area of ​​the physical area corresponding to the pixel point region to be measured; the at least one pixel point includes the first pixel point; the area of ​​the object point corresponding to the first pixel point is obtained based on the area of ​​the first pixel point and the first transmission parameter.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method and device for measuring an area, an electronic device, and a storage medium. Background Art

[0002] With the development of computer vision technology, the application of computer vision technology is becoming more and more extensive, and among the many applications is area measurement based on computer vision technology.

[0003] The current technology obtains the area of ​​the physical area by determining the area of ​​the pixel area in the image corresponding to the physical area. However, due to the large difference between the area of ​​the pixel area in the image and the area of ​​the physical area corresponding to the pixel area, the accuracy of the obtained area of ​​the physical area is low. Summary of the invention

[0004] The present application provides a method and device for measuring area, an electronic device and a storage medium.

[0005] In a first aspect, a method for measuring an area is provided, the method comprising:

[0006] Acquire first transmission parameters of a pixel region to be measured and a first pixel; the first pixel belongs to the pixel region to be measured; the first transmission parameter represents a conversion relationship between a size of the first pixel and a size of a first object point; the first object point is an object point corresponding to the first pixel;

[0007] Determine the sum of the areas of at least one object point corresponding to at least one pixel in the pixel area to be measured, and obtain the area of ​​the physical area corresponding to the pixel area to be measured; the at least one pixel includes the first pixel; the area of ​​the object point corresponding to the first pixel is obtained based on the area of ​​the first pixel and the first transmission parameter.

[0008] In this aspect, since the first transmission parameter carries the scale information of the first pixel point, the device for measuring the area determines the area of ​​the first object point based on the first transmission parameter and the area of ​​the first pixel point, which can improve the accuracy of the area of ​​the first object point, and further improve the accuracy of the sum of the areas of at least one physical point corresponding to at least one pixel point, thereby improving the accuracy of the area of ​​the physical area corresponding to the pixel point area to be measured.

[0009] In combination with any implementation manner of the present application, the step of obtaining the pixel area to be tested includes:

[0010] Acquire an image to be processed and at least one position in the image to be processed;

[0011] A pixel point region is determined from the image to be processed according to the at least one position as the pixel point region to be tested.

[0012] In combination with any embodiment of the present application, the pixel area to be measured belongs to the image to be processed, and the step of obtaining a first transmission parameter of a first pixel includes:

[0013] Performing object detection processing on the image to be processed or performing object detection processing on the pixel point area to be detected to obtain the position of a first object frame and the position of a second object frame; the first object frame contains a first object; the second object frame contains a second object;

[0014] Obtaining a first size of the first object according to the position of the first object frame, and obtaining a second size of the second object according to the position of the second object frame;

[0015] A second transmission parameter is obtained according to the first size and the third size, and a third 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 second 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 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; the fourth size is the physical size of the second object; the third 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 position of the third pixel in the 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;

[0016] The second transmission parameter and the third transmission parameter are subjected to curve fitting processing to obtain a first transmission parameter map of the pixel point area to be measured; the conversion relationship between the ninth dimension and the tenth dimension is determined according to the first pixel value in the first transmission parameter map; the ninth dimension is the dimension of a fourth pixel point in the pixel point area to be measured; the tenth dimension is the dimension of an object point corresponding to the fourth pixel point; the first pixel value is the pixel value of a fifth pixel point; the fifth pixel point is the pixel point corresponding to the fourth pixel point in the first transmission parameter map;

[0017] The first transmission parameter is obtained according to the pixel value corresponding to the first pixel point in the first transmission parameter map.

[0018] In combination with any embodiment of the present application, before performing curve fitting processing on the second transmission parameter and the third transmission parameter to obtain the first transmission parameter map of the pixel point area to be measured, the method further includes:

[0019] Acquire a confidence map; the confidence map represents a mapping between object types and confidences of transmission parameters;

[0020] Obtaining a first confidence level of the second transmission parameter according to the object type of the first object and the confidence level mapping;

[0021] The performing curve fitting processing on the second transmission parameter and the third transmission parameter to obtain a first transmission parameter map of the pixel point area to be measured includes:

[0022] Obtaining a fourth transmission parameter according to the first confidence level and the second transmission parameter; the fourth transmission parameter is positively correlated with the first confidence level;

[0023] Curve fitting is performed on the third transmission parameter and the fourth transmission parameter to obtain the first transmission parameter graph.

[0024] In combination with any embodiment of the present application, before obtaining the first confidence of the second transmission parameter according to the object type of the first object and the confidence mapping, the method further includes:

[0025] Performing feature extraction processing on the pixel point area within the first object frame to obtain feature data;

[0026] Obtaining a score of the first object according to the feature data; the score is positively correlated with the confidence level of the size of the first object;

[0027] The obtaining, according to the object type of the first object and the confidence mapping, a first confidence of the second transmission parameter comprises:

[0028] Obtaining a second confidence level of the second transmission parameter according to the object type of the first object and the confidence level mapping;

[0029] The first confidence level is obtained according to the score and the second confidence level; the first confidence level is correlated with the score.

[0030] In combination with any embodiment of the present application, obtaining a fourth transmission parameter according to the first confidence level and the second transmission parameter includes:

[0031] The product of the first confidence level and the second transmission parameter is determined to obtain the fourth transmission parameter.

[0032] In combination with any embodiment of the present application, before performing curve fitting processing on the third transmission parameter and the fourth transmission parameter to obtain the first transmission parameter graph, the method further includes:

[0033] Acquire a depth image of the image to be processed;

[0034] Obtaining first depth information of the second pixel and second depth information of the third pixel according to the depth image;

[0035] Obtain a first data point according to the first depth information and the fourth transmission parameter, and obtain a second data point according to the second depth information and the third transmission parameter;

[0036] The performing curve fitting processing on the third transmission parameter and the fourth transmission parameter to obtain the first transmission parameter graph includes:

[0037] Curve fitting is performed on the first data point and the second data point to obtain the first transmission parameter map.

[0038] In combination with any embodiment of the present application, the method further includes:

[0039] Performing curve fitting processing on the first data point and the second data point to obtain a second transmission parameter map of the image to be processed;

[0040] Acquire a target position of a region of interest in the image to be processed and a physical size of the region of interest;

[0041] Obtaining the size of the region of interest in the image to be processed according to the second transmission parameter map, the target position and the physical size of the region of interest;

[0042] According to the target position and the size of the region of interest in the image to be processed, a pixel point region is determined from the image to be processed as the region of interest.

[0043] In combination with any embodiment of the present application, performing object detection processing on the image to be processed and / or performing object detection processing on the pixel area to be detected to obtain the position of the first object frame and the position of the second object frame includes:

[0044] When the positions of at least two object frames are obtained by performing object detection processing on the pixel point area to be detected, determining the position of the first object frame and the position of the second object frame from the positions of the at least two object frames;

[0045] In the case where the position of at most one object frame is obtained by performing object detection processing on the pixel point area to be measured, performing object detection processing on the non-measured pixel point area in the image to be processed to obtain the position of at least one object frame; the non-measured pixel point area does not intersect with the pixel point area to be measured;

[0046] The position of the first object frame and the position of the second object frame are determined from the position of the at most one object frame and the position of the at least one object frame.

[0047] In combination with any implementation manner of the present application, the size of the first object point obtained according to the first transmission parameter and the size of the first pixel point is positively correlated with the scale of the first pixel point.

[0048] In a second aspect, a device for measuring area is provided, the device comprising:

[0049] An acquisition unit, used for acquiring first transmission parameters of a pixel region to be measured and a first pixel; the first pixel belongs to the pixel region to be measured; the first transmission parameter represents a conversion relationship between a size of the first pixel and a size of a first object point; the first object point is an object point corresponding to the first pixel;

[0050] The first processing unit is used to determine the sum of the areas of at least one object point corresponding to at least one pixel point in the pixel point area to be measured, and obtain the area of ​​the physical area corresponding to the pixel point area to be measured; the at least one pixel point includes the first pixel point; the area of ​​the object point corresponding to the first pixel point is obtained based on the area of ​​the first pixel point and the first transmission parameter.

[0051] In combination with any implementation manner of the present application, the acquisition unit is used to:

[0052] Acquire an image to be processed and at least one position in the image to be processed;

[0053] A pixel point region is determined from the image to be processed according to the at least one position as the pixel point region to be tested.

[0054] In combination with any implementation manner of the present application, the pixel point region to be measured belongs to the image to be processed, and the acquisition unit is used to:

[0055] Performing object detection processing on the image to be processed or performing object detection processing on the pixel point area to be detected to obtain the position of a first object frame and the position of a second object frame; the first object frame contains a first object; the second object frame contains a second object;

[0056] Obtaining a first size of the first object according to the position of the first object frame, and obtaining a second size of the second object according to the position of the second object frame;

[0057] A second transmission parameter is obtained according to the first size and the third size, and a third 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 second 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 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; the fourth size is the physical size of the second object; the third 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 position of the third pixel in the 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;

[0058] The second transmission parameter and the third transmission parameter are subjected to curve fitting processing to obtain a first transmission parameter map of the pixel point area to be measured; the conversion relationship between the ninth dimension and the tenth dimension is determined according to the first pixel value in the first transmission parameter map; the ninth dimension is the dimension of a fourth pixel point in the pixel point area to be measured; the tenth dimension is the dimension of an object point corresponding to the fourth pixel point; the first pixel value is the pixel value of a fifth pixel point; the fifth pixel point is the pixel point corresponding to the fourth pixel point in the first transmission parameter map;

[0059] The first transmission parameter is obtained according to the pixel value corresponding to the first pixel point in the first transmission parameter map.

[0060] In combination with any embodiment of the present application, the acquisition unit is further used to acquire a confidence map before performing curve fitting processing on the second transmission parameter and the third transmission parameter to obtain the first transmission parameter map of the pixel point area to be measured; the confidence map represents the mapping between the object type and the confidence of the transmission parameter;

[0061] The area measuring device further includes: a second processing unit, configured to obtain a first confidence level of the second transmission parameter according to the object type of the first object and the confidence level mapping;

[0062] The acquisition unit is further used for:

[0063] Obtaining a fourth transmission parameter according to the first confidence level and the second transmission parameter; the fourth transmission parameter is positively correlated with the first confidence level;

[0064] Curve fitting is performed on the third transmission parameter and the fourth transmission parameter to obtain the first transmission parameter graph.

[0065] In combination with any embodiment of the present application, the area measuring device further includes:

[0066] A third processing unit is used for performing feature extraction processing on a pixel point area within the first object frame to obtain feature data before obtaining the first confidence of the second transmission parameter according to the object type of the first object and the confidence mapping;

[0067] a fourth processing unit, configured to obtain a score of the first object according to the feature data; the score is positively correlated with a confidence level of a size of the first object;

[0068] The second processing unit is used for:

[0069] Obtaining a second confidence level of the second transmission parameter according to the object type of the first object and the confidence level mapping;

[0070] The first confidence level is obtained according to the score and the second confidence level; the first confidence level is correlated with the score.

[0071] In combination with any implementation manner of the present application, the acquisition unit is further used to:

[0072] The product of the first confidence level and the second transmission parameter is determined to obtain the fourth transmission parameter.

[0073] In combination with any embodiment of the present application, the acquisition unit is further configured to acquire a depth image of the image to be processed before performing curve fitting processing on the third transmission parameter and the fourth transmission parameter to obtain the first transmission parameter map;

[0074] The second processing unit is further configured to:

[0075] Obtaining first depth information of the second pixel and second depth information of the third pixel according to the depth image;

[0076] Obtain a first data point according to the first depth information and the fourth transmission parameter, and obtain a second data point according to the second depth information and the third transmission parameter;

[0077] The acquisition unit is further used for:

[0078] Curve fitting is performed on the first data point and the second data point to obtain the first transmission parameter map.

[0079] In combination with any implementation manner of the present application, the acquisition unit is further used to:

[0080] Performing curve fitting processing on the first data point and the second data point to obtain a second transmission parameter map of the image to be processed;

[0081] Acquire a target position of a region of interest in the image to be processed and a physical size of the region of interest;

[0082] Obtaining the size of the region of interest in the image to be processed according to the second transmission parameter map, the target position and the physical size of the region of interest;

[0083] According to the target position and the size of the region of interest in the image to be processed, a pixel point region is determined from the image to be processed as the region of interest.

[0084] In combination with any implementation manner of the present application, the acquisition unit is further used to:

[0085] When the positions of at least two object frames are obtained by performing object detection processing on the pixel point area to be detected, determining the position of the first object frame and the position of the second object frame from the positions of the at least two object frames;

[0086] In the case where the position of at most one object frame is obtained by performing object detection processing on the pixel point area to be measured, performing object detection processing on the non-measured pixel point area in the image to be processed to obtain the position of at least one object frame; the non-measured pixel point area does not intersect with the pixel point area to be measured;

[0087] The position of the first object frame and the position of the second object frame are determined from the position of the at most one object frame and the position of the at least one object frame.

[0088] In combination with any implementation manner of the present application, the size of the first object point obtained according to the first transmission parameter and the size of the first pixel point is positively correlated with the scale of the first pixel point.

[0089] According to a third aspect, a processor is provided, wherein the processor is used to execute the method according to the first aspect and any possible implementation thereof.

[0090] In a fourth aspect, an electronic device is provided, comprising: a processor, a sending device, an input device, an output device and a memory, wherein the memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device executes the method as described in the first aspect above and any possible implementation method thereof.

[0091] In a fifth aspect, a computer-readable storage medium is provided, in which a computer program is stored. The computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to execute the method as described in the first aspect above and any possible implementation method thereof.

[0092] In a sixth aspect, a computer program product is provided, which includes a computer program or instructions, and when the computer program or instructions are run on a computer, the computer is enabled to execute the method of the above-mentioned first aspect and any possible implementation thereof.

[0093] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0094] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.

[0095] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.

[0096] Figure 1 A schematic diagram of a crowd image provided in an embodiment of the present application;

[0097] Figure 2 A schematic diagram of a pixel coordinate system provided in an embodiment of the present application;

[0098] Figure 3 A schematic diagram of a flow chart of a method for measuring area provided in an embodiment of the present application;

[0099] Figure 4 A schematic flow chart of another method for measuring area provided in an embodiment of the present application;

[0100] Figure 5 A schematic diagram of a goal provided in an embodiment of the present application;

[0101] Figure 6 A schematic diagram of the structure of a device for measuring area provided in an embodiment of the present application;

[0102] Figure 7 A schematic diagram of the hardware structure of a device for measuring area provided in an embodiment of the present application. DETAILED DESCRIPTION

[0103] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0104] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0105] It should be understood that in the present application, "at least one (item)" means one or more, "more than one" means two or more, "at least two (items)" means two or three and more than three, and "and / or" is used to describe the association relationship of associated objects, indicating that there may be three relationships. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " can indicate that the objects before and after the association are in an "or" relationship, which means any combination of these items, including any combination of single items (items) or plural items (items). For example, at least one 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. The character " / " can also represent the division sign in mathematical operations, for example, a / b = a divided by b; 6 / 3 = 2. "At least one of the following" or similar expressions.

[0106] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0107] First, some concepts that will appear below are defined. In the embodiments of the present application, object points refer to points in the real world, physical sizes refer to sizes in the real world, and physical regions refer to regions in the real world.

[0108] Object points correspond to pixel points in an image. For example, a camera is used to take a picture of a table to obtain image A. The table includes object point a, and pixel point b in image A is obtained by imaging object point a. Therefore, object point a corresponds to pixel point b.

[0109] The physical area corresponds to the pixel area in the image. For example, a basketball court is photographed using a camera to obtain image B. Pixel area c in image A is obtained by imaging the basketball court, so the basketball court corresponds to pixel area c.

[0110] In the embodiment of the present application, the scale of the near object in the image is large, and the scale of the far object in the image is small. In the embodiment of the present application, "far" means that the distance between the real object corresponding to the object in the image and the imaging device that collects the above image is far, and "near" means that the distance between the real object corresponding to the object in the image and the imaging device that collects the above image is short.

[0111] In an image, the scale of a pixel is positively correlated with the size of the object point corresponding to the pixel. Specifically, the larger the scale of a pixel in an image, the larger the size of the object point corresponding to the pixel. For example, image A contains pixel a and pixel b, where the object point corresponding to pixel a is object point 1, and the object point corresponding to pixel b is object point 2. If the scale of pixel a in image A is larger than the scale of pixel b in image A, then the size of object point 1 is larger than the size of object point 2.

[0112] In an image, the scale of a location refers to the ratio between the size of an object at that location in the image and the physical size of the object. Figure 1 In the figure, since the scale of the position where character A is located is larger than the scale of the position where character B is located, 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 point area covered by character A is larger than the area of ​​the pixel point area covered by character B.

[0113] In the embodiments of the present application, the positions in the image refer to the positions in the pixel coordinates of the image. The horizontal coordinate of the pixel coordinate system in the embodiments of the present application is used to indicate the column number where the pixel point is located, and the vertical coordinate of the pixel coordinate system is used to indicate the row number where the pixel point is located. For example, in Figure 2 In the image shown, the upper left corner of the image is taken as the coordinate origin O, the direction parallel to the row of the image is the direction of the X axis, and the direction parallel to the column of the image is the direction of the Y axis, and the pixel coordinate system is constructed as XOY. The units of the horizontal and vertical coordinates are both pixels. For example, Figure 2 Pixel A in 11 The coordinates of pixel A are (1, 1). 23 The coordinates of pixel A are (3, 2). 42 The coordinates of pixel A are (2, 4). 34The coordinates are (4, 3).

[0114] The execution subject of the embodiment of the present application is a device for measuring area. Optionally, the device for measuring area can be one of the following: a mobile phone, a computer, a server, and a tablet computer. The embodiment of the present application is described below in conjunction with the drawings in the embodiment of the present application.

[0115] The following describes the embodiments of the present application in conjunction with the accompanying drawings in the embodiments of the present application. Figure 3 , Figure 3 It is a flow chart of a method for measuring area provided in an embodiment of the present application.

[0116] 301. Obtain first transmission parameters of a pixel region to be measured and a first pixel, wherein the first pixel belongs to the pixel region to be measured.

[0117] In the embodiment of the present application, the pixel area to be tested may be an image; the pixel area to be tested may also be a pixel area in an image. The first pixel is a pixel in the pixel area to be tested.

[0118] The pixel area to be tested may contain any content. For example, the pixel area to be tested may contain a person; the pixel area to be tested may also contain a road. This application does not limit the content contained in the pixel area to be tested.

[0119] In one implementation of obtaining the pixel area to be measured, the area measuring device receives the pixel area to be measured input by the user through an input component. The above input component includes: a keyboard, a mouse, a touch screen, a touch pad, and an audio input device.

[0120] In another implementation of obtaining the pixel area to be measured, the image to be processed is stored in the device for measuring the area. The device for measuring the area receives the pixel area selected by the user from the image to be processed through an input component as the pixel area to be measured. The input component includes: a keyboard, a mouse, a touch screen, a touch pad, an audio input device, etc.

[0121] In another implementation of obtaining the pixel area to be measured, the area measuring device receives the pixel area to be measured sent by the first terminal. Optionally, the first terminal can be any of the following: a mobile phone, a computer, a tablet computer, a server, and a wearable device.

[0122] In the embodiment of the present application, the first 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 object point corresponding to the first pixel point. For example, the first transmission parameter represents the conversion relationship between the length of the first pixel point and the length of the first object point. For another example, the first transmission parameter represents the conversion relationship between the height of the first pixel point and the height of the first object point. For another example, the first transmission parameter represents the conversion relationship between the width of the first pixel point and the width of the first object point.

[0123] In an implementation of obtaining the first transmission parameter, the area measuring device receives the first transmission parameter input by the user through an input component. The input component includes: a keyboard, a mouse, a touch screen, a touch pad, an audio input device, and the like.

[0124] In another implementation of obtaining the first transmission parameter, the area measuring device receives the first transmission parameter sent by the second terminal. Optionally, the second terminal can be any one of the following: a mobile phone, a computer, a tablet computer, a server, a wearable device. The second terminal can be the same as the first terminal or different.

[0125] 302. Determine the sum of the areas of at least one object point corresponding to at least one pixel in the pixel area to be measured, and obtain the area of ​​the physical area corresponding to the pixel area to be measured.

[0126] In an embodiment of the present application, at least one pixel point includes a first pixel point. The sum of the areas of at least one object point corresponding to at least one pixel point is the sum of the areas of the object points corresponding to all the pixels in the at least one pixel point. For example, at least one pixel point includes: pixel point a and pixel point b. The object point corresponding to pixel point a is object point A, and the object point corresponding to pixel point b is object point B. Assuming that the area of ​​object point A is m1 and the area of ​​object point B is m2, the sum of the areas of at least one object point corresponding to at least one pixel point is m1+m2.

[0127] The device for measuring area can obtain the sum of the areas of at least one object point corresponding to at least one pixel in the pixel area to be measured, and then obtain the area of ​​the physical area corresponding to the pixel area to be measured. For example, the pixel area to be measured includes: pixel a, pixel b, and pixel c. The area of ​​the object point corresponding to pixel a is m1, the area of ​​the object point corresponding to pixel b is m2, and the area of ​​the object point corresponding to pixel c is m3. Assume that the first pixel is pixel a, and the physical area corresponding to the pixel area to be measured is area A. The device for measuring area can use m1+m2+m3 as the area of ​​area A; the device for measuring area can also use m1+m2 as the area of ​​area A; the device for measuring area can also use m1 as the area of ​​area A.

[0128] In the embodiment of the present application, the area of ​​the object point corresponding to the first pixel point is obtained based on the area of ​​the first pixel point and the first transmission parameter.

[0129] For example, the shape of the first pixel is a rectangle. Assuming that the length of the first pixel is L1 and the width is W1, the area of ​​the first pixel is L1*W1. Assuming that the length of the object point corresponding to the first pixel is L2 and the width is W2, the area of ​​the first pixel is L2*W2. Because L2 can be obtained based on L1 and the first transmission parameter, and W2 can be obtained based on W1 and the first transmission parameter, the device for measuring the area can obtain L2*W2 based on L1*W1 and the first transmission parameter, that is, the device for measuring the area can obtain the area of ​​the object point corresponding to the first pixel based on the area of ​​the first pixel and the first transmission parameter.

[0130] For another example, the shape of the first pixel is a circle. Assuming the radius of the first pixel is B1, the area of ​​the first pixel is Assuming that the radius of the object point corresponding to the first pixel is B2, the area of ​​the first pixel is Since B2 can be obtained based on B1 and the first transmission parameter, the device for measuring the area can be based on and the first transmission parameter is obtained That is, the area measuring device can obtain the area of ​​the object point corresponding to the first pixel point according to the area of ​​the first pixel point and the first transmission parameter.

[0131] As an optional implementation, the first transmission parameter represents the ratio between the size of the first pixel and the size of the first object point. Assume that the first transmission parameter is α1 and the area of ​​the first pixel is β1. When the shape of the first pixel is a rectangle or a circle, the area of ​​the first object point is:

[0132] Because different pixels correspond to different object points, the area of ​​the object points corresponding to each pixel in the pixel area to be measured is different. Therefore, the device for measuring the area of ​​the physical area corresponding to the pixel area to be measured can improve the accuracy of the area of ​​the physical area by separately determining the area of ​​the object points corresponding to each pixel in the pixel area to be measured, thereby determining the area of ​​the physical area corresponding to the pixel area to be measured.

[0133] As an optional implementation, the size of the first object point obtained according to the first transmission parameter and the size of the first pixel is positively correlated with the scale of the first pixel. In other words, the first transmission parameter carries the scale information of the first pixel.

[0134] Since the first transmission parameter carries the scale information of the first pixel point, the device for measuring the area determines the area of ​​the first object point based on the first transmission parameter and the area of ​​the first pixel point, which can improve the accuracy of the area of ​​the first object point, and further improve the accuracy of the sum of the areas of at least one physical point corresponding to at least one pixel point, thereby improving the accuracy of the area of ​​the physical area corresponding to the pixel point area to be measured.

[0135] As an optional implementation, the device for measuring the area can obtain the transmission parameters of all pixels in the pixel area to be measured, and obtain the area of ​​the object point corresponding to each pixel according to the area and transmission parameter of each pixel, so as to obtain the area of ​​the physical area corresponding to the pixel area to be measured. For example, the pixel area to be measured includes: pixel a, pixel b and pixel c, the object point corresponding to pixel a is object point 1, the object point corresponding to pixel b is object point 2, and the object point corresponding to pixel c is object point 3. The transmission parameter of pixel a is transmission parameter A, the transmission parameter of pixel b is transmission parameter B, and the transmission parameter of pixel c is transmission parameter C. The device for measuring the area obtains the area of ​​object point 1 according to transmission parameter A and pixel a, obtains the area of ​​object point 2 according to transmission parameter B and pixel b, and obtains the area of ​​object point 3 according to transmission parameter C and pixel c. The device for measuring the area sums the area of ​​object point 1, the area of ​​object point 2 and the area of ​​object point 3 to obtain the area of ​​the physical area corresponding to the pixel area to be measured.

[0136] As an optional implementation manner, the device for measuring area obtains the pixel point area to be measured by performing the following steps:

[0137] 1. Obtain an image to be processed and at least one position in the image to be processed.

[0138] In the embodiment of the present application, the image to be processed may contain any content. For example, the image to be processed may contain a person; the image to be processed may also contain a road; the image to be processed may also contain an animal. The present application does not limit the content contained in the image to be processed.

[0139] In an implementation method of acquiring an image to be processed, the area measuring device receives the image to be processed input by a user through an input component. The input component includes: a keyboard, a mouse, a touch screen, a touch pad, an audio input device, etc.

[0140] In another implementation of acquiring the image to be processed, the area measuring device selects a frame of image from the acquired video stream as the image to be processed. The above input components include: a keyboard, a mouse, a touch screen, a touch pad, and an audio input device.

[0141] In another implementation of obtaining the image to be processed, the area measuring device receives the image to be processed sent by the third terminal. Optionally, the third terminal can be any one of the following: a mobile phone, a computer, a tablet computer, a server, a wearable device. The third terminal can be the same as the first terminal or different.

[0142] In an embodiment of the present application, at least one position is at least one position in the image to be processed. At least one position is used to determine a pixel point area from the image to be processed. In a possible implementation, the device for measuring the area receives at least one position input by a user through an input component. The input component includes: a keyboard, a mouse, a touch screen, a touch pad, an audio input device, etc.

[0143] In another implementation of obtaining at least one location, the area measuring device receives at least one location sent by a fourth terminal. Optionally, the fourth terminal can be any one of the following: a mobile phone, a computer, a tablet computer, a server, and a wearable device. The fourth terminal can be the same as or different from the first terminal.

[0144] 2. Determine a pixel point region from the image to be processed according to the at least one position as the pixel point region to be tested.

[0145] In a possible implementation, the shape of the pixel region to be measured is circular, and at least one position includes the position of the center of the circle and the radius. The area measuring device determines the pixel region to be measured from the image to be processed based on the at least one position.

[0146] In another possible implementation, the shape of the pixel region to be measured is a rectangle, and at least one position includes the coordinates of four vertices of the rectangle. The area measuring device determines the pixel region to be measured from the image to be processed based on the at least one position.

[0147] In another possible implementation, the shape of the pixel region to be measured is an irregular polygon, and at least one position includes the coordinates of all vertices of the irregular polygon. The area measuring device determines the pixel region to be measured from the image to be processed based on the at least one position.

[0148] See also Figure 4 , Figure 4 It is a flowchart of a possible method for obtaining the transmission parameters of the first image provided in an embodiment of the present application.

[0149] 401 . Perform object detection processing on the image to be processed or perform object detection processing on the pixel area to be detected to obtain the position of the first object frame and the position of the second object frame.

[0150] In the embodiment of the present application, the object detection process is an object whose physical size is close to the determined value. For example, the average length of a human face is 20 centimeters, and the object detection process can be a human face. For another example, the average height of a person is 1.65 meters, and the object detection process can be a human body. For another example, in a football field, Figure 5 The heights of the goals shown are all fixed (eg, 2.44 meters), and the detection object of the object detection process may be the goals.

[0151] In the embodiment of the present application, the object frame can be of any shape, and the present application does not limit the shape of the object frame (including the first object frame and the second object frame mentioned above). Optionally, the shape of the object frame includes at least one of the following: rectangle, diamond, circle, ellipse, polygon.

[0152] In an embodiment of the present application, the position of the object frame (including the position of the above-mentioned first object frame and the position of the above-mentioned second object frame) is used to determine the pixel point area contained in the object frame, that is, the position of the object frame in the image to be processed. For example, when the shape of the object frame is a rectangle, the position of the object frame may include the coordinates of any pair of diagonals in the rectangle, wherein a pair of diagonals refers to two vertices on the diagonal line of the rectangle. For another example, when the shape of the object frame is a 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. For another example, when the shape of the body frame is a circle, the position of the object frame may include: the position of the center of the object frame, and the radius of the object frame.

[0153] In an embodiment of the present application, the number of detection objects processed by the object detection is not less than 1. For example, when the detection object is a human face, the position of the face frame containing the face can be obtained by performing object detection processing on the processed image. For another example, when the detection object includes a face and a human body, the position of the face frame containing the face and the position of the human body frame containing the human body can be obtained by performing object detection processing on the processed image. For another example, when the detection object includes a face, a human body and a screw, the position of the face frame containing the face, the position of the human body frame containing the human body and the position of the screw frame containing the screw can be obtained by performing object detection processing on the processed image. Optionally, the detection object of the object detection processing includes at least one of the following: a face, a foot, a human body, a screw, and a goal.

[0154] In one possible implementation, object detection processing of the image to be processed can be implemented by a convolutional neural network. The convolutional neural network is trained by using images with annotation information as training data, so that the trained convolutional neural network can complete object detection processing of the image. The annotation information of the image in the training data is the position information of the object box, and the object box contains the detection object of the object detection processing.

[0155] In another possible implementation, object detection processing may be implemented through an object detection algorithm, wherein the object detection algorithm may be one of the following: you only look once (YOLO), a deformable part model (DMP), a single shot multiBox detector (SSD), a Faster-RCNN algorithm, etc. This application does not limit the object detection algorithm for implementing object detection processing.

[0156] In the embodiment of the present application, the detection object contained in the first object frame is different from the detection object contained in the second object frame. For example, the detection object contained in the first object frame is Zhang San's face, and the detection object contained in the second object frame is Li Si's face. For another example, the detection object contained in the first object frame is Zhang San's face, and the detection object contained in the second object frame is a signboard.

[0157] In an embodiment of the present application, the device for measuring area can obtain the position of a first object frame containing a first object and the position of a second object frame containing a second object by performing object detection processing on the image to be processed; the device for measuring area can also obtain the position of a first object frame containing a first object and the position of a second object frame containing a second object by performing object detection processing on the pixel point area to be measured.

[0158] 402. Obtain a first size of the first object according to the position of the first object frame, and obtain a second size of the second object according to the position of the second object frame.

[0159] The device for measuring the area 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 device for measuring the area 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.

[0160] The area measuring device can obtain a first size of the first object according to the position of the first object frame, and obtain a second size of the second object according to the position of the second object frame.

[0161] 403. Obtain a second transmission parameter according to the first size and the third size, and obtain a third transmission parameter according to the second size and the fourth size.

[0162] In the embodiment of the present application, the third size is the physical size of the first object, and the fourth size is the physical size of the second object. For example, if the detection object contained in the first object frame is a human body, the third size can be the height of the person (such as 170 cm). For another example, if the detection object contained in the second object frame is a human face, the third size can be the length of the human face (such as 20 cm).

[0163] The device for measuring the area may determine a pixel point (i.e., a second pixel point) in the image to be processed based on the position of the first object frame. For example, when the shape of the first object frame is a rectangle, the device for measuring the area may determine the position of the geometric center of the first object frame based on the position of the first object frame, and use the pixel point corresponding to the geometric center as the second pixel point. For another example, when the shape of the first object frame is a rectangle, the device for measuring the area may determine the position of any vertex of the first object frame based on the position of the first object frame, and use the pixel point corresponding to the vertex as the second pixel point. For another example, when the shape of the first object frame is a circle, the device for measuring the area may determine the position of the center of the first object frame based on the position of the first object frame, and use the pixel point corresponding to the center of the circle as the second pixel point. Similarly, the device for measuring the area may determine a pixel point, i.e., a third pixel point, in the image to be processed based on the position of the second object frame.

[0164] In the embodiment of the present application, the size of the second pixel is called the fifth size, the size of the object point corresponding to the second pixel is called the sixth size, the size of the third pixel is called the seventh size, and the size of the object point corresponding to the third pixel is called the eighth size. The conversion relationship between the fifth size and the sixth size is called the second transmission parameter, and the conversion relationship between the seventh size and the eighth size is called the third transmission parameter.

[0165] The device for measuring the area can obtain a second transmission parameter according to the first size and the third size, and can obtain a third transmission parameter according to the second size and the fourth size. Assume that the first size is s1, the second size is s2, the third size is s3, the fourth size is s4, the second transmission parameter is b3, and the third transmission parameter is b4.

[0166] In one possible implementation, s1, s3, and b3 satisfy the following formula:

[0167] s2, s4, b4 satisfy the following formula:

[0168] Wherein, r is a positive number. Optionally, r=1.

[0169] In another possible implementation, s1, s3, and b3 satisfy the following formula:

[0170] s2, s4, b4 satisfy the following formula:

[0171] Wherein, r is a positive number, c is a real number. Optionally, r=1, c=0.

[0172] In another possible implementation, s1, s3, and b3 satisfy the following formula:

[0173] s2, s4, b4 satisfy the following formula:

[0174] Wherein, r is a positive number, c is a real number. Optionally, r=1, c=0.

[0175] 404 . Perform curve fitting processing on the second transmission parameter and the third transmission parameter to obtain a first transmission parameter map of the pixel point area to be measured.

[0176] Since in the image, the scale of the pixel point is linearly related to the horizontal coordinate of the pixel point, and / or the scale of the pixel point is linearly related to the vertical coordinate of the pixel point, the device for measuring the area can obtain a first transmission parameter map of the pixel point area to be measured by performing curve fitting processing on the second transmission parameter and the third transmission parameter. According to the pixel value in the first transmission parameter map, the transmission parameter of any pixel point in the pixel point area to be measured can be determined.

[0177] Take the fifth pixel in the first transmission parameter map as an example. Assuming that the pixel value of the fifth pixel is the first pixel value, the position of the fifth pixel in the first transmission parameter map is the same as the position of the fourth pixel in the pixel area to be measured, that is, the fifth pixel is the pixel corresponding to the fourth pixel in the first transmission parameter map. Then the device for measuring the area can determine the conversion relationship between the size of the fourth pixel (i.e., the ninth size) and the tenth size based on the first pixel value, where the tenth size is the size of the object point corresponding to the fourth pixel.

[0178] Assume that the first pixel value is p1, the ninth size is s5, and the tenth size is s6. In a possible implementation, p1, s5, and s6 satisfy the following formula:

[0179] p1=u×s5 / s6…Formula (7)

[0180] Wherein, u is a positive number. Optionally, u=1.

[0181] In another possible implementation, p1, s5, and s6 satisfy the following formula:

[0182] p1=u×s5 / s6+y…Formula (8)

[0183] Wherein, u is a positive number, y is a real number. Optionally, u=1, y=0.

[0184] In another possible implementation, p1, s5, and s6 satisfy the following formula:

[0185]

[0186] Wherein, u is a positive number, y is a real number. Optionally, u=1, y=0.

[0187] Similarly, the area measuring device can determine the transmission parameter of any pixel point except the fourth pixel point in the pixel point area to be measured according to the first transmission parameter map.

[0188] 405. Obtain the first transmission parameter according to the first transmission parameter map and the pixel value corresponding to the first pixel point.

[0189] The device for measuring the area can determine the reference pixel value (i.e., the pixel value corresponding to the first pixel in the first transmission parameter map) from the first transmission parameter map according to the position of the first pixel in the pixel area to be measured, wherein the position of the pixel corresponding to the reference pixel value in the first transmission parameter map is the same as the position of the first pixel in the pixel area to be measured. The device for measuring the area can then obtain the first transmission parameter according to the reference pixel value.

[0190] In the embodiment of the present application, the second transmission parameter is obtained according to the first size and the third size, and the third transmission parameter is obtained according to the second size and the fourth size. The first transmission parameter map is obtained by performing curve fitting processing on the second transmission parameter and the third transmission parameter, and then the transmission parameter of any pixel point in the pixel point area to be measured can be determined according to the first transmission parameter map.

[0191] As an optional implementation, before executing step 404, the area measuring device further executes the following steps:

[0192] 3. Get the confidence map.

[0193] In the embodiment of the present application, the accuracy of the transmission parameter of a pixel point is positively correlated with the accuracy of the size of the object point corresponding to the pixel point. Correspondingly, the accuracy of the first transmission parameter map is positively correlated with the accuracy of the size of the first object and the size of the second object.

[0194] Obviously, the accuracy of the size of an object with a fixed size is higher than the accuracy of the size of an object with a floating size.

[0195] For example, a standard soccer goal has a width of 7.32 meters and a height of 2.44 meters. 90% of people are between 1.4 meters and 2 meters tall. The accuracy of the size of a soccer goal is higher than the accuracy of a person's height.

[0196] For another example, the height of a standard basketball stand is 3.05 meters. The length of 95% of human faces is between 17 centimeters and 30 centimeters. The accuracy of the height of a basketball stand is higher than the accuracy of the length of a human face.

[0197] For another example, a screw with a fixed length. 95% of people's feet are between 20 cm and 35 cm long. The length accuracy of a screw with a fixed length is higher than the accuracy of a human foot.

[0198] Optionally, the above-mentioned object with a fixed size may be an object with a fixed size in a specific scene, for example, a boarding sign in a waiting room, a chair in a gymnasium, or a desk in an office.

[0199] In the embodiment of the present application, the confidence mapping represents the mapping between the object type and the confidence of the transmission parameter. For example, the confidence mapping can be seen in Table 1.

[0200] Object Type Confidence Goals, basketball hoops, boarding signs 0.9 human body 0.8 Face 0.7 Human feet 0.65

[0201] Table 1

[0202] In an implementation of obtaining a confidence map, the area measuring device receives the confidence map input by the user through an input component. The input component includes: a keyboard, a mouse, a touch screen, a touch pad, an audio input device, and the like.

[0203] In another implementation of obtaining the confidence map, the area measuring device receives the confidence map sent by the fifth terminal. Optionally, the fifth terminal can be any one of the following: a mobile phone, a computer, a tablet computer, a server, a wearable device. The fifth terminal can be the same as the first terminal or different.

[0204] 4. According to the object type of the first object and the confidence mapping, obtain a first confidence of the second transmission parameter.

[0205] After the area measuring device obtains the confidence map, the first confidence of the second transmission parameter can be obtained according to the confidence map and the object type of the first object. For example, assuming that the confidence map is as shown in Table 1 above, and the object type of the first object is a human body, the first confidence is 0.9. For another example, assuming that the confidence map is as shown in Table 1 above, and the object type of the first object is a human foot, the first confidence is 0.65.

[0206] Optionally, the area measuring device may determine the object type of the first object by performing feature extraction processing on a pixel point area included in the first object frame.

[0207] As an optional real-time method, the device for measuring the area can determine the transmission parameters corresponding to the objects in each object frame according to the object type of the objects in each object frame. For example, the device for measuring the area can obtain the confidence of the third transmission parameter (hereinafter referred to as the third confidence) according to the object type and confidence mapping of the second object.

[0208] After obtaining the first confidence level, the area measuring device performs the following steps during the execution of step 404:

[0209] 5. Obtain a fourth transmission parameter based on the first confidence level and the second transmission parameter.

[0210] In the embodiment of the present application, the fourth transmission parameter is positively correlated with the first confidence level. Assume that the first confidence level is c1 and the fourth transmission parameter is b5. In a possible implementation, c1 and b5 satisfy the following formula:

[0211] b5=a×c1…Formula (10)

[0212] Wherein, a is a positive number. Optionally, a=1.

[0213] In another possible implementation, c1 and b5 satisfy the following formula:

[0214] b5=a×c1+e…Formula (11)

[0215] Wherein, a is a positive number, e is a real number. Optionally, a=1, e=0.

[0216] In another possible implementation, c1 and b5 satisfy the following formula:

[0217]

[0218] Wherein, a is a positive number, e is a real number. Optionally, a=1, e=0.

[0219] 6. Perform curve fitting processing on the third transmission parameter and the fourth transmission parameter to obtain the first transmission parameter graph.

[0220] The device for measuring area can improve the accuracy of the first transmission parameter map by performing curve fitting processing on the third transmission parameter and the fourth transmission parameter.

[0221] As an optional implementation, when the device for measuring area obtains the third confidence level by executing step 4 and obtains the fifth transmission parameter based on the third confidence level and the third transmission parameter, the device for measuring area can obtain the first transmission parameter graph by performing curve fitting processing on the fourth transmission parameter and the fifth transmission parameter.

[0222] As an optional implementation, before executing step 4, the area measuring device further executes the following steps:

[0223] 7. Perform feature extraction processing on the pixel point area within the first object frame to obtain feature data.

[0224] In the embodiment of the present application, the feature extraction process can be a convolution process, a pooling process, or a combination of a convolution process and a pooling process. Optionally, the feature extraction process can be implemented by a trained convolutional neural network or a feature extraction model, which is not limited in the present application.

[0225] The area measuring device can extract semantic information from the pixel area within the object frame by performing feature extraction processing on the pixel area within the object frame, thereby obtaining feature data of the object frame.

[0226] In an implementation method for performing feature extraction processing on a pixel region within a first object frame, at least two convolution layers are used to perform convolution processing on the pixel region within the first object frame layer by layer, thereby completing feature extraction processing on the pixel region within the first object frame. The convolution layers in at least two convolution layers are connected in series, that is, the output of the previous convolution layer is the input of the next convolution layer, and the semantic information extracted by each convolution layer is different. Specifically, the feature extraction processing abstracts the features of the pixel region within the first object frame step by step, and also gradually discards relatively minor feature data, wherein the relatively minor feature information refers to feature information other than feature information that can be used to determine the object type of the object in the first object frame. Therefore, the smaller the size of the feature data extracted later, the more concentrated the semantic information. The semantic information of the pixel region within the first object frame can be obtained by performing convolution processing on the pixel region within the first object frame step by step through multiple convolution layers.

[0227] Optionally, the area measuring device may perform feature extraction processing on the pixel point area within each object frame respectively to obtain feature data of the pixel point area within each object frame.

[0228] 8. Based on the above feature data, obtain the score of the above first object.

[0229] Taking into account that the actual size of an object that does not have a fixed size may change, in an embodiment of the present application, the state of the object is determined based on the characteristic 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 positively correlated with the confidence of the size of the object.

[0230] For example, assuming that the object is a human body and the size of the object is the height of the person. When the person is standing upright, the height of the person is equal to the person's real height, and at this time, the confidence of the person's height is the highest; when the person is walking, there is a small error between the height of the person and the person's real height, and at this time, the confidence of the person's height is second; when the person is lowering his head (such as looking down at a mobile phone), there is a small error between the height of the person and the person's real height, and at this time, the confidence of the person's height is lower than the confidence of the height of the person walking; when the person is sitting, there is a large error between the height of the person and the person's real height, and at this time, the confidence of the person's height is low.

[0231] In the embodiment of the present application, the device for measuring the area can determine the score of the object in the object frame based on the feature data extracted from the pixel point area in the object frame.

[0232] As an optional implementation, the area measuring device may use a classifier (such as a support vector machine, a softmax function) to process the feature data of the object frame to obtain a score of the object in the object frame.

[0233] Optionally, the device for measuring area can use a neural network to process the pixel area within the object frame to obtain the score of the object within the object frame. For example, the device for measuring area uses a labeled image set as training data to train the neural network to obtain a trained neural network. The trained neural network is used to process an unlabeled image set to obtain a label of the unlabeled image set. The trained neural network is trained using a labeled image set, an unlabeled image set, and labels of an unlabeled image set to obtain an image processing neural network. The information carried by the label includes the position of the object frame in the image and the score of the object within the object frame.

[0234] The device for measuring the area can obtain the score of the first object according to the characteristic data of the first object. Optionally, the device for measuring the area can obtain the score of each object separately.

[0235] When the score of the first object is obtained, the area measuring device performs the following steps during the process of executing step 4:

[0236] 9. Obtain a second confidence level of the second transmission parameter based on the object type of the first object and the confidence level mapping.

[0237] The implementation process of this step can refer to step 4, but in this step, the device for measuring the area maps the object type and confidence of the first object, and obtains the second confidence instead of the first confidence.

[0238] 10. Based on the above score and the above second confidence level, obtain the above first confidence level.

[0239] In the embodiment of the present application, the first confidence level is correlated with the score. Assume that the first confidence level is c1, the second confidence level is c2, and the score is s. In a possible implementation, c1, c2, and s satisfy the following formula:

[0240] c2=α×s×c1…Formula (13)

[0241] Wherein, α is a positive number. Optionally, α=1.

[0242] In another possible implementation, c1, c2, and s satisfy the following formula:

[0243] c2=α×s×c1+σ…Formula (14)

[0244] Wherein, α is a positive number, σ is a real number. Optionally, α=1, σ=0.

[0245] In another possible implementation, c1, c2, and s satisfy the following formula:

[0246]

[0247] Wherein, α is a positive number, σ is a real number. Optionally, α=1, σ=0.

[0248] The device for measuring the area obtains the first confidence level according to the score of the first object and the second confidence level, thereby improving the accuracy of the first confidence level.

[0249] Optionally, the device for measuring area may obtain a fourth confidence level of the third transmission parameter by executing step 9. The device for measuring area may obtain the third confidence level according to the score of the second object and the fourth confidence level.

[0250] As an optional implementation, before executing step 6, the area measuring device further executes the following steps:

[0251] 11. Obtain a depth image of the above-mentioned image to be processed.

[0252] In an embodiment of the present application, the depth image of the image to be processed carries the depth information of the pixels in the image to be processed. In one possible implementation, the device for measuring the area receives the depth image input by the user through an input component. The input component includes: a keyboard, a mouse, a touch screen, a touch pad, an audio input device, etc.

[0253] In another possible implementation, the device for measuring the area is equipped with an RGB camera and a depth camera. The device for measuring the area uses the depth camera to collect a depth image of the image to be processed while using the RGB camera to collect the image to be processed. The depth camera can be any one of the following: a structured light camera, a TOF camera, or a binocular stereo vision camera.

[0254] In another possible implementation, the area measuring device receives a depth image sent by a fourth terminal, wherein the fourth terminal includes a mobile phone, a computer, a tablet computer, a server, etc. In this embodiment, the fourth terminal may be the same as or different from the first terminal.

[0255] 12. Obtain first depth information of the second pixel and second depth information of the third pixel according to the depth image.

[0256] As described above, the depth image carries the depth information of the pixels in the image to be processed. After acquiring the depth image, the area measuring device can determine the depth information of the second pixel (i.e., the first depth information) and the depth information of the third pixel (i.e., the second depth information) based on the depth image.

[0257] 13. Obtain a first data point according to the first depth information and the fourth transmission parameter, and obtain a second data point according to the second depth information and the third transmission parameter.

[0258] In a possible implementation, 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 fourth transmission parameter, and the ordinate of the second data point is the third transmission parameter. That is, the device for measuring the area uses the depth information of the pixel point as the abscissa and the transmission parameter of the pixel point as the ordinate.

[0259] In a possible implementation, 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 fourth transmission parameter, and the abscissa of the second data point is the third transmission parameter. That is, the device for measuring the area uses the depth information of the pixel point as the ordinate and the transmission parameter of the pixel point as the abscissa.

[0260] After obtaining the first data point and the second data point, the device for measuring the area performs the following steps during the process of executing step 6:

[0261] 14. Perform curve fitting processing on the first data point and the second data point to obtain the first transmission parameter graph.

[0262] Since both the first data point and the second data point carry depth information of the pixel point, the device for measuring the area performs curve fitting processing on the first data point and the second data point, and the first transmission parameter map obtained also carries depth information.

[0263] Because the scale of the pixel in the image to be processed is determined based on the depth information of the pixel, the accuracy of the scale of the pixel in the image to be processed can be improved, so the device for measuring the area obtains the first transmission parameter map by executing step 14, which can improve the accuracy of the first transmission parameter map, and then improve the accuracy of the transmission parameters of the pixel in the image to be processed, thereby increasing the area of ​​the physical area corresponding to the pixel area to be measured.

[0264] As an optional implementation manner, the device for measuring area performs at least one of the following steps during the process of executing step 401:

[0265] The device for measuring the area performs object detection processing on the pixel area to be measured to determine the number of objects in the pixel area to be measured. Since obtaining the first transmission parameter map of the pixel area to be measured requires transmission parameters of at least different positions, obtaining the first transmission parameter map of the pixel area to be measured requires at least two objects.

[0266] When the number of objects contained in the pixel region to be measured exceeds 1, the area measuring device can obtain the positions of at least two object frames by performing object detection processing on the pixel region to be measured. At this time, the area measuring device executes step 15.

[0267] 15. When the positions of at least two object frames are obtained by performing object detection processing on the pixel point area to be detected, the position of the first object frame and the position of the second object frame are determined from the positions of the at least two object frames.

[0268] The device for measuring the area selects the positions of two object frames from the positions of at least two object frames as the positions of the first object frame and the second object frame, respectively. For example, the device for measuring the area obtains the positions of object frame 1, object frame 2, and object frame 3 by performing object detection processing on the pixel point area to be measured. The measuring device can use the position of object frame 1 as the position of the first object frame and the position of object frame 2 as the position of the second object frame; the measuring device can use the position of object frame 2 as the position of the first object frame and the position of object frame 3 as the position of the second object frame; the measuring device can also use the position of object frame 3 as the position of the first object frame and the position of object frame 1 as the position of the second object frame.

[0269] When the number of objects contained in the pixel region to be measured does not exceed 1, the area measuring device can obtain the position of at most one object frame by performing object detection processing on the pixel region to be measured. At this time, the area measuring device executes steps 16 and 17.

[0270] 16. When the position of at most one object frame is obtained by performing object detection processing on the above-mentioned pixel point area to be measured, object detection processing is performed on the non-measurement pixel point area in the above-mentioned image to be processed to obtain the position of at least one object frame.

[0271] In the embodiment of the present application, the non-measured pixel point area is a pixel point area in the image to be processed that does not intersect with the pixel point area to be measured.

[0272] In the case where the number of objects included in the pixel area to be measured does not exceed 1, in order to obtain the first transmission parameter map of the pixel area to be measured, object detection processing can be performed on the non-measured pixel area to obtain the position of at least one object frame. Specifically, in the case where the pixel area to be measured contains 1 object, the device for measuring the area can obtain the position of at least one object frame by performing object detection processing on the non-measured pixel area; in the case where the pixel area to be measured does not contain an object, the device for measuring the area can obtain the positions of at least two object frames by performing object detection processing on the non-measured pixel area.

[0273] 17. Determine the position of the first object frame and the position of the second object frame from the position of the at most one object frame and the position of the at least one object frame.

[0274] In the case where the pixel area to be measured includes one object, the position of at most one object frame includes the position of one object frame (hereinafter referred to as the position of the object frame to be selected). The device for measuring the area can select two positions from the position of the object frame in the area to be measured and the position of at least one object frame as the position of the first object frame and the position of the second object frame, respectively.

[0275] Optionally, the device for measuring area uses the position of the object frame to be selected as the position of the first object frame, and selects a position from the position of at least one object frame as the position of the second object frame; the device for measuring area uses the position of the object frame to be selected as the position of the second object frame, and selects a position from the position of at least one object frame as the position of the first object frame.

[0276] When the pixel area to be measured does not contain an object, the position of at most one object frame does not include the position of the object frame. The device for measuring the area can select two positions from the position in the area to be measured and the position of at least one object frame as the position of the first object frame and the position of the second object frame, respectively.

[0277] In an embodiment of the present application, the device for measuring area determines the number of objects in the pixel area to be measured by performing object detection processing on the pixel area to be measured, and then determines whether it is necessary to perform object detection processing on the non-measurement pixel area based on the number, thereby reducing the data processing amount of the device for measuring area.

[0278] As an optional implementation manner, after obtaining the first data point and the second data point, the area measuring device further performs the following steps:

[0279] 18. Perform curve fitting processing on the first data point and the second data point to obtain a second transmission parameter map of the image to be processed.

[0280] Since the second pixel point and the third pixel point both belong to the image to be processed, the device for measuring the area can obtain a second transmission parameter map of the image to be processed by performing curve fitting processing on the first data point and the second data point. It should be understood that the first transmission parameter map belongs to the second transmission parameter map, that is, the second transmission parameter map includes the first transmission parameter map.

[0281] 19. Obtain the target position of the region of interest in the image to be processed and the physical size of the region of interest.

[0282] In the embodiment of the present application, the region of interest refers to the pixel point region in the image to be processed. For example, in the process of using the device for measuring area to monitor illegal parking, the device for measuring area can use the illegal parking area in the image to be processed as the region of interest. For another example, in the process of using the device for measuring area to monitor non-motor vehicles invading the highway, the device for measuring area can use the highway area in the image to be processed as the region of interest.

[0283] The physical size of the region of interest is the size of the physical area corresponding to the region of interest. For example, if the region of interest is an illegal parking area in the image to be processed, the physical size of the region of interest is the size of the illegal parking area in the real world.

[0284] In one implementation of obtaining the target position, the area measuring device receives the target position input by the user through an input component. The input component includes: a keyboard, a mouse, a touch screen, a touch pad, an audio input device, etc.

[0285] In another implementation of obtaining the target position, the area measuring device receives the target position sent by the sixth terminal. Optionally, the sixth terminal can be any one of the following: a mobile phone, a computer, a tablet computer, a server, a wearable device. The sixth terminal can be the same as the first terminal or different.

[0286] In one implementation of obtaining the physical size of the region of interest, the area measuring device receives the physical size of the region of interest input by the user through an input component, which includes a keyboard, a mouse, a touch screen, a touch pad, and an audio input device.

[0287] In another implementation of obtaining the physical size of the region of interest, the area measuring device receives the physical size of the region of interest sent by the seventh terminal. Optionally, the seventh terminal can be any one of the following: a mobile phone, a computer, a tablet computer, a server, a wearable device. The seventh terminal can be the same as or different from the first terminal.

[0288] 20. According to the second transmission parameter map, the target position and the physical size of the region of interest, the size of the region of interest in the image to be processed is obtained.

[0289] Since the scale of a pixel is linearly related to the horizontal coordinate of the pixel, and / or the scale of a pixel is linearly related to the vertical coordinate of the pixel, the scale of the line between any two pixels in the image can be expressed by the scale of the midpoint of the two pixels, that is, the transmission parameter of the line between any two pixels in the image can be expressed by the transmission parameter of the midpoint of the two pixels.

[0290] In an embodiment of the present application, the transmission parameter of a line segment in an image characterizes the conversion relationship between the length of the line segment and the physical length corresponding to the line segment. For example, the image to be processed includes Zhang San and Li Si. Assume that the position of pixel a represents the position of Zhang San in the image, the position of pixel b represents the position of Li Si in the image, the line between pixel a and pixel b is line segment A, the transmission parameter of line segment A is transmission parameter 1, and the physical line segment corresponding to line segment A is line segment B. The device for measuring area can obtain the length of line segment B based on the length of line segment A and transmission parameter 1. The device for measuring area can also obtain the length of line segment A based on the length of line segment B and transmission parameter 1.

[0291] The device for measuring the area can obtain the length of the line segment in the image based on the transmission parameter of the line segment in the region of interest and the physical length of the line segment. The device for measuring the area can further obtain the size of the region of interest in the image. For example, the shape of the region of interest is a circle. The device for measuring the area can obtain the length of the radius in the image based on the physical length of the radius and the transmission parameter of the radius. For another example, the shape of the region of interest is a rectangle. The device for measuring the area can obtain the length of the region of interest in the image based on the physical length of the length of the rectangle and the transmission parameter of the length; the device for measuring the area can obtain the width of the region of interest in the image based on the physical length of the width of the rectangle and the transmission parameter of the width.

[0292] As an optional implementation, the transmission parameter of the pixel point is linearly positively correlated with the horizontal coordinate of the pixel point, and / or the transmission parameter of the pixel point is linearly positively correlated with the vertical coordinate of the pixel point. The device for measuring the area obtains the size of the region of interest in the image to be processed based on the second transmission parameter map, the target position and the physical size of the region of interest.

[0293] For example, suppose the transmission parameter of a pixel is T, the horizontal coordinate of the pixel is X, and the vertical coordinate of the pixel is Y. Then T, X, and Y satisfy the following formula:

[0294] T x =μ×X…Formula (16)

[0295] Wherein, μ is a positive number.

[0296] Assume that the shape of the region of interest is a circle, the coordinates of the center of the circle are (x1, y1), the coordinates of any point on the circle are (x2, y2), the physical radius of the region of interest is R, and the transmission parameter of the line segment represents the ratio between the length of the line segment in the image and the physical length corresponding to the line segment. Then x1, y1, x2, y2, and R satisfy the following formula:

[0297]

[0298] 21. According to the target position and the size of the region of interest in the image to be processed, determine a pixel point area from the image to be processed as the region of interest.

[0299] In an embodiment of the present application, the area measuring device determines the region of interest from the image to be processed based on the transmission parameters of the pixel points in the image to be processed, the target position and the physical size of the region of interest, which can improve the matching degree between the range of the region of interest and the range of the physical area corresponding to the region of interest, thereby improving the accuracy of determining the region of interest from the image to be processed.

[0300] Based on the technical solution provided in the embodiments of the present application, the user can determine the area of ​​interest corresponding to the physical area from the image to be processed by the device for measuring the area by inputting the position of the physical area in the image to be processed and the size of the physical area in the real world into the device for measuring the area.

[0301] The above describes in detail the method of the embodiment of the present application, and the following provides the device of the embodiment of the present application. Figure 6 , Figure 6 A schematic diagram of a device for measuring an area provided in an embodiment of the present application is provided. The device for measuring an area includes: an acquisition unit 11 and a first processing unit 12, wherein:

[0302] An acquisition unit 11 is used to acquire first transmission parameters of a pixel region to be measured and a first pixel; the first pixel belongs to the pixel region to be measured; the first transmission parameter represents a conversion relationship between a size of the first pixel and a size of a first object point; the first object point is an object point corresponding to the first pixel;

[0303] The first processing unit 12 is used to determine the sum of the areas of at least one object point corresponding to at least one pixel point in the pixel point area to be measured, and obtain the area of ​​the physical area corresponding to the pixel point area to be measured; the at least one pixel point includes the first pixel point; the area of ​​the object point corresponding to the first pixel point is obtained based on the area of ​​the first pixel point and the first transmission parameter.

[0304] In combination with any embodiment of the present application, the acquisition unit 11 is used to:

[0305] Acquire an image to be processed and at least one position in the image to be processed;

[0306] A pixel point region is determined from the image to be processed according to the at least one position as the pixel point region to be tested.

[0307] In combination with any embodiment of the present application, the pixel point area to be measured belongs to the image to be processed, and the acquisition unit 11 is used to:

[0308] Performing object detection processing on the image to be processed or performing object detection processing on the pixel point area to be detected to obtain the position of a first object frame and the position of a second object frame; the first object frame contains a first object; the second object frame contains a second object;

[0309] Obtaining a first size of the first object according to the position of the first object frame, and obtaining a second size of the second object according to the position of the second object frame;

[0310] A second transmission parameter is obtained according to the first size and the third size, and a third 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 second 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 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; the fourth size is the physical size of the second object; the third 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 position of the third pixel in the 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;

[0311] The second transmission parameter and the third transmission parameter are subjected to curve fitting processing to obtain a first transmission parameter map of the pixel point area to be measured; the conversion relationship between the ninth dimension and the tenth dimension is determined according to the first pixel value in the first transmission parameter map; the ninth dimension is the dimension of a fourth pixel point in the pixel point area to be measured; the tenth dimension is the dimension of an object point corresponding to the fourth pixel point; the first pixel value is the pixel value of a fifth pixel point; the fifth pixel point is the pixel point corresponding to the fourth pixel point in the first transmission parameter map;

[0312] The first transmission parameter is obtained according to the pixel value corresponding to the first pixel point in the first transmission parameter map.

[0313] In combination with any embodiment of the present application, the acquisition unit 11 is further used to acquire a confidence map before performing curve fitting processing on the second transmission parameter and the third transmission parameter to obtain the first transmission parameter map of the pixel point area to be measured; the confidence map represents the mapping between the object type and the confidence of the transmission parameter;

[0314] The area measuring device 1 further includes: a second processing unit 13, configured to obtain a first confidence level of the second transmission parameter according to the object type of the first object and the confidence level mapping;

[0315] The acquisition unit 11 is further used for:

[0316] Obtaining a fourth transmission parameter according to the first confidence level and the second transmission parameter; the fourth transmission parameter is positively correlated with the first confidence level;

[0317] Curve fitting is performed on the third transmission parameter and the fourth transmission parameter to obtain the first transmission parameter graph.

[0318] In combination with any embodiment of the present application, the area measuring device 1 further includes:

[0319] A third processing unit 14 is used for performing feature extraction processing on a pixel point area within the first object frame to obtain feature data before obtaining the first confidence of the second transmission parameter according to the object type of the first object and the confidence mapping;

[0320] The fourth processing unit 15 is used to obtain a score of the first object according to the feature data; the score is positively correlated with the confidence of the size of the first object;

[0321] The second processing unit 13 is used for:

[0322] Obtaining a second confidence level of the second transmission parameter according to the object type of the first object and the confidence level mapping;

[0323] The first confidence level is obtained according to the score and the second confidence level; the first confidence level is correlated with the score.

[0324] In combination with any embodiment of the present application, the acquisition unit 11 is further used for:

[0325] The product of the first confidence level and the second transmission parameter is determined to obtain the fourth transmission parameter.

[0326] In combination with any embodiment of the present application, the acquisition unit is further configured to acquire a depth image of the image to be processed before performing curve fitting processing on the third transmission parameter and the fourth transmission parameter to obtain the first transmission parameter map;

[0327] The second processing unit 13 is further configured to:

[0328] Obtaining first depth information of the second pixel and second depth information of the third pixel according to the depth image;

[0329] Obtain a first data point according to the first depth information and the fourth transmission parameter, and obtain a second data point according to the second depth information and the third transmission parameter;

[0330] The acquisition unit 11 is further used for:

[0331] Curve fitting is performed on the first data point and the second data point to obtain the first transmission parameter map.

[0332] In combination with any embodiment of the present application, the acquisition unit 11 is further used for:

[0333] Performing curve fitting processing on the first data point and the second data point to obtain a second transmission parameter map of the image to be processed;

[0334] Acquire a target position of a region of interest in the image to be processed and a physical size of the region of interest;

[0335] Obtaining the size of the region of interest in the image to be processed according to the second transmission parameter map, the target position and the physical size of the region of interest;

[0336] According to the target position and the size of the region of interest in the image to be processed, a pixel point region is determined from the image to be processed as the region of interest.

[0337] In combination with any embodiment of the present application, the acquisition unit 11 is further used for:

[0338] When the positions of at least two object frames are obtained by performing object detection processing on the pixel point area to be detected, determining the position of the first object frame and the position of the second object frame from the positions of the at least two object frames;

[0339] In the case where the position of at most one object frame is obtained by performing object detection processing on the pixel point area to be measured, performing object detection processing on the non-measured pixel point area in the image to be processed to obtain the position of at least one object frame; the non-measured pixel point area does not intersect with the pixel point area to be measured;

[0340] The position of the first object frame and the position of the second object frame are determined from the position of the at most one object frame and the position of the at least one object frame.

[0341] In combination with any implementation manner of the present application, the size of the first object point obtained according to the first transmission parameter and the size of the first pixel point is positively correlated with the scale of the first pixel point.

[0342] In this embodiment, since the first transmission parameter carries the scale information of the first pixel point, the device for measuring the area determines the area of ​​the first object point based on the first transmission parameter and the area of ​​the first pixel point, which can improve the accuracy of the area of ​​the first object point, and further improve the accuracy of the sum of the areas of at least one physical point corresponding to at least one pixel point, thereby improving the accuracy of the area of ​​the physical area corresponding to the pixel point area to be measured.

[0343] In some embodiments, the functions or modules included in the device provided in the embodiments of the present application can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments. For the sake of brevity, it will not be repeated here.

[0344] Figure 7 A schematic diagram of the hardware structure of a device for measuring area provided in an embodiment of the present application. The device 2 for measuring area 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 via a connector, and the connector includes various interfaces, transmission lines, or buses, etc., which are not limited in the embodiments of the present application. It should be understood that in each embodiment of the present application, coupling refers to mutual connection in a specific manner, including direct connection or indirect connection through other devices, for example, it can be connected through various interfaces, transmission lines, buses, etc.

[0345] The processor 21 may be one or more graphics processing units (GPUs). When the processor 21 is a GPU, the GPU may be a single-core GPU or a multi-core GPU. Optionally, the processor 21 may be a processor group consisting of multiple GPUs, and the multiple processors are coupled to each other via one or more buses. Optionally, the processor may also be a processor of other object types, etc., which is not limited in the embodiments of the present application.

[0346] The memory 22 can be used to store computer program instructions and various computer program codes including the program code for executing the program code of the present application. Optionally, the memory includes but is not limited to random access memory (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM), or portable read only memory (CD-ROM), which is used for related instructions and data.

[0347] The input device 23 is used to input data and / or signals, and the output device 24 is used to output data and / or signals. The input device 23 and the output device 24 can be independent devices or an integrated device.

[0348] It can be understood that in the embodiment of the present application, the memory 22 can be used not only to store relevant instructions, but also to store relevant data. For example, the memory 22 can be used to store the first transmission parameter obtained through the input device 23, or the memory 22 can also be used to store the area of ​​the physical area obtained by the processor 21, etc. The embodiment of the present application does not limit the specific data stored in the memory.

[0349] Understandably, Figure 7 Only a simplified design of a device for measuring area is shown. In practical applications, the device for measuring area may also include other necessary components, including but not limited to any number of input / output devices, processors, memories, etc., and all devices for measuring area that can implement the embodiments of the present application are within the protection scope of the present application.

[0350] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0351] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. Those skilled in the art can also clearly understand that the descriptions of the various embodiments of the present application have different focuses. For the convenience and brevity of description, the same or similar parts may not be repeated in different embodiments. Therefore, for parts not described or not described in detail in a certain embodiment, refer to the records of other embodiments.

[0352] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0353] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0354] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0355] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using 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. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).

[0356] A person skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by a computer program to instruct the relevant hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned method embodiments. The aforementioned storage medium includes: a read-only memory (ROM) or a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

Claims

1. A method for measuring area, It is characterized in that The method comprises: Acquire first transmission parameters of a pixel region to be measured and a first pixel; the first pixel belongs to the pixel region to be measured; the first transmission parameter represents a conversion relationship between a size of the first pixel and a size of a first object point; the first object point is an object point corresponding to the first pixel, and the pixel region to be measured belongs to an image to be processed; The method of obtaining the first transmission parameter of the first pixel point includes: performing object detection processing on the image to be processed or performing object detection processing on the pixel point area to be detected to obtain the position of the first object frame and the position of the second object frame; the first object frame contains the first object; the second object frame contains the second object; the first size of the first object is obtained according to the position of the first object frame, and the second size of the second object is obtained according to the position of the second object frame; the second transmission parameter is obtained according to the first size and the third size, and the third 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 second transmission parameter represents the conversion relationship between the fifth size and the sixth size; the fifth size is the size of the second pixel point; the position of the second pixel point in the 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 size of the second object physical size; the third transmission parameter characterizes 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 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; the second transmission parameter and the third transmission parameter are subjected to curve fitting processing to obtain the first transmission parameter map of the pixel area to be measured; the conversion relationship between the ninth size and the tenth size is determined according to the first pixel value in the first transmission parameter map; the ninth size is the size of the fourth pixel in the pixel area to be measured; 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; the fifth pixel is the pixel corresponding to the fourth pixel in the first transmission parameter map; the first transmission parameter is obtained according to the pixel value corresponding to the first pixel in the first transmission parameter map; Determine the sum of the areas of at least one object point corresponding to at least one pixel in the pixel area to be measured, and obtain the area of ​​the physical area corresponding to the pixel area to be measured; the at least one pixel includes the first pixel; the area of ​​the object point corresponding to the first pixel is obtained based on the area of ​​the first pixel and the first transmission parameter.

2. The method according to claim 1, It is characterized in that The step of obtaining the pixel area to be tested includes: Acquire an image to be processed and at least one position in the image to be processed; A pixel point region is determined from the image to be processed according to the at least one position as the pixel point region to be tested.

3. The method according to claim 1, It is characterized in that Before performing curve fitting processing on the second transmission parameter and the third transmission parameter to obtain a first transmission parameter map of the pixel point area to be measured, the method further includes: Acquire a confidence map; the confidence map represents a mapping between object types and confidences of transmission parameters; Obtaining a first confidence level of the second transmission parameter according to the object type of the first object and the confidence level mapping; The performing curve fitting processing on the second transmission parameter and the third transmission parameter to obtain a first transmission parameter map of the pixel point area to be measured includes: Obtaining a fourth transmission parameter according to the first confidence level and the second transmission parameter; the fourth transmission parameter is positively correlated with the first confidence level; Curve fitting is performed on the third transmission parameter and the fourth transmission parameter to obtain the first transmission parameter graph.

4. The method according to claim 3, It is characterized in that Before obtaining the first confidence of the second transmission parameter according to the object type of the first object and the confidence mapping, the method further includes: Performing feature extraction processing on the pixel point area within the first object frame to obtain feature data; Obtaining a score of the first object according to the feature data; the score is positively correlated with the confidence level of the size of the first object; The obtaining, according to the object type of the first object and the confidence mapping, a first confidence of the second transmission parameter comprises: Obtaining a second confidence level of the second transmission parameter according to the object type of the first object and the confidence level mapping; The first confidence level is obtained according to the score and the second confidence level; the first confidence level is correlated with the score.

5. The method according to claim 3 or 4, It is characterized in that The obtaining a fourth transmission parameter according to the first confidence level and the second transmission parameter comprises: The product of the first confidence level and the second transmission parameter is determined to obtain the fourth transmission parameter.

6. The method according to any one of claims 3 to 5, It is characterized in that Before performing curve fitting processing on the third transmission parameter and the fourth transmission parameter to obtain the first transmission parameter graph, the method further includes: Acquire a depth image of the image to be processed; Obtaining first depth information of the second pixel and second depth information of the third pixel according to the depth image; Obtain a first data point according to the first depth information and the fourth transmission parameter, and obtain a second data point according to the second depth information and the third transmission parameter; The performing curve fitting processing on the third transmission parameter and the fourth transmission parameter to obtain the first transmission parameter graph includes: Curve fitting is performed on the first data point and the second data point to obtain the first transmission parameter map.

7. The method according to claim 6, It is characterized in that The method further comprises: Performing curve fitting processing on the first data point and the second data point to obtain a second transmission parameter map of the image to be processed; Acquire a target position of a region of interest in the image to be processed and a physical size of the region of interest; Obtaining the size of the region of interest in the image to be processed according to the second transmission parameter map, the target position and the physical size of the region of interest; According to the target position and the size of the region of interest in the image to be processed, a pixel point region is determined from the image to be processed as the region of interest.

8. The method according to any one of claims 1, 3 to 7, It is characterized in that The performing object detection processing on the image to be processed and / or the pixel point area to be detected to obtain the position of the first object frame and the position of the second object frame includes: When the positions of at least two object frames are obtained by performing object detection processing on the pixel point area to be detected, determining the position of the first object frame and the position of the second object frame from the positions of the at least two object frames; In the case where the position of at most one object frame is obtained by performing object detection processing on the pixel point area to be measured, performing object detection processing on the non-measured pixel point area in the image to be processed to obtain the position of at least one object frame; the non-measured pixel point area does not intersect with the pixel point area to be measured; The position of the first object frame and the position of the second object frame are determined from the position of the at most one object frame and the position of the at least one object frame.

9. The method according to any one of claims 1 to 8, It is characterized in that The size of the first object point obtained according to the first transmission parameter and the size of the first pixel point is positively correlated with the scale of the first pixel point.

10. A device for measuring area, It is characterized in that The device comprises: An acquisition unit, used for acquiring first transmission parameters of a pixel region to be measured and a first pixel; the first pixel belongs to the pixel region to be measured; the first transmission parameter represents a conversion relationship between a size of the first pixel and a size of a first object point; the first object point is an object point corresponding to the first pixel, and the pixel region to be measured belongs to an image to be processed; The method of obtaining the first transmission parameter of the first pixel point includes: performing object detection processing on the image to be processed or performing object detection processing on the pixel point area to be detected to obtain the position of the first object frame and the position of the second object frame; the first object frame contains the first object; the second object frame contains the second object; the first size of the first object is obtained according to the position of the first object frame, and the second size of the second object is obtained according to the position of the second object frame; the second transmission parameter is obtained according to the first size and the third size, and the third 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 second transmission parameter represents the conversion relationship between the fifth size and the sixth size; the fifth size is the size of the second pixel point; the position of the second pixel point in the 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 size of the second object physical size; the third transmission parameter characterizes 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 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; the second transmission parameter and the third transmission parameter are subjected to curve fitting processing to obtain the first transmission parameter map of the pixel area to be measured; the conversion relationship between the ninth size and the tenth size is determined according to the first pixel value in the first transmission parameter map; the ninth size is the size of the fourth pixel in the pixel area to be measured; 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; the fifth pixel is the pixel corresponding to the fourth pixel in the first transmission parameter map; the first transmission parameter is obtained according to the pixel value corresponding to the first pixel in the first transmission parameter map; The first processing unit is used to determine the sum of the areas of at least one object point corresponding to at least one pixel point in the pixel point area to be measured, and obtain the area of ​​the physical area corresponding to the pixel point area to be measured; the at least one pixel point includes the first pixel point; the area of ​​the object point corresponding to the first pixel point is obtained based on the area of ​​the first pixel point and the first transmission parameter.

11. An electronic device, It is characterized in that include: A processor and a memory, wherein the memory is used to store computer program codes, wherein the computer program codes include computer instructions, and when the processor executes the computer instructions, the electronic device executes the method according to any one of claims 1 to 9.

12. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor, the processor is caused to execute the method according to any one of claims 1 to 9.