CN116608782A - Method for detecting object size, storage medium and electronic device - Google Patents

Method for detecting object size, storage medium and electronic device Download PDF

Info

Publication number
CN116608782A
CN116608782A CN202210119628.8A CN202210119628A CN116608782A CN 116608782 A CN116608782 A CN 116608782A CN 202210119628 A CN202210119628 A CN 202210119628A CN 116608782 A CN116608782 A CN 116608782A
Authority
CN
China
Prior art keywords
physical
display interface
size
measured
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210119628.8A
Other languages
Chinese (zh)
Inventor
邱伟波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shirui Electronics Co Ltd
Original Assignee
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shirui Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Shiyuan Electronics Thecnology Co Ltd, Guangzhou Shirui Electronics Co Ltd filed Critical Guangzhou Shiyuan Electronics Thecnology Co Ltd
Priority to CN202210119628.8A priority Critical patent/CN116608782A/en
Priority to PCT/CN2023/074884 priority patent/WO2023151568A1/en
Publication of CN116608782A publication Critical patent/CN116608782A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/24Measuring arrangements characterised by the use of optical techniques for measuring contours or curvatures
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B17/00Measuring arrangements characterised by the use of infrasonic, sonic or ultrasonic vibrations
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B17/00Measuring arrangements characterised by the use of infrasonic, sonic or ultrasonic vibrations
    • G01B17/06Measuring arrangements characterised by the use of infrasonic, sonic or ultrasonic vibrations for measuring contours or curvatures
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B7/00Measuring arrangements characterised by the use of electric or magnetic techniques
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B7/00Measuring arrangements characterised by the use of electric or magnetic techniques
    • G01B7/28Measuring arrangements characterised by the use of electric or magnetic techniques for measuring contours or curvatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Geometry (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The application discloses a method for detecting the size of an object, a storage medium and electronic equipment, and relates to the technical field of size identification. The method comprises the following steps: acquiring a contour image of an object to be detected through touch data of the object to be detected in a display screen, and determining at least two mark points in the contour image; determining virtual positions of all marking points corresponding to a display interface in a display screen according to the rectangular coordinate system; and calculating the size of the object to be measured according to the virtual position of each marking point and the physical length of the display interface in the display screen. The method comprises the steps of firstly determining a contour image of an object to be detected, determining a virtual position of a display interface of the object to be detected in a display screen according to mark points on the contour image, and further calculating the size of the object to be detected according to the relationship between the physical length of the display interface in the display screen and the virtual position of each mark point; the method only needs to acquire the outline image of the object to be measured through the display screen, and the size of the object to be measured can be obtained through calculation.

Description

Method for detecting object size, storage medium and electronic device
Technical Field
The present application relates to the field of size recognition technologies, and in particular, to a method for detecting a size of an object, a storage medium, and an electronic device.
Background
At present, the shape and the size of an object are the most important factors of the object, and in the traditional industrial production process, the measurement of the size of the object is generally performed through a vernier caliper, a tape measure or a distance measuring device such as an infrared distance measuring instrument.
However, the above method requires a specific measuring device to detect the size of the object, so the method for detecting the size of the actual object has a large limitation and a small application range.
Disclosure of Invention
The application provides a method for detecting the size of an object, a storage medium and electronic equipment, which can solve the technical problems that a specific measuring device is needed to detect the size of the object in the related technology, so that the method for detecting the size of an actual object has larger limitation and smaller application range.
In a first aspect, an embodiment of the present application provides a method for detecting a size of an object, the method including:
acquiring a contour image of an object to be detected through touch data of the object to be detected in a display screen, and determining at least two mark points in the contour image;
Determining virtual positions of all marking points corresponding to a display interface in the display screen according to a rectangular coordinate system;
and calculating the size of the object to be measured according to the virtual positions of the marking points and the physical length of the display interface in the display screen.
In a second aspect, an embodiment of the present application provides an apparatus for detecting a size of an object, the apparatus comprising: the device comprises an acquisition module, a determination module and a calculation module;
the acquisition module is used for acquiring a contour image of an object to be detected through touch data of the object to be detected in a display screen and determining at least two marking points in the contour image;
the determining module is used for determining virtual positions of all marking points corresponding to the display interface in the display screen according to the rectangular coordinate system;
the calculating module is used for calculating the size of the object to be measured according to the virtual positions of the marking points and the physical length of the display interface in the display screen.
In a third aspect, embodiments of the present application provide a computer readable storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the steps of the method according to any of the first aspects.
In a fourth aspect, an embodiment of the present application provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method according to any one of the first aspects when the program is executed.
The technical scheme provided by the embodiments of the application has the beneficial effects that at least:
the application provides a method for detecting the size of an object, which comprises the steps of firstly, acquiring a contour image of the object to be detected through touch data of the object to be detected in a display screen, and determining at least two mark points in the contour image; then determining virtual positions of all marking points corresponding to the display interfaces in the display screen according to the rectangular coordinate system; and finally, calculating the size of the object to be measured according to the virtual position of each marking point and the physical length of the display interface in the display screen. The method comprises the steps of firstly determining a contour image of an object to be detected, determining a virtual position of a display interface of the object to be detected in a display screen according to mark points on the contour image, and further calculating the size of the object to be detected according to the relationship between the physical length of the display interface in the display screen and the virtual position of each mark point; the method only needs to acquire the outline image of the object to be detected through the display screen and calculate the outline image to obtain the size of the object to be detected, so that other specific detection equipment is not needed when the size of the object to be detected is detected, and the applicability of the detection size of the method is higher.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the description below are only some embodiments of the application, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is an exemplary system architecture diagram of a method for detecting object dimensions according to an embodiment of the present application;
FIG. 2 is an exemplary system architecture diagram of a method for detecting a dimension of an object according to another embodiment of the present application;
FIG. 3 is a flow chart of a method for detecting object dimensions according to another embodiment of the present application;
FIG. 4 is a schematic diagram of a contour image of an object to be measured according to another embodiment of the present application;
FIG. 5 is a flow chart of a method for detecting object size according to another embodiment of the present application;
FIG. 6 is a schematic diagram of a contour image of a display screen according to another embodiment of the present application;
FIG. 7 is a cut-away view of a contour image of a method for detecting object dimensions according to another embodiment of the present application;
FIG. 8 is a schematic block diagram of an apparatus for detecting the size of an object according to another embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the features and advantages of the present application more comprehensible, embodiments accompanied with figures in the present application are described in detail below, wherein the embodiments are described only in some but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the application as set forth in the appended claims.
Fig. 1 is an exemplary system architecture diagram of a method for detecting a size of an object according to an embodiment of the present application.
As shown in fig. 1, the system architecture may include an electronic device 101, a network 102, and a server 103. Network 102 is the medium used to provide communication links between electronic device 101 and server 103. Network 102 may include various types of wired or wireless communication links, such as: the wired communication link includes an optical fiber, a twisted pair wire, or a coaxial cable, and the Wireless communication link includes a bluetooth communication link, a Wireless-Fidelity (Wi-Fi) communication link, a microwave communication link, or the like.
The electronic device 101 may interact with the server 103 via the network 102 to receive messages from the server 103 or send messages to the server 103, or the electronic device 101 may interact with the server 103 via the network 102 to receive messages or data sent by other users to the server 103, and the electronic device may interact with the motor via the network 102 to obtain operational data in the motor or send control commands to the motor. The electronic device 101 may be hardware or software. When the electronic device 101 is hardware, it may be a variety of electronic devices including, but not limited to, a smart watch, a smart phone, a tablet computer, a laptop portable computer, a desktop computer, and the like. When the electronic device 101 is software, it may be installed in the above-listed electronic device, and may be implemented as a plurality of software or software modules (for example, to provide distributed services), or may be implemented as a single software or software module, which is not specifically limited herein.
The server 103 may be a business server providing various services. The server 103 may be hardware or software. When the server 103 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When the server 103 is software, it may be implemented as a plurality of software or software modules (for example, to provide a distributed service), or may be implemented as a single software or software module, which is not specifically limited herein.
It should be understood that the number of electronic devices, networks, and servers in fig. 1 is merely illustrative, and any number of electronic devices, networks, and servers may be used as desired for implementation.
Fig. 2 is an exemplary system architecture diagram of a method for detecting a size of an object according to another embodiment of the present application. Further, as shown in fig. 2, the electronic device 101 in the system architecture may include a processor 1011, a display screen 1012, and a communication link, where the processor 1011 and the display screen 1012 are in communication connection through the communication link, and the processor 1011 may also be connected with other electronic devices through the communication link, which is not described herein, where the display screen 1012 is used to display signals and display pictures, and in the present application, the display screen 1012 is further used to obtain a contour image of an object to be measured, and in practical application, the display screen 1012 is generally configured as a touch display screen, that is, when the surface to be measured of the object to be measured contacts a display interface of the display screen 1012, a contour image corresponding to the surface to be measured of the object to be measured may be obtained on the display screen 1012, and the processor 1011 is used to process the contour image obtained by the display screen 1012 to obtain the size of the object to be measured.
The display 1012 can be any of a capacitive touch display, a capacitive touch screen, a resistive touch screen, a surface acoustic wave touch screen and an infrared touch display, the surface to be measured of the object to be measured is contacted with the display interface of the display, and the display obtains a contour image corresponding to the contact surface when the object to be measured is contacted with the display interface according to the contact data of the object to be measured and the display interface.
It should be appreciated that the number of processors and displays in fig. 2 is merely illustrative, and that any number of processors and displays may be used, as desired for implementation.
The size of the object is taken as one of the most important factors of the object, along with the development of computer technology, the computer technology is also applied to the measurement of the size of the object, in the prior art, the size of the object to be measured is measured by using a computer, generally, an image containing the object to be measured is obtained by shooting the object to be measured through a camera, further, the image size of the object to be measured in the image is determined, and since the distance between the camera and the object to be measured determines the size of the image size of the object to be measured, the distance between the object to be measured and the camera can be obtained through a related distance measuring device, the amplification ratio of the image size can be determined based on the distance between the object to be measured and the camera, and the size obtained after the image size is amplified based on the amplification ratio, namely the real size of the object to be measured. However, the above method for calculating the physical size of the object to be measured through the picture requires a special distance measuring device, which results in a great limitation of the above method in the prior art.
In summary, when the size of the object to be detected is detected by using the computer technology, a method for accurately obtaining the size of the object to be detected at any time and any place without a specific measuring device is required to be found, so the application provides a method for detecting the size of the object to be detected based on the computer technology, which only needs to obtain the contour image of the object to be detected through a display screen, calculates the size of the contour image corresponding to the size of the object to be detected by taking the physical length of a display interface in the display screen as a reference, takes the size of the contour image as the size of the object to be detected, and further completes the calculation of the size of the object to be detected.
Referring to fig. 3, fig. 3 is a flowchart of a method for detecting a size of an object according to another embodiment of the application. The method of the embodiment of the present application is described in detail herein with an execution body of the method of the present application as a processor, and the specific method of the embodiment of the present application includes:
s301, acquiring a contour image of an object to be detected through touch data of the object to be detected in a display screen, and determining at least two marking points in the contour image.
It can be understood that the core of the present application is to calculate the size of the contour image of the object to be measured based on the contour image of the object to be measured and the physical length of the display interface in the display screen, and take the size of the contour image of the object to be measured as the size of the object to be measured, so that the contour image of the object to be measured needs to be acquired first.
The object to be detected can be any object with any structure, for example, in a teaching scene, the object to be detected can be a triangle, a book or the like. Since the object to be measured is generally a three-dimensional object having a certain shape, that is, the object to be measured has a plurality of surfaces, when the size of the object to be measured is detected, the size of a certain surface of the object to be measured is usually detected. The object to be measured also comprises a surface to be measured with a measured size, and the measured surface is limited to have edges due to the fact that the measured surface is impossible to infinitely large in size, so that an image representing the shape or the edges corresponding to the measured surface in the object to be measured can be used as a contour image of the object to be measured, and when the measured surface of the object to be measured is contacted with a display screen, the display screen is equivalent to being touched by the measured surface of the object to be measured, and touch data about the object to be measured are formed on a display interface of the display screen.
Referring to fig. 4, fig. 4 is a schematic diagram of a contour image of an object to be measured according to another embodiment of the present application.
As shown in fig. 4, the object 300 to be measured is a cuboid, in order to measure the size of one side surface of the object 300 to be measured, the side surface to be measured may be taken as the surface 310 to be measured, and since the side surface of the cuboid is rectangular, the contour image 320 of the surface 310 to be measured in the object 300 to be measured represents a rectangular image corresponding to the shape or edge of the side surface.
Further, the method for acquiring the contour image of the object to be measured in the present application is not limited. Considering that the display screen is frequently used in daily life of people, the outline image of the object to be detected can be obtained through the display screen, so that the application range of the object to be detected detection method can be increased.
Specifically, in the process of acquiring the contour image of the object to be measured through the display screen, the display screen can be used as a tool for acquiring the contour image of the object to be measured, and simultaneously the display screen can also be used as a tool for normally displaying the image, namely, the display screen can simultaneously perform the operations of acquiring the contour image and displaying the image of the object to be measured.
Further, the manner of touch data of the object to be detected on the display screen may be not limited, and different acquisition manners may be selected according to the specific type of the display screen, for example, in practical application, the display screen may be any one of a capacitive touch display screen, a resistive touch screen, a surface acoustic wave touch screen and an infrared touch display screen.
When the display screen is an infrared display touch display screen, after the surface to be detected of the object to be detected is contacted or approaches to a display interface of the infrared touch display screen, infrared rays emitted by the edge position of the infrared touch display screen are blocked by the edge of the object to be detected and then reflected, the infrared touch display screen obtains touch data of the edge position of the object to be detected according to the reflected infrared rays, and then a contour image of the object to be detected is determined according to the touch data; when the display screen is a capacitive touch display screen, after the surface to be measured of the object to be measured is contacted with the display interface of the capacitive touch display screen, the surface to be measured of the object to be measured presses the capacitance in the capacitive touch display screen, the capacitive touch display screen determines the whole image of the surface to be measured according to the capacitance at different positions, and then the edge of the surface to be measured is determined according to the touch data of the whole image of the surface to be measured, so that the outline image corresponding to the surface to be measured of the object to be measured is formed. In addition, the process of acquiring the contour image of the object to be measured by the resistive touch screen and the surface acoustic wave touch screen is similar to the process of acquiring the contour of the object to be measured by the capacitive touch display screen, and will not be described herein.
It will be appreciated that for any object's dimensions, the type of dimension may vary, for example, the dimensions may refer to the length, area, circumference, etc. of a portion of the object, but regardless of the particular type of dimension, once the dimension to be calculated is determined, it may be calculated from the minimum unit length. For example, to calculate the perimeter of the edge of a rectangular surface of an object, the edge of the rectangular surface may be divided into several line segments, the lengths of all the line segments and the perimeter of the edge of the rectangular surface; for another example, to calculate the area of a certain circular surface of an object, the radius of a circle corresponding to the edge of the circular surface may be divided into a plurality of line segments, and the sum of the lengths of all the line segments is used as the radius of the circle corresponding to the circular surface, so as to obtain the area of the circle corresponding to the circular surface. And the two points determine a straight line, at least two points are needed for determining the length, so that after the outline image of the object to be detected is acquired through the display screen, at least two marking points in the outline image can be determined according to the size of the object to be detected, which is calculated according to the need, and the specific positions of the marking points in the outline image can be determined, so that the length between the marking points can be determined according to the marking points.
When determining the size of the object to be measured, the position of each line segment and the length of the line segment corresponding to the surface to be measured need to be calculated according to the size type of the object to be measured, and the positions of the mark points at two ends of the line segment need to be determined first to calculate the length of the line segment, in practical application, in order to detect the area size of the outline image 320 of the surface to be measured 310 in the object to be measured 300 shown in fig. 3, the size of the long line segment and the size of the wide line segment of the outline image 320 need to be calculated, and then two mark points at two ends of the long line segment and two mark points at two points of the wide line segment need to be determined in the outline image 320.
S302, determining virtual positions of all marking points corresponding to the display interfaces in the display screen according to the rectangular coordinate system.
It can be appreciated that after the contour image of the object to be measured is obtained and the marker point in the contour image is determined, the position of the marker point in the display interface of the display screen needs to be represented, so as to determine the relative position of the marker point with respect to the display interface in the display screen.
Specifically, when the mark points are represented, a reference system needs to be determined, the generally determined reference system is a rectangular coordinate system, and because the rectangular coordinate system reads data simply and accurately, a rectangular coordinate system related to each mark point is generally established in the display interface so as to read the virtual position of each mark point on the display interface.
In practical application, the edge of the display interface can be used as a reference system, and the virtual position of the mark point of the object to be detected can be obtained according to the relative distance between the mark point and the reference system; the rectangular coordinate system can be established at any position of the display interface, and is used as a reference system of the marking points, and the virtual positions of the marking points can be obtained by dimension marking of the rectangular coordinate system.
By obtaining the virtual position of the marking point relative to the display interface of the display screen, the relative position of each marking point in the display interface of the display screen can be represented by parameters such as distance or position, and then the actual position, namely the physical position, of each marking point in the display screen is determined by the virtual position of each marking point corresponding to the display interface in the display screen.
S303, calculating the size of the object to be measured according to the virtual position of each marking point, the virtual length of the display interface and the physical length of the display interface.
It can be understood that the core of the present application is to calculate the size of the outline image of the object to be measured and the size of the outline image of the object to be measured as the size of the object to be measured based on the outline image of the object to be measured and the physical length of the display interface in the display screen, so that the physical size of the outline image of the object to be measured needs to be calculated, the rectangular coordinate system needs to be labeled according to two different labels, the physical position of each label point is obtained according to the ratio of the two labels and the virtual position of each label point, then since a line segment can be determined between the two label points, and all the sizes of the object to be measured can be calculated through the line segment, the physical length of the line segment between each label point is calculated according to the physical position between each label point, and the size of the object to be measured is calculated.
Because each marking point is positioned in the plane where the display interface of the display screen is positioned, the same reference system can be set based on each marking point, different marks are carried out on the reference system, the virtual position of each marking point relative to the reference system can be obtained according to the first marked reference system, and then the length of the display interface of the display screen can be obtained according to the first marked reference system, and the length of the display interface obtained through the first marked reference system is recorded as the virtual length; according to the second marked reference frame, the length of the display interface of the display screen is obtained, the length of the display interface obtained through the second marked reference frame is recorded as the physical length, and the physical position of each measuring point is calculated according to the ratio and the virtual position of each marking point obtained through the first reference frame, so that the size of the object to be measured is calculated through a size calculation method.
The application provides a method for detecting the size of an object, which comprises the following steps: acquiring a contour image of an object to be detected through touch data of the object to be detected in a display screen, and determining at least two mark points in the contour image; determining virtual positions of all marking points corresponding to a display interface in a display screen according to the rectangular coordinate system; and calculating the size of the object to be measured according to the virtual position of each marking point and the physical length of the display interface in the display screen. According to the size type of the surface to be measured of the object to be measured, which is required to be calculated, further determining the position of a line segment required to be calculated in the contour image, determining a corresponding mark point according to the position of the line segment, further obtaining the virtual position of the mark point through a coordinate system, obtaining the physical position of each mark point according to the virtual position and the ratio between the virtual length of the display interface and the physical length of the display interface, further calculating the size of the contour image, and taking the size of the contour image as the size of the surface to be measured of the object to be measured. The method only needs to acquire the outline image of the object to be detected through the display screen and calculate the outline image to obtain the size of the object to be detected, so that other specific detection equipment is not needed when the size of the object to be detected is detected, and the applicability of the detection size of the method is higher.
Fig. 5 is a flowchart of a method for detecting a size of an object according to another embodiment of the present application.
Optionally, as shown in fig. 5, the method includes:
s501, acquiring a contour image of the object to be measured through touch data of the object to be measured in a display screen, and determining the size type of the object to be measured to be calculated.
It can be understood that the core of the present application is to calculate the size of the contour image of the object to be measured based on the contour image of the object to be measured and the physical length of the display interface in the display screen, and take the size of the contour image of the object to be measured as the size of the object to be measured, so that the contour image of the object to be measured needs to be acquired first.
The size of the same object to be measured may include various types, for example, if the shape of the object to be measured is rectangular, the size type of the rectangular shape may include any one of length, perimeter and area, so when the size of the object to be measured is calculated, the size type of the object to be measured needs to be determined first, so as to calculate the size of the object to be measured subsequently.
Typical size types of the object to be measured include: length, circumference, area, and volume; that is, the method of the present application can be applied to the calculation of the length of the object to be measured, the circumference of the object to be measured, the area of the object to be measured, and the volume of the object to be measured, because the circumference of the object to be measured can be obtained by adding the side lengths of the plurality of objects to be measured, the area of the object to be measured can be obtained by calculating the length of the line segment in the object to be measured, and the side lengths of the object to be measured and the length of the line segment in the object to be measured can be the length of the line segment in the object to be measured and then obtained by calculation. It is therefore necessary to acquire the size type of the object to be measured to be calculated before calculating the size of the object to be measured.
In practical application, the size type of the object to be measured can be manually selected by an operator, or can be set in advance in a program of a controller, and the size type is not particularly limited; specifically, when the size type of the object to be measured is obtained by selecting by an operator, before the operator selects, the controller sends all options to the man-machine interaction interface to select the operator, and the controller performs the next operation according to the size type selected by the operator.
In addition, if the size type of the object to be measured is set in advance through a program, the size type of the object to be measured may be multiple or one, that is, after the controller acquires the contour image of the object to be measured, the size type of the object to be measured to be acquired is obtained according to the contour image, in actual operation, a corresponding relation between contour information about the object to be measured and the size type of the object to be measured may be set, and after the controller detects the contour information corresponding to the object to be measured, the size type of the object to be measured may be determined according to the contour information; and the program in the controller can also acquire various size types of an object to be detected.
Furthermore, the embodiment of the application can be used for detecting the volume, the area, the perimeter and the length of the cube figure, can be used for detecting the area, the perimeter and the length of the two-dimensional plane structure, and can be used for detecting the length of the line.
S502, determining at least two marking points in the outline image of the object to be detected according to the size type of the object to be detected.
The line segment corresponding to the size type can be determined and calculated according to the size type of the object to be measured, the size of the object to be measured, which is required to be calculated, can be calculated through the minimum unit length, namely the size of the outline image, which is required to be calculated, is decomposed into a plurality of lengths of the line segments, and the length of one line segment is required to be calculated due to the fact that two points determine a straight line, and the distance between the marking points at the two ends of the line segment is required to be calculated, so that after the size type of the object to be measured, which is required to be calculated, is determined, the number of the line segments, and then the number of the marking points, is required to be determined according to the size type of the object to be measured.
The number of the marking points and the corresponding position coordinates of each marking point need to be acquired when the marking points are acquired, and for the sake of clarity, the following is exemplified:
If the cuboid of the object to be measured needs to obtain the bottom surface area and the height of the cuboid, and then the bottom surface area of the cuboid needs to be obtained, the length and the width of the bottom surface of the cuboid need to be obtained, and as the length of one line segment is calculated only by two marking points, the volume of the cuboid needs to be calculated, two marking points related to the length of the bottom surface of the cuboid, two marking points related to the width of the cuboid and two marking points related to the height of the cuboid need to be obtained, and then the pixel abscissa and the pixel ordinate of all the marking points related to the cuboid need to be obtained according to the rectangular coordinate system.
If the object to be measured is a rectangle, the length and the width of the rectangle need to be obtained, and as the length of one line segment is calculated only by two mark points, the area of the rectangle needs to be calculated, and then the two mark points related to the length of the rectangle and the two mark points related to the width of the rectangle need to be obtained, and further the pixel abscissa and the pixel ordinate of the two mark points related to the length of the rectangle and the pixel abscissa and the pixel ordinate of the two mark points related to the width of the rectangle are obtained according to the rectangular coordinate system.
If the size type of the object to be measured is the same length on the straight line, the determined marking points are two marking points at two ends of the length to be measured of the object to be measured
S503, establishing a rectangular coordinate system related to the display interface in the display screen according to a preset origin on the display interface in the display screen.
It will be appreciated that the coordinates of each point on the display interface of the display screen can be clearly represented using a rectangular coordinate system, and therefore, when determining the virtual positions of the marking points, it is necessary to establish a rectangular coordinate system for each marking point.
Specifically, the display screen has various shapes, and the general display screen has a rectangular, elliptical or circular shape, and in practical application, if the display screen has a rectangular shape, any vertex of the rectangular display screen can be used as a preset origin, and the length and width directions of the display screen are respectively the directions of an X axis and a Y axis, so as to establish a rectangular coordinate system; if the display screen is elliptical or circular, taking any vertex of the circular or elliptical circumscribing rectangle as a preset original point, taking the length and width directions of the circumscribing rectangle of the display screen as the directions of X and Y axes respectively, and establishing a rectangular coordinate system, if the display screen is in other shapes, determining the preset original point according to the specific shape of the display screen, wherein the preset original point is not particularly limited.
Specifically, for further explanation, the display screen is rectangular in shape, and a rectangular coordinate system is established with the top left corner vertex of the rectangular display screen as a preset origin.
In practical applications, the rectangular coordinate system has the advantages of accurate coordinates and accurate reading of the virtual positions of the marking points, so that when determining the virtual positions of the marking points, it is necessary to establish the rectangular coordinate system for each marking point.
S504, marking the pixel coordinate of the rectangular coordinate system according to the horizontal pixel resolution and the vertical pixel resolution of the display interface.
In practical application, because the display screen is used to obtain the outline image of the object to be measured, and because the display interface of the display screen is provided with a plurality of pixels for displaying, and the pixels are uniformly distributed on the display interface, the rectangular coordinate system can be marked according to the display resolution of the display interface, and after the rectangular coordinate system is marked by using the display resolution, the coordinates of each marking point represent the number of pixels between the projection distance origins of the position of the marking point in the transverse direction of the rectangular coordinate system and the number of pixels between the projection distance origins of the position of the marking point in the longitudinal direction of the rectangular coordinate system.
For example, the pixel resolution of the display screen is the number of pixels on the display screen, for example, the pixels of the display interface of the display screen are 1000×800, that is, the horizontal pixel resolution of the display interface of the display screen is 1000, the vertical pixel resolution is 800, and the number of pixels on the display screen is the product of the number of horizontal pixels and the number of vertical pixels is 800000 pixels. If the pixels of the display interface of the display screen are 1000×800, the abscissa of the rectangular coordinate system is 0-1000, and the ordinate of the rectangular coordinate system is 0-800.
In addition, in the application, the more pixels of the display interface of the display screen are used, the more numerical values marked in each unit length in the rectangular coordinate system are, so that the dimension accuracy of the object to be detected obtained by the method is higher. The display resolution of the display interface of the display screen is selected according to actual needs, and is not particularly limited herein.
S505, determining the pixel abscissa and the pixel ordinate corresponding to each marking point in the rectangular coordinate system according to the pixel coordinate marks, and taking the pixel abscissa and the pixel ordinate corresponding to each marking point as the virtual position of each marking point.
It can be understood that the corresponding position of each mark point on the rectangular coordinate system is read, that is, the number of pixels between the projection distance of each mark point in the transverse direction of the rectangular coordinate system and the origin of the rectangular coordinate system is read, and the number of pixels is taken as the abscissa of the mark point, and the number of pixels between the projection distance of each mark point in the longitudinal direction of the rectangular coordinate system and the origin of the rectangular coordinate system is read, and the number of pixels is taken as the ordinate of the mark point, and the corresponding pixel abscissa and pixel ordinate of each mark point are taken as the virtual position of each mark point.
Fig. 6 is a schematic diagram of a contour image of a display screen according to another embodiment of the present application. In practical applications, a rectangular coordinate system is generally established with any vertex of the display screen as an origin, and for clarity of explanation, as shown in fig. 6, the rectangular coordinate system is established with the upper left corner of the display screen as the origin, and the rectangular coordinate system is marked, so that the coordinates of the rectangular coordinate system are read, and the coordinates of each marking point are obtained, so as to obtain the virtual position of each marking point on the display interface.
In addition, all the marking points of the object to be measured are represented by the pixel abscissa and the pixel ordinate of the rectangular coordinate system in the display interface of the display screen, so that the virtual positions of all the marking points of the object to be measured passing through the rectangular coordinate system in the display interface are determined. If two mark points in the outline image of the object to be detected are provided, and the pixel abscissa corresponding to the first mark point is 100, and the pixel ordinate is 200; the second mark point has a pixel abscissa of 400 and a pixel ordinate of 600, and the virtual position of the first mark point is (100, 200) and the virtual position of the second mark point is (400, 600).
S506, calculating the physical position of each marking point according to the virtual position of each marking point, the virtual length of the display interface and the physical length of the display interface.
It can be understood that the core of the present application is to calculate the size of the outline image of the object to be measured and the size of the outline image of the object to be measured as the size of the object to be measured based on the outline image of the object to be measured and the physical length of the display interface in the display screen, so that the physical size of the outline image of the object to be measured needs to be calculated, the rectangular coordinate system needs to be labeled according to two different labels, and the physical position of each label point is obtained according to the ratio of the two labels and the virtual position of each label point.
In general, the physical position of each mark point is calculated by determining a scaling factor between the virtual length of the display interface and the physical length of the display interface, and then determining and calculating the physical position of each mark point according to the virtual position and the scaling factor of each mark point.
Because each marking point is positioned on the display interface of the display screen and the rectangular coordinate system is established relative to the display interface, the same marking point has two different representation modes, namely, pixel coordinates are used for representation and coordinates of the marking point with physical length are used for representation, so that a certain proportional relationship exists between the coordinates of the marking points represented by the two representation modes; also, because there may be a difference in the ratio between the abscissa and the ordinate, it is necessary to calculate the abscissa and the ordinate of the pixel coordinate and the physically noted coordinate, respectively.
Specifically, firstly, determining a maximum pixel abscissa and a maximum pixel ordinate corresponding to a virtual length of a display interface; determining a maximum physical abscissa and a maximum physical ordinate corresponding to the physical length of the display interface; then, determining an abscissa scaling factor according to the maximum pixel abscissa and the maximum physical abscissa, and determining an ordinate scaling factor according to the maximum pixel ordinate and the maximum physical ordinate; and finally, determining and calculating the physical position of each marking point according to the virtual position and the proportionality coefficient of each marking point.
And determining the maximum pixel abscissa and the maximum pixel ordinate corresponding to the virtual length of the display interface, wherein the corresponding horizontal maximum pixel coordinate and the corresponding vertical maximum pixel coordinate of the display interface are required to be read in the rectangular coordinate system, the horizontal maximum pixel coordinate is taken as the maximum pixel abscissa, and the vertical maximum pixel coordinate is taken as the maximum pixel ordinate.
In practical application, since the origin of the rectangular coordinate system is set based on one vertex of the display interface of the display screen and pixels are used for marking, marking points at any positions of the plane where the display interface is located can be read through the rectangular coordinate system.
Specifically, the pixel abscissa of the display interface of the display screen represents the number of pixels owned by the display interface of the display screen, that is, the abscissa of the large pixel in the transverse direction of the display screen is the number of pixels owned by the display screen in the transverse direction, and similarly, the ordinate of the maximum pixel in the longitudinal direction of the display screen is the number of pixels owned by the display screen in the longitudinal direction. If the resolution of the pixels of the display screen is 1000×800, the corresponding maximum pixel abscissa of the display interface in the rectangular coordinate system is 1000, and the maximum pixel ordinate is 800.
And determining the corresponding maximum pixel abscissa and maximum pixel ordinate of the display interface in the rectangular coordinate system according to the pixel coordinate marks. Namely, the maximum pixel abscissa and the maximum pixel ordinate corresponding to the display interface in the rectangular coordinate system are used as the maximum pixel abscissa and the maximum pixel ordinate corresponding to the virtual length of the display interface.
And determining the maximum physical abscissa and the maximum physical ordinate corresponding to the physical length of the display interface, wherein the corresponding horizontal maximum physical coordinate and the corresponding vertical maximum physical coordinate of the display interface are required to be read in the rectangular coordinate system, the horizontal maximum physical coordinate is taken as the maximum physical abscissa, and the vertical maximum physical coordinate is taken as the maximum physical ordinate.
It can be understood that, since the origin of the rectangular coordinate system is set based on one vertex of the display interface of the display screen, the rectangular coordinate system can be marked by using the horizontal physical length and the vertical physical length of the display interface, so that the rectangular coordinate system can be used for representing the actual physical length of the display interface, and the display interface in the rectangular coordinate system using the actual physical size is read, so as to obtain the maximum physical abscissa and the maximum physical ordinate in the display interface.
Specifically, determining the maximum physical abscissa and the maximum physical ordinate corresponding to the physical length of the display interface, and marking the physical coordinate of the rectangular coordinate system according to the horizontal physical length and the vertical physical length of the display interface; and then, determining the maximum physical abscissa and the maximum physical ordinate corresponding to the display interface in the rectangular coordinate system according to the physical coordinate mark.
In practical application, because the horizontal physical length and the vertical physical length of a display screen are both fixed sizes, the horizontal physical length of the display interface of the display screen is used for marking the horizontal coordinate of the rectangular coordinate system, and the vertical physical length of the display interface of the display screen is used for marking the vertical coordinate of the rectangular coordinate system.
Specifically, since the horizontal physical length and the vertical physical length of a display screen are both fixed sizes, the horizontal physical length of the display screen is taken as the abscissa of the rectangular coordinate system, and the vertical physical length of the display screen is taken as the abscissa of the rectangular coordinate system.
In practical applications, before the rectangular coordinate system is marked by using the transverse physical length and the longitudinal physical length, the transverse physical length and the longitudinal physical length of the display interface need to be converted into the same unit, so that subsequent calculation can be performed, and generally, the transverse physical length and the longitudinal physical length of the display interface are converted into quantities in millimeters.
Specifically, in the rectangular coordinate system, if the horizontal physical length of the display interface of the display screen is 800 mm and the vertical physical length is 600 mm, the maximum physical abscissa of the display interface of the display screen is 800 and the maximum physical ordinate is 600.
And determining an abscissa scaling factor according to the maximum pixel abscissa and the maximum physical abscissa, determining an ordinate scaling factor according to the maximum pixel ordinate and the maximum physical abscissa, calculating the ratio of the maximum pixel abscissa to the maximum physical abscissa to obtain the abscissa scaling factor, and calculating the ratio of the maximum pixel ordinate to the maximum physical ordinate to obtain the ordinate scaling factor.
Specifically, since the rectangular coordinate system includes an abscissa and an ordinate, and the rectangular coordinate system is labeled by using pixels, the maximum pixel abscissa and the maximum pixel ordinate of the display interface can be read through the rectangular coordinate system; the rectangular coordinate system is marked by using a physical size, so that the maximum physical abscissa and the maximum physical ordinate of the display interface can be read through the rectangular coordinate system, the pixel proportion of the maximum pixel abscissa and the maximum physical abscissa is taken as an abscissa proportion coefficient, the pixel proportion of the maximum pixel ordinate and the maximum physical ordinate is taken as an ordinate proportion coefficient, and the abscissa proportion coefficient and the ordinate proportion coefficient can be equal or unequal, and the specific limitation is not carried out.
Further, since the abscissa and the ordinate are not necessarily equal, it is necessary to calculate the physical abscissa of each mark point according to the pixel abscissa and the abscissa corresponding to the virtual position of each mark point, and calculate the physical ordinate of each mark point according to the pixel ordinate and the ordinate corresponding to the virtual position of each mark point, and further, use the physical abscissa and the physical ordinate of each mark point as the physical position of each mark point.
Specifically, the abscissa scale factor is used to represent the ratio of the pixel abscissa to the physical abscissa, so that the physical abscissa corresponding to each marking point can be calculated by the abscissa scale factor and the pixel abscissa of each marking point in the profile image read by the rectangular coordinate system marked by the pixel.
Specifically, if the abscissa scaling factor is 1:100, and wherein the pixel abscissa of a marker point is 3, the calculated physical abscissa is 300 according to the abscissa scaling factor.
The ordinate scale factor is used for representing the proportion of the pixel ordinate to the physical ordinate, so that the physical ordinate corresponding to each marking point can be obtained through calculation by the ordinate scale factor and the pixel ordinate of each marking point in the profile image read by the rectangular coordinate system marked by the pixel.
Specifically, if the ordinate scaling factor is 1:150, and wherein the pixel ordinate of one mark point is 4, the physical ordinate calculated from the ordinate scale factor is 600.
The physical abscissa 300 calculated in the above step and the physical ordinate 600 calculated are taken as the physical position of the marker point, i.e. the physical position of the marker point is noted (300, 600).
Specifically, since there is a proportional relationship between the display abscissa and the physical abscissa, there is a proportional relationship between the display ordinate and the physical ordinate, i.e.Wherein, (X dis_1 ,Y dis_1 ) For the pixel abscissa of the first target mark point and the pixel ordinate of the target mark point, the +.>For the maximum pixel abscissa and the large pixel ordinate in the rectangular coordinate system, (X) phy_max ,Y phy_max ) Is the maximum physical abscissa and the maximum physical ordinate in the rectangular coordinate system, (X) phy_1 ,Y phy_1 ) The physical abscissa of the first target mark point and the physical ordinate of the target mark point are the physical coordinates of the first target mark point, which are required to be calculated in the step, relative to the rectangular coordinate system.
Further, the above ratio isThe relation is converted to obtain The physical abscissa and physical ordinate of the first target mark point relative to the rectangular coordinate system can be calculated by bringing the pixel abscissa and the pixel abscissa, the maximum pixel ordinate, the maximum physical abscissa and the maximum physical ordinate of the first target mark point into the above formula.
Further, the physical abscissa and the physical ordinate of all the target mark points can be calculated through the steps, and the physical length among the target mark points can be calculated through the relation among the target mark points.
Specifically, if it is necessary to calculate the physical length between the first target mark point and the second target mark point, the physical abscissa and the physical ordinate (X phy_1 ,Y phy_1 ) And the physical abscissa and physical ordinate (X phy_2 ,Y phy_2 )。
Because two labels are used for labeling in the same rectangular coordinate system, namely, the first label is a pixel label, the second label is a physical size label, in the rectangular coordinate system of the pixel label, the pixel abscissa and the pixel ordinate of the virtual position of the contour image can be obtained, and in the rectangular coordinate system of the physical size label, the physical abscissa and the physical ordinate of the virtual position of the contour image can be obtained.
S607, calculating the size of the object to be measured according to the physical position of each marking point.
Since the physical positions of the marking points in the rectangular coordinate system marked by the physical dimensions are obtained through calculation in the steps, the physical lengths among the marking points can be calculated according to the physical positions of the marking points, and then the dimensions of the object to be measured can be calculated according to the physical lengths among the marking points.
Specifically, according to the physical position of each marking point of the object to be detected, namely, the physical coordinates, the distance between the two marking points is calculated, and in practical application, the physical length method for calculating the distance between the two marking points according to the coordinates of the two marking points is as follows:
wherein, (X 1 ,Y 1 ) For the coordinates of the first marker point, (X) 2 ,Y 2 ) Is the coordinates of the second marker point. And then calculating the size of the outline image of the object to be detected according to the size type of the object to be detected, and taking the size of the outline image of the object to be detected as the size of the side surface to be detected of the object to be detected.
Generally, if the size type of the object to be measured is the length, the circumference or the area of the line segment, the lengths of a plurality of line segments need to be calculated, and then the geometric calculation method is used to calculate the lengths of the line segments, so as to obtain the size of the object to be measured.
In practical application, if an object to be measured to be calculated is a rectangle, the calculated size is an area, according to a rectangular area calculation formula, the long physical length and the wide physical length of the rectangle are required to be obtained, at least three vertexes of the rectangle are required to be used as marking points, virtual positions of at least three vertexes in the contour image are required to be obtained, physical abscissa and physical ordinate corresponding to the three vertexes are calculated through the virtual positions of the three vertexes and through an abscissa proportional coefficient and an ordinate proportional coefficient, then the physical lengths of two adjacent vertexes are calculated, namely the length and the width of the cuboid are obtained, further the long physical length and the wide physical length of the cuboid are multiplied through a rectangular area calculation formula, the area of the contour image is obtained, and the area of the contour image is further used as the size of the object to be measured.
Specifically, the size calculation formula is selected according to the size to be calculated, which is not described herein.
Fig. 7 is a contour image cutting chart of a method for detecting the size of an object according to another embodiment of the present application. Optionally, fig. 7 is a contour image cutting chart of a method for detecting a size of an object according to another embodiment of the present application; the shape of the object to be measured may be various, for example, the object to be measured may be an irregular shape as shown in the figure, and the size type of the object to be measured to be detected is the area of the object to be measured, because the shape of the object to be measured is an irregular pattern, the area of the object to be measured cannot be directly calculated in the geometric calculation process, and then the contour image of the object to be measured needs to be cut; for example, as shown in fig. 7, the outline image of the irregular object to be measured is cut into a rectangle a and a rectangle B, the areas of the rectangle a and the rectangle B are calculated respectively, and then the calculated areas of the rectangle a and the rectangle B are added to obtain the area of the object to be measured. The irregular object to be measured can be cut and divided into a plurality of regular shapes, and the sum of the sizes of the irregular shapes is equal to the size of the irregular object to be measured.
The application provides a method for detecting the size of an object, which comprises the following steps: acquiring a contour image of an object to be detected through touch data of the object to be detected in a display screen, and determining at least two mark points in the contour image; determining virtual positions of all marking points corresponding to a display interface in a display screen according to the rectangular coordinate system; and calculating the size of the object to be measured according to the virtual position of each marking point and the physical length of the display interface in the display screen. According to the size type of the surface to be measured of the object to be measured, which is required to be calculated, the position of a required line segment in the outline image is further determined, the corresponding marking point is determined according to the position of the line segment, the virtual position of the marking point is further obtained through a coordinate system, the virtual length between the two marking points is calculated according to the virtual position, the virtual lengths of a plurality of line segments of the surface to be measured of the object to be measured in the outline image are further obtained, the virtual size of the outline image is calculated according to the virtual length of the surface to be measured and the size calculating method, and therefore the proportion of the virtual size of the surface to be measured of the object to be measured to the size of the object to be measured is obtained according to the proportion of the virtual length of the display interface to the physical length of the display interface, the size of the outline image is further obtained, and the size of the outline image is used as the size of the surface to be measured of the object to be measured. The method only needs to acquire the outline image of the object to be detected through the display screen and calculate the outline image to obtain the size of the object to be detected, so that other specific detection equipment is not needed when the size of the object to be detected is detected, and the applicability of the detection size of the method is higher.
Referring to fig. 8, fig. 8 is a schematic block diagram of an apparatus for detecting a size of an object according to another embodiment of the application.
As shown in fig. 8, an apparatus 800 for detecting a size of an object includes: an acquisition module 801, a determination module 802, a calculation module 803;
the acquiring module 801 is configured to acquire a contour image of an object to be measured according to touch data of the object to be measured in a display screen, and determine at least two mark points in the contour image;
the determining module 802 is configured to determine, according to the rectangular coordinate system, a virtual position of each marking point corresponding to a display interface in the display screen;
and the calculating module 803 is configured to calculate the size of the object to be measured according to the virtual position of each mark point and the physical length of the display interface in the display screen.
Optionally, the calculating module 803 is specifically configured to calculate the physical position of each mark point according to the virtual position of each mark point, the virtual length of the display interface, and the physical length of the display interface;
and calculating the size of the object to be measured according to the physical position of each marking point.
Optionally, the calculating module 803 is further configured to determine a scaling factor between the virtual length of the display interface and the physical length of the display interface;
and determining and calculating the physical position of each marking point according to the virtual position and the proportionality coefficient of each marking point.
Optionally, the calculating module 803 is further configured to calculate a physical length between the marking points according to the physical positions of the marking points;
and calculating the size of the object to be measured according to the physical length between the marking points.
Optionally, the calculating module 803 is further configured to determine a maximum pixel abscissa and a maximum pixel ordinate corresponding to the virtual length of the display interface, and determine a maximum physical abscissa and a maximum physical ordinate corresponding to the physical length of the display interface;
and determining an abscissa scaling factor according to the maximum pixel abscissa and the maximum physical abscissa, and determining an ordinate scaling factor according to the maximum pixel ordinate and the maximum physical ordinate.
Optionally, the calculating module 803 is further configured to calculate a physical abscissa of each marking point according to a ratio coefficient of a pixel abscissa to an abscissa corresponding to the virtual position of each marking point;
calculating the physical longitudinal coordinates of each marking point according to the ratio coefficients of the corresponding pixel longitudinal coordinates and the longitudinal coordinates of the virtual positions of each marking point;
the physical abscissa and the physical ordinate of each mark point are taken as the physical position of each mark point.
Optionally, the determining module 802 is specifically configured to establish a rectangular coordinate system related to the display interface in the display screen according to a preset origin on the display interface in the display screen;
According to the horizontal pixel resolution and the vertical pixel resolution of the display interface, marking the pixel coordinates of the rectangular coordinate system;
and determining the pixel abscissa and the pixel ordinate corresponding to each marking point in the rectangular coordinate system according to the pixel coordinate marks, and taking the pixel abscissa and the pixel ordinate corresponding to each marking point as the virtual position of each marking point.
Optionally, the determining module 802 is further configured to determine a maximum pixel abscissa and a maximum pixel ordinate corresponding to the display interface in the rectangular coordinate system according to the pixel coordinate mark.
Optionally, the calculating module 803 further performs physical coordinate marking on the rectangular coordinate system according to the horizontal physical length and the vertical physical length of the display interface;
and determining the maximum physical abscissa and the maximum physical ordinate corresponding to the display interface in the rectangular coordinate system according to the physical coordinate marks.
Optionally, the obtaining module 801 is specifically configured to determine a size type of the object to be measured to be calculated, where the size type at least includes: length, circumference and area;
and determining at least two marking points in the outline image of the object to be detected according to the size type of the object to be detected.
The application provides a device for detecting the size of an object, which comprises: the device comprises an acquisition module, a determination module and a calculation module; the acquisition module is used for acquiring a contour image of the object to be detected through touch data of the object to be detected in the display screen and determining at least two marking points in the contour image; the determining module is used for determining virtual positions of all marking points corresponding to the display interface in the display screen according to the rectangular coordinate system; and the calculating module is used for calculating the size of the object to be measured according to the virtual position of each marking point and the physical length of the display interface in the display screen. According to the size type of the surface to be measured of the object to be measured, which is required to be calculated, the position of a required line segment in the contour image is further determined, the corresponding marking point is determined according to the position of the line segment, the virtual position of the marking point is further obtained through a coordinate system, the virtual length between the two marking points is calculated according to the virtual position, the virtual lengths of a plurality of line segments of the surface to be measured of the object to be measured in the contour image are further obtained, the virtual size of the contour image is calculated according to the virtual length of the surface to be measured and the size calculation method, and therefore the proportion of the virtual size of the surface to be measured of the object to be measured to the size of the object to be measured is obtained according to the proportion of the virtual length of the display interface to the physical length of the display interface, the size of the contour image is further obtained, and the size of the contour image is used as the size of the surface to be measured of the object to be measured. The method only needs to acquire the outline image of the object to be detected through the display screen and calculate the outline image to obtain the size of the object to be detected, so that other specific detection equipment is not needed when the size of the object to be detected is detected, and the applicability of the detection size of the method is higher.
Embodiments of the present application also provide a computer readable storage medium having stored thereon a plurality of instructions adapted to be loaded by a processor and to perform the steps of the method according to any of the embodiments described above.
Referring to fig. 9, fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 9, the electronic device 900 may include: at least one electronic device processor 901, at least one network interface 904, a user interface 903, memory 905, at least one communication bus 902. Wherein a communication bus 902 is employed to facilitate communications among the components.
The user interface 903 may include a Display screen (Display) and a Camera (Camera), and the optional user interface 903 may further include a standard wired interface and a wireless interface.
The network interface 904 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), among others.
Wherein the electronic device processor 901 may include one or more processing cores. The electronic device processor 901 connects various portions of the overall electronic device 900 using various interfaces and lines, executing various functions of the electronic device 900 and processing data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 905, and invoking data stored in the memory 905. Alternatively, the electronic device processor 901 may be implemented in hardware in at least one of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), programmable logic array (Programmable Logic Array, PLA). The electronic device processor 901 may integrate one or a combination of several of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), and a modem, etc. The CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content required to be displayed by the display screen; the modem is used to handle wireless communications. It will be appreciated that the modem may not be integrated into the electronic device processor 901, and may be implemented solely by a single chip.
The Memory 905 may include a random access Memory (Random Access Memory, RAM) or a Read-Only Memory (ROM). Optionally, the memory 905 includes a non-transitory computer readable medium (non-transitory computer-readable storage medium). The memory 905 may be used to store instructions, programs, code, sets of codes, or sets of instructions. The memory 905 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the above-described respective method embodiments, etc.; the storage data area may store data or the like referred to in the above respective method embodiments. The memory 905 may also optionally be at least one storage device located remotely from the aforementioned electronic device processor 901. As shown in fig. 9, an operating system, a network communication module, a user interface module, and a program for detecting the size of an object may be included in the memory 905, which is a computer-readable storage medium.
In the electronic device 900 shown in fig. 9, the user interface 903 is mainly used for providing an input interface for a user, and acquiring data input by the user; and the electronic device processor 901 may be configured to invoke the detected object size program stored in the memory 905 and specifically perform the following operations:
Acquiring a contour image of an object to be detected through touch data of the object to be detected in a display screen, and determining at least two mark points in the contour image;
determining virtual positions of all marking points corresponding to a display interface in the display screen according to a rectangular coordinate system;
and calculating the size of the object to be measured according to the virtual position of each marking point, the virtual length of the display interface and the physical length of the display interface.
In some embodiments, the processor 901, when executing calculation of the size of the object to be measured according to the virtual position of each mark point, the virtual length of the display interface and the physical length of the display interface, specifically executes the following steps: calculating the physical position of each marking point according to the virtual position of each marking point, the virtual length of the display interface and the physical length of the display interface; and calculating the size of the object to be measured according to the physical position of each marking point.
In some embodiments, the processor 901, when executing the calculation of the physical position of each mark point according to the virtual position of each mark point, the virtual length of the display interface, and the physical length of the display interface, specifically executes the following steps: determining a proportionality coefficient between the virtual length of the display interface and the physical length of the display interface; and determining and calculating the physical position of each marking point according to the virtual position of each marking point and the proportionality coefficient.
When the processor 901 calculates the size of the object to be measured according to the physical position of each mark point, the following steps are specifically executed: calculating the physical length among the marking points according to the physical positions of the marking points; and calculating the size of the object to be measured according to the physical length between the marking points.
The processor 901, when executing the determining the proportionality coefficient between the virtual length of the display interface and the physical length of the display interface, specifically executes the following steps: determining a maximum pixel abscissa and a maximum pixel ordinate corresponding to the virtual length of the display interface, and determining a maximum physical abscissa and a maximum physical ordinate corresponding to the physical length of the display interface; and determining an abscissa scaling factor according to the maximum pixel abscissa and the maximum physical abscissa, and determining an ordinate scaling factor according to the maximum pixel ordinate and the maximum physical ordinate.
When executing the calculation of the physical position of each mark point according to the virtual position of each mark point and the scaling factor, the processor 901 specifically executes the following steps: calculating the physical abscissa of each marking point according to the pixel abscissa corresponding to the virtual position of each marking point and the abscissa ratio coefficient; calculating the physical ordinate of each marking point according to the pixel ordinate corresponding to the virtual position of each marking point and the ordinate-scale coefficient of the ordinate; the physical abscissa and the physical ordinate of each mark point are taken as the physical position of each mark point.
When executing the determination that each mark point corresponds to the virtual position of the display interface in the display screen according to the rectangular coordinate system, the processor 901 specifically executes the following steps: establishing a rectangular coordinate system related to a display interface in the display screen according to a preset origin on the display interface in the display screen; according to the horizontal pixel resolution and the vertical pixel resolution of the display interface, marking the pixel coordinates of the rectangular coordinate system; and determining the pixel abscissa and the pixel ordinate corresponding to each marking point in the rectangular coordinate system according to the pixel coordinate marks, and taking the pixel abscissa and the pixel ordinate corresponding to each marking point as the virtual position of each marking point.
When executing the determination of the maximum pixel abscissa and the maximum pixel ordinate corresponding to the virtual length of the display interface, the processor 901 specifically executes the following steps: and determining the corresponding maximum pixel abscissa and maximum pixel ordinate of the display interface in the rectangular coordinate system according to the pixel coordinate mark.
When executing the determination of the maximum physical abscissa and the maximum physical ordinate corresponding to the physical length of the display interface, the processor 901 specifically executes the following steps: according to the transverse physical length and the longitudinal physical length of the display interface, carrying out physical coordinate marking on the rectangular coordinate system; and determining the maximum physical abscissa and the maximum physical ordinate corresponding to the display interface in the rectangular coordinate system according to the physical coordinate mark.
When executing the determining of at least two marker points in the contour image, the processor 901 specifically executes the following steps: determining the size type of the object to be measured, wherein the size type at least comprises: length, circumference and area; and determining at least two marking points in the outline image of the object to be detected according to the size type of the object to be detected.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of modules is merely a logical function division, and there may be additional divisions of actual implementation, e.g., multiple modules or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or modules, which may be in electrical, mechanical, or other forms.
The modules illustrated as separate components may or may not be physically separate, and components shown as modules may or may not be physical modules, i.e., may be located in one place, or may be distributed over a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module. The integrated modules may be implemented in hardware or in software functional modules.
The integrated modules, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
It should be noted that, for the sake of simplicity of description, the foregoing method embodiments are all expressed as a series of combinations of actions, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily all required for the present application.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to the related descriptions of other embodiments.
The foregoing describes a method for detecting the size of an object, a storage medium and an electronic device, which are provided by the present application, and the present application should not be construed as being limited to the specific embodiments and application ranges given by the present application, as long as the person skilled in the art is informed by the concepts of the embodiments of the present application.

