WO2020118621A1 - 一种列车注水口检测定位方法 - Google Patents

一种列车注水口检测定位方法 Download PDF

Info

Publication number
WO2020118621A1
WO2020118621A1 PCT/CN2018/120895 CN2018120895W WO2020118621A1 WO 2020118621 A1 WO2020118621 A1 WO 2020118621A1 CN 2018120895 W CN2018120895 W CN 2018120895W WO 2020118621 A1 WO2020118621 A1 WO 2020118621A1
Authority
WO
WIPO (PCT)
Prior art keywords
water injection
injection port
train
video image
window
Prior art date
Application number
PCT/CN2018/120895
Other languages
English (en)
French (fr)
Inventor
周慧鑫
向培
邓宝凯
于跃
郭立新
赵东
秦翰林
王炳健
宋江鲁奇
李欢
姚博
赖睿
贾秀萍
周峻
Original Assignee
西安电子科技大学
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 西安电子科技大学 filed Critical 西安电子科技大学
Priority to PCT/CN2018/120895 priority Critical patent/WO2020118621A1/zh
Priority to US17/270,873 priority patent/US11066088B2/en
Publication of WO2020118621A1 publication Critical patent/WO2020118621A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • G06T7/74Determining position or orientation of objects or cameras using feature-based methods involving reference images or patches
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B61RAILWAYS
    • B61CLOCOMOTIVES; MOTOR RAILCARS
    • B61C17/00Arrangement or disposition of parts; Details or accessories not otherwise provided for; Use of control gear and control systems
    • B61C17/02Bunkers; Tanks; Tenders; Water or fuel pick-up or scoop apparatus; Water or fuel supply fittings
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B61RAILWAYS
    • B61DBODY DETAILS OR KINDS OF RAILWAY VEHICLES
    • B61D35/00Sanitation
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B61RAILWAYS
    • B61KAUXILIARY EQUIPMENT SPECIALLY ADAPTED FOR RAILWAYS, NOT OTHERWISE PROVIDED FOR
    • B61K11/00Serving peculiar to locomotives, e.g. filling with, or emptying of, water, sand, or the like at the depots
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B61RAILWAYS
    • B61LGUIDING RAILWAY TRAFFIC; ENSURING THE SAFETY OF RAILWAY TRAFFIC
    • B61L27/00Central railway traffic control systems; Trackside control; Communication systems specially adapted therefor
    • B61L27/50Trackside diagnosis or maintenance, e.g. software upgrades
    • B61L27/57Trackside diagnosis or maintenance, e.g. software upgrades for vehicles or trains, e.g. trackside supervision of train conditions
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • 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
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/751Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/758Involving statistics of pixels or of feature values, e.g. histogram matching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B61RAILWAYS
    • B61LGUIDING RAILWAY TRAFFIC; ENSURING THE SAFETY OF RAILWAY TRAFFIC
    • B61L2201/00Control methods
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/71Circuitry for evaluating the brightness variation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/74Circuitry for compensating brightness variation in the scene by influencing the scene brightness using illuminating means

