Historic building earthquake response discrimination method based on OpenCV and perceptual hash algorithm

Through the combination of OpenCV and perceived hash algorithm, the acceleration changes and half-peak-time image similarity of the monitoring points of ancient buildings are calculated, and the hash difference is used to judge the response of ancient buildings to earthquakes, which solves the problem of judgment in the existing technology. Accurate problems achieve quantitative response evaluation.

CN118884530AActive Publication Date: 2024-11-01BEIJING JIAOTONG UNIV
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411030810.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-11-01
Estimated Expiration
2044-07-30

AI Technical Summary

Technical Problem

The existing technology cannot effectively quantify the judgment of ancient buildings' response to earthquakes, and mainly depends on whether the acceleration-time image and the semi-peak peak image meet the standard curve, and lack accuracy and uniqueness.

Method used

The similarity calculation is performed using the OpenCV computer vision library, combined with the perceived hashing algorithm, the image group is filtered by monitoring the acceleration change direction of the point and the similarity of the half-peak-time image, and the hash difference of the image group is calculated to determine the ancient Building response to earthquakes.

Benefits of technology

It improves the accuracy and uniqueness of ancient buildings' response to earthquakes, provides quantitative response standards, and ensures the reliability of judgment results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118884530A_ABST
    Figure CN118884530A_ABST
Patent Text Reader

Abstract

The invention discloses a historic building earthquake response discrimination method based on OpenCV and perceptual hash algorithms, and the method comprises the steps: taking the position of a historic building as a center, obtaining the earthquake data around the historic building, obtaining the monitoring data of a monitoring point on the historic building when an earthquake occurs each time, processing images formed by the monitoring data of all the monitoring points, and judging the image similarity of all the monitoring points; respectively reading images formed by the monitoring data of each monitoring point position in sequence, calculating a Hash value of the image of each monitoring point position through a Hash algorithm, comparing the Hash value of the image of each monitoring point position with a set threshold value, and determining whether each earthquake enables the historic building to respond or not based on a comparison result; according to the invention, similarity calculation is carried out on the monitoring result image of each monitoring point on the historic building by using the open source computer vision library in sequence, and response judgment is carried out by using the perceptual hash algorithm, so that the response result of the historic building to the earthquake can be directly output.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of earthquake response of ancient buildings, and in particular to an ancient building earthquake response discrimination method based on OpenCV and perceptual hash algorithm. Background Art

[0002] With the rapid development of the times, ancient buildings are also suffering from the ruthless attacks of wind, frost, rain, dew and natural disasters, which inevitably cause damage, destruction and collapse to the ancient buildings. Coupled with the increasingly serious human destruction, the maintenance and monitoring of ancient buildings has gradually become a topic of concern.

[0003] At present, the method for judging whether an earthquake causes an ancient building to respond is mainly based on the images generated by the sensors. The acceleration-time images and half-peak-value images generated by the accelerometers each time an earthquake is transmitted to the ancient buildings are analyzed to judge whether an earthquake causes an ancient building to respond. That is, by observing whether the acceleration-time images of the sensors in various directions at each measuring point conform to the standard earthquake acceleration-time curve, and whether the half-peak values ​​of the half-peak-value images reach the peak at the same time.

[0004] Currently, judgment is mainly made by the human eye. Since the judgment scales for whether the acceleration-time image conforms to the standard earthquake acceleration-time curve and whether the half-peak values ​​of the half-peak-value image reach the peak value at the same time are different, the judgment measures for whether the ancient buildings respond to earthquake results are also different. There is no quantitative standard for the response of ancient buildings to earthquakes. Summary of the invention

[0005] The purpose of the present invention is to provide a method for distinguishing earthquake responses of ancient buildings based on OpenCV and perceptual hash algorithm, so as to solve the technical problem in the prior art that there is no quantification in judging whether an ancient building responds to an earthquake.

[0006] In order to solve the above technical problems, the present invention specifically provides the following technical solutions:

[0007] A method for distinguishing the seismic response of ancient buildings using OpenCV and perceptual hashing algorithm uses an open source computer vision library for similarity calculation and a perceptual hashing algorithm for response judgment, including the following steps:

[0008] Step 100: With the location of the ancient building as the center, obtain earthquake data occurring around the ancient building, and obtain monitoring data of monitoring points on the ancient building when each earthquake occurs, process images formed by the monitoring data of all monitoring points, determine the image similarity of all monitoring points, and filter out image groups based on the image similarity;

[0009] Step 200, read the filtered image groups in order, and calculate the hash value difference between each pair of images in the image group through a hash algorithm, compare the hash value difference between each pair of images in the image group with a set threshold, and determine whether each earthquake causes a response in the ancient building based on the comparison result.

[0010] As a preferred solution of the present invention, the earthquake data includes the time of earthquake occurrence, the location of earthquake occurrence, the magnitude of earthquake and the focal depth of the earthquake.

[0011] As a preferred solution of the present invention, in step 100, a three-dimensional coordinate system is constructed with the ancient building to determine the acceleration change direction monitored by each monitoring point and the time point when the acceleration change is detected each time;

[0012] The monitoring results of each monitoring point are plotted as a half-peak-time image, the acceleration change direction of each monitoring point is grouped according to the three directions of X, Y, and Z, and the half-peak-time image of each monitoring point is saved in the corresponding X, Y, and Z groups respectively.

[0013] As a preferred solution of the present invention, the monitoring result of each monitoring point is plotted into a half-peak-time image using Matlab as follows:

[0014] The acceleration value generated by the accelerometer at each monitoring point is obtained, and a peak-to-peak-time image is plotted according to a two-dimensional parameter of time-peak value;

[0015] A half-peak-time image of each monitoring point is obtained based on the peak-to-peak-time image.

[0016] As a preferred solution of the present invention, the implementation method of processing the image formed by the monitoring data of all monitoring points is as follows:

[0017] Read the half-peak-time images in the X, Y, and Z groups respectively, and convert the half-peak-time images into grayscale images;

[0018] Performing feature extraction on the grayscale image;

[0019] The grayscale images of the half-peak-time images in the X, Y, and Z groups are grouped in pairs based on the extracted features, and the similarity of the half-peak-time images in the pairwise groups is calculated to screen out images with a similarity greater than a set value.

[0020] As a preferred solution of the present invention, three half-peak-time images of the same time period in the three groups X, Y, and Z are read simultaneously, loaded as grayscale images, and stored in variables img1, img2, and img3 respectively;

[0021] The SIFT algorithm is used to detect feature points in the grayscale images of the three half-peak-time images;

[0022] Use the FLANN matcher to match the feature points between each pair of images in img1, img2, and img3, and calculate the similarity between each pair of images.

[0023] As a preferred solution of the present invention, the feature points in the three images img1, img2, and img3 are extracted and descriptors are calculated by using the SIFT algorithm to obtain the key points (kp1, kp2, kp3) and descriptors (des1, des2, des3) corresponding to each image;

[0024] Use the FLANN matcher to match the descriptors of the first image and the second image to obtain matches1, match the descriptors of the first image and the third image to obtain matches2, and match the descriptors of the second image and the third image to obtain matches3;

[0025] For each pair of matching images (m, n), m represents the best matching descriptor and n represents the second best matching descriptor. If the best matching distance (m.distance) is less than 0.6 times the second best matching distance (0.6*n.distance), count them.

[0026] Finally, the counted number of matches is divided by the total number of matches to obtain the similarity value of each pair of matching images.

[0027] As a preferred solution of the present invention, the images of the corresponding time series in the three groups of images X, Y, and Z are grouped and compared in pairs according to XY, XZ, and YZ, and the image groups whose similarities calculated for the three groupings are all greater than 0.499 are screened out.