Claims (12)

1. A method of detecting a size of an object, the method comprising:
Acquiring a contour image of an object to be detected through touch data of the object to be detected in a display screen, and determining at least two mark points in the contour image;
determining virtual positions of all marking points corresponding to a display interface in the display screen according to a rectangular coordinate system;
and calculating the size of the object to be measured according to the virtual position of each marking point, the virtual length of the display interface and the physical length of the display interface.
2. The method according to claim 1, wherein calculating the size of the object to be measured according to the virtual position of each mark point, the virtual length of the display interface, and the physical length of the display interface comprises:
calculating the physical position of each marking point according to the virtual position of each marking point, the virtual length of the display interface and the physical length of the display interface;
and calculating the size of the object to be measured according to the physical position of each marking point.
3. The method of claim 2, wherein calculating the physical location of each marker point based on the virtual location of each marker point, the virtual length of the display interface, and the physical length of the display interface comprises:
Determining a proportionality coefficient between the virtual length of the display interface and the physical length of the display interface;
and determining and calculating the physical position of each marking point according to the virtual position of each marking point and the proportionality coefficient.
4. The method of claim 2, wherein calculating the size of the object to be measured based on the physical location of each marker point comprises:
calculating the physical length among the marking points according to the physical positions of the marking points;
and calculating the size of the object to be measured according to the physical length between the marking points.
5. The method of claim 3, wherein the determining a scaling factor between the virtual length of the display interface and the physical length of the display interface comprises:
determining a maximum pixel abscissa and a maximum pixel ordinate corresponding to the virtual length of the display interface, and determining a maximum physical abscissa and a maximum physical ordinate corresponding to the physical length of the display interface;
and determining an abscissa scaling factor according to the maximum pixel abscissa and the maximum physical abscissa, and determining an ordinate scaling factor according to the maximum pixel ordinate and the maximum physical ordinate.
6. The method of claim 5, wherein determining the physical location of each marker based on the virtual location of each marker and the scaling factor comprises:
calculating the physical abscissa of each marking point according to the pixel abscissa corresponding to the virtual position of each marking point and the abscissa proportional coefficient;
calculating the physical ordinate of each marking point according to the pixel ordinate corresponding to the virtual position of each marking point and the ordinate proportional coefficient;
the physical abscissa and the physical ordinate of each mark point are taken as the physical position of each mark point.
7. The method of claim 5, wherein determining, according to the rectangular coordinate system, a virtual position of each marker point corresponding to a display interface in the display screen according to the rectangular coordinate system, comprises:
establishing a rectangular coordinate system related to the display interface in the display screen according to a preset origin on the display interface in the display screen;
according to the horizontal pixel resolution and the vertical pixel resolution of the display interface, marking the pixel coordinates of the rectangular coordinate system;
and determining the pixel abscissa and the pixel ordinate corresponding to each marking point in the rectangular coordinate system according to the pixel coordinate marks, and taking the pixel abscissa and the pixel ordinate corresponding to each marking point as the virtual position of each marking point.
8. The method of claim 7, wherein determining a maximum pixel abscissa and a maximum pixel ordinate corresponding to a virtual length of the display interface comprises:
and determining the corresponding maximum pixel abscissa and maximum pixel ordinate of the display interface in the rectangular coordinate system according to the pixel coordinate mark.
9. The method of claim 7, wherein determining a maximum physical abscissa and a maximum physical ordinate corresponding to a physical length of the display interface comprises:
according to the transverse physical length and the longitudinal physical length of the display interface, carrying out physical coordinate marking on the rectangular coordinate system;
and determining the maximum physical abscissa and the maximum physical ordinate corresponding to the display interface in the rectangular coordinate system according to the physical coordinate mark.
10. The method of claim 1, wherein said determining at least two marker points in said profile image comprises:
determining the size type of the object to be measured, wherein the size type at least comprises: length, circumference and area;
and determining at least two marking points in the outline image of the object to be detected according to the size type of the object to be detected.
11. A computer readable storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the steps of the method according to any one of claims 1 to 10.
12. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method according to any one of claims 1 to 10 when the program is executed.
CN202210119628.8A 2022-02-08 2022-02-08 Method for detecting object size, storage medium and electronic device Pending CN116608782A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210119628.8A CN116608782A (en) 2022-02-08 2022-02-08 Method for detecting object size, storage medium and electronic device
PCT/CN2023/074884 WO2023151568A1 (en) 2022-02-08 2023-02-08 Method for measuring size of object, storage medium, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210119628.8A CN116608782A (en) 2022-02-08 2022-02-08 Method for detecting object size, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN116608782A true CN116608782A (en) 2023-08-18

