CN116363223A - Binocular vision-based boxcar size measurement method, device and medium - Google Patents

Binocular vision-based boxcar size measurement method, device and medium Download PDF

Info

Publication number
CN116363223A
CN116363223A CN202310241099.3A CN202310241099A CN116363223A CN 116363223 A CN116363223 A CN 116363223A CN 202310241099 A CN202310241099 A CN 202310241099A CN 116363223 A CN116363223 A CN 116363223A
Authority
CN
China
Prior art keywords
carriage
truck
boxcar
image
dimensional space
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
CN202310241099.3A
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.)
South China University of Technology SCUT
Original Assignee
South China University of Technology SCUT
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 South China University of Technology SCUT filed Critical South China University of Technology SCUT
Priority to CN202310241099.3A priority Critical patent/CN116363223A/en
Publication of CN116363223A publication Critical patent/CN116363223A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • G06T7/85Stereo camera calibration
    • 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/02Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras

Landscapes

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

Abstract

The invention discloses a method, a device and a medium for measuring the size of a boxcar based on binocular vision, wherein the method comprises the following steps: acquiring images from the rear side of the truck by using the calibrated binocular camera to obtain truck images; extracting a truck target from the truck image to obtain a target image; performing line segment detection on the target image to obtain a plurality of carriage edge line segments, and taking intersection points among the carriage edge line segments as carriage angular points; according to binocular vision theory, acquiring coordinates of the carriage angular points in a three-dimensional space according to the positions of the carriage angular points in the images, and calculating the actual size of the carriage according to the three-dimensional space coordinates of the carriage angular points. The invention realizes the measurement of the size of the boxcar by a pure vision technology, and solves the problems of low efficiency and inconvenient measurement of the large size of the boxcar in the existing manual measurement. The invention can be widely applied to the field of computer vision.

Description

