A method, device and medium for image acquisition in a tunnel
By using multi-frame image processing technology to remove invalid features from tunnel images and reconstruct vehicle targets, the problem of low accuracy in tunnel image acquisition is solved, enabling automated monitoring and early warning of vehicle status within tunnels.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JINAN RUIYUAN INTELLIGENT CITY DEV CO LTD
- Filing Date
- 2022-07-08
- Publication Date
- 2026-07-14
Smart Images

Figure CN115311631B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image recognition technology, specifically to an image acquisition method, device, and medium for tunnels. Background Technology
[0002] Tunnels are important facilities in national infrastructure and an important part of the road network. Due to the special environment of tunnels, they are prone to congestion and traffic accidents. If timely warnings are not issued, road congestion can spread. Therefore, monitoring the movement of vehicles in tunnels is a crucial aspect of tunnel operation.
[0003] Currently, image acquisition devices, such as cameras, are typically installed inside tunnels to determine the operating status of vehicles. However, this method is mostly manual monitoring, which has low accuracy, and the acquired images are easily affected by tunnel lighting, increasing the difficulty of image recognition. Summary of the Invention
[0004] To address the aforementioned problems, this application proposes a method for image acquisition within a tunnel, comprising:
[0005] Multiple image acquisition devices installed inside the tunnel are used to acquire multiple frames of images inside the tunnel at preset time intervals.
[0006] Based on the pixel values corresponding to the multiple pixels contained in the multi-frame images, target extraction is performed on the multiple pixels to determine the target region;
[0007] The target region is segmented, and feature recognition is performed on the resulting sub-target regions to determine whether any invalid features are carried in the sub-target regions; the invalid features refer to features in the target region other than vehicle features.
[0008] If the invalid features exist in the multiple sub-target regions, the target region is reconstructed to remove the invalid features from the target region and obtain the final vehicle target;
[0009] Based on the vehicle targets in different frame images, the movement trajectory of the corresponding vehicle is determined, and based on the movement trajectory and the sum of multiple time intervals, it is determined whether there is congestion inside the tunnel, so as to provide early warning for vehicles about to enter the tunnel.
[0010] In one implementation of this application, target extraction is performed on the multiple pixels based on their respective pixel values to obtain a target region, specifically including:
[0011] For any two adjacent frames in the multi-frame image, the first image is grayscaled to obtain the grayscaled second image.
[0012] The pixel difference between the same pixel points in the first image and the second image is obtained by subtracting the pixel values and taking the absolute value of the difference.
[0013] The pixel type of the pixel is determined based on the relationship between the pixel difference and a first preset threshold; the pixel type includes foreground pixels and background pixels.
[0014] The second image is traversed, and the foreground pixels are extracted to obtain the target region.
[0015] In one implementation of this application, the target region is segmented, and feature recognition is performed on the multiple sub-target regions obtained after segmentation to determine whether the multiple sub-target regions carry invalid features, specifically including:
[0016] Extract the contour information corresponding to the target region, and segment the target region according to whether there is an intersection between the regions containing the contour information to obtain multiple sub-target regions after segmentation;
[0017] For the multiple sub-target regions, standard feature points corresponding to each sub-target region are determined, as well as a first distance between each pixel in the sub-target region and the standard feature points; the difference between the pixel value corresponding to the standard feature point and the pixel value of its corresponding background pixel is maximized.
[0018] Based on the first distance, the pixel difference that each pixel can generate is calculated, and based on the distance and pixel difference corresponding to each pixel, a pixel difference trend distribution map corresponding to the sub-target region is fitted to obtain the pixel difference trend distribution map.
[0019] The concentration of the sub-target region is determined based on the pixel difference trend distribution map;
[0020] If the concentration is higher than a preset value, it is determined that the sub-target region carries invalid features.
[0021] In one implementation of this application, extracting the contour information corresponding to the target region specifically includes:
[0022] A preset detection window is defined; the width and length of the detection window are the same.
[0023] Using the corner points of the target area as standard positions, the detection window is slid along the direction of increasing vertical coordinate of the standard positions. The pixels in each of the sliding detection windows are traversed to determine the target detection window with the most non-zero grayscale pixels from each detection window, and the center pixel of the target detection window is determined as the contour point.
[0024] The abscissas of the standard positions are incremented sequentially, and the above process is repeated to generate the corresponding contour point sequence.
[0025] The contour point sequence is filtered, and the contour information corresponding to the target region is obtained by fitting the filtered contour points.
[0026] In one implementation of this application, the target region is reconstructed to remove the invalid features from the target region, thereby obtaining the final vehicle target. Specifically, this includes:
[0027] For sub-target regions carrying invalid features, the gradient value of each pixel in the sub-target region is calculated using a preset image gradient calculation method;
[0028] Determine the set of pixels whose gradient values are greater than a preset gradient, and generate a target overlay layer for the sub-target region based on the set of pixels.
[0029] The target overlay layer is superimposed on the sub-target area to reconstruct the region, and the reconstructed sub-target area is taken as the area where the vehicle target is located.
[0030] In one implementation of this application, determining the standard feature points corresponding to each sub-target region specifically includes:
[0031] Determine the outer region of the sub-target region, wherein the outer region can cover all pixels contained in the sub-target region;
[0032] Determine whether a pixel in the outer region belongs to the sub-target region. If yes, the determination result is recorded as 1; otherwise, the determination result is recorded as 0.
[0033] The judgment results corresponding to the pixels in the outer region are summed to obtain the area of the sub-target region;
[0034] The coordinates of the standard feature points corresponding to the sub-target region are determined based on the coordinate values of the pixels in the sub-target region and the area.
[0035] In one implementation of this application, determining the concentration of the sub-target region based on the pixel difference trend distribution map specifically includes:
[0036] Determine the center point of the pixel difference trend distribution map, where the x and y coordinates of the center point are the average values of the x and y coordinates of each pixel.
[0037] Determine the average distance between each pixel and the center point, and the second distance between the origin and the center point;
[0038] The concentration of the sub-target region is determined based on the ratio between the mean distance and the second distance.
[0039] In one implementation of this application, determining whether there is congestion inside the tunnel based on the motion trajectory and the sum of multiple time intervals specifically includes:
[0040] The vehicle's expected travel distance is determined by the sum of the multiple time intervals corresponding to the multiple frames of images and the product of the preset vehicle saturation speed.
[0041] The estimated travel distance is compared with the length of the trajectory. If the length is less than the estimated travel distance, it is determined that there is congestion inside the tunnel.
[0042] This application provides an image acquisition device for use in a tunnel, characterized in that it includes:
[0043] At least one processor; and,
[0044] A memory communicatively connected to the at least one processor; wherein,
[0045] The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to:
[0046] Multiple image acquisition devices installed inside the tunnel are used to acquire multiple frames of images inside the tunnel at preset time intervals.
[0047] Based on the pixel values corresponding to the multiple pixels contained in the multi-frame images, target extraction is performed on the multiple pixels to determine the target region;
[0048] The target region is segmented, and feature recognition is performed on the resulting sub-target regions to determine whether any invalid features are carried in the sub-target regions; the invalid features refer to features in the target region other than vehicle features.
[0049] If the invalid features exist in the multiple sub-target regions, the target region is reconstructed to remove the invalid features from the target region and obtain the final vehicle target;
[0050] Based on the vehicle targets in different frame images, the movement trajectory of the corresponding vehicle is determined, and based on the movement trajectory and the sum of multiple time intervals, it is determined whether there is congestion inside the tunnel, so as to provide early warning for vehicles about to enter the tunnel.
[0051] This application provides a non-volatile computer storage medium storing computer-executable instructions, characterized in that the computer-executable instructions are configured as follows:
[0052] Multiple image acquisition devices installed inside the tunnel are used to acquire multiple frames of images inside the tunnel at preset time intervals.
[0053] Based on the pixel values corresponding to the multiple pixels contained in the multi-frame images, target extraction is performed on the multiple pixels to determine the target region;
[0054] The target region is segmented, and feature recognition is performed on the resulting sub-target regions to determine whether any invalid features are carried in the sub-target regions; the invalid features refer to features in the target region other than vehicle features.
[0055] If the invalid features exist in the multiple sub-target regions, the target region is reconstructed to remove the invalid features from the target region and obtain the final vehicle target;
[0056] Based on the vehicle targets in different frame images, the movement trajectory of the corresponding vehicle is determined, and based on the movement trajectory and the sum of multiple time intervals, it is determined whether there is congestion inside the tunnel, so as to provide early warning for vehicles about to enter the tunnel.
[0057] The image acquisition method for tunnels proposed in this application can bring the following beneficial effects:
[0058] The target area where the vehicle is located is extracted from the collected images inside the tunnel. By performing feature recognition on the target area to remove invalid features, the vehicle trajectory is obtained based on the obtained vehicle target, thereby determining whether there is congestion inside the tunnel. This process no longer requires manual intervention, realizing automatic monitoring of the tunnel's operating status. Furthermore, after extracting the target area, the re-identification of the target area's features can effectively remove the influence of the external environment on the tunnel image, improving the detection accuracy. Attached Figure Description
[0059] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0060] Figure 1 A flowchart illustrating an image acquisition method within a tunnel, as provided in an embodiment of this application;
[0061] Figure 2 A pixel difference trend distribution map provided in an embodiment of this application;
[0062] Figure 3 This is a schematic diagram of the structure of an image acquisition device in a tunnel, provided in an embodiment of this application. Detailed Implementation
[0063] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0064] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.
[0065] like Figure 1 As shown in the embodiment of this application, an image acquisition method in a tunnel includes:
[0066] S101: Multiple image acquisition devices installed inside the tunnel acquire multiple frames of images inside the tunnel at preset time intervals.
[0067] Multiple image acquisition devices are installed at preset intervals on the top of the tunnel. During the daily use of the tunnel, the image acquisition devices can capture multiple consecutive frames of images and send them to the monitoring platform. The monitoring platform then performs further analysis and processing on the captured images to determine whether there is congestion inside the tunnel.
[0068] S102: Based on the pixel values corresponding to multiple pixels contained in multiple frames of images, target extraction is performed on multiple pixels to determine the target region.
[0069] An image is composed of several pixels, each with its corresponding pixel value. After acquiring multiple consecutive frames of images, since the background pixel values of adjacent frames are highly similar, while the regions where moving targets are located have significant differences, the target region where the moving target is located can be extracted by subtracting the values of adjacent frames.
[0070] Specifically, after acquiring multiple frames of images, the monitoring platform can perform grayscale analysis on any two adjacent frames of the first image to obtain a grayscale second image. Then, the pixel values corresponding to the same pixels in the first and second images are subtracted, and the absolute value of the difference is taken to obtain the pixel difference value. After obtaining the pixel difference value, the pixel type is determined based on the relationship between the pixel difference value and a first preset threshold. It should be noted that the pixel type includes foreground pixels and background pixels. The first preset threshold is the critical point between the pixel values of foreground and background pixels in the image. If the pixel difference is less than the first preset threshold, the pixel is a background pixel; if the pixel difference is greater than a second preset threshold, the pixel is a foreground pixel. This first preset threshold is proportional to the light intensity inside the tunnel. Finally, the second image is traversed, and the foreground pixels are used to extract the target area.
[0071] S103: Perform region segmentation on the target region and perform feature recognition on the multiple sub-target regions obtained after segmentation to determine whether the multiple sub-target regions carry invalid features; invalid features refer to features other than vehicle features in the target region.
[0072] Because multiple lighting devices are installed inside the tunnel, and vehicles also turn on their headlights while moving through the tunnel, the resulting illumination can affect the acquired images. Therefore, the target area obtained through S102 typically carries both vehicle features and some invalid features, such as illumination. Thus, when analyzing and recognizing the images, it is necessary to detect whether the images contain invalid features other than vehicle features. Furthermore, during the above process, the target area can be divided into multiple sub-target areas for feature recognition separately to improve accuracy.
[0073] Specifically, the contour information corresponding to the target region is extracted, and the target region is segmented according to whether there is an intersection between the regions containing the contour information. If there is an intersection, the contours with the intersection are connected together as a sub-target region. In this way, multiple sub-target regions can be obtained after segmentation.
[0074] In one embodiment, extracting the contour information of the target region can be achieved through the following steps: First, a preset detection window is determined. This detection window uses the number of pixels as the unit of measurement for its length and width, and both the length and width are the same. Typically, to reduce the difficulty of contour extraction, the size of the detection window can be set to an odd number, such as 9x9. It should be noted that the length and width of the detection window can be set according to actual application requirements, and this application does not impose any restrictions on this. Next, a detection window is set with any corner point of the target region as the standard position. Starting from the standard position, keeping the horizontal coordinate unchanged, the detection window is slid sequentially in the direction of increasing vertical coordinate of the standard position. Each time it is slid, the number Ni of non-zero grayscale pixels in the current detection window is determined, until the detection window exceeds the target region. At this time, from the above i detection windows, the window with the most non-zero grayscale pixels is determined as the target detection window, and the center pixel of the target detection window is taken as the contour point. Then, the horizontal coordinates of the standard positions are incremented sequentially. Each increment is followed by repeating the process of sliding the detection window in the direction of vertical coordinate increment, obtaining corresponding contour points. This continues until the detection window exceeds the target area, generating a contour point sequence. It should be noted that the detection window slides at one-pixel intervals. After obtaining the contour point sequence, it is filtered to remove scattered contour points. After filtering, the contour points are connected sequentially to fit the contour information corresponding to the target area. This contour extraction method ensures the integrity of the contour even in tunnels with strong illumination interference, avoiding defects in the extracted contour due to invalid features.
[0075] Furthermore, after segmenting multiple sub-target regions, the presence of invalid features can be determined by analyzing the pixel values of each sub-target region's pixels. Specifically, standard feature points are determined for each sub-target region. The pixel value corresponding to this standard feature point has the largest difference between its pixel value and the pixel value of its corresponding background pixel, indicating the pixel with the highest light intensity. After obtaining the standard feature points, the first distance between each pixel in the sub-target region and the standard feature points is calculated. The pixel difference that the nearest light source to the sub-target region can produce, as well as the vertical distance between the sub-target region and the light source, are determined. This vertical distance is a fixed value for a given sub-target region. Based on the first distance, the vertical distance, and the pixel difference that the light source can produce, the pixel difference that each pixel in the sub-target region can produce is determined. Thus, for each pixel, the relationship between the distance between the pixel and the standard feature point and the pixel difference it can produce is obtained. Based on this relationship, a pixel difference trend distribution map corresponding to the sub-target region can be fitted, such as... Figure 2The graph shown represents a pixel difference trend distribution. The horizontal axis represents the distance between a pixel and a standard feature point, and the vertical axis represents the pixel difference that a pixel can produce. The distance and pixel difference are inversely proportional, and the pixel difference gradually decreases as the distance increases.
[0076] In one embodiment, for a sub-target region, the pixel difference tends to decrease from the center outwards. Therefore, the standard feature point, as the pixel with the largest pixel difference, can usually be obtained by finding the center point of the sub-target region.
[0077] Determining the standard feature points of a sub-target region can be achieved through the following steps: For any given sub-target region, determine its corresponding circumscribed region. This circumscribed region should cover all pixels contained within the sub-target region and can be a circular region, a rectangular region, etc. After determining the circumscribed region, for each pixel contained within it, determine whether it belongs to the sub-target region. If it does, the determination result for that pixel is recorded as 1; otherwise, the determination result is recorded as 0. Summing the determination results for the pixels in the circumscribed region yields the area of the sub-target region. This can be achieved using the following formula:
[0078]
[0079] Where Sj represents the area of the j-th sub-target region, and z(.) is 1 when the pixel belongs to the sub-target region and 0 when the pixel does not belong to the sub-target region.
[0080] After obtaining the area of the sub-target region, the coordinates (mj, nj) of the corresponding standard feature points of the sub-target region are determined based on the coordinate values of the pixels in the sub-target region and the area. This can be achieved using the following formula:
[0081]
[0082]
[0083] Where x and y are the coordinates of the pixel.
[0084] Furthermore, after fitting the pixel difference trend distribution map, the concentration of the sub-target region can be determined based on this map. The concentration represents the correlation between the pixel difference that a pixel can generate and the distance. The higher the concentration, the more concentrated the distribution of pixels in the distribution map. When the concentration is higher than a preset value, it indicates that the correlation between the pixel difference of each pixel and the distance is high, which conforms to the law of illumination change. At this time, it can be determined that the sub-target region carries invalid features such as illumination.
[0085] It should be noted that when determining the concentration of the pixel difference trend distribution map, it can be equivalent to calculating the extension radius of the pixels; the larger the extension radius, the smaller the concentration. For example... Figure 2 As shown, the center point P of the pixel difference trend distribution map is determined, and the x and y coordinates of the center point P are the average of the x and y coordinates of each pixel. After determining the center point P, the average distance between each pixel and the center point P, and the second distance OP between the origin and the center point P are determined. Based on the ratio between the average distance and the second distance OP, the extension radius PM of the pixel can be obtained. The smaller the extension radius, the more concentrated the pixels are, and the greater their concentration.
[0086] S104: In the case of invalid features in multiple sub-target regions, the target region is reconstructed to remove invalid features from the target region and obtain the final vehicle target.
[0087] When invalid features are identified in a sub-target region, the gradient value of each pixel in the sub-target region can be calculated using a preset image gradient calculation method. The gradient value represents the rate of change of pixel value in the gradient direction; the larger the gradient value, the greater the difference between the pixel and its neighboring pixels. Pixels with gradient values greater than the preset gradient are collected as a set of pixels. Based on this set, a target overlay layer for the sub-target region can be fitted. It can be understood that the gradient values of pixels without invalid features fluctuate, while the gradient values of pixels with invalid features tend to be 0 due to constant illumination. Therefore, the target overlay layer obtained above represents the region without invalid features. This target overlay layer is superimposed on the sub-target region for region reconstruction. The reconstructed sub-target region is the region where invalid features have been removed, which is the actual vehicle target.
[0088] S105: Based on the vehicle targets in different frame images, determine the movement trajectory of the corresponding vehicle, and based on the sum of the movement trajectory and multiple time intervals, determine whether there is congestion inside the tunnel, so as to provide early warning for vehicles about to enter the tunnel.
[0089] After identifying vehicle targets in each frame of the image, the motion trajectory of the vehicle target can be obtained based on the consecutive frames. The length of the motion trajectory is the actual distance traveled by the vehicle. By comparing the actual distance traveled by the vehicle with the expected distance traveled, it can be determined whether there is congestion inside the tunnel.
[0090] The estimated travel distance is the distance a vehicle will travel at its saturation speed. Saturation speed is a critical value for vehicle speed; below this speed, the number of vehicles exceeds the road's capacity, potentially leading to congestion. The estimated travel distance is calculated by summing the time intervals across multiple frames of images and multiplying them by the preset vehicle saturation speed. This estimated distance is then compared to the length of the vehicle's trajectory. If the trajectory is shorter than the estimated distance, congestion is detected inside the tunnel. The monitoring platform can then issue warnings to vehicles about to enter the tunnel, prompting them to detour or slow down, thus improving tunnel efficiency and safety.
[0091] The above are embodiments of the methods proposed in this application. Based on the same idea, some embodiments of this application also provide devices and non-volatile computer storage media corresponding to the above methods.
[0092] Figure 3 This is a schematic diagram of the structure of an image acquisition device in a tunnel, provided as an embodiment of this application. Figure 3 As shown, it includes:
[0093] At least one processor; and,
[0094] At least one processor-communication-connected memory; wherein,
[0095] The memory stores instructions that can be executed by at least one processor, and the instructions, when executed by at least one processor, enable at least one processor to:
[0096] Multiple image acquisition devices installed inside the tunnel are used to acquire multiple frames of images inside the tunnel at preset time intervals.
[0097] Based on the pixel values corresponding to the multiple pixels contained in the multi-frame images, target extraction is performed on the multiple pixels to determine the target region;
[0098] The target region is segmented, and feature recognition is performed on the resulting sub-target regions to determine whether any invalid features are carried in the sub-target regions; the invalid features refer to features in the target region other than vehicle features.
[0099] If the invalid features exist in the multiple sub-target regions, the target region is reconstructed to remove the invalid features from the target region and obtain the final vehicle target;
[0100] Based on the vehicle targets in different frame images, the movement trajectory of the corresponding vehicle is determined, and based on the movement trajectory and the sum of multiple time intervals, it is determined whether there is congestion inside the tunnel, so as to provide early warning for vehicles about to enter the tunnel.
[0101] This application provides a non-volatile computer storage medium storing computer-executable instructions, which are configured as follows:
[0102] Multiple image acquisition devices installed inside the tunnel are used to acquire multiple frames of images inside the tunnel at preset time intervals.
[0103] Based on the pixel values corresponding to the multiple pixels contained in the multi-frame images, target extraction is performed on the multiple pixels to determine the target region;
[0104] The target region is segmented, and feature recognition is performed on the resulting sub-target regions to determine whether any invalid features are carried in the sub-target regions; the invalid features refer to features in the target region other than vehicle features.
[0105] If the invalid features exist in the multiple sub-target regions, the target region is reconstructed to remove the invalid features from the target region and obtain the final vehicle target;
[0106] Based on the vehicle targets in different frame images, the movement trajectory of the corresponding vehicle is determined, and based on the movement trajectory and the sum of multiple time intervals, it is determined whether there is congestion inside the tunnel, so as to provide early warning for vehicles about to enter the tunnel.
[0107] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and medium embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the description of the method embodiments.
[0108] The devices and media provided in this application are one-to-one with the methods. Therefore, the devices and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0109] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0110] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0111] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0112] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0113] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0114] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0115] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0116] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0117] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for image acquisition within a tunnel, characterized in that, The method includes: Multiple image acquisition devices installed inside the tunnel are used to acquire multiple frames of images inside the tunnel at preset time intervals. Based on the pixel values corresponding to the multiple pixels contained in the multi-frame images, target extraction is performed on the multiple pixels to determine the target region; The target region is segmented, and feature recognition is performed on the resulting sub-target regions to determine whether any invalid features are carried in the sub-target regions; the invalid features refer to features in the target region other than vehicle features. If the invalid features exist in the multiple sub-target regions, the target region is reconstructed to remove the invalid features from the target region and obtain the final vehicle target; Based on the vehicle targets in different frame images, the movement trajectory of the corresponding vehicle is determined, and based on the movement trajectory and the sum of multiple time intervals, it is determined whether there is congestion inside the tunnel, so as to provide early warning for vehicles about to enter the tunnel. The target region is segmented, and feature recognition is performed on the resulting sub-target regions to determine whether any invalid features are carried in the sub-target regions. Specifically, this includes: Extract the contour information corresponding to the target region, and segment the target region according to whether there is an intersection between the regions containing the contour information to obtain multiple sub-target regions after segmentation; For the multiple sub-target regions, standard feature points corresponding to each sub-target region are determined, as well as a first distance between each pixel in the sub-target region and the standard feature points; the difference between the pixel value corresponding to the standard feature point and the pixel value of its corresponding background pixel is maximized. Based on the first distance, the pixel difference that each pixel can generate is calculated, and based on the distance and pixel difference corresponding to each pixel, a pixel difference trend distribution map corresponding to the sub-target region is fitted to obtain the pixel difference trend distribution map. The concentration of the sub-target region is determined based on the pixel difference trend distribution map; If the concentration is higher than a preset value, it is determined that the sub-target region carries invalid features; The target region is reconstructed to remove invalid features and obtain the final vehicle target. Specifically, this includes: For sub-target regions carrying invalid features, the gradient value of each pixel in the sub-target region is calculated using a preset image gradient calculation method; Determine the set of pixels whose gradient values are greater than a preset gradient, and generate a target overlay layer for the sub-target region based on the set of pixels. The target overlay layer is superimposed on the sub-target region to reconstruct the region, and the reconstructed sub-target region is taken as the region where the vehicle target is located. Determine the standard feature points corresponding to each sub-target region, specifically including: Determine the outer region of the sub-target region, wherein the outer region can cover all pixels contained in the sub-target region; Determine whether a pixel in the outer region belongs to the sub-target region. If yes, the determination result is recorded as 1; otherwise, the determination result is recorded as 0. The judgment results corresponding to the pixels in the outer region are summed to obtain the area of the sub-target region; Based on the coordinate values of the pixels in the sub-target region and the area, determine the coordinates of the standard feature points corresponding to the sub-target region; Based on the pixel difference trend distribution map, the concentration of the sub-target region is determined, specifically including: Determine the center point of the pixel difference trend distribution map, where the x and y coordinates of the center point are the average values of the x and y coordinates of each pixel. Determine the average distance between each pixel and the center point, and the second distance between the origin and the center point; The concentration of the sub-target region is determined based on the ratio between the mean distance and the second distance.
2. The image acquisition method in a tunnel according to claim 1, characterized in that, Based on the pixel values corresponding to multiple pixels contained in the multi-frame images, target extraction is performed on the multiple pixels to obtain the target region, specifically including: For any two adjacent frames in the multi-frame image, the first image is grayscaled to obtain the grayscaled second image. The pixel difference between the same pixel points in the first image and the second image is obtained by subtracting the pixel values and taking the absolute value of the difference. The pixel type of the pixel is determined based on the relationship between the pixel difference and a first preset threshold; the pixel type includes foreground pixels and background pixels. The second image is traversed, and the foreground pixels are extracted to obtain the target region.
3. The image acquisition method in a tunnel according to claim 1, characterized in that, Extracting the contour information corresponding to the target region specifically includes: A preset detection window is defined; the width and length of the detection window are the same. Using the corner points of the target area as standard positions, the detection window is slid along the direction of increasing vertical coordinate of the standard positions. The pixels in each of the sliding detection windows are traversed to determine the target detection window with the most non-zero grayscale pixels from each detection window, and the center pixel of the target detection window is determined as the contour point. The abscissas of the standard positions are incremented sequentially, and the above process is repeated to generate the corresponding contour point sequence. The contour point sequence is filtered, and the contour information corresponding to the target region is obtained by fitting the filtered contour points.
4. The image acquisition method in a tunnel according to claim 1, characterized in that, Based on the movement trajectory and the sum of multiple time intervals, it is determined whether there is congestion inside the tunnel, specifically including: The vehicle's expected travel distance is determined by the sum of the multiple time intervals corresponding to the multiple frames of images and the product of the preset vehicle saturation speed. The estimated travel distance is compared with the length of the trajectory. If the length is less than the estimated travel distance, it is determined that there is congestion inside the tunnel.
5. An image acquisition device for use in tunnels, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to: Multiple image acquisition devices installed inside the tunnel are used to acquire multiple frames of images inside the tunnel at preset time intervals. Based on the pixel values corresponding to the multiple pixels contained in the multi-frame images, target extraction is performed on the multiple pixels to determine the target region; The target region is segmented, and feature recognition is performed on the resulting sub-target regions to determine whether any invalid features are carried in the sub-target regions; the invalid features refer to features in the target region other than vehicle features. If the invalid features exist in the multiple sub-target regions, the target region is reconstructed to remove the invalid features from the target region and obtain the final vehicle target; Based on the vehicle targets in different frame images, the movement trajectory of the corresponding vehicle is determined, and based on the movement trajectory and the sum of multiple time intervals, it is determined whether there is congestion inside the tunnel, so as to provide early warning for vehicles about to enter the tunnel. The target region is segmented, and feature recognition is performed on the resulting sub-target regions to determine whether any invalid features are carried in the sub-target regions. Specifically, this includes: Extract the contour information corresponding to the target region, and segment the target region according to whether there is an intersection between the regions containing the contour information to obtain multiple sub-target regions after segmentation; For the multiple sub-target regions, standard feature points corresponding to each sub-target region are determined, as well as a first distance between each pixel in the sub-target region and the standard feature points; the difference between the pixel value corresponding to the standard feature point and the pixel value of its corresponding background pixel is maximized. Based on the first distance, the pixel difference that each pixel can generate is calculated, and based on the distance and pixel difference corresponding to each pixel, a pixel difference trend distribution map corresponding to the sub-target region is fitted to obtain the pixel difference trend distribution map. The concentration of the sub-target region is determined based on the pixel difference trend distribution map; If the concentration is higher than a preset value, it is determined that the sub-target region carries invalid features; The target region is reconstructed to remove invalid features and obtain the final vehicle target. Specifically, this includes: For sub-target regions carrying invalid features, the gradient value of each pixel in the sub-target region is calculated using a preset image gradient calculation method; Determine the set of pixels whose gradient values are greater than a preset gradient, and generate a target overlay layer for the sub-target region based on the set of pixels. The target overlay layer is superimposed on the sub-target region to reconstruct the region, and the reconstructed sub-target region is taken as the region where the vehicle target is located. Determine the standard feature points corresponding to each sub-target region, specifically including: Determine the outer region of the sub-target region, wherein the outer region can cover all pixels contained in the sub-target region; Determine whether a pixel in the outer region belongs to the sub-target region. If yes, the determination result is recorded as 1; otherwise, the determination result is recorded as 0. The judgment results corresponding to the pixels in the outer region are summed to obtain the area of the sub-target region; Based on the coordinate values of the pixels in the sub-target region and the area, determine the coordinates of the standard feature points corresponding to the sub-target region; Based on the pixel difference trend distribution map, the concentration of the sub-target region is determined, specifically including: Determine the center point of the pixel difference trend distribution map, where the x and y coordinates of the center point are the average values of the x and y coordinates of each pixel. Determine the average distance between each pixel and the center point, and the second distance between the origin and the center point; The concentration of the sub-target region is determined based on the ratio between the mean distance and the second distance.
6. A non-volatile computer storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are set as follows: Multiple image acquisition devices installed inside the tunnel are used to acquire multiple frames of images inside the tunnel at preset time intervals. Based on the pixel values corresponding to the multiple pixels contained in the multi-frame images, target extraction is performed on the multiple pixels to determine the target region; The target region is segmented, and feature recognition is performed on the resulting sub-target regions to determine whether any invalid features are carried in the sub-target regions; the invalid features refer to features in the target region other than vehicle features. If the invalid features exist in the multiple sub-target regions, the target region is reconstructed to remove the invalid features from the target region and obtain the final vehicle target; Based on the vehicle targets in different frame images, the movement trajectory of the corresponding vehicle is determined, and based on the movement trajectory and the sum of multiple time intervals, it is determined whether there is congestion inside the tunnel, so as to provide early warning for vehicles about to enter the tunnel. The target region is segmented, and feature recognition is performed on the resulting sub-target regions to determine whether any invalid features are carried in the sub-target regions. Specifically, this includes: Extract the contour information corresponding to the target region, and segment the target region according to whether there is an intersection between the regions containing the contour information to obtain multiple sub-target regions after segmentation; For the multiple sub-target regions, standard feature points corresponding to each sub-target region are determined, as well as a first distance between each pixel in the sub-target region and the standard feature points; the difference between the pixel value corresponding to the standard feature point and the pixel value of its corresponding background pixel is maximized. Based on the first distance, the pixel difference that each pixel can generate is calculated, and based on the distance and pixel difference corresponding to each pixel, a pixel difference trend distribution map corresponding to the sub-target region is fitted to obtain the pixel difference trend distribution map. The concentration of the sub-target region is determined based on the pixel difference trend distribution map; If the concentration is higher than a preset value, it is determined that the sub-target region carries invalid features; The target region is reconstructed to remove invalid features and obtain the final vehicle target. Specifically, this includes: For sub-target regions carrying invalid features, the gradient value of each pixel in the sub-target region is calculated using a preset image gradient calculation method; Determine the set of pixels whose gradient values are greater than a preset gradient, and generate a target overlay layer for the sub-target region based on the set of pixels. The target overlay layer is superimposed on the sub-target region to reconstruct the region, and the reconstructed sub-target region is taken as the region where the vehicle target is located. Determine the standard feature points corresponding to each sub-target region, specifically including: Determine the outer region of the sub-target region, wherein the outer region can cover all pixels contained in the sub-target region; Determine whether a pixel in the outer region belongs to the sub-target region. If yes, the determination result is recorded as 1; otherwise, the determination result is recorded as 0. The judgment results corresponding to the pixels in the outer region are summed to obtain the area of the sub-target region; Based on the coordinate values of the pixels in the sub-target region and the area, determine the coordinates of the standard feature points corresponding to the sub-target region; Based on the pixel difference trend distribution map, the concentration of the sub-target region is determined, specifically including: Determine the center point of the pixel difference trend distribution map, where the x and y coordinates of the center point are the average values of the x and y coordinates of each pixel. Determine the average distance between each pixel and the center point, and the second distance between the origin and the center point; The concentration of the sub-target region is determined based on the ratio between the mean distance and the second distance.