[0028] As a preferred solution of the present invention, in step 200, the image groups with similarities greater than a set value selected from the X, Y, and Z groups are read in order, and the image groups are converted by a hash algorithm to determine the hash values ​​(hash1, hash2, hash3) of the image groups;

[0029] Calculate the hash value difference (hash12, hash13, hash23) between each pair of images in each image group;

[0030] The hash values ​​of each pair of images in the image group are compared with the set hash value threshold. If the hash values ​​of each pair of images in the image group are less than the set threshold, the image group is determined to be a responsive image group, and the earthquake represented by the image group is a responsive earthquake.

[0031] As a preferred scheme of the present invention, if the hash values ​​of two images in more than half of the image group are less than a set threshold, the image group is determined to be a responsive image group, and the earthquake represented by the image group is a responsive earthquake; otherwise, the image group is determined to be an unresponsive image group, and the earthquake represented by the image group is an unresponsive earthquake.

[0032] Compared with the prior art, the present invention has the following beneficial effects:

[0033] The present invention uses an open source computer vision library to calculate the acceleration change directions formed by multiple monitoring points and save them in groups. Based on the similarity of the acceleration change half-peak-time image of each monitoring point, it is determined whether the monitoring point responds to the earthquake. In order to further improve the accuracy of response judgment, the hash value of the acceleration change half-peak-time image grouping after similarity screening is calculated, and the hash value is used to further judge the similarity between the two images of the image group. Based on the hash value judgment result, the response result of the entire ancient building to the earthquake is analyzed in one step. Therefore, a specific quantitative value is used to determine the response of the ancient building to the earthquake, thereby ensuring the uniqueness of the judgment result. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the implementation methods of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the implementation methods or the description of the prior art. Obviously, the drawings in the following description are only exemplary, and for ordinary technicians in this field, other implementation drawings can be derived from the provided drawings without creative work.

[0035] Figure 1 A schematic diagram of a flow chart of a method for distinguishing earthquake responses of ancient buildings according to an embodiment of the present invention;

[0036] Figure 2 A schematic diagram of a half-peak-time image formed at each monitoring point in an embodiment of the present invention;

[0037] Figure 3 Schematic diagram of the state distribution of image groups whose similarity is greater than a set value according to an embodiment of the present invention. DETAILED DESCRIPTION

[0038] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0039] like Figure 1As shown, the present invention provides an ancient building earthquake response discrimination method based on OpenCV and perceptual hash algorithm, using an open source computer vision library (OpenCV) for similarity calculation and using a perceptual hash algorithm (PHash) for response judgment, including the following steps:

[0040] Step 100, taking the location of the ancient building as the center, obtain earthquake data occurring around the ancient building, and obtain monitoring data of the monitoring points on the ancient building when each earthquake occurs, process the image formed by the monitoring data of all monitoring points, determine the image similarity of all monitoring points, and filter out image groups based on image similarity.

[0041] The earthquake data includes the time of earthquake occurrence, the location of earthquake occurrence, the magnitude of earthquake and the focal depth of earthquake.

[0042] In step 100, a three-dimensional coordinate system is constructed using the ancient building to determine the direction of acceleration change monitored by each monitoring point and the time point when each acceleration change is detected.

[0043] The monitoring results of each monitoring point are plotted as a half-peak-time image, the acceleration change direction of each monitoring point is grouped according to the three directions of X, Y, and Z, and the half-peak-time image of each monitoring point is saved in the corresponding X, Y, and Z groups respectively.

[0044] Step 100 uses the open source computer vision library (OpenCV) to perform similarity calculation, which specifically includes four steps: image reading, feature detection, feature matching, and similarity calculation.

[0045] The specific steps for image reading are as follows: import the earthquake data of 18 directions of 6 measuring points of the ancient building from a total of 25 earthquakes of magnitude 3 or above that occurred within a radius of 1,500 kilometers from March 2021 to February 2024 into the OpenCV software. According to the direction of acceleration change, the sensor data of the 6 measuring points are divided into three directions: X, Y, and Z. In order to make the acceleration change direction more clearly expressed, Matlab software is used to draw the half-peak-time image and save it in the three created X, Y, and Z folders.