Binocular vision-based boxcar size measurement method, device and medium
Technical Field
The invention relates to the field of computer vision, in particular to a method, a device and a medium for measuring the size of a boxcar based on binocular vision.
Background
An important ring in the construction of modern 'intelligent logistics' systems is the effective management of transport vehicles, the creation of transport vehicle data management systems, and an important item of transport trucks is the size of the carriage. The traditional measurement of the size of the boxcar is usually carried out by manually using a measuring tape, the measurement efficiency is low, the measurement results of different measuring persons are large in difference, and the measurement is inconvenient for some cases with large size.
Disclosure of Invention
In order to solve at least one of the technical problems existing in the prior art to a certain extent, the invention aims to provide a method, a device and a medium for measuring the size of a boxcar based on binocular vision.
The technical scheme adopted by the invention is as follows:
a boxcar size measurement method based on binocular vision comprises the following steps:
acquiring images from the rear side of the truck by using the calibrated binocular camera to obtain truck images;
extracting a truck target from the truck image to obtain a target image;
performing line segment detection on the target image to obtain a plurality of carriage edge line segments, and taking intersection points among the carriage edge line segments as carriage angular points;
according to binocular vision theory, acquiring coordinates of the carriage angular points in a three-dimensional space according to the positions of the carriage angular points in the images, and calculating the actual size of the carriage according to the three-dimensional space coordinates of the carriage angular points.
Further, the image acquisition is performed from the rear side of the truck by using the calibrated binocular camera to obtain a truck image, including:
calibrating the binocular camera by adopting a checkerboard calibration method to obtain internal and external parameters of the camera and correcting the binocular camera;
shooting from the rear side of the truck by using a calibrated binocular camera to obtain a truck image;
wherein, two cameras in binocular camera both shoot the side and the back of freight train.
Further, the extracting the truck target from the truck image to obtain a target image includes:
by U-shaped 2 The Net detection algorithm processes the truck images acquired by two cameras in the binocular cameras, and cuts and extracts a truck target area as a target image.
Further, after the step of obtaining the target image, the method further comprises the steps of:
and filtering and smoothing the target image to remove outline edge burrs and image noise, so that subsequent straight line detection is facilitated.
Further, the detecting the line segment of the target image to obtain a plurality of carriage edge line segments, and taking the intersection point between the carriage edge line segments as the carriage angular point includes:
the LSD straight line detection algorithm is utilized to carry out straight line detection on the extracted target image, and the detected line segments are screened by adopting the following conditions:
1) The length of the line segment is larger than a preset length value;
2) The included angle between the line segment and the horizontal line is smaller than a preset angle range;
3) The positions of the line segments are located in a preset coordinate range in the target image;
after condition screening, a plurality of carriage edge line segments are obtained, and the intersection points among the carriage edge line segments are used as carriage angular points.
Further, according to the binocular vision theory, the method for obtaining coordinates of the car corner in the three-dimensional space according to the position of the car corner in the image, and calculating the actual size of the car according to the coordinates of the car corner in the three-dimensional space comprises the following steps:
according to the coordinates of the corner points of the carriage in the image, an equation is established by combining projection matrixes obtained by calibrating the left camera and the right camera in the binocular camera, and the three-dimensional space coordinates of the corner points are obtained by solving;
and calculating the distance between two angular points of the actual carriage as the carriage size by using a point-to-point distance formula in the three-dimensional space, and obtaining the length, width and height of the carriage.
Further, the three-dimensional space coordinates of the corner points are obtained by:
coordinates of corner points on images corresponding to the left camera and the right camera are respectively (u) 1 ,v 1 ) Sum (u) 2 ,v 2 ) The projection matrix of the left and right cameras is M respectively 1 And M 2 The method comprises the following steps of:
Figure BDA0004124171680000021
Figure BDA0004124171680000022
wherein X, Y, Z denotes three-dimensional space coordinates of the corner point in the world coordinate system, z denotes depth distance between the binocular camera and the corner point, and f x 、f y 、x 0 、y 0 The rotation matrix R and the translation matrix T are the internal parameters of the left camera and the external parameters of the left camera,
f x ′、f y ′、x′ 0 、y′ 0 the rotation matrix R 'and the translation matrix T' are right camera internal parameters and right camera external parameters.
And combining the two equations, and solving the three-dimensional space coordinates of the corner points by using a least square method.
The invention adopts another technical scheme that:
a binocular vision-based boxcar size measuring device, comprising:
the calibrated binocular camera is used for acquiring images from the rear side of the truck to obtain truck images;
the processing module is used for extracting a truck target from the truck image to obtain a target image; performing line segment detection on the target image to obtain a plurality of carriage edge line segments, and taking intersection points among the carriage edge line segments as carriage angular points; according to binocular vision theory, acquiring coordinates of the carriage angular points in a three-dimensional space according to the positions of the carriage angular points in the images, and calculating the actual size of the carriage according to the three-dimensional space coordinates of the carriage angular points.
The invention adopts another technical scheme that:
a binocular vision-based boxcar size measuring device, comprising:
at least one processor;
at least one memory for storing at least one program;
the at least one program, when executed by the at least one processor, causes the at least one processor to implement the method described above.
The invention adopts another technical scheme that:
a computer readable storage medium, in which a processor executable program is stored, which when executed by a processor is adapted to carry out the method as described above.
The beneficial effects of the invention are as follows: according to the invention, only a binocular camera is utilized to collect images of the truck, partial edge lines of the truck are obtained by extracting the main body target of the truck, the intersection point of the fitted edge lines is obtained, so that the corner coordinates of the truck with the images are obtained, the actual three-dimensional coordinates of the corner are recovered by utilizing binocular vision theory, the actual length, width and height of the truck are calculated by the distance between points in the three-dimensional space, and the measurement of the truck size is completed. The problems of low efficiency and inconvenient measurement of large size of the conventional manual measurement of the size of the wagon compartment can be solved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following description is made with reference to the accompanying drawings of the embodiments of the present invention or the related technical solutions in the prior art, and it should be understood that the drawings in the following description are only for convenience and clarity of describing some embodiments in the technical solutions of the present invention, and other drawings may be obtained according to these drawings without the need of inventive labor for those skilled in the art.
FIG. 1 is a flow chart of steps of a binocular vision-based method for measuring the size of a truck bed in an embodiment of the present invention;
FIG. 2 is a schematic view of a boxcar in an embodiment of the present invention;
fig. 3 is a block diagram of a device for measuring the size of a boxcar based on binocular vision in an embodiment of the present invention.
Detailed Description
Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the invention. The step numbers in the following embodiments are set for convenience of illustration only, and the order between the steps is not limited in any way, and the execution order of the steps in the embodiments may be adaptively adjusted according to the understanding of those skilled in the art.
In the description of the present invention, it should be understood that references to orientation descriptions such as upper, lower, front, rear, left, right, etc. are based on the orientation or positional relationship shown in the drawings, are merely for convenience of description of the present invention and to simplify the description, and do not indicate or imply that the apparatus or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus should not be construed as limiting the present invention.
In the description of the present invention, a number means one or more, a number means two or more, and greater than, less than, exceeding, etc. are understood to not include the present number, and above, below, within, etc. are understood to include the present number. The description of the first and second is for the purpose of distinguishing between technical features only and should not be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated or implicitly indicating the precedence of the technical features indicated.
In the description of the present invention, unless explicitly defined otherwise, terms such as arrangement, installation, connection, etc. should be construed broadly and the specific meaning of the terms in the present invention can be reasonably determined by a person skilled in the art in combination with the specific contents of the technical scheme.
As shown in fig. 1, the embodiment provides a method for measuring the size of a wagon box based on binocular vision, which comprises the following steps:
s1, acquiring images from the rear side of the truck by using the calibrated binocular camera to obtain truck images.
The Zhang Zhengyou checkerboard calibration method is adopted to calibrate the binocular camera to obtain the internal and external parameters of the camera, the binocular camera is corrected, the calibrated binocular camera is used for shooting from the rear side of the truck, and the left and right cameras can be ensured to shoot the side face and the back face of the truck at the same time.
It should be noted that in this embodiment, the detection of the size of the wagon compartment can be completed only by photographing once.
S2, carrying out truck target extraction on the truck image to obtain a target image.
In the images shot by the left camera and the right camera, a truck is an image main object, and U is utilized 2 And the Net significance target detection algorithm is used for processing the left image and the right image, and directly dividing and extracting a cargo truck target area.
In some embodiments, step S2 further includes a step of performing a filter smoothing process on the target image.
And filtering and smoothing the image only containing the truck target, eliminating noise in the image and smoothing the contour edge of the truck target, and facilitating subsequent linear detection.
And S3, carrying out line segment detection on the target image to obtain a plurality of carriage edge line segments, and taking the intersection points among the carriage edge line segments as carriage angular points.
The truck target is detected by using a LSD (Line Segment Detector) linear detection algorithm, and the detected line segments are screened by adopting the following conditions:
1) The length of the line segment is larger than a preset length value;
2) The included angle between the line segment and the horizontal line is smaller than a preset angle range;
3) The positions of the line segments are located in a preset coordinate range in the target image.
As an alternative implementation mode, three truck edges obtained after condition screening are achieved, and one corner point of the truck can be solved according to the straight line. And dividing the back area of the carriage according to the obtained carriage angular points and the straight lines, detecting the straight lines again, and screening the detected straight lines under the condition in the same way, so as to obtain all the required straight lines and calculate all the required carriage angular points.
And S4, acquiring coordinates of the carriage angular points in a three-dimensional space according to the positions of the carriage angular points in the images according to a binocular vision theory, and calculating the actual size of the carriage according to the three-dimensional space coordinates of the carriage angular points.
According to the obtained corner coordinates in the image, calculating the three-dimensional space coordinates of the corner by utilizing binocular vision theory, and then calculating the distance between two corner points of the actual carriage by utilizing a point-to-point distance formula in the three-dimensional space to obtain the length, width and height dimensions of the carriage.
The above method is explained in detail below with reference to the drawings and specific examples.
As shown in fig. 2, after the extraction of the truck object is completed, the straight line detection is performed on the image. The straight lines can be subjected to conditional screening to obtain a straight line 1, a straight line 2, a straight line 3, a straight line 4 and a straight line 5. The intersection point between the straight lines can be obtained through the obtained straight lines, the intersection point between the straight line 1 and the straight line 5 is the corner point 1, the intersection point between the straight line 1 and the straight line 2 is the corner point 2, the intersection point between the straight line 2 and the straight line 3 is the corner point 3, and the intersection point between the straight line 3 and the straight line 4 is the corner point 4. The three-dimensional space coordinates of each corner point can be restored through binocular vision theory, the length of the carriage can be obtained through calculating the distance between the corner point 1 and the corner point 2, the width of the carriage can be obtained through calculating the distance between the corner point 2 and the corner point 3, and the height of the carriage can be obtained through calculating the distance between the corner point 3 and the corner point 4.
Specifically, the straight line detection is performed on the image extracted from the carriage target, and the straight lines obtained through the primary screening include a straight line 1, a straight line 2, a straight line 3 and a straight line 5, and the straight line 4 is difficult to extract together with other edges due to a large amount of interference of the carriage back surface condition. The intersection point of the straight line 1 and the straight line 2 is used as a point and the angle of the straight line 3, the straight line 6 is constructed (namely the straight line 6 can be obtained through translating the straight line 3), the carriage back area can be independently divided according to the straight line 2, the straight line 3 and the straight line 6, the carriage back area is independently subjected to straight line detection, the straight line 4 can be obtained after screening, and all required carriage edges are detected.
As an alternative embodiment, the screening conditions of the line segments are specifically as follows:
since the truck target is a subject target in the image and occupies a main size, the length of the detected straight line should be a straight line in the vicinity of the horizontal direction of the image, the length of the straight line should be not less than 1/3 of the horizontal dimension of the image, and the length of the straight line should be not less than 1/3 of the vertical dimension of the image. The straight line within + -15 DEG of the horizontal direction angle is regarded as the straight line within the horizontal direction range, the straight line within + -15 DEG of the vertical direction angle is regarded as the straight line within the vertical direction range, and in addition, the position areas of the images of different carriage edges are different, for example, the straight line 1 and the straight line 2 are positioned in the upper half area of the images, the straight line 3 is positioned in the right half area of the images, the straight line 4 is positioned in the lower half area of the images, the straight line 5 is positioned in the left half area of the images, and specific straight lines can be detected according to the length, the angle, the position and other information of the different straight lines.
The specific values of the set length, angle and position area are related to the carriage size, the distance between the camera and the camera, and the like, and the values should be taken according to actual conditions.
In this embodiment, the solution of the corner coordinates of the three-dimensional space uses a least square method, and the solution of the three-dimensional space information by the least square method is a solution process of a linear equation set jointly constructed by the position information of the measured point in the three-dimensional space on the left and right image planes and the parameter information of the left and right cameras. After the coordinates of the corner 1, the corner 2 and the corner 3 in the left and right images are obtained, an equation is established by combining projection matrixes obtained by calibrating the left and right cameras, and finally, the three-dimensional space coordinates of the corner are obtained. Taking corner 1 as an example, the coordinates of corner 1 on the left and right images are (u) 1 ,v 1 ) Sum (u) 2 ,v 2 ) The projection matrix of the left and right cameras is M respectively 1 And M 2 It is possible to obtain:
Figure BDA0004124171680000061
Figure BDA0004124171680000062
and integrating the equations and simplifying to finally obtain an overdetermined equation, and solving the three-dimensional space coordinates of the corner point 1 by using a least square method.
In summary, the invention uses the binocular camera to shoot pictures from the rear of the inclined side of the truck, extracts the main body target of the truck through the saliency target detection algorithm, obtains part of the edge line of the truck by using the straight line detection algorithm, and further divides the back of the truck to extract all the edge lines required by calculation. And (3) solving the intersection point of the fitted edge straight line, so as to obtain the corner coordinates of the image seed wagon, recovering the actual three-dimensional coordinates of the corner by utilizing the binocular vision theory, and calculating the actual length, width and height dimensions of the wagon by the distance between the points in the three-dimensional space, thereby completing the measurement of the dimensions of the wagon.
As shown in fig. 3, this embodiment further provides a boxcar size measurement system based on binocular vision, including:
and the processing module B1 is used for executing each partial program and processing data.
And the power supply module B2 is used for supplying power to the whole system and guaranteeing the system to work.
And the output module B3 is used for exporting the data in the system.
And the storage module B4 is used for storing the information such as the local program, the data, the work log and the like of the system.
And a communication module B5 for communication between the system and other devices such as a computer.
And a data display device B6 for directly displaying the system-local execution process data and the like.
The binocular camera B7, the execution end of the system, is controlled by the system for image acquisition.
In this embodiment, the workflow described may be implemented as a computer software program as in fig. 1. For example, the present embodiment includes a computer software program including a system device for carrying out the computer software program, the computer software program including program code for executing the binocular vision-based boxcar size measuring method. In such an embodiment, the computer program may be downloaded into the system from a terminal or network via the communication module B5. The processing module B1 is each stage of the operation of the detection system when executing the corresponding module program code.
The embodiment also provides a boxcar size measurement device based on binocular vision, includes:
a binocular vision-based boxcar size measuring device, comprising:
at least one processor;
at least one memory for storing at least one program;
the at least one program, when executed by the at least one processor, causes the at least one processor to implement the method illustrated in fig. 1.
The binocular vision-based boxcar size measuring device can execute any combination implementation steps of the binocular vision-based boxcar size measuring method provided by the embodiment of the method, and has corresponding functions and beneficial effects.
The present application also discloses a computer program product or a computer program comprising computer instructions stored in a computer readable storage medium. The computer instructions may be read from a computer-readable storage medium by a processor of a computer device, and executed by the processor, to cause the computer device to perform the method shown in fig. 1.
The embodiment also provides a storage medium which stores instructions or programs for executing the binocular vision-based boxcar size measurement method provided by the embodiment of the method, and when the instructions or programs are run, the steps can be implemented by any combination of the embodiment of the executable method, so that the method has the corresponding functions and beneficial effects.
In some alternative embodiments, the functions/acts noted in the block diagrams may occur out of the order noted in the operational illustrations. For example, two blocks shown in succession may in fact be executed substantially concurrently or the blocks may sometimes be executed in the reverse order, depending upon the functionality/acts involved. Furthermore, the embodiments presented and described in the flowcharts of the present invention are provided by way of example in order to provide a more thorough understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed, and in which sub-operations described as part of a larger operation are performed independently.
Furthermore, while the invention is described in the context of functional modules, it should be appreciated that, unless otherwise indicated, one or more of the described functions and/or features may be integrated in a single physical device and/or software module or one or more functions and/or features may be implemented in separate physical devices or software modules. It will also be appreciated that a detailed discussion of the actual implementation of each module is not necessary to an understanding of the present invention. Rather, the actual implementation of the various functional modules in the apparatus disclosed herein will be apparent to those skilled in the art from consideration of their attributes, functions and internal relationships. Accordingly, one of ordinary skill in the art can implement the invention as set forth in the claims without undue experimentation. It is also to be understood that the specific concepts disclosed are merely illustrative and are not intended to be limiting upon the scope of the invention, which is to be defined in the appended claims and their full scope of equivalents.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-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.
Logic and/or steps represented in the flowcharts or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). In addition, the computer readable medium may even be paper or other suitable medium on which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
It is to be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
In the foregoing description of the present specification, reference has been made to the terms "one embodiment/example", "another embodiment/example", "certain embodiments/examples", and the like, means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that: many changes, modifications, substitutions and variations may be made to the embodiments without departing from the spirit and principles of the invention, the scope of which is defined by the claims and their equivalents.
While the preferred embodiment of the present invention has been described in detail, the present invention is not limited to the above embodiments, and various equivalent modifications and substitutions can be made by those skilled in the art without departing from the spirit of the present invention, and these equivalent modifications and substitutions are intended to be included in the scope of the present invention as defined in the appended claims.

