TWI830553B - Method for detecting wear of vehicle windows and related devices - Google Patents

Method for detecting wear of vehicle windows and related devices Download PDF

Info

Publication number
TWI830553B
TWI830553B TW111150036A TW111150036A TWI830553B TW I830553 B TWI830553 B TW I830553B TW 111150036 A TW111150036 A TW 111150036A TW 111150036 A TW111150036 A TW 111150036A TW I830553 B TWI830553 B TW I830553B
Authority
TW
Taiwan
Prior art keywords
primitive
image
area
value
boundary
Prior art date
Application number
TW111150036A
Other languages
Chinese (zh)
Other versions
TW202427369A (en
Inventor
蔡仲智
王于青
周致傑
黃子魁
Original Assignee
荷蘭商荷蘭移動驅動器公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 荷蘭商荷蘭移動驅動器公司 filed Critical 荷蘭商荷蘭移動驅動器公司
Priority to TW111150036A priority Critical patent/TWI830553B/en
Application granted granted Critical
Publication of TWI830553B publication Critical patent/TWI830553B/en
Publication of TW202427369A publication Critical patent/TW202427369A/en

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

The present application provides a method for detecting wear of vehicle windows and related devices. The method includes: obtaining an original image of window glass of a vehicle; establishing an image coordinate system based on the original image, obtaining coordinates of each pixel in the original image in the image coordinate system; converting the original image to a gray image; performing an image enhancement on the gray image to obtain an enhanced image; obtaining a first image area whose pixel values are greater than or equal to a first preset value from the enhanced image; based on the first image area, determining a worn area of the window glass. The method can improve the effectiveness of window wear detection.

Description

車窗磨損檢測方法及相關設備 Vehicle window wear detection methods and related equipment

本發明涉及圖像處理技術領域,尤其涉及一種車窗磨損檢測方法及相關設備。 The present invention relates to the field of image processing technology, and in particular to a vehicle window wear detection method and related equipment.

車輛在長期行駛的過程中,車上的車窗玻璃在經歷雨刮器刮刷、自然耗損後,會存在破損或者刮傷的狀況。若車窗玻璃長期存在磨損,會影響駕駛時對周圍環境的辨識度,從而影響行車安全。習知對車輛的維護往往側重於對輪胎的檢修以及維護,疏忽對車窗玻璃的護理,造成長期磨損後不得不更換玻璃,導致浪費。 When a vehicle is driven for a long time, the window glass on the vehicle will be damaged or scratched after being wiped by the wiper and natural wear and tear. If the window glass is worn for a long time, it will affect the recognition of the surrounding environment while driving, thus affecting driving safety. It is common knowledge that vehicle maintenance often focuses on the repair and maintenance of tires and neglects the care of window glass, resulting in the glass having to be replaced after long-term wear and tear, resulting in waste.

鑒於以上內容,有必要提供一種車窗磨損檢測方法及相關設備,能夠解決車窗長期磨損而影響行車安全的技術問題。 In view of the above, it is necessary to provide a vehicle window wear detection method and related equipment that can solve the technical problem of long-term wear and tear of vehicle windows that affects driving safety.

本申請提供一種車窗磨損檢測方法,所述方法包括:獲取車窗玻璃的原始圖像;基於所述原始圖像建立圖像座標系,獲取所述原始圖像中每個圖元點在所述圖像座標系中的座標;所述原始圖像進行灰度化處理,得到灰度圖像;對所述灰度圖像進行圖像強化,得到強化圖像;從所述強化圖像中獲取圖元值大於或等於第一預設值的第一圖像區域;基於所述第一圖像區域,確定所述車窗玻璃的磨損區域。 This application provides a vehicle window wear detection method. The method includes: obtaining an original image of the vehicle window glass; establishing an image coordinate system based on the original image, and obtaining the location of each element point in the original image. coordinates in the image coordinate system; perform grayscale processing on the original image to obtain a grayscale image; perform image enhancement on the grayscale image to obtain an enhanced image; from the enhanced image Obtain a first image area with a primitive value greater than or equal to a first preset value; and determine the wear area of the window glass based on the first image area.

在一些可選的實施方式中,所述對所述灰度圖像進行圖像強化,包 括:計算所述灰度圖像的目標圖元值;將所述灰度圖像中大於所述目標圖元值且小於所述第一預設值的圖元值修改為所述第一預設值,將小於所述目標圖元值且大於第二預設值的圖元值修改為所述第二預設值,所述第一預設值大於所述第二預設值。 In some optional implementations, image enhancement of the grayscale image includes The method includes: calculating the target primitive value of the grayscale image; modifying the primitive value in the grayscale image that is greater than the target primitive value and smaller than the first preset value to the first preset value. Set a value, and modify the primitive value that is smaller than the target primitive value and larger than the second preset value to the second preset value, and the first preset value is larger than the second preset value.

在一些可選的實施方式中,所述計算所述灰度圖像的目標圖元值,包括:計算所述灰度圖像中圖元點對應的最大圖元值,依據所述最大圖元值的第一預設百分比確定所述目標圖元值。 In some optional implementations, calculating the target primitive value of the grayscale image includes: calculating the maximum primitive value corresponding to the primitive point in the grayscale image. According to the maximum primitive value A first preset percentage of the value determines the target primitive value.

在一些可選的實施方式中,所述基於所述第一圖像區域,確定所述車窗玻璃的磨損區域,包括:計算所述第一圖像區域中每一列圖元點的圖元值的累加值;將所述第一圖像區域中具有最大累加值的一列圖元點作為所述第一圖像區域的第一中線;基於所述第一中線確定所述磨損區域的第一邊界與第二邊界;根據所述第一邊界與所述第二邊界確定所述磨損區域的寬度,根據所述第一中線上位於所述第一圖像區域中的圖元點的數量確定所述磨損區域的長度。 In some optional implementations, determining the wear area of the window glass based on the first image area includes: calculating the primitive value of each column of primitive points in the first image area. The accumulated value of A boundary and a second boundary; determining the width of the wear area based on the first boundary and the second boundary, and determining the width of the wear area based on the number of primitive points located on the first center line in the first image area The length of the wear zone.

在一些可選的實施方式中,所述第一中線將所述第一圖像區域劃分為第一區域與第二區域,所述基於所述第一中線確定所述磨損區域的第一邊界與第二邊界,包括:在所述第一區域中獲取圖元值累加值大於所述第一中線圖元值累加值的第二預設百分比的至少一列圖元點,並將其中距離所述第一中線最遠的一列圖元點作為所述第一邊界;在所述第二區域中獲取圖元值累加值大於所述第一中線圖元值累加值的第二預設百分比的至少一列圖元點,並將其中距離所述第一中線最遠的一列圖元點作為所述第二邊界。 In some optional implementations, the first center line divides the first image area into a first area and a second area, and the first step of determining the wear area based on the first center line The boundary and the second boundary include: obtaining at least one column of primitive points in the first area whose cumulative primitive value is greater than a second preset percentage of the first centerline cumulative primitive value, and adding the distance between them The farthest column of primitive points of the first center line is used as the first boundary; in the second area, a second preset with a cumulative value of primitive values greater than the cumulative value of the first midline primitive value is obtained. percentage of at least one column of primitive points, and the column of primitive points farthest from the first centerline is used as the second boundary.

在一些可選的實施方式中,所述基於所述第一圖像區域,確定所述車窗玻璃的磨損區域,包括:計算所述第一圖像區域中每一行圖元點的圖元值的累加值;將所述第一圖像區域中具有最大累加值的一行圖元點作為所述第一圖像區域的第二中線;基於所述第二中線確定所述磨損區域的第三邊界與第四邊界;根據所述第三邊界與所述第四邊界確定所述磨損區域的寬度,根據所述 第二中線上位於所述第一圖像區域中的圖元點的數量確定所述磨損區域的長度。 In some optional implementations, determining the wear area of the window glass based on the first image area includes: calculating the primitive value of each row of primitive points in the first image area. The accumulated value of Three boundaries and a fourth boundary; determine the width of the wear area according to the third boundary and the fourth boundary, according to the The number of primitive points located in the first image area on the second center line determines the length of the wear area.

在一些可選的實施方式中,所述第二中線將所述第一圖像區域劃分為第三區域與第四區域,所述基於所述第二中線確定所述磨損區域的第三邊界與第四邊界,包括:在所述第三區域中獲取圖元值累加值大於所述第二中線圖元值累加值的第二預設百分比的至少一列圖元點,並將其中距離所述第二中線最遠的一行圖元點作為所述第三邊界;在所述第四區域中獲取圖元值累加值大於所述第二中線圖元值累加值的第二預設百分比的至少一列圖元點,並將其中距離所述第二中線最遠的一行圖元點作為所述第四邊界。 In some optional implementations, the second center line divides the first image area into a third area and a fourth area, and the third area of the wear area is determined based on the second center line. The boundary and the fourth boundary include: obtaining at least one column of primitive points in the third area whose cumulative primitive value is greater than a second preset percentage of the second centerline cumulative primitive value, and adding the distance between them The farthest row of primitive points of the second midline is used as the third boundary; in the fourth area, a second preset is obtained in which the cumulative value of primitive values is greater than the cumulative value of the second midline primitive value. percentage of at least one column of primitive points, and the row of primitive points farthest from the second center line is used as the fourth boundary.

在一些可選的實施方式中,所述從所述強化圖像中獲取圖元值大於或等於所述第一預設值的第一圖像區域,包括:對所述強化圖像進行二值化處理,獲取二值化圖像;從所述二值化圖像中獲取所述第一圖像區域。 In some optional implementations, obtaining a first image region with a primitive value greater than or equal to the first preset value from the enhanced image includes: performing a binary process on the enhanced image. processing to obtain a binarized image; and obtain the first image area from the binarized image.

本申請還提供一種電子設備,所述電子設備包括處理器與儲存器,所述處理器用於執行所述儲存器中存儲的電腦程式時實現所述的車窗磨損檢測方法。 This application also provides an electronic device. The electronic device includes a processor and a storage. The processor is configured to implement the vehicle window wear detection method when executing a computer program stored in the storage.

本申請還提供一種電腦可讀存儲介質,所述電腦可讀存儲介質上存儲有電腦程式,所述電腦程式被處理器執行時實現所述的車窗磨損檢測方法。 The application also provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the vehicle window wear detection method is implemented.

本申請提供的車窗磨損檢測方法獲取車窗玻璃的原始圖像;基於所述原始圖像建立圖像座標系,獲取所述原始圖像中每個圖元點在所述圖像座標系中的座標;對所述原始圖像進行灰度化處理,得到灰度圖像;對所述灰度圖像進行圖像強化,得到強化圖像;從所述強化圖像中獲取圖元值大於或等於第一預設值的第一圖像區域;基於所述第一圖像區域,確定所述車窗玻璃的磨損區域。本申請提供的車窗磨損檢測方法能夠提高車窗磨損的有效性。 The vehicle window wear detection method provided by this application obtains the original image of the vehicle window glass; establishes an image coordinate system based on the original image, and obtains the position of each element point in the original image in the image coordinate system coordinates; perform grayscale processing on the original image to obtain a grayscale image; perform image enhancement on the grayscale image to obtain an enhanced image; obtain from the enhanced image a primitive value greater than Or a first image area equal to a first preset value; based on the first image area, the wear area of the window glass is determined. The vehicle window wear detection method provided by this application can improve the effectiveness of vehicle window wear.

1:電子設備 1: Electronic equipment

11:儲存器 11:Storage

12:處理器 12: Processor

13:通信匯流排 13: Communication bus

S21~S26:步驟 S21~S26: Steps

A、B、C、D:圖像座標系上的點 A, B, C, D: points on the image coordinate system

圖1係本申請實施例提供的電子設備的結構示意圖。 FIG. 1 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.

圖2係本申請實施例提供的車窗磨損檢測方法的流程圖。 Figure 2 is a flow chart of a vehicle window wear detection method provided by an embodiment of the present application.

圖3係從第一圖像區域中檢測磨損區域的第一中線、第一邊界以及第二邊界的示意圖。 Figure 3 is a schematic diagram of detecting the first center line, the first boundary and the second boundary of the wear area from the first image area.

圖4係從第一圖像區域中檢測磨損區域的第二中線、第三邊界以及第四邊界的示意圖。 FIG. 4 is a schematic diagram of detecting the second center line, the third boundary and the fourth boundary of the wear area from the first image area.

為了便於理解,示例性的給出了部分與本申請實施例相關概念的說明以供參考。 To facilitate understanding, some descriptions of concepts related to the embodiments of the present application are exemplarily provided for reference.

需要說明的係,本申請中“至少一個”係指一個或者複數個,“複數個”係指兩個或多於兩個。“與/或”,描述關聯物件的關聯關係,表示可以存在三種關係,例如,A與/或B可以表示:單獨存在A,同時存在A與B,單獨存在B的情況,其中A,B可為單數或者複數。本申請的說明書與請求項書及附圖中的術語“第一”、“第二”、“第三”、“第四”等(如果存在)係用於區別類似的物件,而不係用於描述特定的順序或先後次序。 It should be noted that "at least one" in this application refers to one or a plurality, and "plural" refers to two or more than two. "And/or" describes the relationship between related objects, indicating that there can be three relationships. For example, A and/or B can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A and B can Be singular or plural. The terms "first", "second", "third", "fourth", etc. (if present) in the description, claim and drawings of this application are used to distinguish similar objects and are not used to refer to them. Used to describe a specific order or sequence.

為了更好地理解本申請實施例提供的車窗磨損檢測方法及相關設備,下面首先對本申請車窗磨損檢測方法的應用場景進行描述。 In order to better understand the vehicle window wear detection method and related equipment provided by the embodiments of the present application, the application scenarios of the vehicle window wear detection method of the present application are first described below.

圖1為本申請實施例提供的車窗磨損檢測方法的應用場景示意圖。本申請實施例提供的車窗磨損檢測方法應用於電子設備。參閱圖1所示,所述電子設備1包括,但不限於,儲存器11與至少一個處理器12。儲存器11與處理器12之間可以藉由通信匯流排13連接,也可以直接連接。 Figure 1 is a schematic diagram of the application scenario of the vehicle window wear detection method provided by the embodiment of the present application. The vehicle window wear detection method provided by the embodiment of the present application is applied to electronic equipment. Referring to FIG. 1 , the electronic device 1 includes, but is not limited to, a memory 11 and at least one processor 12 . The storage 11 and the processor 12 may be connected through the communication bus 13 or directly connected.

所述電子設備1可以是電腦、手機、平板電腦、個人數位助理(Personal Digital Assistant,PDA)等設備。本領域技術人員可以理解,所述示意圖1僅僅是電子設備1的示例,並不構成對電子設備1的限定,可以包括比圖示更多或更少的部件,或者組合某些部件,或者不同的部件,例如所述電子設備1還可以包括輸入輸出設備、網路接入設備等。 The electronic device 1 may be a computer, a mobile phone, a tablet computer, a personal digital assistant (Personal Digital Assistant, PDA) and other devices. Those skilled in the art can understand that the schematic diagram 1 is only an example of the electronic device 1 and does not constitute a limitation on the electronic device 1. It may include more or fewer components than shown in the figure, or some components may be combined or different. components, for example, the electronic device 1 may also include input and output devices, network access devices, etc.

車輛在長期行駛的過程中,車上的車窗玻璃在經歷雨刮器刮刷、自然耗損後,會存在破損或者刮傷的狀況。若車窗玻璃長期存在磨損,會影響駕駛時對周圍環境的辨識度,從而影響行車安全。習知對車輛的維護往往側重於對輪胎的檢修以及維護,疏忽對車窗玻璃的護理,造成長期磨損後不得不更換玻璃,導致浪費。 When a vehicle is driven for a long time, the window glass on the vehicle will be damaged or scratched after being wiped by the wiper and natural wear and tear. If the window glass is worn for a long time, it will affect the recognition of the surrounding environment while driving, thus affecting driving safety. It is common knowledge that vehicle maintenance often focuses on the repair and maintenance of tires and neglects the care of window glass, resulting in the glass having to be replaced after long-term wear and tear, resulting in waste.

為了解決上述技術問題,本申請實施例提供一種車窗磨損檢測方法。圖2是本申請實施例提供的車窗磨損檢測方法的流程圖。所述車窗磨損檢測方法應用在電子設備中。根據不同的需求,該流程圖中步驟的順序可以改變,某些步驟可以省略。 In order to solve the above technical problems, embodiments of the present application provide a vehicle window wear detection method. Figure 2 is a flow chart of a vehicle window wear detection method provided by an embodiment of the present application. The vehicle window wear detection method is applied in electronic equipment. Depending on different needs, the order of steps in this flowchart can be changed and some steps can be omitted.

步驟S21為獲取車窗玻璃的原始圖像。 Step S21 is to obtain the original image of the vehicle window glass.

車窗磨損檢測採用本申請實施例提供的車窗磨損檢測方法,可以檢測車輛的前窗玻璃、後窗玻璃或側窗玻璃的磨損區域。相應地,電子設備獲取車輛的前窗玻璃、後窗玻璃或側窗玻璃的原始圖像,電子設備可以是帶有攝像功能的設備。 The window wear detection method provided by the embodiment of the present application can be used to detect the wear area of the front window glass, rear window glass or side window glass of the vehicle. Correspondingly, the electronic device acquires the original image of the vehicle's front window glass, rear window glass or side window glass, and the electronic device may be a device with a camera function.

以前窗玻璃為例,在前窗玻璃的外側放置一張能完全遮擋前窗玻璃的遮擋物,所述遮擋物包括但不限於白紙。在前窗玻璃的內側採用帶攝像功能的設備拍攝前窗玻璃,將拍攝的圖像作為車窗玻璃的原始圖像。其中,前窗玻璃的內側是位於車內的一側,前窗玻璃的外側是位於車輛外表面的一側。 Taking the front window glass as an example, a shield that can completely block the front window glass is placed outside the front window glass. The shield includes but is not limited to white paper. A device with a camera function is used on the inside of the front window glass to capture the front window glass, and the captured image is used as the original image of the car window glass. Among them, the inner side of the front window glass is the side located inside the vehicle, and the outer side of the front window glass is the side located on the outer surface of the vehicle.

由於前窗玻璃的面積比較大,可以將拍攝的原始圖像劃分為多個原始圖像分別進行處理,對每個劃分的原始圖像進行標號,以便在組合所有帶標號的原始圖像時,能還原前窗玻璃實際的拍攝區域。 Since the area of the front window glass is relatively large, the original image taken can be divided into multiple original images for processing respectively, and each divided original image is labeled, so that when combining all labeled original images, The actual shooting area of the front window glass can be restored.

步驟S22為基於所述原始圖像建立圖像座標系,獲取所述原始圖像中每個圖元點在所述圖像座標系中的座標。 Step S22 is to establish an image coordinate system based on the original image, and obtain the coordinates of each primitive point in the original image in the image coordinate system.

電子設備根據步驟S21獲取的原始圖像,對所述原始圖像建立圖像座標系。所述原始圖像有四個頂角,可以以原始圖像的任意一個頂角作為所述座標系的原點建立圖像座標系,得到原始圖像中每個圖元點在圖像座標系中的 座標。 The electronic device establishes an image coordinate system for the original image based on the original image obtained in step S21. The original image has four vertices. An image coordinate system can be established using any vertex corner of the original image as the origin of the coordinate system, and the position of each primitive point in the original image in the image coordinate system can be obtained. middle coordinates.

本申請實施例中,原始圖像是彩色圖像。 In the embodiment of this application, the original image is a color image.

步驟S23為對所述原始圖像進行灰度化處理,得到灰度圖像。 Step S23 is to perform grayscale processing on the original image to obtain a grayscale image.

灰度化處理就是將一幅色彩圖像轉化為灰度圖像的過程。在彩色圖像中,圖元點的圖元值包括紅色(R)、綠色(G)、藍色(B)三個分量,圖元點根據不同的圖元值顯示不同的顏色,灰度化就是使彩色圖像的圖元點的R,G,B分量相等的過程。在拍攝原始圖像的過程中,由於光照或者其他影響因素,原始圖像中可能會存在灰度以外的其他顏色,為了避免計算誤差,對原始圖像進行灰度化處理。灰度處理過的圖像,其各圖元點的圖元值為一個數值。圖元值對應所述圖元點的亮度,圖元值越高,代表亮度越高。 Grayscale processing is the process of converting a color image into a grayscale image. In a color image, the primitive value of a primitive point includes three components: red (R), green (G), and blue (B). The primitive point displays different colors according to different primitive values. Grayscale It is the process of making the R, G, and B components of the primitive points of the color image equal. During the process of shooting the original image, due to lighting or other influencing factors, there may be colors other than grayscale in the original image. In order to avoid calculation errors, the original image is grayscaled. In a grayscale processed image, the primitive value of each primitive point is a numerical value. The primitive value corresponds to the brightness of the primitive point. The higher the primitive value, the higher the brightness.

步驟S24為對所述灰度圖像進行圖像強化,得到強化圖像。 Step S24 is to perform image enhancement on the grayscale image to obtain an enhanced image.

在得到灰度圖像之後,由於不同圖元點對應的區域產生的差異不明顯,對灰度圖像進行圖像強化,使得灰度圖像中的明暗分區明顯。 After obtaining the grayscale image, since the differences in the areas corresponding to different primitive points are not obvious, the grayscale image is image enhanced to make the light and dark divisions in the grayscale image obvious.

在本申請的一些實施例中,計算所述灰度圖像的目標圖元值;將所述灰度圖像中大於所述目標圖元值且小於所述第一預設值的圖元值修改為所述第一預設值,將小於或等於所述目標圖元值且大於第二預設值的圖元值修改為所述第二預設值,所述第一預設值大於所述第二預設值。 In some embodiments of the present application, the target primitive value of the grayscale image is calculated; the primitive values in the grayscale image that are greater than the target primitive value and smaller than the first preset value are Modify to the first preset value, modify the primitive value that is less than or equal to the target primitive value and greater than the second preset value to the second preset value, and the first preset value is greater than the the second default value.

所述計算所述灰度圖像的目標圖元值,包括:計算所述灰度圖像中圖元點對應的最大圖元值,依據所述最大圖元值的第一預設百分比確定為所述目標圖元值。具體的,所述第一預設百分比可以是95%,將所述最大圖元值的95%作為所述目標圖元值。例如,獲取到的最大圖元值為100,則目標圖元值為95。 The calculation of the target primitive value of the grayscale image includes: calculating the maximum primitive value corresponding to the primitive point in the grayscale image, and determining the first preset percentage of the maximum primitive value as The target primitive value. Specifically, the first preset percentage may be 95%, and 95% of the maximum graphic element value is used as the target graphic element value. For example, if the maximum primitive value obtained is 100, the target primitive value is 95.

示例性地,進行灰度化處理的灰度圖像包含較亮區域與較暗區域,對於較亮區域則提高亮度,對於較暗區域則降低暗度,使得較亮區域與較暗區域的差異明顯。假設第一預設值為200,第二預設值為40,獲取到的最大圖元值為100,目標圖元值為95,當在灰度圖像中識別到圖元點的圖元值為98時, 由於圖元值為98大於目標圖元值95且小於第一預設值200,將圖元點對應的98的圖元值修改為200,當在灰度圖像中識別到圖元點的圖元值為90時,由於圖元值為90小於目標圖元值95且大於第二預設值40,將圖元點對應的90的圖元值修改為40,以使較亮區域與較暗區域的差異明顯,獲取較亮區域與較暗區域存在明顯差異的強化圖像。在灰度圖像中識別到圖元點的圖元值為小於40時,可以將小於40的圖元值修改為40,也可以保留當前小於40的圖元值。 For example, the grayscale image that undergoes grayscale processing contains lighter areas and darker areas. For the brighter areas, the brightness is increased, and for the darker areas, the darkness is reduced, so that the difference between the brighter areas and the darker areas is Obvious. Assume that the first preset value is 200, the second preset value is 40, the maximum obtained primitive value is 100, and the target primitive value is 95. When the primitive value of the primitive point is identified in the grayscale image is 98 hours, Since the primitive value of 98 is greater than the target primitive value of 95 and smaller than the first preset value of 200, the primitive value of 98 corresponding to the primitive point is modified to 200. When the primitive point is identified in the grayscale image, When the primitive value is 90, since the primitive value of 90 is smaller than the target primitive value of 95 and greater than the second preset value of 40, the primitive value of 90 corresponding to the primitive point is modified to 40 to make the brighter area and the darker area The difference in the area is obvious, and the enhanced image with obvious difference between the brighter area and the darker area is obtained. When it is recognized that the primitive value of a primitive point is less than 40 in the grayscale image, the primitive value less than 40 can be modified to 40, or the current primitive value less than 40 can be retained.

示例性地,進行灰度化處理的灰度圖像包含較亮區域與較暗區域,對於較亮區域則提高亮度,對於較暗區域則降低暗度,使得較亮區域與較暗區域的差異明顯。假設第一預設值為200,第二預設值為40,獲取到的最大圖元值為220,目標圖元值為209。當在灰度圖像中識別到圖元點的圖元值為210時,由於圖元值為210大於目標圖元值209但未小於第一預設值200,可將圖元點對應的210的圖元值修改為200,或保留為210。當在灰度圖像中識別到圖元點的圖元值為205時,由於圖元值為205小於目標圖元值209且大於第二預設值40,將圖元點對應的205的圖元值修改為40,以使較亮區域與較暗區域的差異明顯,獲取較亮區域與較暗區域存在明顯差異的強化圖像。在灰度圖像中識別到圖元點的圖元值為小於40時,可以將小於40的圖元值修改為40,也可以保留當前小於40的圖元值。 For example, the grayscale image that undergoes grayscale processing contains lighter areas and darker areas. For the brighter areas, the brightness is increased, and for the darker areas, the darkness is reduced, so that the difference between the brighter areas and the darker areas is Obvious. Assume that the first preset value is 200, the second preset value is 40, the maximum obtained primitive value is 220, and the target primitive value is 209. When the primitive value of the primitive point is identified as 210 in the grayscale image, since the primitive value of 210 is greater than the target primitive value of 209 but not smaller than the first preset value of 200, the primitive point corresponding to 210 can be The primitive value is modified to 200, or left at 210. When the primitive value of the primitive point is identified as 205 in the grayscale image, since the primitive value of 205 is smaller than the target primitive value of 209 and larger than the second preset value of 40, the image corresponding to the primitive point of 205 is The element value is modified to 40 to make the difference between the brighter area and the darker area obvious, and obtain an enhanced image with obvious differences between the brighter area and the darker area. When it is recognized that the primitive value of a primitive point is less than 40 in the grayscale image, the primitive value less than 40 can be modified to 40, or the current primitive value less than 40 can be retained.

示例性地,進行灰度化處理的灰度圖像包含較亮區域與較暗區域,對於較亮區域則提高亮度,對於較暗區域則降低暗度,使得較亮區域與較暗區域的差異明顯。假設第一預設值為200,第二預設值為40,獲取到的最大圖元值為30,目標圖元值為29。當在灰度圖像中識別到圖元點的圖元值為35時,由於圖元值為35大於目標圖元值29且小於第一預設值200,將圖元點對應的35的圖元值修改為200。當在灰度圖像中識別到圖元點的圖元值為20時,由於圖元值為20小於目標圖元值29但未大於第二預設值40,可將圖元點對應的20的圖元值修改為40或保留為20,以使較亮區域與較暗區域的差異明顯,獲取較亮區域與較暗區域存在明顯差異的強化圖像。 For example, the grayscale image that undergoes grayscale processing contains lighter areas and darker areas. For the brighter areas, the brightness is increased, and for the darker areas, the darkness is reduced, so that the difference between the brighter areas and the darker areas is Obvious. Assume that the first preset value is 200, the second preset value is 40, the maximum obtained primitive value is 30, and the target primitive value is 29. When the primitive value of the primitive point is identified as 35 in the grayscale image, since the primitive value of 35 is greater than the target primitive value of 29 and smaller than the first preset value of 200, the image corresponding to the primitive point of 35 is The yuan value is modified to 200. When the primitive value of the primitive point is identified as 20 in the grayscale image, since the primitive value of 20 is smaller than the target primitive value of 29 but not greater than the second preset value of 40, the primitive point corresponding to 20 can be Modify the primitive value to 40 or leave it at 20 to make the difference between the brighter area and the darker area obvious, and obtain an enhanced image with obvious differences between the brighter area and the darker area.

步驟S25為從所述強化圖像中獲取圖元值大於或等於第一預設值的第一圖像區域。 Step S25 is to obtain a first image area whose primitive value is greater than or equal to a first preset value from the enhanced image.

在本申請的一些實施例中,在獲取強化圖像之後,對強化圖像進行二值化處理,獲取二值化圖像,二值化圖像中包含兩個圖元值,利用這兩個圖元值將二值化圖像劃分為第一圖像區域以及第二圖像區域,即較亮區域與較暗區域。假設第一預設值為200,將大於或等於200的圖元值所在的區域作為第一圖像區域,即較亮區域,將圖元值小於200所在的區域作為第二圖像區域,即較暗區域。 In some embodiments of the present application, after obtaining the enhanced image, the enhanced image is binarized to obtain a binary image. The binary image contains two primitive values. Using these two The primitive value divides the binary image into a first image area and a second image area, that is, a brighter area and a darker area. Assuming that the first preset value is 200, the area where the primitive value is greater than or equal to 200 is regarded as the first image area, that is, the brighter area, and the area where the primitive value is less than 200 is regarded as the second image area, that is, Darker areas.

步驟S26為基於所述第一圖像區域,確定所述車窗玻璃的磨損區域。 Step S26 is to determine the wear area of the window glass based on the first image area.

基於對原始圖像建立的圖像座標系,計算二值化圖像中的第一圖像區域的座標,即,較亮區域的座標,根據所述第一圖像區域的座標,確定所述車窗的磨損區域。 Based on the image coordinate system established for the original image, calculate the coordinates of the first image area in the binary image, that is, the coordinates of the brighter area, and determine the coordinates of the first image area based on the coordinates of the first image area. Worn areas of car windows.

圖3是從第一圖像區域中檢測磨損區域的第一中線、第一邊界以及第二邊界的示意圖。 FIG. 3 is a schematic diagram of detecting the first center line, the first boundary and the second boundary of the wear area from the first image area.

在本申請的一些實施例中,基於所述第一圖像區域,確定所述車窗玻璃的磨損區域,即,所述第一圖像區域為較亮區域,根據較亮區域,確定車窗玻璃的磨損區域,包括:計算所述第一圖像區域中每一列圖元點的圖元值的累加值;將所述第一圖像區域中具有最大累加值的一列圖元點作為所述第一圖像區域的第一中線;基於所述第一中線確定所述磨損區域的第一邊界與第二邊界;根據所述第一邊界與所述第二邊界確定所述磨損區域的寬度,根據所述第一中線上位於所述第一圖像區域中的圖元點的數量確定所述磨損區域的長度。 In some embodiments of the present application, the wear area of the vehicle window glass is determined based on the first image area, that is, the first image area is a brighter area, and the vehicle window is determined based on the brighter area. The wear area of glass includes: calculating the cumulative value of the primitive values of each column of primitive points in the first image area; taking a column of primitive points with the largest cumulative value in the first image area as the a first center line of the first image area; determining a first boundary and a second boundary of the wear area based on the first center line; determining a first boundary and a second boundary of the wear area based on the first boundary and the second boundary Width, the length of the wear area is determined based on the number of primitive points located in the first image area on the first center line.

示例性地,計算所述第一圖像區域中每一列圖元點的圖元值的累加 值,將最大累加值所在的列作為第一圖像區域的第一中線,以第一中線為起點遍歷所述第一圖像區域,確定磨損區域的第一邊界與第二邊界,根據第一邊界與第二邊界確定磨損邊界的寬度,根據第一中線上圖元點的數量確定磨損區域的長度。 Exemplarily, calculate the accumulation of primitive values of each column of primitive points in the first image area value, take the column with the maximum accumulated value as the first center line of the first image area, traverse the first image area with the first center line as the starting point, and determine the first boundary and the second boundary of the wear area, according to The first boundary and the second boundary determine the width of the wear boundary, and the length of the wear area is determined according to the number of primitive points on the first center line.

在本申請的一個實施例中,所述第一中線將所述第一圖像區域劃分為第一區域與第二區域,所述基於所述第一中線確定所述磨損區域的第一邊界與第二邊界,包括:在所述第一區域中獲取圖元值累加值大於所述第一中線圖元值累加值的第二預設百分比的至少一列圖元點,並將其中距離所述第一中線最遠的一列圖元點作為所述第一邊界;在所述第二區域中獲取圖元值累加值大於所述第一中線圖元值累加值的第二預設百分比的至少一列圖元點,並將其中距離所述第一中線最遠的一列圖元點作為所述第二邊界。 In one embodiment of the present application, the first center line divides the first image area into a first area and a second area, and the first step of determining the wear area based on the first center line The boundary and the second boundary include: obtaining at least one column of primitive points in the first area whose cumulative primitive value is greater than a second preset percentage of the first centerline cumulative primitive value, and adding the distance between them The farthest column of primitive points of the first center line is used as the first boundary; in the second area, a second preset with a cumulative value of primitive values greater than the cumulative value of the first midline primitive value is obtained. percentage of at least one column of primitive points, and the column of primitive points farthest from the first centerline is used as the second boundary.

示例性地,在所述二值化圖像中,會存在許多較亮區域的點,本申請所述的較亮區域是大於預設範圍的區域,可以忽略較小的點形成的較亮區域。 For example, in the binary image, there will be many points in the brighter area. The brighter area described in this application is an area larger than the preset range. The brighter area formed by smaller points can be ignored. .

所述第一中線為與Y軸平行的線,將所述第一圖像區域劃分為第一區域與第二區域。針對第一區域,基於所述第一圖像區域每一列的圖元值,獲取圖元值累加值大於第一中線圖元值累加值的第二預設百分比的至少一列圖元點,將其中距離第一中線最遠的一列圖元點作為第一邊界,其中,所述第二預設百分比可以是80%,假設第一中線圖元值累加值(最大累加值)為90,則,獲取圖元值累加值大於第一中線圖元值累加值的第二預設百分比的至少一列圖元點,可以包括,76,…,80等,因此,第一邊界可以是圖元值累加值76所在的列,同樣的,針對第二區域,將圖元累加值為76所在的列作為第二邊界。如圖3所示,獲取具有最大累加值(例如,圖元累加值為90)的列的兩端圖元點,分別設置為點A與點B,且根據經過點A、點B且與X軸平行的直線 分別與第一邊界、第二邊界相交,構建成一個矩形區域作為磨損區域。第一邊界與第二邊界之間的距離為磨損區域的寬度值,第一中線上圖元點的數量作為磨損區域的長度值。 The first center line is a line parallel to the Y-axis, dividing the first image area into a first area and a second area. For the first area, based on the primitive value of each column of the first image area, obtain at least one column of primitive points whose accumulated value of the primitive value is greater than a second preset percentage of the accumulated value of the first centerline primitive value, and The column of primitive points farthest from the first centerline is used as the first boundary, wherein the second preset percentage may be 80%, assuming that the accumulated value (maximum accumulated value) of the first centerline primitive value is 90, Then, obtain at least one column of primitive points whose cumulative primitive value is greater than the second preset percentage of the first centerline primitive value cumulative value, which may include 76,...,80, etc. Therefore, the first boundary may be a primitive The column where the cumulative value of the value is 76 is located. Similarly, for the second area, the column where the cumulative value of the primitive is 76 is used as the second boundary. As shown in Figure 3, obtain the primitive points at both ends of the column with the maximum cumulative value (for example, the primitive cumulative value is 90), set them as point A and point B respectively, and pass through point A, point B and X axis parallel straight line Intersect with the first boundary and the second boundary respectively to construct a rectangular area as the wear area. The distance between the first boundary and the second boundary is the width value of the wear area, and the number of primitive points on the first center line is the length value of the wear area.

圖4是從第一圖像區域中檢測磨損區域的第二中線、第三邊界以及第四邊界的示意圖。 FIG. 4 is a schematic diagram of detecting the second center line, the third boundary and the fourth boundary of the wear area from the first image area.

在本申請的一個實施例中,所述基於所述第一圖像區域,確定所述車窗玻璃的磨損區域,包括:計算所述第一圖像區域中每一行圖元點的圖元值的累加值;將所述第一圖像區域中具有最大累加值的一行圖元點作為所述第一圖像區域的第二中線;基於所述第二中線確定所述磨損區域的第三邊界與第四邊界;根據所述第三邊界與所述第四邊界確定所述磨損區域的寬度,根據所述第二中線上位於所述第一圖像區域中的圖元點的數量確定所述磨損區域的長度。 In one embodiment of the present application, determining the wear area of the window glass based on the first image area includes: calculating the primitive value of each row of primitive points in the first image area. The accumulated value of Three boundaries and a fourth boundary; determining the width of the wear area based on the third boundary and the fourth boundary, and determining the width of the wear area based on the number of primitive points located in the first image area on the second center line The length of the wear zone.

示例性地,計算所述第一圖像區域中每一行圖元點的圖元值的累加值,將最大累加值所在的行作為第一圖像區域的第二中線,以第二中線為起點遍歷所述第一圖像區域,確定磨損區域的第三邊界與第四邊界,根據第三邊界與第四邊界確定磨損邊界的寬度,根據第二中線上圖元點的數量確定磨損區域的長度。 Exemplarily, calculate the accumulated value of the primitive values of each row of primitive points in the first image area, and use the row with the maximum accumulated value as the second center line of the first image area, and use the second center line Traverse the first image area as the starting point, determine the third boundary and the fourth boundary of the wear area, determine the width of the wear boundary based on the third boundary and the fourth boundary, and determine the wear area based on the number of primitive points on the second center line length.

在本申請的一個實施例中,所述第二中線將所述第一圖像區域劃分為第三區域與第四區域,所述基於所述第二中線確定所述磨損區域的第三邊界與第四邊界,包括:在所述第三區域中獲取圖元值累加值大於所述第二中線圖元值累加值的第二預設百分比的至少一列圖元點,並將其中距離所述第二中線最遠的一行圖元點作為所述第三邊界;在所述第四區域中獲取圖元值累加值大於所述第二中線圖元值累加 值的第二預設百分比的至少一列圖元點,並將其中距離所述第二中線最遠的一行圖元點作為所述第四邊界。 In one embodiment of the present application, the second center line divides the first image area into a third area and a fourth area, and the third step of determining the wear area based on the second center line The boundary and the fourth boundary include: obtaining at least one column of primitive points in the third area whose cumulative primitive value is greater than a second preset percentage of the second centerline cumulative primitive value, and adding the distance between them The farthest row of primitive points of the second midline is used as the third boundary; the cumulative value of primitive values obtained in the fourth area is greater than the cumulative cumulative value of primitive values of the second midline At least one column of primitive points with a second preset percentage of the value, and a row of primitive points farthest from the second center line is used as the fourth boundary.

示例性地,在所述二值化圖像中,會存在許多較亮區域的點,本申請所述的較亮區域是大於預設範圍的區域,可以忽略較小的點形成的較亮區域。 For example, in the binary image, there will be many points in the brighter area. The brighter area described in this application is an area larger than the preset range. The brighter area formed by smaller points can be ignored. .

所述第二中線為與X軸平行的線,將所述第一圖像區域劃分為第三區域與第四區域。針對第三區域,基於上述獲取了所述第一圖像區域每一行的圖元值,獲取圖元值累加值大於第二中線圖元值累加值的第二預設百分比的至少一列圖元點,將其中距離第二中線最遠的一列圖元點作為第三邊界,其中,所述第二預設百分比可以是80%,假設第二中線圖元值累加值(最大累加值)為90,則,獲取圖元值累加值大於第二中線圖元值累加值的第二預設百分比的至少一列圖元點,可以包括,76,…,80等,因此,第三邊界可以是圖元值累加值76所在的列,同樣的,針對第四區域,將圖元值累加值為76所在的行作為第四邊界。如圖4所示,獲取具有最大累加值(例如,圖元累加值為90)所在的行的兩端圖元點,分別設置為點C與點D,且根據經過點C與點D且與Y軸平行的直線分別與第一邊界、第二邊界相交,構成一個矩形區域作為磨損區域,第三邊界與第四邊界之間的距離為磨損區域的寬度值,第二中線上圖元點的數量作為磨損區域的長度值。 The second center line is a line parallel to the X-axis, dividing the first image area into a third area and a fourth area. For the third area, based on the above-mentioned acquisition of the primitive values of each row of the first image area, obtain at least one column of primitives whose cumulative value of primitive values is greater than a second preset percentage of the second center line cumulative value of primitive values. points, and the column of primitive points farthest from the second midline is used as the third boundary, where the second preset percentage may be 80%, assuming that the cumulative value of the second midline primitive value (maximum cumulative value) is 90, then, obtain at least one column of primitive points whose cumulative value of primitive values is greater than the second preset percentage of the second center line cumulative value of primitive values, which may include, 76,...,80, etc., therefore, the third boundary can is the column where the accumulated value of the primitive value is 76. Similarly, for the fourth area, the row where the accumulated value of the primitive value is 76 is used as the fourth boundary. As shown in Figure 4, obtain the primitive points at both ends of the row with the maximum accumulated value (for example, the accumulated value of the primitive is 90), and set them as point C and point D respectively, and according to passing through point C and point D and with The straight lines parallel to the Y-axis intersect the first boundary and the second boundary respectively, forming a rectangular area as the wear area. The distance between the third boundary and the fourth boundary is the width value of the wear area. The primitive point on the second center line Quantity as length value of the wear area.

在本申請的一個實施例中,根據所述磨損區域在所述圖像座標系中的位置,確定所述磨損區域在前窗玻璃的位置。 In one embodiment of the present application, the position of the wear area on the front window glass is determined based on the position of the wear area in the image coordinate system.

將多個帶標號的原始圖像組合成前窗玻璃所展示的大小,根據在每個原始圖像中建立的圖像座標系,可以計算出座標系中的磨損區域,根據磨損區域在圖像座標系的位置,可以得出該磨損區域所在前窗玻璃實際的位置。 Multiple labeled original images are combined into the size shown on the front window glass. According to the image coordinate system established in each original image, the wear area in the coordinate system can be calculated. According to the wear area in the image The position of the coordinate system can be used to determine the actual position of the front window where the wear area is located.

本申請藉由對原始圖像的灰度化處理以及圖像強化處理,以使不同圖元點所在的區域差異明顯。圖像處理後的圖像進行二值化,在圖像強化的基礎上,二值化的分區明顯,藉由對圖元值的判斷,確定存在磨損區域的第一圖 像區域,提高了對車窗磨損區域的檢測效果。當車窗磨損不明顯的情況下,藉由圖像強化以及二值化處理,極大了提高了檢索的有效性,避免了長期磨損造成磨損不可逆的情況,以便維修人員及時對磨損區域進行維護。 This application uses grayscale processing and image enhancement processing on the original image to make the differences in the areas where different picture element points are obvious. The image after image processing is binarized. On the basis of image enhancement, the binarized partitions are obvious. By judging the primitive values, the first image with the wear area is determined. image area, which improves the detection effect of the window wear area. When the window wear is not obvious, image enhancement and binary processing can greatly improve the effectiveness of retrieval and avoid irreversible wear caused by long-term wear, so that maintenance personnel can promptly maintain the worn area.

請繼續參閱圖1,本實施例中,所述儲存器11可為電子設備1的內部儲存器,即內置於所述電子設備1的儲存器。在其他實施例中,所述儲存器11也可為電子設備1的外部儲存器,即外接於所述電子設備1的儲存器。 Please continue to refer to FIG. 1 . In this embodiment, the memory 11 may be an internal memory of the electronic device 1 , that is, a memory built into the electronic device 1 . In other embodiments, the storage 11 may also be an external storage of the electronic device 1 , that is, a storage external to the electronic device 1 .

在一些實施例中,所述儲存器11用於存儲程式碼與各種資料,並在電子設備1的運行過程中實現高速、自動地完成程式或資料的存取。 In some embodiments, the storage 11 is used to store program codes and various data, and realize high-speed and automatic access to programs or data during the operation of the electronic device 1 .

所述儲存器11可以包括隨機存取儲存器,還可以包括非易失性儲存器,例如硬碟、記憶體(Memory)、插接式硬碟、智慧存儲卡(Smart Media Card,SMC)、安全數位(Secure Digital,SD)卡、記憶卡(Flash Card)、至少一個磁碟儲存器件、快閃儲存器器件、或其他易失性固態儲存器件。 The storage 11 may include random access memory, and may also include non-volatile storage, such as hard disk, memory, plug-in hard disk, smart memory card (Smart Media Card, SMC), Secure Digital (SD) card, memory card (Flash Card), at least one disk storage device, flash memory device, or other volatile solid-state storage device.

在一實施例中,所述處理器12可為中央處理單元(Central Processing Unit,CPU),還可為其他通用處理器、數位訊號處理器(Digital Signal Processor,DSP)、特殊應用積體電路(Application Specific Integrated Circuit,ASIC)、現場可程式設計閘陣列(Field-Programmable Gate Array,FPGA)或者其他可程式設計邏輯器件、分立門或者電晶體邏輯器件、分立硬體元件等。通用處理器可為微處理器或者所述處理器也可為其它任何常規的處理器等。 In one embodiment, the processor 12 may be a central processing unit (Central Processing Unit, CPU), or other general-purpose processor, digital signal processor (Digital Signal Processor, DSP), special application integrated circuit ( Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general processor may be a microprocessor or the processor may be any other conventional processor.

所述儲存器11中的程式碼與各種資料如果以軟體功能單元的形式實現並作為獨立的產品銷售或使用時,可以存儲在一個電腦可讀取存儲介質中。基於這樣的理解,本申請實現上述實施例方法中的全部或部分流程,例如車窗磨損檢測方法,也可以藉由電腦程式來指令相關的硬體來完成,所述的電腦程式可存儲於電腦可讀存儲介質中,所述電腦程式在被處理器執行時,可實現上述各個方法實施例的步驟。其中,所述電腦程式包括電腦程式代碼,所述電腦程式代碼可以為原始程式碼形式、物件代碼形式、可執行檔或某些中間形式等。所述電腦可讀介質可以包括:能夠攜帶所述電腦程式代碼的任何實體或裝置、 記錄介質、隨身碟、移動硬碟、磁碟、光碟、電腦儲存器、唯讀儲存器(ROM,Read-Only Memory)等。 If the program codes and various data in the storage 11 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above embodiment methods, such as the car window wear detection method, which can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in the computer. In a readable storage medium, when the computer program is executed by the processor, the steps of each of the above method embodiments can be implemented. Wherein, the computer program includes computer program code, and the computer program code can be in the form of original program code, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, Recording media, pen drives, mobile hard drives, magnetic disks, optical disks, computer storage, read-only memory (ROM, Read-Only Memory), etc.

可以理解的係,以上所描述的模組劃分,為一種邏輯功能劃分,實際實現時可以有另外的劃分方式。另外,在本申請各個實施例中的各功能模組可以集成在相同處理單元中,也可為各個模組單獨物理存在,也可以兩個或兩個以上模組集成在相同單元中。上述集成的模組既可以採用硬體的形式實現,也可以採用硬體加軟體功能模組的形式實現。 It can be understood that the module division described above is a logical function division, and there may be other division methods in actual implementation. In addition, each functional module in each embodiment of the present application can be integrated in the same processing unit, or each module can physically exist separately, or two or more modules can be integrated in the same unit. The above integrated modules can be implemented in the form of hardware or in the form of hardware plus software function modules.

最後應說明的係,以上實施例僅用以說明本申請的技術方案而非限制,儘管參照較佳實施例對本申請進行了詳細說明,本領域的普通技術人員應當理解,可以對本申請的技術方案進行修改或等同替換,而不脫離本申請技術方案的精神與範圍。 Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and are not limiting. Although the present application has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present application can be modified. Modifications or equivalent substitutions may be made without departing from the spirit and scope of the technical solution of the present application.

S21~S26:步驟 S21~S26: Steps

Claims (9)

一種車窗磨損檢測方法,應用於電子設備,其中,該方法包括:獲取車窗玻璃的原始圖像;基於所述原始圖像建立圖像座標系,獲取所述原始圖像中每個圖元點在所述圖像座標系中的座標;對所述原始圖像進行灰度化處理,得到灰度圖像,包括計算所述灰度圖像的目標圖元值;將所述灰度圖像中大於所述目標圖元值且小於所述第一預設值的圖元值修改為所述第一預設值,將小於所述目標圖元值且大於第二預設值的圖元值修改為所述第二預設值,所述第一預設值大於所述第二預設值;對所述灰度圖像進行圖像強化,得到強化圖像;從所述強化圖像中獲取圖元值大於或等於第一預設值的第一圖像區域;基於所述第一圖像區域,確定所述車窗玻璃的磨損區域,包括根據所述圖像座標系計算二值化圖像中的第一圖像區域的座標,根據所述第一圖像區域的座標,確定所述車窗玻璃的磨損區域。 A vehicle window wear detection method, applied to electronic equipment, wherein the method includes: obtaining an original image of the vehicle window glass; establishing an image coordinate system based on the original image, and obtaining each primitive in the original image the coordinates of the point in the image coordinate system; performing grayscale processing on the original image to obtain a grayscale image, including calculating the target primitive value of the grayscale image; converting the grayscale image into The primitive values in the image that are greater than the target primitive value and smaller than the first preset value are modified to the first preset value, and the primitive values that are smaller than the target primitive value and greater than the second preset value are modified. The value is modified to the second preset value, and the first preset value is greater than the second preset value; image enhancement is performed on the grayscale image to obtain an enhanced image; from the enhanced image Obtain a first image area with a primitive value greater than or equal to a first preset value; based on the first image area, determine the wear area of the window glass, including calculating a binary value according to the image coordinate system The coordinates of the first image area in the image are determined, and the wear area of the window glass is determined based on the coordinates of the first image area. 如請求項1所述的車窗磨損檢測方法,其中,所述計算所述灰度圖像的目標圖元值,包括:計算所述灰度圖像中圖元點對應的最大圖元值,依據所述最大圖元值的第一預設百分比確定所述目標圖元值。 The vehicle window wear detection method according to claim 1, wherein calculating the target primitive value of the grayscale image includes: calculating the maximum primitive value corresponding to the primitive point in the grayscale image, The target primitive value is determined according to a first preset percentage of the maximum primitive value. 如請求項1所述的車窗磨損檢測方法,其中,所述基於所述第一圖像區域,確定所述車窗玻璃的磨損區域,包括:計算所述第一圖像區域中每一列圖元點的圖元值的累加值;將所述第一圖像區域中具有最大累加值的一列圖元點作為所述第一圖像區域的第一中線;基於所述第一中線確定所述磨損區域的第一邊界與第二邊界;根據所述第一邊界與所述第二邊界確定所述磨損區域的寬度,根據所述第一中線上位於所述第一圖像區域中的圖元點的數量確定所述磨損區域的長度。 The vehicle window wear detection method according to claim 1, wherein determining the wear area of the vehicle window glass based on the first image area includes: calculating each column diagram in the first image area The accumulated value of the primitive value of the primitive point; taking a column of primitive points with the maximum cumulative value in the first image area as the first center line of the first image area; determining based on the first center line The first boundary and the second boundary of the wear area; the width of the wear area is determined according to the first boundary and the second boundary, and the width of the wear area is determined according to the first center line located in the first image area. The number of primitive points determines the length of the wear area. 如請求項3所述的車窗磨損檢測方法,其中,所述第一中線將所述第一圖像區域劃分為第一區域與第二區域,所述基於所述第一中線確定所述磨損區域的第一邊界與第二邊界,包括:在所述第一區域中獲取圖元值累加值大於所述第一中線圖元值累加值的第二預設百分比的至少一列圖元點,並將其中距離所述第一中線最遠的一列圖元點作為所述第一邊界;在所述第二區域中獲取圖元值累加值大於所述第一中線圖元值累加值的所述第二預設百分比的至少一列圖元點,並將其中距離所述第一中線最遠的一列圖元點作為所述第二邊界。 The vehicle window wear detection method according to claim 3, wherein the first center line divides the first image area into a first area and a second area, and the determination based on the first center line The first boundary and the second boundary of the wear area include: obtaining at least one column of primitives in the first area whose cumulative primitive value is greater than a second preset percentage of the first centerline cumulative primitive value. points, and the column of primitive points farthest from the first centerline is used as the first boundary; the cumulative value of the primitive values obtained in the second area is greater than the cumulative cumulative value of the first midline primitive values. At least one column of primitive points that is the second preset percentage of the value, and the column of primitive points that is farthest from the first centerline is used as the second boundary. 如請求項1所述的車窗磨損檢測方法,其中,所述基於所述第一圖像區域,確定所述車窗玻璃的磨損區域,包括:計算所述第一圖像區域中每一行圖元點的圖元值的累加值;將所述第一圖像區域中具有最大累加值的一行圖元點作為所述第一圖像區域的第二中線;基於所述第二中線確定所述磨損區域的第三邊界與第四邊界;根據所述第三邊界與所述第四邊界確定所述磨損區域的寬度,根據所述第二中線上位於所述第一圖像區域中的圖元點的數量確定所述磨損區域的長度。 The vehicle window wear detection method according to claim 1, wherein determining the wear area of the vehicle window glass based on the first image area includes: calculating each row of images in the first image area The accumulated value of the primitive value of the primitive point; taking a row of primitive points with the maximum cumulative value in the first image area as the second center line of the first image area; determining based on the second center line The third boundary and the fourth boundary of the wear area; the width of the wear area is determined according to the third boundary and the fourth boundary, and the width of the wear area is determined according to the second center line located in the first image area. The number of primitive points determines the length of the wear area. 如請求項5所述的車窗磨損檢測方法,其中,所述第二中線將所述第一圖像區域劃分為第三區域與第四區域,所述基於所述第二中線確定所述磨損區域的第三邊界與第四邊界,包括:在所述第三區域中獲取圖元值累加值大於所述第二中線圖元值累加值的第二預設百分比的至少一列圖元點,並將其中距離所述第二中線最遠的一行圖元點作為所述第三邊界;在所述第四區域中獲取圖元值累加值大於所述第二中線圖元值累加值的第二預設百分比的至少一列圖元點,並將其中距離所述第二中線最遠的一行圖元點作為所述第四邊界。 The vehicle window wear detection method according to claim 5, wherein the second center line divides the first image area into a third area and a fourth area, and the determination based on the second center line The third boundary and the fourth boundary of the wear area include: obtaining at least one column of primitives in the third area whose cumulative primitive value is greater than a second preset percentage of the second centerline cumulative primitive value. points, and the row of primitive points farthest from the second midline is used as the third boundary; the cumulative value of primitive values obtained in the fourth area is greater than the cumulative cumulative value of primitive values of the second midline At least one column of primitive points with a second preset percentage of the value, and a row of primitive points farthest from the second center line is used as the fourth boundary. 如請求項1所述的車窗磨損檢測方法,其中,所述從所述強化圖像中獲取圖元值大於或等於所述第一預設值的第一圖像區域,包括:對所述強化圖像進行二值化處理,獲取二值化圖像;從所述二值化圖像中獲取所述第一圖像區域。 The vehicle window wear detection method according to claim 1, wherein said obtaining a first image area with a primitive value greater than or equal to the first preset value from the enhanced image includes: The enhanced image is binarized to obtain a binarized image; and the first image area is obtained from the binarized image. 一種電子設備,其中,所述電子設備包括處理器與儲存器,所述處理器用於執行儲存器中存儲的電腦程式以實現如請求項1至7中任意一項所述的車窗磨損檢測方法。 An electronic device, wherein the electronic device includes a processor and a storage, and the processor is used to execute a computer program stored in the storage to implement the vehicle window wear detection method as described in any one of claims 1 to 7 . 一種電腦可讀存儲介質,其中,所述電腦可讀存儲介質存儲有至少一個指令,所述至少一個指令被處理器執行時實現如請求項1至7中任意一項所述的車窗磨損檢測方法。 A computer-readable storage medium, wherein the computer-readable storage medium stores at least one instruction. When the at least one instruction is executed by a processor, the vehicle window wear detection as described in any one of claims 1 to 7 is implemented. method.
TW111150036A 2022-12-26 2022-12-26 Method for detecting wear of vehicle windows and related devices TWI830553B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW111150036A TWI830553B (en) 2022-12-26 2022-12-26 Method for detecting wear of vehicle windows and related devices

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW111150036A TWI830553B (en) 2022-12-26 2022-12-26 Method for detecting wear of vehicle windows and related devices

Publications (2)

Publication Number Publication Date
TWI830553B true TWI830553B (en) 2024-01-21
TW202427369A TW202427369A (en) 2024-07-01

Family

ID=90459280

Family Applications (1)

Application Number Title Priority Date Filing Date
TW111150036A TWI830553B (en) 2022-12-26 2022-12-26 Method for detecting wear of vehicle windows and related devices

Country Status (1)

Country Link
TW (1) TWI830553B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105405142A (en) * 2015-11-12 2016-03-16 冯平 Edge defect detection method and system for glass panel
CN105447851A (en) * 2015-11-12 2016-03-30 刘新辉 Glass panel sound hole defect detection method and system
CN110596134A (en) * 2018-05-25 2019-12-20 上海翌视信息技术有限公司 Sheet glass edge flaw detection method based on image acquisition
CN114693673A (en) * 2022-04-24 2022-07-01 睿云奇智(重庆)科技有限公司 Glass detection method and device, electronic equipment and computer-readable storage medium
CN115100221A (en) * 2022-08-22 2022-09-23 启东市云鹏玻璃机械有限公司 Glass defect segmentation method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105405142A (en) * 2015-11-12 2016-03-16 冯平 Edge defect detection method and system for glass panel
CN105447851A (en) * 2015-11-12 2016-03-30 刘新辉 Glass panel sound hole defect detection method and system
CN110596134A (en) * 2018-05-25 2019-12-20 上海翌视信息技术有限公司 Sheet glass edge flaw detection method based on image acquisition
CN114693673A (en) * 2022-04-24 2022-07-01 睿云奇智(重庆)科技有限公司 Glass detection method and device, electronic equipment and computer-readable storage medium
CN115100221A (en) * 2022-08-22 2022-09-23 启东市云鹏玻璃机械有限公司 Glass defect segmentation method

Similar Documents

Publication Publication Date Title
US11430103B2 (en) Method for image processing, non-transitory computer readable storage medium, and electronic device
EP3309703A1 (en) Method and system for decoding qr code based on weighted average grey method
US8599270B2 (en) Computing device, storage medium and method for identifying differences between two images
US20120308125A1 (en) Mapping colors of an image
CN108174057B (en) Method and device for rapidly reducing noise of picture by utilizing video image inter-frame difference
CN108596908B (en) LED display screen detection method and device and terminal
TWI759669B (en) Method and system for inspecting display image
CN113034447B (en) Edge defect detection method and device
US20070200864A1 (en) Method and system for gathering per-frame image statistics while preserving resolution and runtime performance in a real-time visual simulation
WO2020119454A1 (en) Method and apparatus for color reproduction of image
CN116503414B (en) Screen defect detection method, device, computer equipment and storage medium
CN113785181A (en) OLED screen point defect judgment method and device, storage medium and electronic equipment
JP2019106644A (en) Deposit detection apparatus and deposit detection method
TWI830553B (en) Method for detecting wear of vehicle windows and related devices
JP2018142828A (en) Deposit detector and deposit detection method
CN110033412B (en) Image processing method and device
CN111105431A (en) Method and device for marking image
TW202427369A (en) Method for detecting wear of vehicle windows and related devices
WO2018159037A1 (en) Facial detection device, and control method and program for same
CN112580638B (en) Text detection method and device, storage medium and electronic equipment
CN115205596A (en) Image classification method, device, equipment and storage medium
CN118279595A (en) Vehicle window abrasion detection method and related equipment
CN107146207B (en) A kind of enhancement method of low-illumination image of parameter optimization
CN116612146B (en) Image processing method, device, electronic equipment and computer storage medium
CN111556228A (en) Method and system for correcting lens shadow