[0046] The implementation method of using Matlab to draw the monitoring results of each monitoring point into a half-peak-time image is as follows:

[0047] The acceleration value generated by the accelerometer at each monitoring point is obtained, and a peak-to-peak-time image is plotted according to a two-dimensional parameter of time-peak value;

[0048] A half-peak-time image of each monitoring point is obtained based on the peak-to-peak-time image.

[0049] Half-peak value refers to the distance between the peak value and the zero point of the signal waveform in one cycle, which can also be understood as half of the peak-to-peak value. When calculating half-peak value, I need to first find the peak value and the zero point in one cycle, then subtract them and take half to get the half-peak value. The half-peak value-time data is calculated from the acceleration-time data. These data are directly obtained from the earthquake monitoring platform. After obtaining the data, you can directly use Matlab to draw the graph, such as Figure 2 shown.

[0050] The image formed by the monitoring data of all monitoring points is processed, including two steps: feature detection and extraction and feature matching. The specific implementation method of feature detection and extraction is as follows:

[0051] Read the half-peak-time images in the X, Y, and Z groups respectively, and convert the half-peak-time images into grayscale images;

[0052] Perform feature extraction on the grayscale image.

[0053] The grayscale images of the half-peak-time images in the X, Y, and Z groups are grouped in pairs based on the extracted features, and the similarity of the half-peak-time images in the pairwise groups is calculated to screen out images with a similarity greater than a set value.

[0054] The specific implementation method of feature matching is: read three half-peak-time images of the same time period in the three groups of X, Y, and Z at the same time, load them as grayscale images, and store them in variables img1, img2, and img3 respectively.

[0055] The SIFT algorithm is used to detect feature points in the grayscale images of the three half-peak-time images.

[0056] Use the FLANN matcher to match the feature points between each pair of images in img1, img2, and img3, and calculate the similarity between each pair of images.

[0057] In summary, the SIFT algorithm is used to extract the feature points in the three images img1, img2, and img3 and calculate the descriptors to obtain the key points (kp1, kp2, kp3) and descriptors (des1, des2, des3) corresponding to each image.

[0058] Use the FLANN matcher to match the descriptors of the first image and the second image to obtain matches1, match the descriptors of the first image and the third image to obtain matches2, and match the descriptors of the second image and the third image to obtain matches3.

[0059] Each pair of matching images (m, n) is screened, where m represents the best matching descriptor and n represents the second best matching descriptor. If the best matching distance (m.distance) is less than 0.6 times the second best matching distance (0.6*n.distance), it is counted.

[0060] Finally, the counted number of matches is divided by the total number of matches to obtain the similarity value of each pair of matching images.

[0061] The images of the corresponding time series in the three groups of images X, Y, and Z are grouped and compared in pairs according to XY, XZ, and YZ, and the image groups with three grouping similarities greater than 0.499 are selected.

[0062] When performing feature matching, the FLANN matcher returns the best match and the second best match descriptor pair, that is, each matching operation returns the two most similar descriptors. Therefore, by comparing the distance of the best match and the distance of the second best match, high-quality matching points can be screened out. If the distance of the best match is much smaller than the distance of the second best match, it means that the best match is more reliable and is likely to be a good matching result.

[0063] SIFT (Scale Invariant Feature Transform) is an algorithm for detecting key points in an image and generating descriptors around these key points. These descriptors can be used to compare the similarity between images. In the code, the similarity between the two images is derived by calculating the SIFT descriptor and then using FLANN Matcher (a fast feature matching algorithm) to match the feature points between the two images.

[0064] The specific operation of the similarity calculation part is to group the pictures with corresponding serial numbers in the three groups of images X, Y, and Z into groups of two by XY, XZ, and YZ, and calculate the similarity by comparing the ratio of the feature point distances to obtain the similarity metric value, and store the image groups with three calculated similarities greater than 0.499 into a new folder named 1 containing the three folders X, Y, and Z, and proceed to the next step of calculation.

[0065] In summary, when using OpenCV to calculate the similarity in the three directions of X, Y, and Z, this embodiment first uses the cv2.imread() function to load the X, Y, and Z images in order and convert them into grayscale images. Next, the image is subjected to feature extraction. The present invention adopts the SIFT algorithm, which has high recognition accuracy but is time-consuming, to perform feature extraction. The third step is to match the extracted features. This embodiment selects the FLANN algorithm, which can perform large-scale feature matching tasks and is competent for feature matching in complex situations. After the similarity calculation, the model will perform similarity calculations on X, Y, and Z in pairs. The image groups with the same group of X, Y, and Z similarities that meet the requirements of greater than 0.499 are stored in new folders according to the three monitoring directions of X, Y, and Z.

[0066] After the preliminary acceleration response image similarity detection is performed using the OpenCV algorithm, for some earthquake images that meet the similarity requirements but do not actually cause the ancient buildings to respond, it is necessary to set a hash threshold to further determine whether the earthquake caused the ancient buildings to respond.

[0067] Among them, with the ancient building as the center, the collected data of a total of 25 earthquakes of magnitude 3 or above that occurred within a radius of 1,500 kilometers of the ancient building are shown in Table 1 below.

[0068] Table 1. Earthquake dates and responses

[0069]

[0070]

[0071]

[0072] When the above earthquake occurred, the monitoring data corresponding to the six monitoring points on the ancient building (specifically, the acceleration change values ​​of the monitoring points) were obtained, and the results obtained are shown in Table 2 below.

[0073] Table 2. Earthquake dates and image group numbers corresponding to the six survey points

[0074]

[0075]

[0076] Step 200, read the filtered image groups in order, and calculate the hash value difference between each pair of images in the image group through a hash algorithm, compare the hash value difference between each pair of images in the image group with a set threshold, and determine whether each earthquake causes a response in the ancient building based on the comparison result.

[0077] In step 200, the image groups with similarities greater than a set value selected from the X, Y, and Z groups are read in order, and the image groups are converted by a hash algorithm to determine the hash values ​​(hash1, hash2, hash3) of the image groups;

[0078] Calculate the hash value difference (hash12, hash13, hash23) between each pair of images in each image group;

[0079] The hash values ​​of each pair of images in the image group are compared with the set hash value threshold. If the hash values ​​of each pair of images in the image group are less than the set threshold, the image group is determined to be a responsive image group, and the earthquake represented by the image group is a responsive earthquake.

[0080] If the hash values ​​of two images in more than half of the image groups are less than the set threshold, the image group is determined to be a responsive image group, and the earthquake represented by the image group is a responsive earthquake; otherwise, the image group is determined to be an unresponsive image group, and the earthquake represented by the image group is an unresponsive earthquake.

[0081] The purpose of the perceptual hash algorithm is to filter out image groups that meet the similarity requirements but have no response. The specific method of use is to read the image groups in the three folders X, Y, and Z in the folder named 1 in the previous step, and use the hash algorithm to transform the image groups to calculate the hash value of each image, and calculate the hash value difference between the two images. After the calculation, the hash value difference between the two images of the image group is compared with the set hash value threshold. If the calculated hash value difference between the two images of the image group is less than the set hash value threshold, the image group is determined to be a responsive image group, and the earthquake represented by the image group is a responsive earthquake, such as Figure 3 As shown, specifically, it is a half-peak-time image corresponding to the image group that responds to earthquakes.

[0082] After the sensors at each monitoring point are processed through the above steps 100 and 200, the response results of each sensor to the earthquake are obtained, as shown in Table 3 below.

[0083] Table 3. Recognition results

[0084]

[0085]

[0086] According to Table 3 above, for the earthquake that occurred on January 16, 2024, sensor 205 responded, sensor 206 responded, sensor 207 responded, sensor 208 responded, sensor 209 responded, and sensor 210 responded, which means that the ancient building responded to the earthquake and the ancient building itself vibrated.

[0087] For the earthquake that occurred on February 26, 2024, sensor 205 responded, sensor 206 responded, sensor 207 responded, sensor 208 responded, sensor 209 responded, and sensor 210 responded, which means that the ancient building responded to the earthquake and the ancient building itself vibrated.

[0088] For the earthquake that occurred on January 24, 2023, sensor 205 responded, sensor 206 responded, sensor 207 responded, sensor 208 responded, sensor 209 responded, and sensor 210 responded, which means that the ancient building responded to the earthquake and the ancient building itself vibrated.

[0089] That is to say, in this embodiment, when the six groups of monitors all vibrate in response to an earthquake occurring around the ancient building, it means that the six groups of monitors responded to the earthquake, and the ancient building itself vibrated.

[0090] For the earthquake that occurred on March 21, 2024, since three sensors did not respond, specifically, sensor 206 did not respond, sensor 208 did not respond, and sensor 210 did not respond, it means that the ancient building did not respond to the earthquake.

[0091] This implementation uses an open source computer vision library to calculate the acceleration change directions formed by multiple monitoring points and save them in groups. Based on the similarity of the acceleration change half-peak-time images of each monitoring point, it determines whether the monitoring point responds to the earthquake. In order to further improve the accuracy of the response judgment, the hash value of the acceleration change half-peak-time image grouping after similarity screening is calculated, and the hash value is used to further judge the similarity between each pair of images in the image group. Based on the hash value judgment result, the response result of the entire ancient building to the earthquake is analyzed in one step. Therefore, a specific quantitative value is used to determine the response of the ancient building to the earthquake to ensure the uniqueness of the judgment result.

[0092] The above embodiments are only exemplary embodiments of the present application and are not intended to limit the present application. The protection scope of the present application is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to the present application within the essence and protection scope of the present application, and such modifications or equivalent substitutions shall also be deemed to fall within the protection scope of the present application.

Claims

1. A method for distinguishing the seismic response of ancient buildings based on OpenCV and perceptual hashing algorithm. It is characterized in that Use an open source computer vision library to calculate similarity and use a perceptual hashing algorithm to make response judgments, including the following steps: Step 100: With the location of the ancient building as the center, obtain earthquake data occurring around the ancient building, and obtain monitoring data of monitoring points on the ancient building when each earthquake occurs, process images formed by the monitoring data of all monitoring points, determine the image similarity of all monitoring points, and filter out image groups based on the image similarity; Step 200, read the filtered image groups in order, and calculate the hash value difference between each pair of images in the image group through a hash algorithm, compare the hash value difference between each pair of images in the image group with a set threshold, and determine whether each earthquake causes a response in the ancient building based on the comparison result.

2. According to the OpenCV and perceptual hash algorithm method for distinguishing earthquake responses of ancient buildings according to claim 1, It is characterized in that The earthquake data includes the time of earthquake occurrence, the location of earthquake occurrence, the magnitude of earthquake and the focal depth of earthquake.

3. According to the OpenCV and perceptual hash algorithm method for distinguishing earthquake responses of ancient buildings according to claim 1, It is characterized in that In step 100, a three-dimensional coordinate system is constructed using the ancient building to determine the acceleration change direction monitored by each monitoring point and the time point at which the acceleration change is detected each time; The monitoring results of each monitoring point are plotted as a half-peak-time image, the acceleration change direction of each monitoring point is grouped according to the three directions of X, Y, and Z, and the half-peak-time image of each monitoring point is saved in the corresponding X, Y, and Z groups respectively.

4. According to the OpenCV and perceptual hash algorithm method for distinguishing earthquake responses of ancient buildings according to claim 3, It is characterized in that The implementation method of using Matlab to draw the monitoring results of each monitoring point into a half-peak-time image is as follows: The acceleration value generated by the accelerometer at each monitoring point is obtained, and a peak-to-peak-time image is plotted according to a two-dimensional parameter of time-peak value; A half-peak-time image of each monitoring point is obtained based on the peak-to-peak-time image.