Claims (10)

1. The method for measuring the size of the boxcar based on binocular vision is characterized by comprising the following steps of:
acquiring images from the rear side of the truck by using the calibrated binocular camera to obtain truck images;
extracting a truck target from the truck image to obtain a target image;
performing line segment detection on the target image to obtain a plurality of carriage edge line segments, and taking intersection points among the carriage edge line segments as carriage angular points;
according to binocular vision theory, acquiring coordinates of the carriage angular points in a three-dimensional space according to the positions of the carriage angular points in the images, and calculating the actual size of the carriage according to the three-dimensional space coordinates of the carriage angular points.
2. The binocular vision-based boxcar size measurement method of claim 1, wherein said capturing images from the rear of the boxcar side using a calibrated binocular camera, obtaining the boxcar image, comprises:
calibrating the binocular camera by adopting a checkerboard calibration method to obtain internal and external parameters of the camera and correcting the binocular camera;
shooting from the rear side of the truck by using a calibrated binocular camera to obtain a truck image;
wherein, two cameras in binocular camera both shoot the side and the back of freight train.
3. The binocular vision-based boxcar size measurement method of claim 1, wherein said performing a boxcar target extraction on said boxcar image to obtain a target image comprises:
by U-shaped 2 The Net detection algorithm processes the truck images acquired by two cameras in the binocular cameras, and cuts and extracts a truck target area as a target image.
4. A method for binocular vision-based boxcar size measurement according to claim 1 or 3, characterized by the further steps of, after the step of obtaining the target image:
and filtering and smoothing the target image to remove contour edge burrs and image noise.
5. The binocular vision-based boxcar size measurement method of claim 1, wherein the detecting the target image to obtain a plurality of boxcar edge line segments, taking the intersection points between the boxcar edge line segments as the boxcar corner points, comprises:
the LSD straight line detection algorithm is utilized to carry out straight line detection on the extracted target image, and the detected line segments are screened by adopting the following conditions:
1) The length of the line segment is larger than a preset length value;
2) The included angle between the line segment and the horizontal line is smaller than a preset angle range;
3) The positions of the line segments are located in a preset coordinate range in the target image;
after condition screening, a plurality of carriage edge line segments are obtained, and the intersection points among the carriage edge line segments are used as carriage angular points.
6. The method for measuring the size of the wagon box based on binocular vision according to claim 1, wherein the steps of obtaining coordinates of the wagon box corner in a three-dimensional space according to the position of the wagon box corner in the image according to the binocular vision theory, and calculating the actual size of the wagon box according to the three-dimensional space coordinates of the wagon box corner include:
according to the coordinates of the carriage angular points in the image, an equation is established by combining projection matrixes obtained by calibrating the left camera and the right camera in the binocular camera,
solving to obtain three-dimensional space coordinates of the corner points;
and calculating the distance between two angular points of the actual carriage as the carriage size by using a point-to-point distance formula in the three-dimensional space, and obtaining the length, width and height of the carriage.
7. The binocular vision-based boxcar size measuring method of claim 6, wherein the three-dimensional space coordinates of the corner points are obtained by:
coordinates of corner points on images corresponding to the left camera and the right camera are respectively (u) 1 ,v 1 ) Sum (u) 2 ,v 2 ) The projection matrix of the left and right cameras is M respectively 1 And M 2 The method comprises the following steps of:
Figure FDA0004124171660000021
Figure FDA0004124171660000022
wherein X, Y, Z denotes three-dimensional space coordinates of the corner point in the world coordinate system, z denotes depth distance between the binocular camera and the corner point, and f x 、f y 、x 0 、y 0 The rotation matrix R and the translation matrix T are the external parameters of the left camera, f x ′、f y ′、x′ 0 、y′ 0 The rotation matrix R 'and the translation matrix T' are right camera internal parameters and right camera external parameters.
And combining the two equations, and solving the three-dimensional space coordinates of the corner points by using a least square method.
8. Boxcar size measuring device based on binocular vision, characterized by comprising:
the calibrated binocular camera is used for acquiring images from the rear side of the truck to obtain truck images;
the processing module is used for extracting a truck target from the truck image to obtain a target image; performing line segment detection on the target image to obtain a plurality of carriage edge line segments, and taking intersection points among the carriage edge line segments as carriage angular points; according to binocular vision theory, acquiring coordinates of the carriage angular points in a three-dimensional space according to the positions of the carriage angular points in the images, and calculating the actual size of the carriage according to the three-dimensional space coordinates of the carriage angular points.
9. Boxcar size measuring device based on binocular vision, characterized by comprising:
at least one processor;
at least one memory for storing at least one program;
the at least one program, when executed by the at least one processor, causes the at least one processor to implement the method of any one of claims 1-7.
10. A computer readable storage medium, in which a processor executable program is stored, characterized in that the processor executable program is for performing the method according to any of claims 1-7 when being executed by a processor.
CN202310241099.3A 2023-03-13 2023-03-13 Binocular vision-based boxcar size measurement method, device and medium Pending CN116363223A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310241099.3A CN116363223A (en) 2023-03-13 2023-03-13 Binocular vision-based boxcar size measurement method, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310241099.3A CN116363223A (en) 2023-03-13 2023-03-13 Binocular vision-based boxcar size measurement method, device and medium

Publications (1)

Publication Number Publication Date
CN116363223A true CN116363223A (en) 2023-06-30

Family

ID=86913214

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310241099.3A Pending CN116363223A (en) 2023-03-13 2023-03-13 Binocular vision-based boxcar size measurement method, device and medium

Country Status (1)

Country Link
CN (1) CN116363223A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117115233A (en) * 2023-10-24 2023-11-24 杭州百子尖科技股份有限公司 Dimension measurement method and device based on machine vision and electronic equipment
CN117387539A (en) * 2023-12-11 2024-01-12 苏州朗信智能科技有限公司 Method and device for dynamically detecting carriage of freight vehicle and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117115233A (en) * 2023-10-24 2023-11-24 杭州百子尖科技股份有限公司 Dimension measurement method and device based on machine vision and electronic equipment
CN117115233B (en) * 2023-10-24 2024-02-06 杭州百子尖科技股份有限公司 Dimension measurement method and device based on machine vision and electronic equipment
CN117387539A (en) * 2023-12-11 2024-01-12 苏州朗信智能科技有限公司 Method and device for dynamically detecting carriage of freight vehicle and storage medium
CN117387539B (en) * 2023-12-11 2024-03-26 苏州朗信智能科技有限公司 Method and device for dynamically detecting carriage of freight vehicle and storage medium

Similar Documents

Publication Publication Date Title
CN116363223A (en) Binocular vision-based boxcar size measurement method, device and medium
JP4803449B2 (en) On-vehicle camera calibration device, calibration method, and vehicle production method using this calibration method
JP4803450B2 (en) On-vehicle camera calibration device and vehicle production method using the device
US11407363B2 (en) Method for calculating a tow hitch position
EP3100234B1 (en) Data-processing system and method for calibration of a vehicle surround view system
CN104236478B (en) Automatic vehicle overall size measuring system and method based on vision
CN111210477B (en) Method and system for positioning moving object
CN104933398B (en) vehicle identification system and method
CN109741241B (en) Fisheye image processing method, device, equipment and storage medium
CN109146952B (en) Method, device and computer readable storage medium for estimating free volume of carriage
CN107878561A (en) A kind of dynamic reverse trajectory discharge drawing method and its device
CN113269766A (en) Hob abrasion detection method, hob abrasion detection device, hob abrasion detection equipment and readable storage medium
CN112419154A (en) Method, device, equipment and computer readable storage medium for detecting travelable area
KR101705558B1 (en) Top view creating method for camera installed on vehicle and AVM system
US11519715B2 (en) Method, device, apparatus and storage medium for detecting a height of an obstacle
CN117197771A (en) Intelligent driving auxiliary image processing method based on binocular stereo matching
CN116380918A (en) Defect detection method, device and equipment
CN111738035A (en) Method, device and equipment for calculating yaw angle of vehicle
CN107223266B (en) Kernel approximation of fractional order differential operators for edge detection
CN115294211A (en) Vehicle-mounted camera installation external parameter calibration method, system, device and storage medium
CN111539279B (en) Road height limit detection method, device, equipment and storage medium
CN111260727B (en) Grid positioning method and device based on image processing and storage medium
WO2020212148A1 (en) Method for determining at least one correction value for correcting an orientation error of a camera for a motor vehicle, electronic computing device as well as driver assistance system
JP4858280B2 (en) Container vehicle tilt angle detection device
CN112270311B (en) Near-target rapid detection method and system based on vehicle-mounted looking-around back projection

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