Family

ID=87563620

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210119628.8A Pending CN116608782A (en) 2022-02-08 2022-02-08 Method for detecting object size, storage medium and electronic device

Country Status (2)

Country Link
CN (1) CN116608782A (en)
WO (1) WO2023151568A1 (en)

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2371866A (en) * 2001-01-31 2002-08-07 Hewlett Packard Co Measuring apparatus
CN101470548B (en) * 2007-12-25 2011-03-30 上海晨兴希姆通电子科技有限公司 Method for measuring object dimension and angle through touch screen
CA2842132A1 (en) * 2011-07-25 2013-01-31 C & J Clark International Limited A footgauge
CN102401629A (en) * 2011-10-19 2012-04-04 惠州Tcl移动通信有限公司 Mobile phone and angle measuring method thereof
CN103356198A (en) * 2012-04-09 2013-10-23 英华达(上海)科技有限公司 Multipoint sensing measurement system and multipoint sensing measurement method
CN106152923B (en) * 2015-04-21 2020-01-07 中兴通讯股份有限公司 Measuring method, device and equipment
CN111982037B (en) * 2019-05-23 2022-07-29 华为技术有限公司 Height measuring method and electronic equipment
CN112256191B (en) * 2020-10-22 2023-03-24 广州视源电子科技股份有限公司 Intelligent blackboard, data processing method and device thereof and intelligent interactive panel

