Method and system for extracting key frame in reconnaissance adit image video, terminal and medium
Through frame extraction processing and Laplacian algorithm analysis, the clearest frame in the surveyed image video is selected as the keyframe, which solves the problems of missing frames and redundancy in the prior art, and improves image processing efficiency and the accuracy of the three-dimensional model.
Patent Information
- Application Number
- CN202411037614.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-11-15
AI Technical Summary
The prior art has leaked frames and redundancy when extracting keyframes in the surveying flat hole image video, resulting in low image processing efficiency and disconnection of the three-dimensional model, which cannot accurately reflect the actual geological conditions.
The frame extraction process combined with Laplacian algorithm is used to analyze the blur degree of video frame images, and the clarity of each frame is determined through grayscale processing and weight calculation. The frame with the largest image blur analysis value is selected as the keyframe, and the gain factor enhancement process is used to Preserve image edges and details.
It improves the quality and continuity of video frame extraction, ensures the clarity and continuity of the image, and provides more accurate data support for subsequent three-dimensional model establishment.
Smart Images

Figure CN118968381A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video processing technology, and more specifically, to a method, system, terminal and medium for extracting key frames from flat hole survey image videos. Background Art
[0002] Before the main construction of a hydropower project, it is usually necessary to use a survey tunnel to identify the geological conditions of the project to ensure the safety and feasibility of the project. At present, it is usually necessary to manually enter the survey tunnel to collect image and video data, and then build a three-dimensional cave model based on the image and video data, so that the relevant personnel involved in the construction have a clear understanding of the geological conditions of the project. In the process of building a three-dimensional cave model, it is necessary to convert the image and video data into images, and generate a three-dimensional model from the two-dimensional images. Therefore, it is crucial to find the key frames in the image video that can express the various characteristics of the survey tunnel.
[0003] In the prior art, each video is an image sequence, which contains richer information than ordinary images. However, there is also a lot of redundant information in a sequence. The extraction of video frames also has frame omissions and redundancy. Extracting key frames can improve the processing efficiency of the video. The prior art obtains key frames by comparing the similarity between the edge area and the main area. However, due to the different time intervals of key frames, during the acquisition of survey flat hole images, the quality of the video may be poor or there may be no movement for several consecutive seconds due to personnel, environment, etc. during the video shooting process. Using this method will result in no clear key video frames being extracted during this period. In the three-dimensional model made by filtering images later, this part of the survey flat hole model is disconnected, which is not suitable for practical use.
[0004] Therefore, how to study and design a key frame extraction method, system, terminal and medium in the survey flat hole image video that can overcome the above-mentioned defects is a problem that we urgently need to solve. Summary of the invention
[0005] In order to solve the deficiencies in the prior art, the purpose of the present invention is to provide a method, system, terminal and medium for extracting key frames in survey flat hole image videos. The video is firstly subjected to frame extraction processing, and then the blur degree of the frame image in the video is analyzed by the Laplacian algorithm. In each frame extraction period, a clearest key frame is selected, which ensures both the quality of frame extraction and the continuity of the image.
[0006] The above technical objectives of the present invention are achieved through the following technical solutions:
[0007] In a first aspect, a method for extracting key frames from a flat hole survey image video is provided, comprising the following steps:
[0008] Obtain video images of the exposed surrounding rock during the horizontal tunnel excavation;
[0009] Perform frame extraction on the video image, and divide the extracted image into multiple image sequences according to the frame extraction rate;
[0010] Perform grayscale processing on each frame of the image sequence to obtain a corresponding grayscale image;
[0011] The Laplacian operator is used to perform convolution operation on the grayscale image to calculate the gradient value of each pixel and obtain the Laplacian response image;
[0012] Determine the image fuzzy analysis value of the Laplacian response image according to the discrete degree of pixel value distribution in the Laplacian response image;
[0013] The frame image with the largest image blur analysis value is selected from the image sequence as the key frame of the corresponding image sequence.
[0014] Furthermore, the process of performing grayscale processing on each frame of the image sequence is specifically as follows:
[0015] Assign weight coefficients to various colors in the color image according to the spectral information of the supplementary lighting and the ambient illumination conditions;
[0016] The weight calculation is performed by combining the RGB value of the pixel in each frame of the image and the corresponding weight coefficient to obtain the grayscale value of the corresponding pixel.
[0017] Furthermore, the process of assigning weight coefficients to various colors in the color image according to the spectral information of the supplementary lighting and the ambient illumination conditions is specifically as follows:
[0018] If the spectral information of the supplementary lighting is a yellow spectrum, the weight coefficient of the green channel is greater than the weight coefficient of the red channel;
[0019] And / or, if the ambient illumination value is lower than a preset illumination value, the weight coefficient of the green channel is greater than the weight coefficient of the blue channel.
[0020] Furthermore, the expression for weight calculation based on the RGB value of the pixel in each frame of the image and the corresponding weight coefficient is specifically:
[0021] Br k =a1R k +a2G k +a3B k ;
[0022] Among them, Br k Represents the gray value of the kth pixel; R krepresents the red pixel value of the kth pixel; a1 represents the weight coefficient of the red channel; G k represents the green pixel value of the kth pixel; a2 represents the weight coefficient of the green channel; B k represents the blue pixel value of the kth pixel; a3 represents the weight coefficient of the blue channel.
[0023] Furthermore, the Laplacian operator is used to perform a convolution operation on the grayscale image to calculate the gradient value of each pixel point. Specifically, the expression is:
[0024] g(i,j)=4f(i,j)-f(i+1,j)-f(i-1,j)-f(i,j-1)-f(i,j+1);
[0025] Among them, g(i,j) represents the gradient value of the central pixel (i,j); f(i,j) represents the grayscale value of the central pixel (i,j); f(i+1,j), f(i-1,j), f(i,j-1), and f(i,j+1) represent the pixel values of the four neighboring pixels adjacent to the central pixel (i,j), respectively.
[0026] Furthermore, the calculation formula of the image blur analysis value of the Laplacian response image is specifically as follows:
[0027]
[0028] Among them, S m represents the discrete degree of pixel value distribution in the mth Laplacian response image; n represents the total number of pixels in the Laplacian response image; X m,k represents the gradient value of the kth pixel in the mth Laplacian response image; μ m represents the average gradient of all pixels in the mth Laplacian response image; D m represents the image fuzzy analysis value of the mth Laplacian response image; max(S all ) represents the maximum pixel value distribution dispersion degree in all Laplacian response images; min(S all ) represents the minimum discrete degree of pixel value distribution in all Laplacian response images.
[0029] Furthermore, the method further comprises:
[0030] The Laplacian response image is enhanced by the gain factor;
[0031] The enhanced Laplacian response image is fused with the grayscale image to increase the edge and detail information of the image while retaining the background information of the image, thereby obtaining a sharpened image.
[0032] Output the sharpened image as the final keyframe.
[0033] In a second aspect, a key frame extraction system in a flat-hole survey image video is provided, and the system is used to implement the key frame extraction method in a flat-hole survey image video as described in any one of the first aspects, including:
[0034] An image acquisition module is used to obtain video images of the exposed surrounding rock during the horizontal tunnel excavation;
[0035] An image frame extraction module is used to extract frames from video images and divide the extracted images into multiple image sequences according to the frame extraction rate;
[0036] A grayscale processing module is used to perform grayscale processing on each frame of the image sequence to obtain a corresponding grayscale image;
[0037] The gradient analysis module is used to perform a convolution operation on the grayscale image using the Laplacian operator to calculate the gradient value of each pixel and obtain a Laplacian response image;
[0038] A fuzzy analysis module, used for determining an image fuzzy analysis value of a Laplacian response image according to a discrete degree of pixel value distribution in the Laplacian response image;
[0039] The image extraction module is used to select the frame image with the largest image blur analysis value from the image sequence as the key frame of the corresponding image sequence.
[0040] In a third aspect, a computer terminal is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a method for extracting key frames from a flat hole survey image video as described in any one of the first aspects is implemented.
[0041] In a fourth aspect, a computer-readable medium is provided, on which a computer program is stored, and the computer program is executed by a processor to implement the key frame extraction method in the survey flat hole image video as described in any one of the first aspects.
[0042] Compared with the prior art, the present invention has the following beneficial effects:
[0043] 1. The method for extracting key frames from survey flat hole image videos provided by the present invention first extracts frames from the video, and then analyzes the blur degree of the frame images in the video through the Laplacian algorithm, and selects a clearest key frame in each frame extraction period, thereby ensuring both the quality of frame extraction and the continuity of the image, and preparing for further processing of the image in the later stage;
[0044] 2. When performing grayscale processing on each frame of an image sequence, the present invention simultaneously considers the spectral information of the supplementary lighting and the ambient illumination conditions, so that the differential characterization of the blur situation in the subsequent Laplacian response image is more accurate and reliable;
[0045] 3. The present invention also enhances the Laplacian response image through a gain factor, and fuses the enhanced Laplacian response image with the grayscale image, thereby increasing the edge and detail information of the image while retaining the background information of the image. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The drawings described herein are used to provide a further understanding of the embodiments of the present invention, constitute a part of this application, and do not constitute a limitation of the embodiments of the present invention. In the drawings:
[0047] Figure 1 is a flow chart of Embodiment 1 of the present invention;
[0048] Figure 2 It is a system block diagram in Embodiment 2 of the present invention. DETAILED DESCRIPTION
[0049] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments and drawings. The exemplary embodiments of the present invention and their description are only used to explain the present invention and are not intended to limit the present invention.
[0050] Embodiment 1: A method for extracting key frames from a flat hole survey video, such as Figure 1 As shown, the following steps are included:
[0051] S1: Obtaining video images of the exposed surrounding rock during the excavation of the survey flat tunnel;
[0052] S2: performing frame extraction processing on the video image, and dividing the extracted image into multiple image sequences according to the frame extraction rate;
[0053] S3: Perform grayscale processing on each frame of the image sequence to obtain a corresponding grayscale image;
[0054] S4: Use the Laplacian operator to perform a convolution operation on the grayscale image to calculate the gradient value of each pixel and obtain a Laplacian response image;
[0055] S5: determining the image fuzzy analysis value of the Laplacian response image according to the discrete degree of pixel value distribution in the Laplacian response image;
[0056] S6: Selecting a frame image with the largest image blur analysis value from the image sequence as a key frame of the corresponding image sequence.
[0057] In step S1, a mobile phone can be connected via a multi-purpose photography device, a data acquisition APP can be set in the mobile phone to form a data acquisition instrument, and the frame rate of the camera is set to 30fps.
[0058] Specifically, a person can hold a data acquisition instrument and shoot a video while walking into the survey tunnel at a constant speed. The photographic equipment can collect digital images of the surrounding rock exposed by the excavation of the survey tunnel. The obtained real-life information can be displayed in real time on the mobile phone screen and saved in the mobile phone. The image data in the mobile phone can be imported into the computer to facilitate the frame extraction processing of the image data later.
[0059] In step S2, the images are subjected to frame extraction, and the images extracted according to the frame extraction rate are numbered. For example, if the frame rate is 30 frames per second and the video is 100 seconds in total, the images of the first second are numbered 0001-0030 in the order from 1 second to 100 seconds, and the images of the 100th second are numbered 2971-3000.
[0060] In step S3, the process of grayscale processing for each frame of the image sequence is specifically as follows: weight coefficients are assigned to various colors in the color image according to the spectral information of the supplementary lighting and the ambient illumination conditions; weight calculation is performed based on the RGB value of the pixel point in each frame of the image and the corresponding weight coefficient to obtain the grayscale value of the corresponding pixel point.
[0061] If the spectral information of the supplementary lighting is a yellow spectrum, yellow light is mainly a mixture of red and green light. In this case, giving the green channel more weight can compensate for the relative deficiency of the green light component caused by the yellow lighting, making it more natural, so the weight coefficient of the channel is greater than that of the red channel.
[0062] In addition, the ambient illumination value is lower than the preset illumination value, that is, the flat hole survey is under low illumination conditions, and the brightness information of the image is more important than the color information. In this case, giving more weight to the green channel is more in line with the requirements, so the weight coefficient of the green channel is greater than the weight coefficient of the blue channel.
[0063] The specific expression for weight calculation based on the RGB value of the pixel in each frame of the image and the corresponding weight coefficient is:
[0064] Br k =a1R k +a2G k +a3B k ;
[0065] Among them, Br k Represents the gray value of the kth pixel; R k represents the red pixel value of the kth pixel; a1 represents the weight coefficient of the red channel; G k represents the green pixel value of the kth pixel; a2 represents the weight coefficient of the green channel; B k represents the blue pixel value of the kth pixel; a3 represents the weight coefficient of the blue channel.
[0066] In step S4, the Laplacian operator is used to perform a convolution operation on the grayscale image to calculate the gradient value of each pixel. Specifically, the expression is:
[0067] g(i,j)=4f(i,j)-f(i+1,j)-f(i-1,j)-f(i,j-1)-f(i,j+1);
[0068] Among them, g(i,j) represents the gradient value of the central pixel (i,j); f(i,j) represents the grayscale value of the central pixel (i,j); f(i+1,j), f(i-1,j), f(i,j-1), and f(i,j+1) represent the pixel values of the four neighboring pixels adjacent to the central pixel (i,j), respectively.
[0069] It should be noted that the more dispersed the gradient value distribution in the image is, the clearer the image is; conversely, the more concentrated the gradient value distribution in the image is, the blurrier the image is.
[0070] To this end, in step S5, the calculation formula of the image blur analysis value of the Laplacian response image is specifically:
[0071]
[0072] Among them, S m represents the discrete degree of pixel value distribution in the mth Laplacian response image; n represents the total number of pixels in the Laplacian response image; X m,k represents the gradient value of the kth pixel in the mth Laplacian response image; μ m represents the average gradient of all pixels in the mth Laplacian response image; D m represents the image fuzzy analysis value of the mth Laplacian response image; max(S all) represents the maximum pixel value distribution dispersion degree in all Laplacian response images; min(S all ) represents the minimum discrete degree of pixel value distribution in all Laplacian response images.
[0073] The method for extracting key frames from flat hole survey image videos recorded in the present invention also includes the following steps: enhancing the Laplacian response image by a gain factor; fusing the enhanced Laplacian response image with a grayscale image to increase the edge and detail information of the image while retaining the background information of the image to obtain a sharpened image; and outputting the sharpened image as the final key frame to make the extracted key frame clearer.
[0074] Embodiment 2: A system for extracting key frames from a flat-hole survey image video, the system being used to implement the method for extracting key frames from a flat-hole survey image video as described in Embodiment 1, Figure 2 As shown, it includes an image acquisition module, an image frame extraction module, a grayscale processing module, a gradient analysis module, a fuzzy analysis module and an image extraction module.
[0075] Among them, the image acquisition module is used to obtain video images of the exposed surrounding rock exposed by the excavation of the survey flat tunnel; the image frame extraction module is used to extract the video image and divide the extracted image into multiple image sequences according to the frame extraction rate; the grayscale processing module is used to perform grayscale processing on each frame image in the image sequence to obtain the corresponding grayscale image; the gradient analysis module is used to use the Laplacian operator to perform convolution operation on the grayscale image to calculate the gradient value of each pixel point to obtain the Laplacian response image; the fuzzy analysis module is used to determine the image fuzzy analysis value of the Laplacian response image according to the discrete degree of pixel value distribution in the Laplacian response image; the image extraction module is used to select the frame image with the largest image fuzzy analysis value from the image sequence as the key frame of the corresponding image sequence.
[0076] The present invention also records a computer terminal, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the method for extracting key frames from a flat hole survey image video as described in Example 1 is implemented.
[0077] The present invention also records a computer-readable medium on which a computer program is stored. The computer program is executed by a processor to implement the key frame extraction method in the flat hole survey image video as described in Example 1.
[0078] Working principle: The present invention first performs frame extraction processing on the video, and then analyzes the blur degree of the frame image in the video through the Laplacian algorithm, and selects a clearest key frame in each frame extraction period, which not only ensures the quality of frame extraction, but also ensures the continuity of the image, and prepares for further processing of the subsequent image; in addition. When the present invention performs grayscale processing on each frame image in the image sequence, the spectral information of the supplementary lighting and the ambient illumination conditions are considered at the same time, so that the differential characterization of the blur situation in the subsequent Laplacian response image is more accurate and reliable.
[0079] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0080] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0081] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0082] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1The steps for the functions specified in one or more boxes.
[0083] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. Key frame extraction method in flat hole survey video, Its characteristics are: The following steps are involved: Obtain mobile video images of the surrounding rock exposed during the excavation of the survey flat tunnel; Perform frame extraction on the video image, and divide the extracted image into multiple image sequences according to the frame extraction rate; Perform grayscale processing on each frame of the image sequence to obtain a corresponding grayscale image; The Laplacian operator is used to perform convolution operation on the grayscale image to calculate the gradient value of each pixel and obtain the Laplacian response image; Determine the image fuzzy analysis value of the Laplacian response image according to the discrete degree of pixel value distribution in the Laplacian response image; The frame image with the largest image blur analysis value is selected from the image sequence as the key frame of the corresponding image sequence.
2. The method for extracting key frames from a flat-hole survey video according to claim 1, Its characteristics are: The process of grayscale processing each frame of the image sequence is specifically as follows: Assign weight coefficients to various colors in the color image according to the spectral information of the supplementary lighting and the ambient illumination conditions; The weight calculation is performed by combining the RGB value of the pixel in each frame of the image and the corresponding weight coefficient to obtain the grayscale value of the corresponding pixel.
3. The method for extracting key frames from a flat-hole survey video according to claim 2, Its characteristics are: The process of assigning weight coefficients to various colors in the color image according to the spectral information of the supplementary lighting and the ambient illumination conditions is specifically as follows: If the spectral information of the supplementary lighting is a yellow spectrum, the weight coefficient of the green channel is greater than the weight coefficient of the red channel; And / or, if the ambient illumination value is lower than a preset illumination value, the weight coefficient of the green channel is greater than the weight coefficient of the blue channel.
4. The method for extracting key frames from a flat-hole survey video according to claim 2, Its characteristics are: The expression for weight calculation based on the RGB value of the pixel in each frame of the image and the corresponding weight coefficient is specifically: Br k =a 1 R k +a 2 G k +a 3 B k ; Among them, Br k Represents the gray value of the kth pixel; R k Represents the red pixel value of the kth pixel; a 1 Represents the weight coefficient of the red channel; G k represents the green pixel value of the kth pixel; a 2 Represents the weight coefficient of the green channel; B k Indicates the blue pixel value of the k-th pixel; a 3 Represents the weight coefficient of the blue channel.
5. The method for extracting key frames from a flat-hole survey video according to claim 1, Its characteristics are: The Laplacian operator is used to perform a convolution operation on the grayscale image to calculate the gradient value of each pixel point. Specifically, the expression is: g(i,j)=4f(i,j)-f(i+1,j)-f(i-1,j)-f(i,j-1)-f(i,j+1); Among them, g(i,j) represents the gradient value of the central pixel (i,j); f(i,j) represents the grayscale value of the central pixel (i,j); f(i+1,j), f(i-1,j), f(i,j-1), and f(i,j+1) represent the pixel values of the four neighboring pixels adjacent to the central pixel (i,j), respectively.
6. The method for extracting key frames from a flat-hole survey video according to claim 1, Its characteristics are: The calculation formula of the image blur analysis value of the Laplacian response image is specifically: Among them, S m represents the discrete degree of pixel value distribution in the mth Laplacian response image; n represents the total number of pixels in the Laplacian response image; X m,k represents the gradient value of the kth pixel in the mth Laplacian response image; μ m represents the average gradient of all pixels in the mth Laplacian response image; D m represents the image fuzzy analysis value of the mth Laplacian response image; max(S all ) represents the maximum pixel value distribution dispersion degree in all Laplacian response images; min(S all ) represents the minimum discrete degree of pixel value distribution in all Laplacian response images.
7. The method for extracting key frames from a flat-hole survey video according to claim 1, Its characteristics are: The method further includes: The Laplacian response image is enhanced by the gain factor; The enhanced Laplacian response image is fused with the grayscale image to increase the edge and detail information of the image while retaining the background information of the image, thereby obtaining a sharpened image. Output the sharpened image as the final keyframe.
8. Key frame extraction system in flat hole survey video, Its characteristics are: The system is used to implement the key frame extraction method in the survey flat hole image video as described in any one of claims 1 to 7, comprising: An image acquisition module is used to obtain video images of the exposed surrounding rock during the horizontal tunnel excavation; An image frame extraction module is used to extract frames from video images and divide the extracted images into multiple image sequences according to the frame extraction rate; A grayscale processing module is used to perform grayscale processing on each frame of the image sequence to obtain a corresponding grayscale image; The gradient analysis module is used to perform a convolution operation on the grayscale image using the Laplacian operator to calculate the gradient value of each pixel and obtain a Laplacian response image; A fuzzy analysis module, used for determining an image fuzzy analysis value of a Laplacian response image according to a discrete degree of pixel value distribution in the Laplacian response image; The image extraction module is used to select the frame image with the largest image blur analysis value from the image sequence as the key frame of the corresponding image sequence.
9. A computer terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, Its characteristics are: When the processor executes the program, the key frame extraction method in the survey flat hole image video is implemented as described in any one of claims 1-7.
10. A computer readable medium having a computer program stored thereon, Its characteristics are: The computer program is executed by a processor to implement the key frame extraction method in the survey flat hole image video as described in any one of claims 1 to 7.
Citation Information
Cited By
Visual data intelligent acquisition system based on Internet of Things
CN119205831A
Visual data intelligent collection system based on the Internet of Things
CN119205831B