Definitions

  • the invention belongs to the technical field of train water injection port detection, and in particular relates to a method for detecting and positioning a train water injection port.
  • Manual water injection is not only huge in labor cost, but also inefficient. Therefore, it is particularly important to develop a new type of automatic train watering device.
  • most of the existing train water supply devices cooperate with the railway workers to connect the water injection gun to the water injection port of the train through mechanical devices. Due to the limitations of the surrounding environment of the trains at the docking station, the existing train water transfer cannot be separated from manual cooperation for fully automated water transfer.
  • the main purpose of the present invention is to provide a method for detecting and positioning a train water injection port.
  • An embodiment of the present invention provides a method for detecting and locating a train water inlet.
  • the method is: collecting continuous train water inlet video images, and thresholding the train water inlet video images to obtain a binary train water inlet video image;
  • the binary video image of the train water inlet is processed and matched with the image of the train water inlet template, the position of the water inlet in the video image of the train water inlet is detected, and compared with the preset position range of the water inlet, if If it is matched, the matching valid signal is transmitted to the mechanical device control module to control the mechanical device to stop moving, and to start water injection and stop water injection.
  • the threshold image segmentation of the train water inlet video image to obtain a binarized train water inlet video image specifically includes: binarizing the train water inlet video image according to the binarization threshold and binarizing The video image of is generated m ⁇ n video image window in order of pixels in steps of 1.
  • the position of the pixel in the first row and first column in the video image window in the position of the video image window in the entire frame image is the position coordinate P(i, j) of the video image window.
  • the specific process of obtaining the binarization threshold is to count the number of pixels corresponding to each gray value in the current frame image of the train water injection video image, form an abstract gray histogram, and according to the The abstract grayscale histogram calculates the binarization threshold with the best segmentation effect.
  • the maximum value M1 in the abstract grayscale histogram and the corresponding grayscale value G1 are determined, and the second highest peak M2 in the right part of the grayscale value G1 in the abstract grayscale histogram is determined to correspond to
  • the gray value of G2 is calculated on the histogram between G1 and G2 to obtain the peak-valley minimum value M3 and the corresponding gray value G3, and G3 is defined as the binarization threshold.
  • the comparison with the preset position range where the water injection port is located, and if it has been matched, a matching effective signal is transmitted to the mechanical device control module to control the mechanical device to move or stop, and start or stop water injection specifically:
  • the generated video image window is compared with the train nozzle template image, and the total number of pixels at the same position is calculated, and the result is recorded as a window matching result.
  • the matching degree of the window matching result is verified and the video is combined Image window position P(i,j) performs window matching position verification to obtain a matching valid signal, and sends the matching valid signal to the mechanical device control module.
  • the pair of the generated video image window and the train water injection template image are compared, and the total number of pixels at the same position in the two is calculated, which is recorded as the window matching result, specifically: the two
  • the m lines of the valued video image are sequentially stored in m FIFOs, and the data read out from the m FIFOs are respectively shifted to the left by the corresponding m n-bit shift registers.
  • N-bit shift registers and m n-bit template registers perform bit-wise or-or, add the same-or result of each row, and count the number of the same pixels in each corresponding n-bit register to become n row-matching results , Summing the matching results of the m corresponding n-bit register lines again, and counting the number of the same pixels in the video image window and the train nozzle template image, that is, the window matching result.
  • the method further includes: verifying the matching result of the window, comparing the matching result of the window with the set matching threshold: if the matching result of the window is greater than the matching threshold, the number of pixels matches, and then performs position matching, if the window matches If the result is less than the matching threshold, wait for the matching result of the next clock window to continue matching the number of pixels.
  • the method further includes: performing position verification on the video image window where the number of pixels matches successfully, and comparing the position matching result P(i, j) with the set window position range: if Pi, j is in the set window position Within the range, the position matching is successful, and the matching valid signal is transmitted to the mechanical device control module. If Pi, j is not within the set window position range, wait for the next verification.
  • the method further includes: real-time detection of the light intensity in the surrounding environment, and when the detected ambient light intensity is lower than the set light intensity threshold, controlling the turning on and off of the external lighting lamp.
  • the invention can realize the automatic detection and identification of the water injection port of the train, can detect the stopped train in real time in 24 hours, save a lot of labor costs and have high working efficiency.
  • FIG. 1 is a schematic diagram of pixel statistics in a method for detecting and locating a water injection port of a train according to the implementation of the present invention
  • FIG. 2 is a schematic diagram of threshold segmentation in a method for detecting and positioning a train water injection port provided by the implementation of the present invention
  • FIG. 3 is a schematic diagram of generating a video image window in a method for detecting and positioning a train water inlet according to the implementation of the present invention
  • FIG. 4 is a schematic diagram of template matching in a method for detecting and locating a water injection port of a train according to the implementation of the present invention
  • FIG. 5 is a structural diagram of a train water injection port detection and positioning system based on FPGA provided by the implementation of the present invention.
  • FIG. 6 is a structural block diagram of an FPGA-based train water injection port detection and positioning system provided by the implementation of the present invention.
  • An embodiment of the present invention provides a method for detecting and locating a train water inlet.
  • the method is: collecting continuous train water inlet video images, and thresholding the train water inlet video images to obtain a binary train water inlet video image;
  • the binary video image of the train water inlet is processed and matched with the image of the train water inlet template, the position of the water inlet in the video image of the train water inlet is detected, and compared with the preset position range of the water inlet, if If it is matched, the matching valid signal is transmitted to the mechanical device control module to control the mechanical device to move or stop, and to start or stop water injection.
  • the threshold value segmentation of the train water inlet video image to obtain the binary train water inlet video image specifically includes: binarizing the train water inlet video image according to the binary threshold, and dividing the binarized video image according to The pixels sequentially generate m ⁇ n video image windows according to the step size of 1.
  • the position of the pixels in the first row and first column in the video image window in the position of the video image window in the entire frame of the image is the position coordinate P(i, j) of the video image window.
  • the specific process of obtaining the binarization threshold is: counting the number of pixels corresponding to each gray value in the current frame image in the train water injection video image, forming an abstract gray histogram, and according to the abstract gray
  • the degree histogram calculates the binarization threshold with the best segmentation effect.
  • the resolution of the continuous train water inlet video image collected in the present invention is 640 ⁇ 480, so the bit width of the dual-port RAM is set to 16.
  • Both ports of the dual-port RAM support reading and writing, and the currently reached video image pixel gray value is used as the address of the dual-port RAM A port, and the stored data is read from the dual-port RAM A port to add an adder ;
  • the pixel statistics results are read out by controlling the address of the B port of the dual-port RAM during the frame blanking period.
  • the pixel statistical results are first entered into the first comparator one by one.
  • the first comparator leaves large values and discards the small values.
  • the maximum value M1 of the pixel statistical results is obtained, and the corresponding value of the maximum value is read out.
  • the memory address of the dual-port RAM is the corresponding gray value G1.
  • the 5-level comparator leaves a small value and discards the large value, and the statistical results of pixels with a gray value greater than G1 are entered into the 5-level comparator in sequence, if a gray-scale statistical value appears sequentially
  • the value is regarded as the first trough M12 on the right side of G1
  • the second highest peak M2 on the right side of the corresponding gray value G12 is calculated by the comparator, and the corresponding gray value is G2.
  • the second comparator is set. The second comparator leaves a small value and discards the large value.
  • the pixel statistics between G1 and G2 enter the second comparator in sequence, and the minimum value M3 is calculated, and the corresponding gray value is G3.
  • G3 as the binarization threshold.
  • the pair of the generated video image window and the train water injection template image are compared, the total number of pixels at the same position of the two is calculated, and the result of the window matching is recorded, specifically: the binarized video
  • the m lines in the image are sequentially stored in m FIFOs, and the data read out from the m FIFOs are respectively shifted left to the corresponding m n-bit left shift registers, and the m n bits that are read
  • the left shift register performs bitwise or-or with m n-bit template image registers, and adds each bit of the same-or result of each row, that is, the number of the same pixels in each corresponding n-bit register is counted as n Line matching results, the matching results of the m corresponding n-bit register lines are summed again, that is, the number of the same pixels in the video image window and the train water inlet template image is counted, which is the window matching result.
  • FIG. 3 it is composed of m FIFOs and a left shift register.
  • the number of lines of the train nozzle template image is 24, so the value of m here is 24; each line of the binarized video image has 640 pixels, so the depth of the FIFO is set to 640; because the bit width of the gray value of each pixel is 1, the width of the FIFO is 1.
  • the binarized video image pixels first enter FIFO1. When the FIFO is filled, it enters FIFO2. When the 24 FIFOs are completely filled, the 24-line image buffer ends, that is, a 24-line two-dimensional image matrix is generated. Set 24 16-bit left shift registers corresponding to 24 FIFOs.
  • the matching result is obtained by aligning or matching the video image window with the train nozzle template image.
  • the template image of the train water inlet is stored in 24 16-bit template image registers, corresponding to the 24 16-bit left shift registers of the video image window, and the bit-wise OR operation is performed for each pair of registers to obtain a set of 16 ⁇ 24 identical
  • the OR result is placed in 24 16-bit XOR result registers.
  • each bit of data in each register of the same or result is added to obtain a line matching result.
  • the added sum is the number of 1 in the register, that is, the number of pixels that successfully match the first line of the train water injection template image , And then add the matching results of 24 lines to get the window matching result.
  • the matching threshold PE when the window matching result is greater than PE, the matching is successful, and then read the coordinates of the matching window from the video image window generation module, and determine whether the coordinates of the matching window are within the set range through the comparator , That is, the abscissa is greater than RA and less than RB, and the ordinate is greater than CA and less than CB. If it is within this range, the match is successful, and a matching valid signal is sent to the mechanical device.
  • PE, RA, RB, CA, and CB are preset values. Generally, PE is equal to 325, RA is equal to 298, RB is equal to 318, CA is equal to 222, and CB is equal to 242.
  • the mechanical device starts the mechanical device and starts the movement time timer.
  • the matching valid signal is transmitted to the control module of the mechanical device, the mechanical device stops moving, the movement time timer stops timing, and the water injection gun is extended to start water injection. After 6 minutes, the water injection is stopped, and the mechanical device returns according to the time counted by the moving time timer.
  • the method also includes: real-time detection of the light intensity in the surrounding environment, and when the detected ambient light intensity is lower than the set light intensity threshold, controlling the turning on and off of the external lighting lamp.
  • the light detector is used to monitor the light of the surrounding environment in real time. When the light intensity is too low, the light detector sends a lighting start signal to turn on the lighting lamp.
  • An embodiment of the present invention also provides an FPGA-based train water injection port detection and positioning system, as shown in FIGS. 5 and 6, which includes: a video acquisition module 1, an image cache module 2, an image processing module 3, a mechanical device control module 4, and an environment Light adjustment module 5;
  • the video acquisition module 1 is used to collect continuous train water inlet video images, and simultaneously decode the train water inlet video images, and transmit the decoded train water inlet video images to the image buffer module 2 and the image processing module 3, respectively And mechanical device control module 4;
  • the image buffer module 2 is used to receive the decoded train water inlet video image, and cache two frames of the train water inlet video image and all pixel position coordinate information, and at the same time, the cached train water inlet video image and pixel position coordinate information Send to image processing module 3;
  • the image processing module 3 is used to preprocess the collected video image of the train water injection port, and then to match with the template image of the train water injection port to detect the position of the water injection port in the video image of the train water injection port. Compare the preset position range to determine whether it has been matched, and if it has been matched, transmit the matching valid signal to the mechanical device control module 4;
  • the mechanical device control module 4 is used to send a control signal of the working mode of the mechanical device to the receiving unit of the mechanical device to control the movement and stop of the mechanical device, and at the same time control the mechanical device to start water injection and stop water injection in combination with a matching effective signal;
  • the ambient light adjustment module 5 is used to detect the intensity of light in the surrounding environment, and control the turning on and off of the lighting lamp to adjust the ambient brightness in real time;
  • the video acquisition module 1 includes a CMOS camera 11, a USB 2.0 video interface 12, a video decoding chip 13, and an FPGA video control sub-module 14;
  • CMOS camera 11 used to collect the video image of the train water inlet with the resolution of M ⁇ N pixels and the frame rate of f, where the gray value of each pixel collected is an 8-bit integer data, and the The collected data is transferred to the USB2.0 video interface 12;
  • the USB2.0 video interface 12 is used to receive the video image of the train water inlet collected by the CMOS camera 11, and use the differential transmission method to transmit the video image of the train water inlet to the video decoding chip 13;
  • the video decoding chip 13 is used to re-encode the video image of the train water injection port transmitted from the USB2.0 video interface 12 into 8-bit pixel signals, line synchronization signals and frame synchronization signals, and these 10-bit signals are called decoded video Image, and then transmit the decoded video image to FPGA video control sub-module 14 in parallel;
  • the FPGA video control sub-module 14 is used to receive the decoded video image transmitted by the video decoding chip 13, and at the same time calibrate the pixel position coordinate information for each pixel according to the line synchronization signal and the frame synchronization signal, and transmit the decoded video image to In the image buffer module 2 and the image processing module 3, the first row of pixels in the decoded video image is sent to the mechanical device control module 4;
  • the image cache module 2 includes an FPGA cache control sub-module 21 and an SDRAM memory 22, where the SDRAM memory includes SDRAM1 and SDRAM2;
  • the FPGA cache control sub-module 21 is used to receive the decoded video image transmitted from the video acquisition module 1 and write it into one SDRAM, and at the same time read out the decoded video image in another SDRAM and transmit it to the image Processing module 3;
  • each piece of SDRAM is used to store a frame of decoded video image
  • the module reads the decoded video image from the FPGA cache control sub-module 21, and stores the decoded video image into a piece of SDRAM
  • each storage unit stores one pixel;
  • the image processing module 3 includes: a pixel statistics module 31, a threshold calculation module 32, an image segmentation module 33, a video image window generation module 34, a template matching module 35, and a matching result verification module 36;
  • the pixel statistics module 31 is used to receive the decoded video image from the FPGA video acquisition module 1, and simultaneously count the number of pixels corresponding to each gray value in the current frame image to form an abstract gray histogram, and during the frame blanking period Output the pixel statistical results of each frame of image to the threshold calculation module 32;
  • the threshold calculation module 32 is used to receive the pixel statistical results transmitted by the pixel statistics module 31, and calculate the binarization threshold with the best segmentation effect based on the abstract grayscale histogram, and transmit the binarization threshold to the image segmentation In module 33;
  • the image segmentation module 33 is used to perform threshold segmentation on the decoded video image, read the decoded video image pixel by pixel, use the binarization threshold to perform binarization segmentation, and then convert the binarized video image by The pixels are sequentially transferred to the video image window generation module 34;
  • the video image window generation module 34 is used to sequentially generate m ⁇ n video image windows according to the step size of 1, and transmit the video image windows to the template matching module 35, while marking the video images
  • the position of the pixels in the first row and first column of the window in the entire frame of the image is the position coordinates P(i, j) of the video image window, and P(i, j) is transmitted to the matching result verification module 36
  • m is the train note
  • n is the number of columns of the train nozzle template image
  • i is the row coordinate of the video image window
  • j is the column coordinate of the video image window;
  • the template matching module 35 is used to compare the generated video image window with the train nozzle template image, calculate the total number of pixels at the same location, record the window matching result, and transmit the window matching result to the matching Results verification module 36;
  • the matching result verification module 36 is used to verify the matching degree of the window matching result and the window matching position verification to obtain a matching valid signal and send the matching valid signal to the mechanical device control module 4;
  • the mechanical device control module 4 includes: a start control module 41, a start water injection control module 42, a stop water injection control module 43, and an original return control module 44;
  • the start control module 41 is used to receive the movement start signal transmitted by the start switch, and send a movement command to the mechanical device through the serial port, and at the same time time the movement time. After receiving the matching valid signal transmitted by the matching result verification module 36, Send a stop command to the mechanical device through the serial port, and at the same time end the timing of the moving time;.
  • Start water injection control module 42 for receiving matching valid signals and controlling the mechanical device to start water injection
  • the water injection stop control module 43 is used to time the water injection time. When the time reaches 6 minutes, the control mechanical device stops water injection and the water injection end signal is sent to the original return control module 44;
  • the original return control module 44 is used to receive the water injection end signal and read the timing value of the movement time of the start control module 41 to control the timing value of the reverse movement time of the mechanical device to the starting position;
  • the ambient light adjustment module 5 includes: a light intensity sensing module 51 and a lighting control module 52;
  • the light intensity sensing module 51 is used to detect the light intensity in the surrounding environment in real time, and when the detected ambient light intensity is lower than the set light intensity threshold, send a lighting start signal to the lighting control module 52;
  • the lighting control module 52 is used to receive the lighting start signal sent by the light intensity sensing module 51, and then control the turning on and off of the external lighting lamp;
  • the FPGA cache control sub-module 21 includes a pixel stream receiving unit 21a, a read-write control unit 21b, and a pixel stream sending unit 21c;
  • the pixel stream receiving unit 21a is used to read the decoded video image from the video acquisition module 1, count the video frames according to the frame synchronization signal, and transmit the frame count value to the read-write control unit 21b;
  • the pixel stream sending unit 21c is used to send the decoded video image read out from the SDRAM to the image processing module 3, and count the pixels in the decoded video image to generate pixel position coordinate information and cache line synchronization
  • the signal and the buffer frame synchronization signal are simultaneously transmitted to the image processing module 3;
  • the pixel statistics module 31 includes a dual-port RAM 31a, a cache register 31b, and an adder 31c;
  • the dual-port RAM31a is used to store the pixel statistical results with a bit depth of 256 and a bit width of 16, and uses the gray value of the decoded video image transmitted from the FPGA video acquisition module 1 as the address of the storage space.
  • the A port of the dual-port RAM of the RAM reads the data stored in the corresponding address, and the data buffered by the buffer register 31b is used as the address, and the result of the calculation by the adder 31c is added through the B port of the dual-port RAM of the dual-port RAM Write to the corresponding address storage space, and after the completion of the full frame statistics, the B port of the dual-port RAM through the dual-port RAM reads all the stored data to the threshold calculation module 32 according to the gray value from small to small;
  • the buffer register 31b is used to buffer a clock for each pixel of the decoded video image.
  • the pixel gray value before buffering is used as the A port address of the dual-port RAM 31a dual-port RAM to read out the data to the plus An adder 31c, and write the data output by the adder 1 with the buffered pixel gray value as the B port address of the dual-port RAM 31a dual-port RAM;
  • An adder 31c is added to add one to the data read from the A port of the dual-port RAM 31a dual-port RAM, and then store the calculation result to the same storage unit through the B port of the dual-port RAM at the same address;
  • the threshold segmentation module 32 includes a highest peak calculation module 32a, a second peak calculation module 32b, and a minimum calculation module 32c;
  • the highest peak calculation module 32a is used to calculate the maximum value M1 in the abstract grayscale histogram, and transmit the calculated M1 and its corresponding grayscale value G1 to the second peak calculation module 32b and the minimum value calculation module 32c;
  • the second peak calculation module 32b is used to calculate the second highest peak M2 in the right part of G1 in the histogram, and transmit M2 and its corresponding gray value G2 to the minimum calculation module 32c;
  • the minimum value calculation module 32c is used to calculate the histogram between G1 and G2 to obtain the peak and valley minimum value M3 and the corresponding gray value G3, and define G3 as the binarization threshold;
  • the video image window generation module 34 includes a FIFO buffer module 34a, a window register group 34b, and a window position calibration module 34c;
  • FIFO buffer module 34a used to receive the binarized video image transmitted by the image segmentation module 33, and store m lines of them in m FIFOs in sequence, when all FIFOs are full, read each FIFO to the window Register group 34b, m is the number of lines of the train water injection template image;
  • the window register group 34b is used to register the data read in the FIFO, and the data read in the m FIFOs are respectively shifted to the left to the corresponding m n-bit shift registers, and m n-shift bits are shifted at the same time.
  • the data in the bit register is read out to the template matching module 35, n is the number of columns of the template image of the train water injection port;
  • the window position calibration module 34c is used to receive the pixel position coordinate information in the image buffer module 2 and assign the pixel position coordinate information corresponding to the pixels in the first row and first column of the video image window to the video image window position coordinate P(i, j), and simultaneously transmit P(i, j) to the template matching module 35, i is the row coordinate of the video image window, and j is the column coordinate of the video image window;
  • the template matching module 35 includes a template storage register group 35a, a NOR gate array 35b, a matching row adder group 35c, and a video image window adder group 35d;
  • the template storage register group 35a is used to store the template image of the train water inlet into m n-bit template registers, and at the same time transfer the data stored in the same OR gate array 35b, m is the number of lines of the template image of the train water inlet, n is The number of columns of the train water injection template image;
  • the NOR gate array 35b is used to perform bitwise NOR on the read-in m n-bit shift registers and m n-bit template registers, and transmit the NOR result to the matching row adder group 35c at the same time;
  • Matching line adder group 35c used to add the same or result of each line, count the number of the same pixels in each corresponding n-bit register, become the line matching result, and transfer the line matching result to the video image window for addition Unit 35d;
  • the video image window adder group 35d is used to sum the matching results of the m corresponding n-bit register lines again. The number of the same pixels in the video image window and the train nozzle template image is counted, that is, the window matching result, and the window is matched The result is transmitted to the matching result verification module 36;
  • the matching result verification module 36 includes a pixel number matching module 36a and a position matching module 36b;
  • the pixel number matching module 36a is used to verify the window matching result transmitted from the template matching module 35, and compare the window matching result with the set matching threshold: if the window matching result is greater than the matching threshold, the number of pixels matches, and then position matching If the window matching result is less than the matching threshold, wait for the next clock window matching result to continue to match the number of pixels;
  • the position matching module 36b is used to verify the position of the video image window whose number of pixels match successfully, and read the position coordinates P(i, j) of the video image window from the window position calibration module 34c, and compare the position matching result P(i, j ) And the set window position range: if P(i, j) is within the set window position range, the position matching is successful, and the matching effective signal is transmitted to the mechanical device control module 4, if P(i, j) If it is not within the set window position range, wait for the next verification.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Mechanical Engineering (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Automation & Control Theory (AREA)
  • Biomedical Technology (AREA)
  • Transportation (AREA)
  • Epidemiology (AREA)
  • Public Health (AREA)
  • Image Analysis (AREA)

Abstract

一种列车注水口检测定位方法,采集列车注水口视频图像,同时对列车注水口视频图像进行阈值分割,获得二值化的列车注水口视频图像;对二值化的列车注水口视频图像进行处理并且与列车注水口模板图像进行匹配,检测出注水口在列车注水口视频图像中的位置,并与注水口所在的预设位置范围进行比较,如果已经匹配,则将匹配有效信号传输至机械装置控制模块,从而控制机械装置停止移动,并控制开始注水与停止注水。该列车注水口检测定位方法能够实现对火车注水口的自动化检测识别,可实时对停靠的列车进行检测,节省大量人工成本且工作效率高。

Description

一种列车注水口检测定位方法 技术领域
本发明属于列车注水口检测技术领域,具体涉及一种列车注水口检测定位方法。
背景技术
当前我国铁路飞速发展,高铁技术更是享誉全球,但是普通列车在我国铁路运输中仍占据主要地位。由于列车旅客等对水的需求以及消耗,列车储水箱中的水需要不断进行补给,目前我国对列车储水箱的加水工作需要人工完成。列车进站停靠时间短暂,而且每节车厢同时需要加水,依靠铁路工人往返于各列车注水口与水井之间,效率低下。因为列车对水的需求,铁路工人无论天气状况必须24小时不间断工作,因此会对铁路工人的健康造成一定影响。人工注水不仅劳动力成本巨大,而且效率低下,因此研制新型的列车自动上水装置尤为重要。目前已有的列车上水装置大部分都是通过机械装置配合铁路工人将注水枪与列车注水口进行对接。由于停靠处列车周边环境等因素的限制,现有的列车上水转置不能够脱离人工配合,进行全自动化上水。
技术问题
有鉴于此,本发明的主要目的在于提供一种列车注水口检测定位方法。
技术解决方案
为达到上述目的,本发明的技术方案是这样实现的:
本发明实施例提供一种列车注水口检测定位方法,该方法为:采集连续的列车注水口视频图像,同时对列车注水口视频图像进行阈值分割获得二值化的列车注水口视频图像;对所述二值化的列车注水口视频图像进行处理并且与列车注水口模板图像进行匹配,检测出注水口在列车注水口视频图像中的位置,并与注水口所在的预设位置范围进行比较,如果已经匹配则将匹配有效信号传输至机械装置控制模块控制机械装置移动停止,以及开始注水与停止注水。
上述方案中,所述对列车注水口视频图像进行阈值分割获得二值化的列车注水口视频图像,具体为:根据二值化阈值对列车注水口视频图像进行二值化分割,将二值化的视频图像按像素按照步长为1的大小依次生成m×n的视频图像窗口。
上述方案中,在所述视频图像窗口位置中标记所述视频图像窗口中第一行第一列的像素在整帧图像中的位置为视频图像窗口位置坐标P(i, j)。
上述方案中,所述二值化阈值获得的具体过程为:统计所述列车注水口视频图像中当前帧图像中每个灰度值对应的像素数目,形成抽象的灰度直方图,并根据所述抽象的灰度直方图计算出分割效果最佳的二值化阈值。
上述方案中,确定所述抽象的灰度直方图中的最大值M1与对应的灰度值G1,确定所述抽象的灰度直方图中灰度值G1右侧部分的次高峰值M2与对应的灰度值G2,对所述G1与G2之间的直方图进行计算获得峰谷最小值M3与对应的灰度值G3,并定义G3为二值化阈值。
上述方案中,所述与注水口所在的预设位置范围进行比较,如果已经匹配则将匹配有效信号传输至机械装置控制模块控制机械装置移动或停止,以及开始注水或停止注水,具体为:对生成的所述视频图像窗口与列车注水口模板图像进行比较,计算出二者在同位置像素点相同的总数目,记录为窗口匹配结果,对所述窗口匹配结果进行匹配程度验证,以及结合视频图像窗口位置P(i,j)进行窗口匹配位置验证获得匹配有效信号,并将匹配有效信号发送至机械装置控制模块。
上述方案中,所述对生成的所述视频图像窗口与列车注水口模板图像进行比较,计算出二者在同位置像素点相同的总数目,记录为窗口匹配结果,具体为:将所述二值化的视频图像中的m行依次存入m个FIFO中,将m个FIFO中读出的数据分别作为移位位左移至对应的m个n位移位寄存器中,对读入的m个n位移位寄存器与m个n位模板寄存器进行按位同或,对每行的同或结果进行相加,统计每个对应n位寄存器中相同像素的个数,成为n个行匹配结果,对m个对应n位寄存器行匹配结果再次进行求和,统计视频图像窗口与列车注水口模板图像相同像素的个数,即窗口匹配结果。
上述方案中,该方法还包括:对所述窗口匹配结果进行验证,对比窗口匹配结果与所设定匹配阈值:如果窗口匹配结果大于匹配阈值,则像素数目匹配,然后进行位置匹配,如果窗口匹配结果小于匹配阈值,则等待下一时钟窗口匹配结果的到来,继续进行像素数目匹配。
上述方案中,该方法还包括:对像素数目匹配成功的视频图像窗口进行位置验证,对比位置匹配结果P(i, j)与所设定窗口位置范围:如果Pi, j在所设定窗口位置范围内部,则位置匹配成功,并将匹配有效信号传输至机械装置控制模块,如果Pi, j不在所设定窗口位置范围内部,则等待下一次的验证。
上述方案中,该方法还包括:对周围环境中的光线强度进行实时探测,当探测到的环境光照度低于设定光照度阈值时,控制外接照明灯的打开与关闭。     
有益效果
与现有技术相比,本发明能够实现对火车注水口的自动化检测识别,可24小时实时对停靠的列车进行检测,节省大量人工成本且工作效率高。
附图说明
图1为本发明实施提供一种列车注水口检测定位方法中的像素统计的原理图;
图2为本发明实施提供一种列车注水口检测定位方法中阈值分割的原理图;
图3为本发明实施提供一种列车注水口检测定位方法中视频图像窗口生成的原理图;
图4为本发明实施提供一种列车注水口检测定位方法中模板匹配的原理图;
图5为本发明实施提供一种基于FPGA的列车注水口检测定位系统的结构图;
图6为本发明实施提供一种基于FPGA的列车注水口检测定位系统的结构框图。
本发明的最佳实施方式
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
本发明实施例提供一种列车注水口检测定位方法,该方法为:采集连续的列车注水口视频图像,同时对列车注水口视频图像进行阈值分割获得二值化的列车注水口视频图像;对所述二值化的列车注水口视频图像进行处理并且与列车注水口模板图像进行匹配,检测出注水口在列车注水口视频图像中的位置,并与注水口所在的预设位置范围进行比较,如果已经匹配则将匹配有效信号传输至机械装置控制模块控制机械装置移动或停止,以及开始注水或停止注水。
所述对列车注水口视频图像进行阈值分割获得二值化的列车注水口视频图像,具体为:根据二值化阈值对列车注水口视频图像进行二值化分割,将二值化的视频图像按像素按照步长为1的大小依次生成m×n的视频图像窗口。
在所述视频图像窗口位置中标记所述视频图像窗口中第一行第一列的像素在整帧图像中的位置为视频图像窗口位置坐标P(i, j)。
所述二值化阈值获得的具体过程为:统计所述列车注水口视频图像中当前帧图像中每个灰度值对应的像素数目,形成抽象的灰度直方图,并根据所述抽象的灰度直方图计算出分割效果最佳的二值化阈值。
确定所述抽象的灰度直方图中的最大值M1与对应的灰度值G1,确定所述抽象的灰度直方图中灰度值G1右侧部分的次高峰值M2与对应的灰度值G2,对所述G1与G2之间的直方图进行计算获得峰谷最小值M3与对应的灰度值G3,并定义G3为二值化阈值。
具体地,如图1所示,本发明中采集的连续的列车注水口视频图像分辨率为640×480,因此设置双口RAM的位宽为16。双口RAM的两个端口都支持读写,以当前到达的视频图像像素灰度值作为双口RAM的A端口的地址,从双口RAM的A端口读出存储的数据至加一加法器中;同时对到达的视频图像像素通过缓存寄存器做一个时钟的延时至双口RAM的B端口,作为双口RAM的B端口的地址,将加一加法器计算后的数据通过B端口存储到双口RAM中。当一帧图像全部统计结束后,在帧消隐期间通过给双口RAM的B端口的地址进行控制读出像素统计结果。
如图2所示,首先将像素统计结果,逐一进入第一比较器,第一比较器留下大的数值舍弃小的数值,最终将得到像素统计结果的最大值M1,读出最大值对应的双口RAM存储空间地址为对应的灰度值G1。其次,设置5级比较器,这5级比较器留下小的数值舍弃大的数值,灰度值大于G1的像素统计结果依次进入5级比较器中,若某一灰度统计的数值依次出现在五级比较器中,则认为该数值为G1右侧的第一个低谷M12,再通过比较器计算出对应灰度值G12右侧的次高峰值M2,其对应灰度值为G2。最后,设置第二比较器,第二比较器留下小的数值舍弃大的数值,G1到G2之间的像素统计结果依次进入第二比较器,计算得到最小值M3,对应灰度值为G3,定义G3为二值化阈值。
所述对生成的所述视频图像窗口与列车注水口模板图像进行比较,计算出二者在同位置像素点相同的总数目,记录为窗口匹配结果,具体为:将所述二值化的视频图像中的m行依次存入m个FIFO中,将m个FIFO中读出的数据分别作为移位位左移至对应的m个n位左移位寄存器中,对读入的m个n位左移位寄存器与m个n位模板图像寄存器进行按位同或,对每行的同或结果的每一位进行相加,即统计每个对应n位寄存器中相同像素的个数,成为n个行匹配结果,对m个对应n位寄存器行匹配结果再次进行求和,即统计视频图像窗口与列车注水口模板图像相同像素的个数,也就是窗口匹配结果。
具体地,如图3所示,由m个FIFO以及左移位寄存器组成,列车注水口模板图像的行数为24,所以此处为m的数值为24;二值化的视频图像每行有640个像素,所以设置FIFO的深度为640;因为每个像素灰度值位宽为1,所以FIFO的宽度为1。二值化的视频图像像素首先进入FIFO1中,当填满FIFO后进入FIFO2中,当24个FIFO全部填满后24行图像缓存结束,即生成24行的二维图像矩阵。设置24个16位左移位寄存器对应24个FIFO,当24个FIFO全部写满后同时读出至左移位寄存器的进位位,24个16位左移位寄存器构成一个16×24的视频图像窗口。24个FIFO全部写满时,设置窗口列计数器与窗口行计数器, FIFO每读出一个数据,窗口列计数器加一用于标定窗口第一个像素的行坐标,当窗口列计数器计数到达640时窗口行计数器加一,用于标定窗口第一个像素的行坐标。
如图4所示,通过对视频图像窗口与列车注水口模板图像按位同或得到匹配结果。列车注水口模板图像存放在24个16位模板图像寄存器中,对应视频图像窗口的24个16位左移位寄存器,对每一对寄存器进行按位同或操作,得到一组16×24的同或结果,放在24个16位同或结果寄存器中。首先对同或结果的每一个寄存器中数据的每一位进行相加得到行匹配结果,相加的和为寄存器中1的个数,即与列车注水口模板图像第一行匹配成功的像素数目,然后再对24个行匹配结果进行相加,得到窗口匹配结果。
通过确定视频图像窗口是否与列车注水口模板图像匹配成功,然后确定匹配成功的窗口是否在指定位置范围内部。设定匹配阈值PE,当窗口匹配结果大于PE时则匹配成功,然后从视频图像窗口生成模块读入已经该匹配成功窗口的坐标,通过比较器判断该匹配成功窗口的坐标是否在设定范围内部,即横坐标大于RA小于RB,纵坐标大于CA小于CB范围内部,如果在该范围内部,则匹配成功,发送匹配有效信号至机械装置。PE、RA、RB、CA、CB为预设数值,一般的PE等于325,RA等于298,RB等于318,CA等于222,CB等于242。
所述机械装置当火车停靠后,启动机械装置,并启动移动时间计时器。当匹配有效信号传输至机械装置的控制模块后,机械装置停止移动,移动时间计时器停止计时,并伸出注水枪开始注水。6分钟后停止注水,机械装置根据移动时间计时器计时的时间原路返回。
该方法还包括:对周围环境中的光线强度进行实时探测,当探测到的环境光照度低于设定光照度阈值时,控制外接照明灯的打开与关闭。
具体地,当列车注水口周围光线昏暗时,CMOS相机不能正常工作,因此利用光照探测器实时监测周围环境的光线,当光照度过低时,光照探测器发送照明启动信号控制打开照明灯。
本发明实施例还提供一种基于FPGA的列车注水口检测定位系统,如图5、6所示,包括:视频采集模块1、图像缓存模块2、图像处理模块3、机械装置控制模块4和环境光调节模块5;
所述视频采集模块1,用于采集连续的列车注水口视频图像,同时对列车注水口视频图像进行解码,并将解码后的列车注水口视频图像分别传输到图像缓存模块2、图像处理模块3和机械装置控制模块4;
所述图像缓存模块2,用于接收解码后的列车注水口视频图像,并缓存两帧列车注水口视频图像及所有像素位置坐标信息,同时将缓存后的列车注水口视频图像和像素位置坐标信息发送至图像处理模块3;
所述图像处理模块3,用于对采集到的列车注水口视频图像进行预处理,然后与列车注水口模板图像进行匹配,检测出注水口在列车注水口视频图像中的位置,并与注水口所在的预设位置范围进行比较,确定是否已经匹配,如果已经匹配则将匹配有效信号传输至机械装置控制模块4;
所述机械装置控制模块4,用于将机械装置工作模式控制信号发送至机械装置的接收单元控制机械装置的移动与停止,同时结合匹配有效信号控制机械装置开始注水与停止注水;
所述环境光调节模块5,用于探测周围环境中光线的强度,并控制照明灯的打开与关闭,实时调节环境亮度;
所述视频采集模块1,包括CMOS相机11、USB2.0视频接口12、视频解码芯片13、FPGA视频控制子模块14;
CMOS相机11,用于采集分辨率为M×N像素、帧频为f的列车注水口视频图像,其中采集的每个像素的灰度值是一个8bit的整型数据,同时通过USB数据线将采集到的数据传输至USB2.0视频接口12;
USB2.0视频接口12,用于接收CMOS相机11采集到的列车注水口视频图像,并使用差分传输方式将列车注水口视频图像传输至视频解码芯片13;
视频解码芯片13,用于将USB2.0视频接口12传输来的列车注水口视频图像重新编码成8位像素信号、行同步信号与帧同步信号,并将这些10位信号称为解码后的视频图像,然后将解码后的视频图像并行传输至FPGA视频控制子模块14中;
FPGA视频控制子模块14,用于接收视频解码芯片13传输的解码后的视频图像,同时根据行同步信号与帧同步信号为每一个像素标定像素位置坐标信息,并将解码后的视频图像传输至图像缓存模块2和图像处理模块3中,将解码后的视频图像中第一行像素发送至机械装置控制模块4中;
所述图像缓存模块2,包括FPGA缓存控制子模块21、SDRAM存储器22,其中SDRAM存储器包括SDRAM1与SDRAM2;
FPGA缓存控制子模块21,用于接收视频采集模块1传输来的解码后的视频图像,并写入一片SDRAM中,同时读出另一片SDRAM中的解码后的视频图像,并将其传输至图像处理模块3;
SDRAM存储器22,包括两片SDRAM,每片SDRAM用于存储一帧解码后的视频图像,模块从FPGA缓存控制子模块21读入解码后的视频图像,并将解码后的视频图像存入一片SDRAM的存储单元中,每个存储单元存放一个像素;
所述图像处理模块3,包括:像素统计模块31、阈值计算模块32、图像分割模块33、视频图像窗口生成模块34、模板匹配模块35、匹配结果验证模块36;
像素统计模块31,用于从FPGA视频采集模块1接收解码后的视频图像,同时统计当前帧图像中每个灰度值对应的像素数目,形成抽象的灰度直方图,并在帧消隐期间将每帧图像的像素统计结果输出至阈值计算模块32;
阈值计算模块32,用于接收像素统计模块31传输来的像素统计结果,并根据抽象的灰度直方图计算出分割效果最佳的二值化阈值,并将此二值化阈值传输至图像分割模块33中;
图像分割模块33,用于对解码后的视频图像进行阈值分割,将解码后的视频图像按像素依次读入,并利用二值化阈值进行二值化分割,然后将二值化的视频图像按像素依次传输至视频图像窗口生成模块34中;
视频图像窗口生成模块34,用于将二值化的视频图像按照步长为1的大小依次生成m×n的视频图像窗口,并将视频图像窗口传输至模板匹配模块35中,同时标记视频图像窗口中第一行第一列的像素在整帧图像中的位置为视频图像窗口位置坐标P(i, j),并将P(i, j)传输至匹配结果验证模块36,m为列车注水口模板图像的行数,n为列车注水口模板图像的列数,i为视频图像窗口行坐标,j为视频图像窗口列坐标;
模板匹配模块35,用于对生成的视频图像窗口与列车注水口模板图像进行比较,计算出二者在同位置像素点相同的总数目,记录为窗口匹配结果,同时将窗口匹配结果传输至匹配结果验证模块36;
匹配结果验证模块36,用于对窗口匹配结果进行匹配程度验证,以及进行窗口匹配位置验证,得到匹配有效信号,并将匹配有效信号发送至机械装置控制模块4;
所述机械装置控制模块4,包括:启动控制模块41,开始注水控制模块42,停止注水控制模块43,原返控制模块44;
启动控制模块41,用于接收启动开关传输来的移动开始信号,并通过串口向机械装置发送移动命令,同时对移动时间进行计时,当接收到匹配结果验证模块36传输来的匹配有效信号后,通过串口向机械装置发送停止命令,同时结束移动时间的计时;。
开始注水控制模块42,用于接收匹配的有效信号,并控制机械装置开始注水;
停止注水控制模块43,用于对注水时间进行计时,当计时时间到达6分钟后控制机械装置停止注水并向原返控制模块44注水结束信号;
原返控制模块44,用于接收注水结束信号,并读取启动控制模块41 移动时间的计时值,控制机械装置反向移动时间的计时值至出发位置;
所述环境光调节模块5,包括:光强感知模块51、照明控制模块52;
光强感知模块51,用于对周围环境中的光线强度进行实时探测,当探测到的环境光照度低于设定光照度阈值时,向照明控制模块52发送照明启动信号;
照明控制模块52,用于接收光强感知模块51发送的照明启动信号,然后控制外接照明灯的打开与关闭;
所述FPGA缓存控制子模块21,包括像素流接收单元21a、读写控制单元21b、像素流发送单元21c;
所述像素流接收单元21a,用于从视频采集模块1中读取解码后的视频图像,并根据帧同步信号对视频帧进行计数,并将帧计数值传输至读写控制单元21b中;
所述读写控制单元21b,用于接收帧计数值,并控制SDRAM的读写:如果帧计数值为2a,则写入SDRAM1中,同时从SDRAM2中读取第2a-1帧的图像,如果帧计数值为2a+1,则写入SDRAM2中,同时从SDRAM1中读取第2a帧的图像,a=0,1,2,…,以此方式进行反复读写;
所述像素流发送单元21c,用于将从SDRAM中读出的解码后的视频图像发送至图像处理模块3,并对解码后的视频图像中的像素进行计数生成像素位置坐标信息、缓存行同步信号与缓存帧同步信号,同时传输至图像处理模块3中;
所述像素统计模块31包括双口RAM31a、缓存寄存器31b、加一加法器31c;
双口RAM31a,用于存储位深为256,位宽为16的像素统计结果,并将从FPGA视频采集模块1传输来的解码后的视频图像的灰度值作为存储空间的地址,通过双口RAM的双口RAM的A端口读出对应地址中存储的数据,同时以缓存寄存器31b缓存后的数据作为地址,通过双口RAM的双口RAM的B端口将加一加法器31c计算后的结果写入对应地址存储空间中,待全帧统计结束后通过双口RAM的双口RAM的B端口依灰度值从小到达读出存储的所有数据至阈值计算模块32;
缓存寄存器31b,用于对解码后的视频图像的每一个像素缓存一个时钟,在同一时钟周期,以缓存前的像素灰度值作为双口RAM31a双口RAM的A端口地址读出其中数据至加一加法器31c,并以缓存后的像素灰度值作为双口RAM31a双口RAM的B端口地址写入加一加法器输出的数据;
加一加法器31c,用于对双口RAM31a双口RAM的A端口读出的数据进行加一操作,然后以相同的地址将计算结果通过双口RAM的B端口存储至同一存储单元;
所述阈值分割模块32包括最高峰计算模块32a、次高峰计算模块32b、极小值计算模块32c;
最高峰计算模块32a,用于计算抽象的灰度直方图中的最大值M1,并将计算出的M1与其对应的灰度值G1传输给次高峰计算模块32b和极小值计算模块32c;
次高峰计算模块32b,用于计算出直方图中G1右侧部分的次高峰值M2,并将M2与其对应的灰度值G2传输给极小值计算模块32c;
极小值计算模块32c,用于对G1与G2之间的直方图进行计算,得到峰谷最小值M3与对应的灰度值G3,并定义G3为二值化阈值;
所述视频图像窗口生成模块34包括FIFO缓存模块34a、窗口寄存器组34b、窗口位置标定模块34c;
FIFO缓存模块34a,用于接收图像分割模块33传输来的二值化的视频图像,并将其中的m行依次存入m个FIFO中,当所有FIFO全部存满后读出每个FIFO至窗口寄存器组34b,m为列车注水口模板图像的行数;
窗口寄存器组34b,用于寄存FIFO中读出的数据,将m个FIFO中读出的数据分别作为移位为左移至对应的m个n位移位寄存器中,同时将m个n位移位寄存器中的数据读出至模板匹配模块35, n为列车注水口模板图像的列数;
窗口位置标定模块34c,用于接收图像缓存模块2中像素位置坐标信息,并将视频图像窗口第一行第一列的像素所对应的像素位置坐标信息赋值给视频图像窗口位置坐标P(i, j),同时将P(i, j)传输至模板匹配模块35中,i为视频图像窗口行坐标,j为视频图像窗口列坐标;
所述模板匹配模块35包括模板存储寄存器组35a,同或门阵列35b,匹配行加法器组35c,视频图像窗口加法器组35d;
模板存储寄存器组35a,用于存储列车注水口模板图像至m个n位模板寄存器中,同时将其中存储的数据传输到同或门阵列35b,m为列车注水口模板图像的行数,n为列车注水口模板图像的列数;
同或门阵列35b,用于对读入的m个n位移位寄存器与m个n位模板寄存器进行按位同或,同时将同或结果传输至匹配行加法器组35c;
匹配行加法器组35c,用于对每行的同或结果进行相加,统计每个对应n位寄存器中相同像素的个数,成为行匹配结果,并将行匹配结果传输至视频图像窗口加法器组35d;
视频图像窗口加法器组35d,用于对m个对应n位寄存器行匹配结果再次进行求和,统计视频图像窗口与列车注水口模板图像相同像素的个数,即窗口匹配结果,并将窗口匹配结果传输至匹配结果验证模块36;
所述匹配结果验证模块36包括像素数目匹配模块36a,位置匹配模块36b;
像素数目匹配模块36a,用于对模板匹配模块35传输来的窗口匹配结果进行验证,对比窗口匹配结果与所设定匹配阈值:如果窗口匹配结果大于匹配阈值,则像素数目匹配,然后进行位置匹配,如果窗口匹配结果小于匹配阈值,则等待下一时钟窗口匹配结果的到来,继续进行像素数目匹配;
位置匹配模块36b,用于对像素数目匹配成功的视频图像窗口进行位置验证,同时从窗口位置标定模块34c读取视频图像窗口位置坐标P(i, j),对比位置匹配结果P(i, j)与所设定窗口位置范围:如果P(i, j)在所设定窗口位置范围内部,则位置匹配成功,并将匹配有效信号传输至机械装置控制模块4,如果P(i, j)不在所设定窗口位置范围内部,则等待下一次的验证。
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。

Claims (10)

  1. 一种列车注水口检测定位方法,其特征在于,该方法为:采集连续的列车注水口视频图像,同时对列车注水口视频图像进行阈值分割获得二值化的列车注水口视频图像;对所述二值化的列车注水口视频图像进行处理并且与列车注水口模板图像进行匹配,检测出注水口在列车注水口视频图像中的位置,并与注水口所在的预设位置范围进行比较,如果已经匹配则将匹配有效信号传输至机械装置控制模块控制机械装置移动停止,以及开始注水与停止注水。
  2. 根据权利要求1所述列车注水口检测定位方法,其特征在于,所述对列车注水口视频图像进行阈值分割获得二值化的列车注水口视频图像,具体为:根据二值化阈值对列车注水口视频图像进行二值化分割,将二值化的视频图像按像素按照步长为1的大小依次生成m×n的视频图像窗口。
  3. 根据权利要求2所述列车注水口检测定位方法,其特征在于,在所述视频图像窗口位置中标记所述视频图像窗口中第一行第一列的像素在整帧图像中的位置为视频图像窗口位置坐标P(i, j)。
  4. 根据权利要求3所述列车注水口检测定位方法,其特征在于,所述二值化阈值获得的具体过程为:统计所述列车注水口视频图像中当前帧图像中每个灰度值对应的像素数目,形成抽象的灰度直方图,并根据所述抽象的灰度直方图计算出分割效果最佳的二值化阈值。
  5. 根据权利要求4所述列车注水口检测定位方法,其特征在于,确定所述抽象的灰度直方图中的最大值M1与对应的灰度值G1,确定所述抽象的灰度直方图中灰度值G1右侧部分的次高峰值M2与对应的灰度值G2,对所述G1与G2之间的直方图进行计算获得峰谷最小值M3与对应的灰度值G3,并定义G3为二值化阈值。
  6. 根据权利要求5所述列车注水口检测定位方法,其特征在于,所述与注水口所在的预设位置范围进行比较,如果已经匹配则将匹配有效信号传输至机械装置控制模块控制机械装置移动或停止,以及开始注水或停止注水,具体为:对生成的所述视频图像窗口与列车注水口模板图像进行比较,计算出二者在同位置像素点相同的总数目,记录为窗口匹配结果,对所述窗口匹配结果进行匹配程度验证,以及结合视频图像窗口位置P(i,j)进行窗口匹配位置验证获得匹配有效信号,并将匹配有效信号发送至机械装置控制模块。
  7. 根据权利要求6所述列车注水口检测定位方法,其特征在于,所述对生成的所述视频图像窗口与列车注水口模板图像进行比较,计算出二者在同位置像素点相同的总数目,记录为窗口匹配结果,具体为:将所述二值化的视频图像中的m行依次存入m个FIFO中,将m个FIFO中读出的数据分别作为移位位左移至对应的m个n位移位寄存器中,对读入的m个n位移位寄存器与m个n位模板寄存器进行按位同或,对每行的同或结果进行相加,统计每个对应n位寄存器中相同像素的个数,成为n个行匹配结果,对m个对应n位寄存器行匹配结果再次进行求和,统计视频图像窗口与列车注水口模板图像相同像素的个数,即窗口匹配结果。
  8. 根据权利要求7所述列车注水口检测定位方法,其特征在于,该方法还包括:对所述窗口匹配结果进行验证,对比窗口匹配结果与所设定匹配阈值:如果窗口匹配结果大于匹配阈值,则像素数目匹配,然后进行位置匹配,如果窗口匹配结果小于匹配阈值,则等待下一时钟窗口匹配结果的到来,继续进行像素数目匹配。
  9. 根据权利要求8所述列车注水口检测定位方法,其特征在于,该方法还包括:对像素数目匹配成功的视频图像窗口进行位置验证,对比位置匹配结果P(i, j)与所设定窗口位置范围:如果P(i, j)在所设定窗口位置范围内部,则位置匹配成功,并将匹配有效信号传输至机械装置控制模块,如果P(i, j)不在所设定窗口位置范围内部,则等待下一次的验证。
  10. 根据权利要求1-9任意一项所述列车注水口检测定位方法,其特征在于,该方法还包括:对周围环境中的光线强度进行实时探测,当探测到的环境光照度低于设定光照度阈值时,控制外接照明灯的打开与关闭。
PCT/CN2018/120895 2018-12-13 2018-12-13 一种列车注水口检测定位方法 WO2020118621A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2018/120895 WO2020118621A1 (zh) 2018-12-13 2018-12-13 一种列车注水口检测定位方法
US17/270,873 US11066088B2 (en) 2018-12-13 2018-12-13 Detection and positioning method for train water injection port

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/120895 WO2020118621A1 (zh) 2018-12-13 2018-12-13 一种列车注水口检测定位方法

Publications (1)

Publication Number Publication Date
WO2020118621A1 true WO2020118621A1 (zh) 2020-06-18

Family

ID=71075840

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/120895 WO2020118621A1 (zh) 2018-12-13 2018-12-13 一种列车注水口检测定位方法

Country Status (2)

Country Link
US (1) US11066088B2 (zh)
WO (1) WO2020118621A1 (zh)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN203294097U (zh) * 2013-06-07 2013-11-20 南车青岛四方机车车辆股份有限公司 列车注水控制装置
US20140052316A1 (en) * 2012-03-15 2014-02-20 Bright Energy Storage Technologies, Llp Auxiliary power unit assembly and method of use
DE102013202756A1 (de) * 2013-02-20 2014-08-21 Siemens Aktiengesellschaft Kraftstofftank
CN204406224U (zh) * 2014-12-20 2015-06-17 解胜伟 一种客运加水监控系统
CN105844656A (zh) * 2016-04-22 2016-08-10 中国电子科技集团公司第三研究所 一种图像二值化目标分割装置及方法
DE102015205825A1 (de) * 2015-03-31 2016-10-06 Siemens Aktiengesellschaft Verfahren zur Frostentleerung eines Flüssigkeitsbehälters für ein Schienenfahrzeug und Flüssigkeitsbehälter mit einer Frostentleerungseinrichtung für ein Schienenfahrzeug
CN106683119A (zh) * 2017-01-09 2017-05-17 河北工业大学 基于航拍视频图像的运动车辆检测方法
CN206885072U (zh) * 2017-06-06 2018-01-16 陕西千方科技发展有限责任公司 一种铁路旅客列车上水检测控制装置
CN109709843A (zh) * 2018-12-13 2019-05-03 西安电子科技大学 一种列车注水口检测定位方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6176279B1 (en) * 1998-10-26 2001-01-23 M-Bar-D Railcar Tech., Inc. Locomotive servicing method and vehicle
US7822275B2 (en) * 2007-06-04 2010-10-26 Objectvideo, Inc. Method for detecting water regions in video
US10241514B2 (en) * 2016-05-11 2019-03-26 Brain Corporation Systems and methods for initializing a robot to autonomously travel a trained route
JP6879747B2 (ja) * 2017-01-16 2021-06-02 株式会社ディスコ チャックテーブルの詰まり検出方法及び加工装置

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140052316A1 (en) * 2012-03-15 2014-02-20 Bright Energy Storage Technologies, Llp Auxiliary power unit assembly and method of use
DE102013202756A1 (de) * 2013-02-20 2014-08-21 Siemens Aktiengesellschaft Kraftstofftank
CN203294097U (zh) * 2013-06-07 2013-11-20 南车青岛四方机车车辆股份有限公司 列车注水控制装置
CN204406224U (zh) * 2014-12-20 2015-06-17 解胜伟 一种客运加水监控系统
DE102015205825A1 (de) * 2015-03-31 2016-10-06 Siemens Aktiengesellschaft Verfahren zur Frostentleerung eines Flüssigkeitsbehälters für ein Schienenfahrzeug und Flüssigkeitsbehälter mit einer Frostentleerungseinrichtung für ein Schienenfahrzeug
CN105844656A (zh) * 2016-04-22 2016-08-10 中国电子科技集团公司第三研究所 一种图像二值化目标分割装置及方法
CN106683119A (zh) * 2017-01-09 2017-05-17 河北工业大学 基于航拍视频图像的运动车辆检测方法
CN206885072U (zh) * 2017-06-06 2018-01-16 陕西千方科技发展有限责任公司 一种铁路旅客列车上水检测控制装置
CN109709843A (zh) * 2018-12-13 2019-05-03 西安电子科技大学 一种列车注水口检测定位方法

Also Published As

Publication number Publication date
US11066088B2 (en) 2021-07-20
US20210179154A1 (en) 2021-06-17

Similar Documents

Publication Publication Date Title
CN109035233B (zh) 视觉注意力网络系统及工件表面缺陷检测方法
CN103312994B (zh) 实现面阵cmos传感器双向扫描清晰成像的方法
CN108986134B (zh) 一种基于相关滤波跟踪的视频目标半自动标注方法
CN109709843B (zh) 一种列车注水口检测定位方法
CN102510448B (zh) 多处理器嵌入式图像采集和处理方法和装置
CN103473785A (zh) 一种基于三值化图像聚类的快速多目标分割方法
CN107133610B (zh) 一种复杂路况下行车流量视觉检测与计数方法
CN114049557A (zh) 一种基于深度学习的垃圾分选机器人视觉识别方法
CN110164139B (zh) 一种侧方停车检测识别系统及方法
CN109767424B (zh) 基于fpga的双目视觉列车注水口检测定位方法
CN105678682A (zh) 一种基于fpga的二值图像连通区域信息快速获取系统及方法
CN102509255B (zh) 高速图像采集和处理方法和装置
CN111008608A (zh) 一种基于深度学习的夜间车辆检测方法
CN102879404A (zh) 工业结构化场景中医用胶囊缺陷自动检测的系统
WO2020118621A1 (zh) 一种列车注水口检测定位方法
CN101895685A (zh) 视频采集控制装置及其方法
Hsieh et al. Offline Deep-learning-based Defective Track Fastener Detection and Inspection System.
CN106846398B (zh) 一种基于图像行数据扫描的星空目标最大光强位置的识别方法
CN104657960A (zh) 一种灰度图像对比度拉伸方法及装置
US9681083B2 (en) Method and system to detect a light-emitting diode
CN113657339A (zh) 一种基于机器视觉的仪表指针计数读取方法及介质
CN112085767B (zh) 一种基于深度光流跟踪的客流统计方法及系统
CN103400153A (zh) 一种用于实时图像识别的串行滤波匹配方法及系统
CN116612398A (zh) 基于ctpn算法的无人机巡检照片杆塔号牌文字识别方法
CN103200364B (zh) 基于标记特征的摄像机升降格特效拍摄方法

Legal Events

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

Ref document number: 18942894

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18942894

Country of ref document: EP

Kind code of ref document: A1