Also Published As

Publication number Publication date
WO2023151568A1 (en) 2023-08-17

Similar Documents

Publication Publication Date Title
WO2018157513A1 (en) Method and system for measuring volume of regular three-dimensional object
US7724250B2 (en) Apparatus, method, and program for processing information
CN103890766B (en) Coordinate measuring system data reduction
US8059119B2 (en) Method for detecting border tiles or border pixels of a primitive for tile-based rendering
US7756364B2 (en) Digital pen and paper system
TW201346216A (en) Virtual ruler
CN111625668B (en) Object detection and candidate filtering system
WO2014090090A1 (en) Angle measurement method and device
US20150302549A1 (en) Information processing system, control method and computer-readable medium
CN113077548A (en) Collision detection method, device, equipment and storage medium for object
JP2012048393A (en) Information processing device and operation method of the same
WO2017141553A1 (en) 3-dimensional data processing device and 3-dimensional data processing method
US11733825B2 (en) Interactive three-dimensional representations of objects
CN116608782A (en) Method for detecting object size, storage medium and electronic device
CN115496860A (en) Flexible rule model construction method and device, terminal equipment and storage medium
CN115546417A (en) Three-dimensional reconstruction method, system, electronic device and computer-readable storage medium
JP2019219248A (en) Point group processor, method for processing point group, and program
KR20220169471A (en) Facial 3D model visualization method, device, electronic equipment and storage medium
CN114742881A (en) 2D house type graph actual proportion calculation method, device, system and storage medium
US20200242819A1 (en) Polyline drawing device
CN110569799B (en) Fingerprint module displacement detection method and device and terminal equipment
CN111681277A (en) Method and device for measuring geometric attributes in image, electronic equipment and storage medium
KR20210020536A (en) A portable terminal for generating floor plans based on pointing walls
US20100169041A1 (en) System and method for displaying illustrative information of measured data
Pavanaskar et al. Filling trim cracks on GPU-rendered solid models

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination