CN108492279B - Method and system for detecting on-off state of vehicle tarpaulin - Google Patents

Method and system for detecting on-off state of vehicle tarpaulin Download PDF

Info

Publication number
CN108492279B
CN108492279B CN201810142066.2A CN201810142066A CN108492279B CN 108492279 B CN108492279 B CN 108492279B CN 201810142066 A CN201810142066 A CN 201810142066A CN 108492279 B CN108492279 B CN 108492279B
Authority
CN
China
Prior art keywords
picture
index number
comparison
preset
index
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.)
Active
Application number
CN201810142066.2A
Other languages
Chinese (zh)
Other versions
CN108492279A (en
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.)
Hangzhou Hopechart Iot Technology Co ltd
Original Assignee
Hangzhou Hopechart Iot Technology 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 Hangzhou Hopechart Iot Technology Co ltd filed Critical Hangzhou Hopechart Iot Technology Co ltd
Priority to CN201810142066.2A priority Critical patent/CN108492279B/en
Publication of CN108492279A publication Critical patent/CN108492279A/en
Application granted granted Critical
Publication of CN108492279B publication Critical patent/CN108492279B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • G06T7/001Industrial image inspection using an image reference approach
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30232Surveillance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30236Traffic on road, railway or crossing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30248Vehicle exterior or interior

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Closed-Circuit Television Systems (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the invention provides a method and a system for detecting the on-off state of a vehicle tarpaulin, wherein the method comprises the following steps: acquiring a reference picture and a first comparison picture in real time from a carriage monitoring video of a vehicle to be detected; respectively dividing the reference picture and the first comparison picture into a preset number of rectangular picture units from the upper part to the lower part according to a preset method; sequentially comparing the corresponding picture units with the same index numbers in the reference picture and the first comparison picture, selecting the first index number, and acquiring a second comparison picture; dividing the second comparison picture, comparing the first comparison picture with the second comparison picture, and selecting a second index number; if the second index number is smaller than or equal to the first index number, the tarpaulin of the vehicle is judged to be in the closing process, and if the second index number is larger than or equal to the first index number, the tarpaulin of the vehicle is judged to be in the opening process.

Description

Method and system for detecting on-off state of vehicle tarpaulin
Technical Field
The embodiment of the invention relates to the technical field of vehicle management, in particular to a method and a system for detecting the on-off state of a vehicle tarpaulin.
Background
After the muck truck is filled with muck, if the tarpaulin of the muck truck is not covered well, the muck truck can cause that the muck is thrown out of the truck from the truck hopper of the muck truck in the running process, the muck truck is filled with muck on the running road, and adverse effects are brought to social environments.
In order to avoid the problem of muck throwing caused by the muck truck in the running process, whether the muck truck is covered with the tarpaulin or not needs to be detected when the muck truck is filled with muck. The speed limit treatment can be carried out on the muck truck without covering the tarpaulin.
The existing solution is that a magnet switch or an infrared sensor is installed at the position of a hopper of the muck truck to detect whether the tarpaulin of the muck truck is covered well. However, these two schemes have two disadvantages: firstly, as the magnet switch or the sensor is arranged at the position of the hopper of the muck truck, the muck truck is easy to be collided by a bucket of an excavator, and the damage is caused; secondly, the driver cheats more easily, leads to whether to cover the tarpaulin and causes the erroneous judgement. Therefore, how to provide a method for accurately judging the opening and closing states of the tarpaulin of the muck truck becomes a problem which needs to be solved urgently.
Disclosure of Invention
Aiming at the problems in the prior art, the embodiment of the invention provides a method and a system for detecting the on-off state of a vehicle tarpaulin.
In a first aspect, an embodiment of the present invention provides a method for detecting a state of a vehicle tarpaulin, where the method includes:
acquiring a reference picture and a first comparison picture in real time from a carriage monitoring video of a vehicle to be detected; the time comparison of the reference picture is forward and has a preset time difference with the first comparison picture, the first reference picture and the first comparison picture are both rectangular pictures, the upper part of each rectangular picture represents a picture at the tail part of the carriage, and the lower part of each rectangular picture represents a picture at the front part of the carriage;
respectively dividing the reference picture and the first comparison picture into a preset number of rectangular picture units from the upper part to the lower part according to a preset method; each picture unit corresponds to an index number, the index number corresponding to a picture unit closer to the lower part is larger, a boundary line between two adjacent picture units is parallel to a boundary line at the upper part of the picture, and the preset number is a positive integer larger than 1;
sequentially comparing the reference picture with the picture units with the same corresponding index numbers in the first comparison picture, if a first preset condition is met, selecting one index number from the index numbers corresponding to the picture units with the difference, recording the index number as a first index number, and acquiring a second comparison picture from the monitoring video; wherein the second comparison picture and the first comparison picture have the preset time difference and the time comparison is backward, and the first preset condition includes: only one picture unit is different or a plurality of picture units which are mutually continuous are different;
dividing the second comparison picture into the rectangular picture units with the preset number from the upper part to the lower part according to the preset method, sequentially comparing the picture units with the same corresponding index numbers in the first comparison picture and the second comparison picture, and if the first preset condition is met, selecting an index number from the index numbers corresponding to the picture units with the difference, and recording the index number as a second index number;
if the second index number is smaller than or equal to the first index number, the tarpaulin of the vehicle is judged to be in the closing process, and if the second index number is larger than or equal to the first index number, the tarpaulin of the vehicle is judged to be in the opening process.
In a second aspect, an embodiment of the present invention provides a vehicle tarpaulin switch state detection system, where the system includes:
the image acquisition module is used for acquiring a reference image and a first comparison image in real time from a carriage monitoring video of a vehicle to be detected; the time comparison of the reference picture is forward and has a preset time difference with the first comparison picture, the first reference picture and the first comparison picture are both rectangular pictures, the upper part of each rectangular picture represents a picture at the tail part of the carriage, and the lower part of each rectangular picture represents a picture at the front part of the carriage;
a dividing module, configured to divide the reference picture and the first comparison picture into a first preset number of rectangular picture units from top to bottom according to a preset method; each picture unit corresponds to an index number, the index number corresponding to a picture unit closer to the lower part is larger, a boundary line between two adjacent picture units is parallel to a boundary line at the upper part of the picture, and the first preset number is a positive integer greater than 1;
the first index number acquisition module is used for sequentially comparing the reference picture with the picture units with the same corresponding index numbers in the first comparison picture, if a first preset condition is met, selecting one index number from the index numbers corresponding to the picture units with the difference, recording the index number as a first index number, and acquiring a second comparison picture from the monitoring video; wherein the second comparison picture and the first comparison picture have the preset time difference and the time comparison is backward, and the first preset condition includes: only one picture unit is different or a plurality of picture units which are mutually continuous are different;
a second index number obtaining module, configured to divide the second comparison picture into the preset number of rectangular picture units from the upper portion to the lower portion according to the preset method, sequentially compare picture units with the same index number in the first comparison picture and the second comparison picture, and if the first preset condition is met, select an index number from the index numbers corresponding to the different picture units, which is recorded as a second index number;
and the first judgment module is used for judging that the tarpaulin of the vehicle is in the closing process if the second index number is less than or equal to the first index number, and judging that the tarpaulin of the vehicle is in the opening process if the second index number is greater than or equal to the first index number.
In a third aspect, an embodiment of the present invention provides an electronic device, where the device includes a memory and a processor, where the processor and the memory complete communication with each other through a bus; the memory stores program instructions which can be executed by the processor, and the processor calls the program instructions to execute the vehicle tarpaulin switch state detection method.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the above-described vehicle tarpaulin switch state detection method.
The method and the system for detecting the on-off state of the tarpaulin of the vehicle, provided by the embodiment of the invention, are characterized in that a reference picture and a first comparison picture are obtained from a compartment monitoring video of the vehicle to be detected, the reference picture and the first comparison picture are respectively divided into rectangular picture units with preset numbers from the upper part to the lower part according to a preset method, picture units with the same corresponding index numbers in the reference picture and the first comparison picture are sequentially compared, if a first preset condition is met, one index number is selected from the index numbers corresponding to the picture units with difference and is marked as the first index number, a second comparison picture is obtained from the monitoring video, the second comparison picture is divided into rectangular picture units with preset numbers from the upper part to the lower part according to the preset method, the picture units with the same corresponding index numbers in the first comparison picture and the second comparison picture are sequentially compared, if the first preset condition is met, and selecting one index number from the index numbers corresponding to the picture units with the difference, recording the index number as a second index number, judging that the tarpaulin of the vehicle is in the closing process if the second index number is less than or equal to the first index number, and judging that the tarpaulin of the vehicle is in the opening process if the second index number is greater than or equal to the first index number. The method and the system judge the on-off state of the tarpaulin of the vehicle based on the carriage monitoring video of the vehicle to be detected, and can improve the accuracy of detecting the on-off state of the tarpaulin of the vehicle.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a flow chart of a method for detecting the on-off state of a vehicle tarpaulin according to an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating an installation of a car monitoring device according to an embodiment of the present invention;
fig. 3 to 4 are schematic diagrams of pictures in a car surveillance video according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a picture obtained after a picture in a car surveillance video is segmented according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a vehicle tarpaulin switch state detection system according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some embodiments, but not all embodiments, of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart of a method for detecting a state of a tarpaulin of a vehicle according to an embodiment of the present invention, where as shown in fig. 1, the method includes:
step 10, acquiring a reference picture and a first comparison picture in real time from a carriage monitoring video of a vehicle to be detected; the time comparison of the reference picture is forward and has a preset time difference with the first comparison picture, the first reference picture and the first comparison picture are both rectangular pictures, the upper part of each rectangular picture represents a picture at the tail part of the carriage, and the lower part of each rectangular picture represents a picture at the front part of the carriage;
step 11, dividing the reference picture and the first comparison picture into a preset number of rectangular picture units from the upper part to the lower part according to a preset method; each picture unit corresponds to an index number, the index number corresponding to a picture unit closer to the lower part is larger, a boundary line between two adjacent picture units is parallel to a boundary line at the upper part of the picture, and the preset number is a positive integer larger than 1;
step 12, comparing the reference picture with the picture units corresponding to the same index number in the first comparison picture in sequence, if a first preset condition is met, selecting an index number from the index numbers corresponding to the picture units with difference, recording the index number as a first index number, and acquiring a second comparison picture from the monitoring video; wherein the second comparison picture and the first comparison picture have the preset time difference and the time comparison is backward, and the first preset condition includes: only one picture unit is different or a plurality of picture units which are mutually continuous are different;
step 13, dividing the second comparison picture into the rectangular picture units with the preset number from the upper part to the lower part according to the preset method, sequentially comparing the picture units with the same corresponding index numbers in the first comparison picture and the second comparison picture, and if the first preset condition is met, selecting an index number from the index numbers corresponding to the picture units with the difference, and marking the index number as a second index number;
and 14, if the second index number is smaller than or equal to the first index number, judging that the tarpaulin of the vehicle is in a closing process, and if the second index number is larger than or equal to the first index number, judging that the tarpaulin of the vehicle is in an opening process.
Fig. 2 is a schematic installation diagram of the car monitoring device provided by the embodiment of the present invention, fig. 3 to 4 are schematic diagrams of pictures in the car monitoring video provided by the embodiment of the present invention, and fig. 5 is a schematic diagram of pictures obtained after dividing the pictures in the car monitoring video provided by the embodiment of the present invention. As shown in fig. 2, a camera may be installed above a front portion of a cabin of the vehicle to be tested, wherein the front portion of the cabin refers to a portion close to a head of the vehicle to be tested. The camera can monitor the carriage of the vehicle to be detected in real time to obtain a carriage monitoring video of the vehicle to be detected.
The server can acquire the car monitoring video from the camera, and then acquire two frames of rectangular pictures in front and at the back from the car monitoring video in real time, wherein a preset time difference exists between the two frames of rectangular pictures, and the preset time difference can be set according to actual conditions, for example, can be set to 3 seconds. The server may use one of the two rectangular pictures with the earlier time comparison as a reference picture, and use one of the two rectangular pictures with the later time comparison as a first comparison picture. The lower parts of the reference picture and the first comparison picture represent pictures close to the front part of the compartment of the vehicle to be tested, and the upper parts of the reference picture and the first comparison picture represent pictures close to the tail part of the compartment.
Fig. 3 and 4 are two pictures of the front and rear frames acquired by the server from the car monitoring video, and if the time comparison of fig. 3 is earlier and the time comparison of fig. 4 is later, the server may use fig. 3 as the reference picture and fig. 4 as the first comparison picture.
After the reference picture and the first comparison picture are acquired, the server may segment the reference picture and the first comparison picture according to a preset method. For example, the server may divide the reference picture into a preset number of rectangular picture units from the top to the bottom, where the preset number may be a positive integer greater than 1, and for example, the server may divide the reference picture into 8 picture units as shown in fig. 5. The boundary line between two adjacent rectangular picture units is parallel to the upper boundary line of the reference picture, and each picture unit corresponds to an index number, and picture units closer to the lower part of the reference picture correspond to larger index numbers, that is, picture units closer to the front part of the carriage correspond to larger index numbers.
The server may divide the first comparison picture into a preset number of picture units according to the same method, and set an index number for each picture unit in the first comparison picture according to the same method. In this way, each picture unit in the reference picture has a corresponding picture unit in the first comparison picture, and the index numbers of the two corresponding picture units are the same.
The server may sequentially compare two picture units having the same index number in the reference picture and the first comparison picture. And if the two picture units which are compared with each other are different, acquiring the index numbers corresponding to the two picture units. After the server compares each picture unit in the reference picture with the corresponding picture unit in the first comparison picture, the index numbers corresponding to all the picture units with the difference can be obtained.
If a first preset condition is met, that is, the server acquires only one index number or acquires a plurality of index numbers, but the index numbers are continuous with each other, the server can randomly select one index number from all the acquired index numbers and record the index number as a first index number. For example, if the server obtains only one index number n1, the server may record n1 as the first index number, and if the server obtains 3 index numbers, which are n2, n2+1, and n2+2, respectively, the server may record any one of the three index numbers as the first index number, for example, n2+1 as the first index number.
If the first preset condition is not met, for example, the server acquires a plurality of index numbers, but the index numbers are not consecutive to each other, for example, the index numbers acquired by the server are: 2, 3, 5 and 6, which are not consecutive, the server may retrieve the two rectangular pictures as a new reference picture and a first comparison picture, respectively, and then repeat the above process.
After the server acquires the first index number according to the method, a rectangular picture which is located behind the first comparison picture in a frame time and is separated from the first comparison picture by a preset time difference can be continuously acquired from the monitoring video to serve as a second comparison picture, and the second comparison picture is divided into a preset number of rectangular picture units by adopting the same method. For example, if the reference picture and the first comparison picture are divided into 8 rectangular picture units, the server may divide the second comparison picture into 8 rectangular picture units according to the same method, and set an index number to each picture unit in the second comparison picture according to the same method. Thus, each picture unit in the first comparison picture has a corresponding picture unit in the second comparison picture, and the index numbers of the two corresponding picture units are the same.
Then, the server may sequentially compare two picture units with the same corresponding index numbers in the first and second comparison pictures. And if the two picture units which are compared with each other are different, acquiring the index numbers corresponding to the two picture units. After the server compares each picture unit in the first comparison picture with the corresponding picture unit in the second comparison picture, the index numbers corresponding to all the picture units with difference can be obtained.
If the first preset condition is met, namely the server only acquires one index number or acquires a plurality of index numbers, but the index numbers are continuous with each other, the server can randomly select one index number from all the acquired index numbers and record the index number as a second index number. For example, if the server obtains only one index number n3, the server may record n3 as the second index number, and if the server obtains 3 index numbers, which are n4, n4+1, and n4+2, respectively, the server may record any one of the three index numbers as the second index number, for example, n4+1 as the second index number. Similarly, if the first preset condition is not met, for example, the server obtains a plurality of index numbers, but the index numbers are not consecutive to each other, for example, the index numbers obtained by the server are: 2, 3, 5 and 6, which are not consecutive, the server may retrieve the two rectangular pictures as a new reference picture and a first comparison picture, respectively, and then repeat the above process.
After obtaining the first index number and the second index number, the server may compare the sizes of the two index numbers. If the second index number is smaller than or equal to the first index number through comparison, the part with the difference in the two frames of pictures is gradually moved from the front part of the compartment of the vehicle to be detected to the tail part of the compartment, the tarpaulin of the vehicle to be detected is shown to move from the front part of the compartment to the tail part of the compartment, and the server can judge that the tarpaulin of the vehicle to be detected is in a closing process; if the second index number is larger than or equal to the first index number through comparison, the part with the difference in the two frames of pictures moves from the tail part of the compartment of the vehicle to be tested to the front part of the compartment gradually, the tarpaulin of the vehicle to be tested moves from the tail part of the compartment to the front part of the compartment, and the server can judge that the tarpaulin of the vehicle to be tested is in an opening process.
The server can also store the video frames of the tarpaulin of the vehicle to be tested in the opening process in the form of pictures locally, or store the pictures of the tarpaulin in the completely closed state and the incompletely closed state locally for viewing.
The method for detecting the on-off state of the tarpaulin of the vehicle comprises the steps of acquiring a reference picture and a first comparison picture from a compartment monitoring video of the vehicle to be detected in real time, dividing the reference picture and the first comparison picture into rectangular picture units with preset numbers from the upper part to the lower part according to a preset method, sequentially comparing the picture units with the same corresponding index numbers in the reference picture and the first comparison picture, if a first preset condition is met, selecting one index number from the index numbers corresponding to the picture units with difference, recording the index number as a first index number, acquiring a second comparison picture from the monitoring video, dividing the second comparison picture into the rectangular picture units with the preset numbers from the upper part to the lower part according to the preset method, sequentially comparing the picture units with the same corresponding index numbers in the first comparison picture and the second comparison picture, if the first preset condition is met, and selecting one index number from the index numbers corresponding to the picture units with the difference, recording the index number as a second index number, judging that the tarpaulin of the vehicle is in the closing process if the second index number is less than or equal to the first index number, and judging that the tarpaulin of the vehicle is in the opening process if the second index number is greater than or equal to the first index number. The method judges the on-off state of the tarpaulin of the vehicle based on the compartment monitoring video of the vehicle to be detected, and can improve the accuracy of detecting the on-off state of the tarpaulin of the vehicle. In addition, the carriage monitoring video is obtained by shooting through the camera, and the camera is installed above the carriage of the vehicle to be detected, close to the vehicle head, so that the camera is not easy to be collided by a bucket of the excavator and is not easy to damage.
Optionally, on the basis of the foregoing embodiment, the method further includes:
if the tarpaulin of the vehicle is judged and known to be in a closing process, acquiring a preset closing index number threshold value;
and if the second index number is less than or equal to the closing index number threshold value, judging that the tarpaulin of the vehicle is completely closed.
The server can judge whether the tarpaulin of the vehicle to be tested is in the opening process or the closing process according to the method in the embodiment. If the server knows through the judgement, and the tarpaulin of the vehicle that awaits measuring is in the closing process, then the server can further judge, whether the tarpaulin of this vehicle is closed completely.
Specifically, the server may obtain a preset close index threshold, which may be denoted as Iclose,IcloseCan be set according to actual needs. The server may obtain the second index number according to the method described in the above embodiment, if the second index number is less than or equal to IcloseAnd judging that the tarpaulin is completely closed.
If the second index number is greater than IcloseThe tarpaulin is not completely closed. The server may continue to obtain a frame of rectangular picture after the second comparison picture and separated from the second comparison picture by a preset time difference, and record the frame of rectangular picture as a third comparison picture, according to the method described in the above embodiment, the third comparison picture is divided, corresponding index numbers are set for picture units obtained after the division, two picture units with the same corresponding index numbers in the third comparison picture and the second comparison picture are sequentially compared, and index numbers corresponding to the picture units with the difference are obtained.
If the first preset condition is met, the server can randomly select one index number from the acquired index numbers, the index number is recorded as a third index number, and then the third index number is compared with the second index number. If the third index number is less than or equal to the second index number, continuing to compare the third index number to IcloseIf the third index number is less than or equal to IcloseAnd judging that the tarpaulin is completely closed. If the third index number is greater than IcloseThe server may continue to obtain a frame of picture after the third comparison picture, and so on, and repeat the above process.
In the actual closing process of the tarpaulin, the tarpaulin may be subjected to resistance of dregs in the compartment to move back and forth, and at the moment, the situation that the third index number is larger than the second index number may occur. If the server knows that the third index number is larger than the second index number through comparison, the server can acquire the front and rear frames of pictures as a new reference picture and a first comparison picture respectively again, and the process is repeated.
According to the method for detecting the on-off state of the vehicle tarpaulin, provided by the embodiment of the invention, if the tarpaulin of the vehicle is judged and known to be in the closing process, the preset closing index number threshold value is obtained, and if the second index number is smaller than or equal to the closing index number threshold value, the tarpaulin of the vehicle is judged to be completely closed, so that the method is more scientific.
Optionally, on the basis of the foregoing embodiment, the method further includes:
if the tarpaulin of the vehicle is judged and known to be in the opening process, acquiring a preset opening index number threshold value;
and if the second index number is larger than or equal to the opening index number threshold value, judging that the tarpaulin of the vehicle is completely opened.
The server can judge whether the tarpaulin of the vehicle to be tested is in the opening process or the closing process according to the method in the embodiment. If the server learns that the tarpaulin of the vehicle to be tested is in the opening process through judgment, the server can further judge whether the tarpaulin of the vehicle is completely opened.
Specifically, the server may obtain a preset opening index number threshold, which may be denoted as Iopen,IopenCan be set according to actual needs. The server may obtain the second index number according to the method described in the above embodiment, and if the second index number is obtained by comparison, the second index number is greater than or equal to IopenAnd judging that the tarpaulin is completely opened.
If the comparison shows that the second index number is less than the opening index number threshold IopenThe tarpaulin is not completely opened. The server may continue to acquire, as a third comparison picture, a frame of rectangular picture that is subsequent to the second comparison picture and that is separated from the second comparison picture by a preset time difference.
The server may segment the third comparison picture according to the method described in the above embodiment, set corresponding index numbers for the picture units obtained after the segmentation, and sequentially compare two picture units with the same corresponding index numbers in the third comparison picture and the second comparison picture to obtain the index numbers corresponding to the picture units with the difference, if so, obtain the index numbers corresponding to the picture units with the differenceIf the obtained index numbers meet a first preset condition, the server can randomly select one index number from the obtained index numbers, record the index number as a third index number, and compare the third index number with the second index number. If the third index number is greater than or equal to the second index number, continuing to compare the third index number to IopenIf the third index number is greater than or equal to IopenAnd judging that the tarpaulin is completely opened. If the third index number is less than IopenThe server may continue to obtain a frame of picture after the third comparison picture, and so on, and repeat the above process.
In the actual opening process of the tarpaulin, the tarpaulin may be subjected to resistance of dregs in the compartment, so that the tarpaulin moves back and forth, and at the moment, the situation that the third index number is smaller than the second index number may occur. If the server knows that the third index number is smaller than the second index number through comparison, the server can acquire the front and rear two frames of pictures again to be respectively used as a new reference picture and a first comparison picture, and the process is repeated.
According to the method for detecting the on-off state of the vehicle tarpaulin, provided by the embodiment of the invention, if the on-off state of the vehicle tarpaulin is obtained through judgment, the preset opening index number threshold value is obtained, and if the second index number is larger than or equal to the opening index number threshold value, the vehicle tarpaulin is judged to be completely opened, so that the method is more scientific.
Optionally, on the basis of the foregoing embodiment, the sequentially comparing the picture units with the same index numbers in the reference picture and the first comparison picture includes:
carrying out gray level processing on the reference picture and the first comparison picture respectively to obtain a gray level reference picture and a first gray level comparison picture;
sequentially comparing the gray reference picture with the pixels in the picture unit with the same corresponding index number in the first gray contrast picture, and counting the number of the pixels meeting a second preset condition; wherein the second preset condition comprises: the brightness difference of the pixel points is smaller than a preset threshold value;
and if the proportion of the number of the pixels meeting the second preset condition to the total number of the pixels in the picture units is less than a preset percentage, judging that the two picture units which are compared with each other are different.
Specifically, the specific process of sequentially comparing the picture units with the same index numbers in the reference picture and the first comparison picture in the above embodiment is as follows.
First, the server may perform gray processing on the reference picture to obtain a gray reference picture, or the server may perform gray processing on the first contrast picture by using the same method to obtain the first gray contrast picture.
Then, the server may sequentially compare the gray reference picture with the pixels in the picture units with the same corresponding index numbers in the first gray contrast picture. For example, the server may compare the grayscale reference picture with two picture units with the smallest corresponding index numbers in the first grayscale comparison picture, compare the brightness of the pixel points in the two picture units, then count the number of the pixel points whose brightness meets a second preset condition, and may record the number as N1, where the second preset condition is that the brightness difference of the pixel points is smaller than a preset threshold, and the preset threshold may be set according to an actual situation.
Then, the server may count the total number of pixels in one picture unit, and may record the total number of pixels as N2, and the server may calculate a ratio of N1 to N2, and compare the ratio with a preset percentage, where the preset percentage may be set according to an actual situation, such as 85%. If the ratio is less than the preset percentage, the server may determine that the two picture units are different. If the ratio is greater than or equal to the preset percentage, the server may determine that the two picture units are the same.
The server may compare all the picture units with the same index number in the reference picture and the first comparison picture according to the above method, and obtain that the two compared picture units are the same or different.
According to the method for detecting the on-off state of the vehicle tarpaulin, the gray level reference picture and the first gray level comparison picture are obtained by respectively carrying out gray level processing on the reference picture and the first comparison picture, the gray level reference picture and the first gray level comparison picture are sequentially compared with the pixels in the picture unit with the same corresponding index number, the number of the pixels meeting the second preset condition is counted, and if the proportion of the number of the pixels meeting the second preset condition to the total number of the pixels in the picture unit is smaller than the preset percentage, the difference between the two compared picture units is judged, so that the method is more scientific.
Fig. 6 is a schematic structural diagram of a vehicle tarpaulin switch state detection system according to an embodiment of the present invention, where as shown in fig. 6, the system includes: the image processing system comprises an image acquisition module 20, a segmentation module 21, a first index number acquisition module 22, a second index number acquisition module 23 and a first judgment module 24, wherein:
the image acquisition module 20 is configured to acquire a reference image and a first comparison image in real time from a carriage monitoring video of a vehicle to be detected; the time comparison of the reference picture is forward and has a preset time difference with the first comparison picture, the first reference picture and the first comparison picture are both rectangular pictures, the upper part of each rectangular picture represents a picture at the tail part of the carriage, and the lower part of each rectangular picture represents a picture at the front part of the carriage; the dividing module 21 is configured to divide the reference picture and the first comparison picture into a first preset number of rectangular picture units from top to bottom according to a preset method; each picture unit corresponds to an index number, the index number corresponding to a picture unit closer to the lower part is larger, a boundary line between two adjacent picture units is parallel to a boundary line at the upper part of the picture, and the first preset number is a positive integer greater than 1; the first index number obtaining module 22 is configured to sequentially compare the reference picture and the picture units with the same corresponding index numbers in the first comparison picture, select one index number from the index numbers corresponding to the picture units with the difference if a first preset condition is met, mark the selected index number as a first index number, and obtain a second comparison picture from the monitoring video; wherein the second comparison picture and the first comparison picture have the preset time difference and the time comparison is backward, and the first preset condition includes: only one picture unit is different or a plurality of picture units which are mutually continuous are different; the second index number obtaining module 23 is configured to divide the second comparison picture into the rectangular picture units with the preset number from the upper portion to the lower portion according to the preset method, sequentially compare the picture units with the same corresponding index numbers in the first comparison picture and the second comparison picture, and if the first preset condition is met, select one index number from the index numbers corresponding to the different picture units, and record the selected index number as the second index number; the first judgment module 24 is configured to judge that the tarpaulin of the vehicle is in a closing process if the second index number is less than or equal to the first index number, and judge that the tarpaulin of the vehicle is in an opening process if the second index number is greater than or equal to the first index number.
The vehicle tarpaulin on-off state detection system provided by the embodiment of the invention can comprise: the image processing device comprises an image acquisition module 20, a segmentation module 21, a first index number acquisition module 22, a second index number acquisition module 23 and a first judgment module 24.
The picture obtaining module 20 may obtain the car surveillance video from the camera, and obtain two frames of rectangular pictures in front of and behind the car surveillance video in real time, where a preset time difference exists between the two frames of rectangular pictures, and the preset time difference may be set according to an actual situation, for example, may be set to 3 seconds. The picture obtaining module 20 may use one of the two frames of rectangular pictures with a time earlier as a reference picture, and use one of the two frames of rectangular pictures with a time later as a first comparison picture. The lower parts of the reference picture and the first comparison picture represent pictures close to the front part of the compartment of the vehicle to be tested, and the upper parts of the reference picture and the first comparison picture represent pictures close to the tail part of the compartment of the vehicle to be tested.
After the image obtaining module 20 obtains the reference image and the first comparison image, the dividing module 21 may divide the reference image and the first comparison image according to a preset method. For example, the dividing module 21 may divide the reference picture into a preset number of rectangular picture units from the top to the bottom, where the preset number may be a positive integer greater than 1, and for example, the dividing module 21 may divide the reference picture into 8 picture units as shown in fig. 5. The boundary line between two adjacent rectangular picture units is parallel to the upper boundary line of the reference picture, and each picture unit corresponds to an index number, and picture units closer to the lower part of the reference picture correspond to larger index numbers, that is, picture units closer to the front part of the carriage correspond to larger index numbers. The segmentation module 21 may segment the first comparison picture into a preset number of picture units according to the same method, and set an index number for the picture unit in the first comparison picture according to the same method. In this way, each picture unit in the reference picture has a corresponding picture unit in the first comparison picture, and the index numbers of the two corresponding picture units are the same.
The first index number obtaining module 22 may sequentially compare two picture units with the same corresponding index numbers in the reference picture and the first comparison picture. And if the two picture units which are compared with each other are different, acquiring the index numbers corresponding to the different picture units. After the first index number obtaining module 22 compares all the picture units in the reference picture with the corresponding picture units in the first comparison picture, the index numbers corresponding to all the picture units with differences can be obtained.
If a first preset condition is satisfied, that is, the first index number obtaining module 22 obtains only one index number, or obtains multiple index numbers, but the multiple index numbers are consecutive to each other, the first index number obtaining module 22 may arbitrarily select one index number from all the obtained index numbers, and record the selected index number as the first index number.
If the first preset condition is not satisfied, for example, the first index number obtaining module 22 obtains the plurality of index numbers, but the plurality of index numbers are not consecutive to each other, the picture obtaining module 20 may obtain two frames of rectangular pictures again as a new reference picture and a first contrast picture, respectively, and then repeat the above process.
After the first index number obtaining module 22 obtains the first index number, the second index number obtaining module 23 may continue to obtain a rectangular picture which is located behind the first comparison picture in one frame time and has a preset time difference with the first comparison picture as the second comparison picture, and segment the second comparison picture by using the same method, so as to segment the second comparison picture into a preset number of rectangular picture units, and set an index number for each picture unit in the second comparison picture according to the same method. Thus, each picture unit in the first comparison picture has a corresponding picture unit in the second comparison picture, and the index numbers of the two corresponding picture units are the same.
The second index number obtaining module 23 may sequentially compare two picture units with the same index numbers in the first comparison picture and the second comparison picture. And if the two picture units which are compared with each other are different, acquiring the index numbers corresponding to the different picture units. After the second index number obtaining module 23 compares all the picture units in the first comparison picture with the corresponding picture units in the second comparison picture, the index numbers corresponding to all the picture units with difference can be obtained.
If the first preset condition is satisfied, that is, the second index number obtaining module 23 obtains only one index number, or obtains multiple index numbers, but the multiple index numbers are consecutive to each other, the second index number obtaining module 23 may arbitrarily select one index number from all the obtained index numbers, and record the selected index number as the second index number. Likewise, if the first preset condition is not satisfied, for example, the second index number obtaining module 23 obtains a plurality of index numbers, but the plurality of index numbers are not consecutive to each other, the picture obtaining module 20 may obtain two frames of rectangular pictures again as a new reference picture and a first contrast picture, respectively, and then repeat the above process.
After obtaining the first index number and the second index number, the first determining module 24 may compare the sizes of the two index numbers. If the second index number is smaller than or equal to the first index number through comparison, the part with the difference in the two frames of pictures moves from the front part of the compartment of the vehicle to be detected to the tail part of the compartment gradually, and the first judgment module 24 can judge that the tarpaulin of the vehicle to be detected is in a closing process; if the second index number is greater than or equal to the first index number through comparison, it is indicated that the part with the difference in the two frames of pictures moves from the tail part of the compartment of the vehicle to be detected to the front part of the compartment gradually, and the first judgment module 24 can judge that the tarpaulin of the vehicle to be detected is in an opening process.
The functions of the vehicle tarpaulin switch state detection system provided by the embodiment of the invention specifically refer to the method embodiment, and are not described again here.
The vehicle tarpaulin switch state detection system provided by the embodiment of the invention obtains a reference picture and a first comparison picture from a carriage monitoring video of a vehicle to be detected, respectively divides the reference picture and the first comparison picture into rectangular picture units with preset numbers from the upper part to the lower part according to a preset method, sequentially compares the picture units with the same corresponding index numbers in the reference picture and the first comparison picture, selects one index number from the index numbers corresponding to the picture units with difference if a first preset condition is met, marks the index number as the first index number, obtains a second comparison picture from the monitoring video, divides the second comparison picture into the rectangular picture units with the preset numbers from the upper part to the lower part according to the preset method, sequentially compares the picture units with the same corresponding index numbers in the first comparison picture and the second comparison picture, if the first preset condition is met, and selecting one index number from the index numbers corresponding to the picture units with the difference, recording the index number as a second index number, judging that the tarpaulin of the vehicle is in the closing process if the second index number is less than or equal to the first index number, and judging that the tarpaulin of the vehicle is in the opening process if the second index number is greater than or equal to the first index number. The system judges the on-off state of the tarpaulin of the vehicle based on the carriage monitoring video of the vehicle to be detected, and can improve the accuracy of detecting the on-off state of the tarpaulin of the vehicle. In addition, the carriage monitoring video is obtained by shooting through the camera, and the camera is installed above the carriage of the vehicle to be detected, close to the vehicle head, so that the camera is not easy to be collided by a bucket of the excavator and is not easy to damage.
Optionally, on the basis of the foregoing embodiment, the system includes: the image processing device comprises an image acquisition module, a segmentation module, a first index number acquisition module, a second index number acquisition module, a first judgment module, a first threshold acquisition module and a second judgment module, wherein:
the first threshold value obtaining module is used for obtaining a preset closing index number threshold value; the second judging module is used for judging that the tarpaulin of the vehicle is completely closed if the second index number is smaller than or equal to the closing index number threshold value.
Specifically, the vehicle tarpaulin on-off state detection system provided by the embodiment of the present invention may include: the device comprises a picture acquisition module, a segmentation module, a first index number acquisition module, a second index number acquisition module, a first judgment module, a first threshold acquisition module and a second judgment module. The image obtaining module, the dividing module, the first index number obtaining module, the second index number obtaining module, and the first determining module are described in detail in the above embodiments, and are not described herein again.
The first judgment module is judged to know that the tarpaulin of the vehicle to be detected is in the closing process, the first threshold acquisition module can acquire a preset closing index threshold, and the closing index threshold can be recorded as Iclose,IcloseCan be set according to actual needs.
The second judging module may compare the second index number obtained by the second index number obtaining module with the I obtained by the first threshold obtaining modulecloseIf the comparison shows that the second index number is less than or equal to IcloseAnd the second judging module can judge that the tarpaulin is completely closed. If the comparison shows that the second index number is larger than IcloseThe second judging module may judge that the tarpaulin is not completely closed.
According to the vehicle tarpaulin on-off state detection system provided by the embodiment of the invention, if the judgment shows that the tarpaulin of the vehicle is in the closing process, the preset closing index number threshold value is obtained, and if the second index number is less than or equal to the closing index number threshold value, the tarpaulin of the vehicle is judged to be completely closed, so that the system is more scientific.
Optionally, on the basis of the foregoing embodiment, the system includes: the image processing device comprises an image acquisition module, a segmentation module, a first index number acquisition module, a second index number acquisition module, a first judgment module, a second threshold acquisition module and a third judgment module, wherein:
the second threshold value acquisition module is used for acquiring a preset opening index number threshold value; the third judgment module is used for judging that the tarpaulin of the vehicle is completely opened if the second index number is larger than or equal to the opening index number threshold value.
Specifically, the vehicle tarpaulin switch state detection system provided by the embodiment of the present invention may include: the device comprises a picture acquisition module, a segmentation module, a first index number acquisition module, a second index number acquisition module, a first judgment module, a second threshold acquisition module and a third judgment module. The image obtaining module, the dividing module, the first index number obtaining module, the second index number obtaining module, and the first determining module are described in detail in the above embodiments, and are not described herein again.
The first judgment module is judged and known, after the tarpaulin of the vehicle to be tested is in the opening process, the second threshold value acquisition module can acquire a preset opening index number threshold value, and the opening index number threshold value can be recorded as Iopen,IopenCan be set according to actual needs.
The third judging module may compare the second index number obtained by the second index number obtaining module with the I obtained by the second threshold obtaining moduleopenIf the comparison shows that the second index number is greater than or equal to IopenAnd the third judgment module can judge that the tarpaulin is completely opened. If the comparison shows that the second index number is less than IopenAnd then the third judging module can judge that the tarpaulin is not completely opened.
According to the vehicle tarpaulin on-off state detection system provided by the embodiment of the invention, if the judgment shows that the tarpaulin of the vehicle is in the opening process, the preset opening index number threshold value is obtained, and if the second index number is larger than or equal to the opening index number threshold value, the tarpaulin of the vehicle is judged to be completely opened, so that the system is more scientific.
Optionally, on the basis of the foregoing embodiment, the first index number obtaining module is specifically configured to:
carrying out gray level processing on the reference picture and the first comparison picture respectively to obtain a gray level reference picture and a first gray level comparison picture;
sequentially comparing the gray reference picture with the picture units with the same corresponding index numbers in the first gray contrast picture, and counting the number of pixel points meeting a second preset condition; wherein the second preset condition comprises: the brightness difference of the pixel points is smaller than a preset threshold value;
and if the proportion of the number of the pixels meeting the second preset condition to the total number of the pixels in the picture units is less than a preset percentage, judging that the two picture units which are compared with each other are different.
Specifically, the first index number obtaining module in the above embodiment may perform gray scale processing on the reference picture to obtain a gray scale reference picture, and the first index number obtaining module may also perform gray scale processing on the first contrast picture by using the same method to obtain the first gray scale contrast picture.
The first index number obtaining module may sequentially compare pixel points in the picture units with the same corresponding index numbers in the gray-scale reference picture and the first gray-scale comparison picture. For example, the first index number obtaining module may compare the grayscale reference picture with two picture units with the smallest corresponding index numbers in the first grayscale comparison picture, compare the brightness of the pixel points in the two picture units, then count the number of the pixel points whose brightness meets a second preset condition, and may record the number as N1, where the second preset condition is that the brightness difference of the pixel points is smaller than a preset threshold, and the preset threshold may be set according to an actual situation.
The first index number obtaining module may count the total number of the pixels in one picture unit, and may record the total number of the pixels as N2, and the first index number obtaining module may calculate a ratio between N1 and N2, and compare the ratio with a preset percentage, where the preset percentage may be set according to an actual situation, for example, may be set to 85%. If the ratio is smaller than the preset percentage, the first index number obtaining module may determine that the two picture units are different. If the ratio is greater than or equal to the preset percentage, the first index number obtaining module may determine that the two picture units are the same.
The first index number obtaining module may compare all the picture units with the same index number in the reference picture and the first comparison picture according to the above method, and obtain a result that the two compared picture units are the same or different.
The vehicle tarpaulin switch state detection system provided by the embodiment of the invention obtains the gray reference picture and the first gray contrast picture by respectively carrying out gray processing on the reference picture and the first contrast picture, sequentially compares the gray reference picture with the pixels in the picture unit with the same corresponding index number in the first gray contrast picture, counts the number of the pixels meeting the second preset condition, and judges that the two compared picture units are different if the proportion of the number of the pixels meeting the second preset condition to the total number of the pixels in the picture unit is less than the preset percentage, so that the system is more scientific.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 7, the electronic device includes: a processor (processor)31, a memory (memory)32, and a bus 33, wherein:
the processor 31 and the memory 32 complete communication with each other through the bus 33; the processor 31 is configured to call program instructions in the memory 32 to perform the methods provided by the above-mentioned method embodiments, for example, including: acquiring a reference picture and a first comparison picture in real time from a carriage monitoring video of a vehicle to be detected; the time comparison of the reference picture is forward and has a preset time difference with the first comparison picture, the first reference picture and the first comparison picture are both rectangular pictures, the upper part of each rectangular picture represents a picture at the tail part of the carriage, and the lower part of each rectangular picture represents a picture at the front part of the carriage; respectively dividing the reference picture and the first comparison picture into a preset number of rectangular picture units from the upper part to the lower part according to a preset method; each picture unit corresponds to an index number, the index number corresponding to a picture unit closer to the lower part is larger, a boundary line between two adjacent picture units is parallel to a boundary line at the upper part of the picture, and the preset number is a positive integer larger than 1; sequentially comparing the reference picture with the picture units with the same corresponding index numbers in the first comparison picture, if a first preset condition is met, selecting one index number from the index numbers corresponding to the picture units with the difference, recording the index number as a first index number, and acquiring a second comparison picture from the monitoring video; wherein the second comparison picture and the first comparison picture have the preset time difference and the time comparison is backward, and the first preset condition includes: only one picture unit is different or a plurality of picture units which are mutually continuous are different; dividing the second comparison picture into the rectangular picture units with the preset number from the upper part to the lower part according to the preset method, sequentially comparing the picture units with the same corresponding index numbers in the first comparison picture and the second comparison picture, and if the first preset condition is met, selecting an index number from the index numbers corresponding to the picture units with the difference, and recording the index number as a second index number; if the second index number is smaller than or equal to the first index number, the tarpaulin of the vehicle is judged to be in the closing process, and if the second index number is larger than or equal to the first index number, the tarpaulin of the vehicle is judged to be in the opening process.
An embodiment of the present invention discloses a computer program product, which includes a computer program stored on a non-transitory computer readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer, the computer can execute the methods provided by the above method embodiments, for example, the method includes:
acquiring a reference picture and a first comparison picture in real time from a carriage monitoring video of a vehicle to be detected; the time comparison of the reference picture is forward and has a preset time difference with the first comparison picture, the first reference picture and the first comparison picture are both rectangular pictures, the upper part of each rectangular picture represents a picture at the tail part of the carriage, and the lower part of each rectangular picture represents a picture at the front part of the carriage; respectively dividing the reference picture and the first comparison picture into a preset number of rectangular picture units from the upper part to the lower part according to a preset method; each picture unit corresponds to an index number, the index number corresponding to a picture unit closer to the lower part is larger, a boundary line between two adjacent picture units is parallel to a boundary line at the upper part of the picture, and the preset number is a positive integer larger than 1; sequentially comparing the reference picture with the picture units with the same corresponding index numbers in the first comparison picture, if a first preset condition is met, selecting one index number from the index numbers corresponding to the picture units with the difference, recording the index number as a first index number, and acquiring a second comparison picture from the monitoring video; wherein the second comparison picture and the first comparison picture have the preset time difference and the time comparison is backward, and the first preset condition includes: only one picture unit is different or a plurality of picture units which are mutually continuous are different; dividing the second comparison picture into the rectangular picture units with the preset number from the upper part to the lower part according to the preset method, sequentially comparing the picture units with the same corresponding index numbers in the first comparison picture and the second comparison picture, and if the first preset condition is met, selecting an index number from the index numbers corresponding to the picture units with the difference, and recording the index number as a second index number; if the second index number is smaller than or equal to the first index number, the tarpaulin of the vehicle is judged to be in the closing process, and if the second index number is larger than or equal to the first index number, the tarpaulin of the vehicle is judged to be in the opening process.
Embodiments of the present invention provide a non-transitory computer-readable storage medium, which stores computer instructions, where the computer instructions cause the computer to perform the methods provided by the above method embodiments, for example, the methods include:
acquiring a reference picture and a first comparison picture in real time from a carriage monitoring video of a vehicle to be detected; the time comparison of the reference picture is forward and has a preset time difference with the first comparison picture, the first reference picture and the first comparison picture are both rectangular pictures, the upper part of each rectangular picture represents a picture at the tail part of the carriage, and the lower part of each rectangular picture represents a picture at the front part of the carriage; respectively dividing the reference picture and the first comparison picture into a preset number of rectangular picture units from the upper part to the lower part according to a preset method; each picture unit corresponds to an index number, the index number corresponding to a picture unit closer to the lower part is larger, a boundary line between two adjacent picture units is parallel to a boundary line at the upper part of the picture, and the preset number is a positive integer larger than 1; sequentially comparing the reference picture with the picture units with the same corresponding index numbers in the first comparison picture, if a first preset condition is met, selecting one index number from the index numbers corresponding to the picture units with the difference, recording the index number as a first index number, and acquiring a second comparison picture from the monitoring video; wherein the second comparison picture and the first comparison picture have the preset time difference and the time comparison is backward, and the first preset condition includes: only one picture unit is different or a plurality of picture units which are mutually continuous are different; dividing the second comparison picture into the rectangular picture units with the preset number from the upper part to the lower part according to the preset method, sequentially comparing the picture units with the same corresponding index numbers in the first comparison picture and the second comparison picture, and if the first preset condition is met, selecting an index number from the index numbers corresponding to the picture units with the difference, and recording the index number as a second index number; if the second index number is smaller than or equal to the first index number, the tarpaulin of the vehicle is judged to be in the closing process, and if the second index number is larger than or equal to the first index number, the tarpaulin of the vehicle is judged to be in the opening process.
The above-described embodiments of the electronic device and the like are merely illustrative, where the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may also be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the embodiments of the present invention, and are not limited thereto; although embodiments of the present invention have been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for detecting the on-off state of a vehicle tarpaulin is characterized by comprising the following steps:
acquiring a reference picture and a first comparison picture in real time from a carriage monitoring video of a vehicle to be detected; the time comparison of the reference picture is forward and has a preset time difference with the first comparison picture, the reference picture and the first comparison picture are both rectangular pictures, the upper part of each rectangular picture represents a picture at the tail of the carriage, and the lower part of each rectangular picture represents a picture at the front of the carriage;
respectively dividing the reference picture and the first comparison picture into a preset number of rectangular picture units from the upper part to the lower part according to a preset method; each picture unit corresponds to an index number, the index number corresponding to a picture unit closer to the lower part is larger, a boundary line between two adjacent picture units is parallel to a boundary line at the upper part of the picture, and the preset number is a positive integer larger than 1;
sequentially comparing the reference picture with the picture units with the same corresponding index numbers in the first comparison picture, if a first preset condition is met, selecting one index number from the index numbers corresponding to the picture units with the difference, recording the index number as a first index number, and acquiring a second comparison picture from the monitoring video; wherein the second comparison picture and the first comparison picture have the preset time difference and the time comparison is backward, and the first preset condition includes: only one picture unit is different or a plurality of picture units which are mutually continuous are different;
dividing the second comparison picture into the rectangular picture units with the preset number from the upper part to the lower part according to the preset method, sequentially comparing the picture units with the same corresponding index numbers in the first comparison picture and the second comparison picture, and if the first preset condition is met, selecting an index number from the index numbers corresponding to the picture units with the difference, and recording the index number as a second index number;
if the second index number is smaller than or equal to the first index number, the tarpaulin of the vehicle is judged to be in the closing process, and if the second index number is larger than the first index number, the tarpaulin of the vehicle is judged to be in the opening process.
2. The method of claim 1, further comprising:
if the tarpaulin of the vehicle is judged and known to be in the closing process, a preset closing index number threshold value is obtained;
and if the second index number is less than or equal to the closing index number threshold value, judging that the tarpaulin of the vehicle is completely closed.
3. The method of claim 1, further comprising:
if the tarpaulin of the vehicle is judged and known to be in the opening process, a preset opening index number threshold value is obtained;
and if the second index number is larger than or equal to the opening index number threshold value, judging that the tarpaulin of the vehicle is completely opened.
4. The method according to claim 1, wherein said sequentially comparing the corresponding picture units with the same index numbers in the reference picture and the first comparison picture comprises:
carrying out gray level processing on the reference picture and the first comparison picture respectively to obtain a gray level reference picture and a first gray level comparison picture;
sequentially comparing the gray reference picture with the pixels in the picture unit with the same corresponding index number in the first gray contrast picture, and counting the number of the pixels meeting a second preset condition; wherein the second preset condition comprises: the brightness difference of the pixel points is smaller than a preset threshold value;
and if the proportion of the number of the pixels meeting the second preset condition to the total number of the pixels in the picture units is less than a preset percentage, judging that the two picture units which are compared with each other are different.
5. The utility model provides a vehicle tarpaulin on-off state detecting system which characterized in that includes:
the image acquisition module is used for acquiring a reference image and a first comparison image in real time from a carriage monitoring video of a vehicle to be detected; the time comparison of the reference picture is forward and has a preset time difference with the first comparison picture, the reference picture and the first comparison picture are both rectangular pictures, the upper part of each rectangular picture represents a picture at the tail of the carriage, and the lower part of each rectangular picture represents a picture at the front of the carriage;
a dividing module, configured to divide the reference picture and the first comparison picture into a first preset number of rectangular picture units from top to bottom according to a preset method; each picture unit corresponds to an index number, the index number corresponding to a picture unit closer to the lower part is larger, a boundary line between two adjacent picture units is parallel to a boundary line at the upper part of the picture, and the first preset number is a positive integer greater than 1;
the first index number acquisition module is used for sequentially comparing the reference picture with the picture units with the same corresponding index numbers in the first comparison picture, if a first preset condition is met, selecting one index number from the index numbers corresponding to the picture units with the difference, recording the index number as a first index number, and acquiring a second comparison picture from the monitoring video; wherein the second comparison picture and the first comparison picture have the preset time difference and the time comparison is backward, and the first preset condition includes: only one picture unit is different or a plurality of picture units which are mutually continuous are different;
a second index number obtaining module, configured to divide the second comparison picture into the preset number of rectangular picture units from the upper portion to the lower portion according to the preset method, sequentially compare picture units with the same index number in the first comparison picture and the second comparison picture, and if the first preset condition is met, select an index number from the index numbers corresponding to the different picture units, which is recorded as a second index number;
and the first judgment module is used for judging that the tarpaulin of the vehicle is in the closing process if the second index number is less than or equal to the first index number, and judging that the tarpaulin of the vehicle is in the opening process if the second index number is greater than the first index number.
6. The system of claim 5, further comprising:
the first threshold value obtaining module is used for obtaining a preset closing index number threshold value;
and the second judgment module is used for judging that the tarpaulin of the vehicle is completely closed if the second index number is less than or equal to the closing index number threshold value.
7. The system of claim 5, further comprising:
the second threshold value acquisition module is used for acquiring a preset opening index number threshold value;
and the third judgment module is used for judging that the tarpaulin of the vehicle is completely opened if the second index number is greater than or equal to the opening index number threshold value.
8. The system of claim 5, wherein the first index number obtaining module is specifically configured to:
carrying out gray level processing on the reference picture and the first comparison picture respectively to obtain a gray level reference picture and a first gray level comparison picture;
sequentially comparing the gray reference picture with the picture units with the same corresponding index numbers in the first gray contrast picture, and counting the number of pixel points meeting a second preset condition; wherein the second preset condition comprises: the brightness difference of the pixel points is smaller than a preset threshold value;
and if the proportion of the number of the pixels meeting the second preset condition to the total number of the pixels in the picture units is less than a preset percentage, judging that the two picture units which are compared with each other are different.
9. An electronic device, comprising a memory and a processor, wherein the processor and the memory communicate with each other via a bus; the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the method of any of claims 1 to 4.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 4.
CN201810142066.2A 2018-02-11 2018-02-11 Method and system for detecting on-off state of vehicle tarpaulin Active CN108492279B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810142066.2A CN108492279B (en) 2018-02-11 2018-02-11 Method and system for detecting on-off state of vehicle tarpaulin

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810142066.2A CN108492279B (en) 2018-02-11 2018-02-11 Method and system for detecting on-off state of vehicle tarpaulin

Publications (2)

Publication Number Publication Date
CN108492279A CN108492279A (en) 2018-09-04
CN108492279B true CN108492279B (en) 2020-05-05

Family

ID=63340298

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810142066.2A Active CN108492279B (en) 2018-02-11 2018-02-11 Method and system for detecting on-off state of vehicle tarpaulin

Country Status (1)

Country Link
CN (1) CN108492279B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1556506A (en) * 2003-12-30 2004-12-22 上海交通大学 Intelligent alarming treatment method of video frequency monitoring system
CN101017573A (en) * 2007-02-09 2007-08-15 南京大学 Method for detecting and identifying moving target based on video monitoring
CN103986906A (en) * 2014-05-08 2014-08-13 杭州同尊信息技术有限公司 Door opening and closing detection method based on monitoring videos
CN103984961A (en) * 2014-05-30 2014-08-13 成都西物信安智能系统有限公司 Image detection method for detecting foreign matter at bottom of vehicle
CN104340827A (en) * 2013-07-26 2015-02-11 上海三菱电梯有限公司 Anti-pinch detection method and anti-pinch detection device for sliding door device
CN104899880A (en) * 2015-05-25 2015-09-09 长安大学 Method for automatically detecting open and closed states of vehicle door of public traffic vehicle
CN104952083A (en) * 2015-06-26 2015-09-30 兰州理工大学 Video saliency detection algorithm based on saliency target background modeling
FR3013878B1 (en) * 2013-11-28 2016-01-01 Sagem Defense Securite ANALYSIS OF A MULTISPECTRAL IMAGE
CN105291949A (en) * 2015-11-02 2016-02-03 湖南汽车制造有限责任公司 Tarpaulin top cover state monitoring system and transportation vehicle with same
CN205113119U (en) * 2015-11-13 2016-03-30 湖北佳恒科技有限公司 Novel dregs car roof afterbody prevent raise dust device
CN106023227A (en) * 2016-06-02 2016-10-12 南京康尼机电股份有限公司 Rail vehicle door lock switch non-contact monitoring method and rail vehicle door lock switch non-contact monitoring device
CN107525458A (en) * 2017-07-20 2017-12-29 武汉依迅北斗空间技术有限公司 A kind of dregs hood cloth condition checkout gear and method

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1556506A (en) * 2003-12-30 2004-12-22 上海交通大学 Intelligent alarming treatment method of video frequency monitoring system
CN101017573A (en) * 2007-02-09 2007-08-15 南京大学 Method for detecting and identifying moving target based on video monitoring
CN104340827A (en) * 2013-07-26 2015-02-11 上海三菱电梯有限公司 Anti-pinch detection method and anti-pinch detection device for sliding door device
FR3013878B1 (en) * 2013-11-28 2016-01-01 Sagem Defense Securite ANALYSIS OF A MULTISPECTRAL IMAGE
CN103986906A (en) * 2014-05-08 2014-08-13 杭州同尊信息技术有限公司 Door opening and closing detection method based on monitoring videos
CN103984961A (en) * 2014-05-30 2014-08-13 成都西物信安智能系统有限公司 Image detection method for detecting foreign matter at bottom of vehicle
CN104899880A (en) * 2015-05-25 2015-09-09 长安大学 Method for automatically detecting open and closed states of vehicle door of public traffic vehicle
CN104952083A (en) * 2015-06-26 2015-09-30 兰州理工大学 Video saliency detection algorithm based on saliency target background modeling
CN105291949A (en) * 2015-11-02 2016-02-03 湖南汽车制造有限责任公司 Tarpaulin top cover state monitoring system and transportation vehicle with same
CN205113119U (en) * 2015-11-13 2016-03-30 湖北佳恒科技有限公司 Novel dregs car roof afterbody prevent raise dust device
CN106023227A (en) * 2016-06-02 2016-10-12 南京康尼机电股份有限公司 Rail vehicle door lock switch non-contact monitoring method and rail vehicle door lock switch non-contact monitoring device
CN107525458A (en) * 2017-07-20 2017-12-29 武汉依迅北斗空间技术有限公司 A kind of dregs hood cloth condition checkout gear and method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"基于图像处理的棚车车门状态自动检测";杨顺辽等;《计算机测量与控制》;20121231(第10期);全文 *

Also Published As

Publication number Publication date
CN108492279A (en) 2018-09-04

Similar Documents

Publication Publication Date Title
CN104392468B (en) Based on the moving target detecting method for improving visual background extraction
CN102348128B (en) Surveillance camera system having camera malfunction detection function
CN107948465B (en) A kind of method and apparatus that detection camera is disturbed
CN105957110B (en) Apparatus and method for detection object
US7822275B2 (en) Method for detecting water regions in video
US20120019728A1 (en) Dynamic Illumination Compensation For Background Subtraction
CN107798688B (en) Moving target identification method, early warning method and automobile rear-end collision prevention early warning device
US9904868B2 (en) Visual attention detector and visual attention detection method
CN112528861B (en) Foreign matter detection method and device applied to ballast bed in railway tunnel
KR20140029069A (en) Method and apparatus for monitoring objects from video
CN103475800A (en) Method and device for detecting foreground in image sequence
CN114898434A (en) Method, device and equipment for training mask recognition model and storage medium
CN106611165B (en) A kind of automotive window detection method and device based on correlation filtering and color-match
CN105530404A (en) Image recognizing apparatus and image recognizing method
CN110114801A (en) Display foreground detection device and method, electronic equipment
Dehghani et al. Single camera vehicles speed measurement
CN108492279B (en) Method and system for detecting on-off state of vehicle tarpaulin
CN107343154A (en) A kind of methods, devices and systems for the exposure parameter for determining camera device
JP2019121356A (en) Interference region detection apparatus and method, and electronic apparatus
CN117132768A (en) License plate and face detection and desensitization method and device, electronic equipment and storage medium
JP2011013978A (en) Method and apparatus for detecting object based on estimation of background image
CN116363628A (en) Mark detection method and device, nonvolatile storage medium and computer equipment
KR20210008574A (en) A Real-Time Object Detection Method for Multiple Camera Images Using Frame Segmentation and Intelligent Detection POOL
JP3649277B2 (en) Speed measurement system and speed measurement method by image recognition
JP2002218452A (en) Method and device for monitoring moving object

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
GR01 Patent grant
GR01 Patent grant