5. According to the OpenCV and perceptual hash algorithm method for distinguishing earthquake responses of ancient buildings according to claim 4, It is characterized in that The implementation method of processing the image formed by the monitoring data of all monitoring points is as follows: Read the half-peak-time images in the X, Y, and Z groups respectively, and convert the half-peak-time images into grayscale images; Performing feature extraction on the grayscale image; The grayscale images of the half-peak-time images in the X, Y, and Z groups are grouped in pairs based on the extracted features, and the similarity of the half-peak-time images in the pairwise groups is calculated to screen out images with a similarity greater than a set value.

6. According to claim 5, a method for distinguishing earthquake response of ancient buildings using OpenCV and perceptual hash algorithm, It is characterized in that Simultaneously read the three half-peak-time images of the same time period in the three groups X, Y, and Z, load them as grayscale images, and store them in variables img1, img2, and img3 respectively; The SIFT algorithm is used to detect feature points in the grayscale images of the three half-peak-time images; Use the FLANN matcher to match the feature points between each pair of images in img1, img2, and img3, and calculate the similarity between each pair of images.

7. According to claim 6, a method for distinguishing earthquake response of ancient buildings using OpenCV and perceptual hash algorithm, It is characterized in that The feature points in the three images img1, img2, and img3 are extracted and descriptors are calculated using the SIFT algorithm to obtain the key points (kp1, kp2, kp3) and descriptors (des1, des2, des3) corresponding to each image. Use the FLANN matcher to match the descriptors of the first image and the second image to obtain matches1, match the descriptors of the first image and the third image to obtain matches2, and match the descriptors of the second image and the third image to obtain matches3; For each pair of matching images (m, n), m represents the best matching descriptor and n represents the second best matching descriptor. If the best matching distance (m.distance) is less than 0.6 times the second best matching distance (0.6*n.distance), count them. Finally, the counted number of matches is divided by the total number of matches to obtain the similarity value of each pair of matching images.

8. According to the OpenCV and perceptual hash algorithm method for distinguishing earthquake responses of ancient buildings according to claim 7, It is characterized in that The images of the corresponding time series in the three groups of images X, Y, and Z are grouped and compared in pairs according to XY, XZ, and YZ, and the image groups with three grouping similarities greater than 0.499 are selected.

9. According to claim 8, a method for distinguishing earthquake response of ancient buildings using OpenCV and perceptual hash algorithm, It is characterized in that In step 200, the image groups with similarities greater than a set value selected from the X, Y, and Z groups are read in order, and the image groups are converted by a hash algorithm to determine the hash values ​​(hash1, hash2, hash3) of the image groups; Calculate the hash value difference (hash12, hash13, hash23) between each pair of images in each image group; The hash values ​​of each pair of images in the image group are compared with the set hash value threshold. If the hash values ​​of each pair of images in the image group are less than the set threshold, the image group is determined to be a responsive image group, and the earthquake represented by the image group is a responsive earthquake.

10. According to claim 9, a method for distinguishing earthquake response of ancient buildings using OpenCV and perceptual hash algorithm, It is characterized in that If the hash values ​​of two images in more than half of the image groups are less than the set threshold, the image group is determined to be a responsive image group, and the earthquake represented by the image group is a responsive earthquake; otherwise, the image group is determined to be an unresponsive image group, and the earthquake represented by the image group is an unresponsive earthquake.

Citation Information

Patent Citations

  • Automatic registration of FPC images based on SURF features and hash perception algorithm

    CN109271996A

  • Image-text cross-modal retrieval based on multi-layer semantic deep Hash algorithm

    CN110110122A

  • Audio-video image-text recognition system

    CN110674337A

  • Monitoring data processing method for earthquake prediction

    CN111190219A

  • Management system for gaming chip, and storage box

    KR102669328B1