TWI846177B - Road image segmentation method, computer device and storage medium - Google Patents
Road image segmentation method, computer device and storage medium Download PDFInfo
- Publication number
- TWI846177B TWI846177B TW111146059A TW111146059A TWI846177B TW I846177 B TWI846177 B TW I846177B TW 111146059 A TW111146059 A TW 111146059A TW 111146059 A TW111146059 A TW 111146059A TW I846177 B TWI846177 B TW I846177B
- Authority
- TW
- Taiwan
- Prior art keywords
- road
- area
- edge line
- image
- target
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 44
- 238000003709 image segmentation Methods 0.000 title abstract 2
- 230000011218 segmentation Effects 0.000 claims abstract description 87
- 238000007781 pre-processing Methods 0.000 claims description 14
- 238000001914 filtration Methods 0.000 claims description 9
- 238000003708 edge detection Methods 0.000 claims description 6
- 238000010191 image analysis Methods 0.000 abstract 1
- 238000001514 detection method Methods 0.000 description 20
- 238000010586 diagram Methods 0.000 description 14
- 238000004590 computer program Methods 0.000 description 12
- 230000006870 function Effects 0.000 description 7
- 239000011159 matrix material Substances 0.000 description 6
- 238000004422 calculation algorithm Methods 0.000 description 4
- 238000000605 extraction Methods 0.000 description 4
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 238000013500 data storage Methods 0.000 description 2
- 230000001419 dependent effect Effects 0.000 description 2
- 238000003672 processing method Methods 0.000 description 2
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 1
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 1
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000011176 pooling Methods 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
Landscapes
- Image Analysis (AREA)
Abstract
Description
本發明涉及影像處理領域,尤其涉及一種道路分割方法、電腦設備及儲存介質。 The present invention relates to the field of image processing, and in particular to a road segmentation method, a computer device and a storage medium.
在目前基於圖像對道路進行檢測的方案中,由於在逆光環境下拍攝的道路圖像的亮度大,使得圖像中的道路模糊,導致無法從逆光的道路圖像中準確檢測出道路,進而影響駕車安全。 In the current image-based road detection solution, the road in the image is blurred due to the high brightness of the road image taken in a backlit environment, resulting in the inability to accurately detect the road from the backlit road image, thus affecting driving safety.
鑒於以上內容,有必要提供一種道路分割方法、電腦設備及儲存介質,解決了無法從逆光的道路圖像中準確檢測出道路的技術問題,從而能夠提高駕駛安全。 In view of the above, it is necessary to provide a road segmentation method, computer equipment and storage medium to solve the technical problem of being unable to accurately detect the road from the backlit road image, thereby improving driving safety.
本申請提供一種道路分割方法,所述道路分割方法包括:獲取道路圖像,基於所述道路圖像,得到多個感興趣區域,基於所述多個感興趣區域生成拼接區域,將所述拼接區域輸入至預先訓練完成的道路分割模型,得到道路分割圖像以及所述道路分割圖像中的分割結果。 This application provides a road segmentation method, which includes: obtaining a road image, obtaining multiple regions of interest based on the road image, generating a spliced region based on the multiple regions of interest, inputting the spliced region into a pre-trained road segmentation model, and obtaining a road segmentation image and a segmentation result in the road segmentation image.
根據本申請可選實施例,所述多個感興趣區域包括預處理區域、第一均衡化區域、第二均衡化區域以及目標區域,所述基於所述道路圖像,得到多個感興趣區域包括:對所述道路圖像進行預處理,得到所述預處理區域,並對所述預處理區域進行均衡化處理,得到所述第一均衡化區域以及所述第二 均衡化區域,對所述第一均衡化區域進行檢測,得到目標邊緣線,根據所述目標邊緣線以及所述第一均衡化區域生成所述目標區域。 According to an optional embodiment of the present application, the multiple regions of interest include a preprocessing region, a first equalization region, a second equalization region, and a target region. The step of obtaining the multiple regions of interest based on the road image includes: preprocessing the road image to obtain the preprocessing region, performing equalization processing on the preprocessing region to obtain the first equalization region and the second equalization region, detecting the first equalization region to obtain a target edge line, and generating the target region based on the target edge line and the first equalization region.
根據本申請可選實施例,所述對所述第一均衡化區域進行檢測,得到目標邊緣線包括:對所述第一均衡化區域進行邊緣檢測,得到多條初始邊緣線,基於每條初始邊緣線上的每個像素點在所述第一均衡化區域中的像素位置,計算每個像素點的極座標方程,基於多個所述極座標方程從所述多條初始邊緣線中選取所述目標邊緣線。 According to an optional embodiment of the present application, the detecting the first equalized region to obtain the target edge line includes: performing edge detection on the first equalized region to obtain multiple initial edge lines, calculating the polar coordinate equation of each pixel point on each initial edge line based on the pixel position in the first equalized region, and selecting the target edge line from the multiple initial edge lines based on the multiple polar coordinate equations.
根據本申請可選實施例,所述對所述第一均衡化區域進行邊緣檢測,得到多條初始邊緣線包括:對所述第一均衡化區域進行濾波處理,得到濾波區域,計算所述濾波區域中每個像素點的梯度值,根據預設的上限閥值以及預設的下限閥值對多個所述梯度值對應的多個像素點進行篩選,得到邊緣像素點,將多個相鄰的邊緣像素點構成的多條線確定為所述多條初始邊緣線。 According to an optional embodiment of the present application, the edge detection of the first equalized area to obtain multiple initial edge lines includes: filtering the first equalized area to obtain a filter area, calculating the gradient value of each pixel in the filter area, filtering multiple pixels corresponding to the multiple gradient values according to a preset upper limit threshold value and a preset lower limit threshold value to obtain edge pixels, and determining multiple lines formed by multiple adjacent edge pixels as the multiple initial edge lines.
根據本申請可選實施例,所述目標邊緣線包括第一目標邊緣線以及第二目標邊緣線,所述基於多個所述極座標方程從所述多條初始邊緣線中選取所述目標邊緣線包括:繪製每個極座標方程對應的曲線,基於多條所述曲線選取每條初始邊緣線的極角,根據所述極角計算對應的初始邊緣線的邊緣線斜率,選取最大的邊緣線斜率對應的初始邊緣線作為所述第一目標邊緣線,並選取最小的邊緣線斜率對應的初始邊緣線作為所述第二目標邊緣線。 According to an optional embodiment of the present application, the target edge line includes a first target edge line and a second target edge line, and the selecting the target edge line from the multiple initial edge lines based on the multiple polar coordinate equations includes: drawing a curve corresponding to each polar coordinate equation, selecting the polar angle of each initial edge line based on the multiple curves, calculating the edge line slope of the corresponding initial edge line according to the polar angle, selecting the initial edge line corresponding to the maximum edge line slope as the first target edge line, and selecting the initial edge line corresponding to the minimum edge line slope as the second target edge line.
根據本申請可選實施例,所述根據所述目標邊緣線以及所述第一均衡化區域生成所述目標區域包括:將所述第一目標邊緣線以及所述第二目標邊緣線在所述第一均衡化區域圍成的區域確定為道路區域,基於所述道路區域對所述第一均衡化區域進行二值化處理,得到所述目標區域。 According to an optional embodiment of the present application, generating the target area according to the target edge line and the first equalization area includes: determining the area enclosed by the first target edge line and the second target edge line in the first equalization area as a road area, and binarizing the first equalization area based on the road area to obtain the target area.
根據本申請可選實施例,所述基於所述多個感興趣區域生成拼接區域包括:將所述第一均衡化區域與所述目標區域中相互對應的像素點的像素值進行相乘運算,得到第一像素值,並將所述第一均衡化區域中每個像素點的像素值調整為對應的第一像素值,得到第一區域,將所述第二均衡化區域與所 述目標區域中相互對應的像素點的像素值進行相乘運算,得到第二像素值,並將所述第二均衡化區域中每個像素點的像素值調整為對應的第二像素值,得到第二區域,將所述預處理區域與所述目標區域中相互對應的像素點的像素值進行相乘運算,得到第三像素值,並將所述預處理區域中每個像素點的像素值調整為對應的第三像素值,得到第三區域,將所述第一區域、所述第二區域及所述第三區域進行拼接,得到所述拼接區域。 According to an optional embodiment of the present application, generating a stitching region based on the multiple regions of interest includes: multiplying the pixel values of the first equalized region and the corresponding pixel points in the target region to obtain a first pixel value, and adjusting the pixel value of each pixel point in the first equalized region to the corresponding first pixel value to obtain a first region, and multiplying the pixel values of the second equalized region and the corresponding pixel points in the target region to obtain a second region. Pixel value, and adjust the pixel value of each pixel in the second equalization area to the corresponding second pixel value to obtain the second area, multiply the pixel values of the corresponding pixels in the pre-processing area and the target area to obtain a third pixel value, and adjust the pixel value of each pixel in the pre-processing area to the corresponding third pixel value to obtain the third area, and splice the first area, the second area and the third area to obtain the spliced area.
根據本申請可選實施例,在將所述拼接區域輸入至預先訓練完成的道路分割模型之前,所述方法還包括:獲取道路分割網路、道路訓練圖像以及所述道路訓練圖像的標註結果,將所述道路訓練圖像輸入至所述道路分割網路中進行特徵提取,得到道路特徵圖,對所述道路特徵圖中每個像素點進行道路預測,得到所述道路特徵圖的預測結果,根據所述預測結果以及所述標註結果對所述道路分割網路的參數進行調整,得到訓練完成的道路分割模型。 According to an optional embodiment of the present application, before inputting the spliced area into a pre-trained road segmentation model, the method further includes: obtaining a road segmentation network, a road training image, and an annotation result of the road training image, inputting the road training image into the road segmentation network for feature extraction to obtain a road feature map, performing road prediction on each pixel in the road feature map to obtain a prediction result of the road feature map, and adjusting the parameters of the road segmentation network according to the prediction result and the annotation result to obtain a trained road segmentation model.
本申請提供一種電腦設備,所述電腦設備包括:儲存器,儲存至少一個指令;及處理器,執行所述至少一個指令以實現所述的道路分割方法。 This application provides a computer device, which includes: a memory storing at least one instruction; and a processor executing the at least one instruction to implement the road segmentation method.
本申請提供一種電腦可讀儲存介質,所述電腦可讀儲存介質中儲存有至少一個指令,所述至少一個指令被電腦設備中的處理器執行以實現所述的道路分割方法。 This application provides a computer-readable storage medium, in which at least one instruction is stored, and the at least one instruction is executed by a processor in a computer device to implement the road segmentation method.
由上述技術方案可知,本申請對所述道路圖像進行影像處理,得到多個感興趣區域,所述影像處理包括圖像剪裁、二值化及均衡化、道路檢測以及霍夫變換,由於圖像裁剪能夠刪除所述道路圖像中不包含道路的部分,因此,能夠減少對道路檢測干擾。當所述道路圖像為逆光圖像時,透過對所述逆光圖像進行二值化及均衡化處理,能夠降低所述逆光圖像的亮度使得所述逆光圖像中更加清晰。透過對所述逆光圖像進行道路檢測,能夠檢測到所述逆光圖像中道路的多條可能的初始邊緣線,透過霍夫變換對所述多條可能的邊緣線進行篩選,得到目標邊緣線,因此能夠提高道路檢測的準確性。此外,由於所述多個感興趣區域中融合了更多道路資訊,因此基於所述多個感興趣區域生成拼 接區域,能夠使得所述拼接區域中的道路更加清晰。此外,透過預先訓練完成的道路分割模型對所述拼接區域中的道路進行檢測,由於所述道路分割模型學習到了道路的位置特徵,因此,能夠更為準確地預測出所述拼接區域中道路的位置。 It can be seen from the above technical solution that the present application performs image processing on the road image to obtain multiple regions of interest. The image processing includes image cropping, binarization and equalization, road detection and Hough transform. Since image cropping can delete the part of the road image that does not contain the road, it can reduce the interference to the road detection. When the road image is a backlit image, by binarizing and equalizing the backlit image, the brightness of the backlit image can be reduced to make the backlit image clearer. By performing road detection on the backlit image, multiple possible initial edge lines of the road in the backlit image can be detected, and the multiple possible edge lines are screened by Hough transform to obtain the target edge line, thereby improving the accuracy of road detection. In addition, since more road information is integrated into the multiple regions of interest, the roads in the spliced regions can be made clearer by generating a spliced region based on the multiple regions of interest. In addition, the roads in the spliced region are detected by using a pre-trained road segmentation model. Since the road segmentation model has learned the location features of the roads, the location of the roads in the spliced region can be predicted more accurately.
1:電腦設備 1: Computer equipment
12:儲存器 12: Storage
13:處理器 13: Processor
S11~S14、S121~S124、S141~S144:步驟 S11~S14, S121~S124, S141~S144: Steps
圖1是本申請實施例提供的一種道路分割方法的應用場景圖。 Figure 1 is an application scenario diagram of a road segmentation method provided by the embodiment of this application.
圖2是本申請實施例提供的一種道路分割方法的流程圖。 Figure 2 is a flow chart of a road segmentation method provided by the embodiment of this application.
圖3是本申請實施例提供的影像處理的流程圖。 Figure 3 is a flowchart of image processing provided by the embodiment of this application.
圖4是本申請實施例提供的初始邊緣線和目標邊緣線的示意圖。 Figure 4 is a schematic diagram of the initial edge line and the target edge line provided in the embodiment of this application.
圖5是本申請實施例提供的道路分割模型的訓練流程圖。 Figure 5 is a training flowchart of the road segmentation model provided in the embodiment of this application.
圖6是本申請實施例提供的道路分割圖像的示意圖。 Figure 6 is a schematic diagram of a road segmentation image provided by the embodiment of this application.
圖7是本申請實施例提供的電腦設備的結構示意圖。 Figure 7 is a schematic diagram of the structure of the computer device provided in the embodiment of this application.
為了使本申請的目的、技術方案和優點更加清楚,下面結合附圖和具體實施例對本申請進行詳細描述。 In order to make the purpose, technical solution and advantages of this application clearer, this application is described in detail below with reference to the attached drawings and specific embodiments.
如圖1所示,是本申請實施例提供的一種道路分割方法的應用場景圖。所述道路場景圖可以由拍攝設備逆著光線對道路場景進行拍攝獲得,由於逆著光線,因此所述道路場景圖的圖像亮度很大,導致圖中的道路模糊不清。所述應用場景圖中包括道路、車輛、樹木以及天空等等。所述道路分割方法可應用於一個或者多個電腦設備1中,例如圖7所示的電腦設備1。所述電腦設備1與所述拍攝設備相通信,所述拍攝設備可以是單目相機,也可以是具有拍攝功能的其它設備。 As shown in FIG1 , it is an application scene diagram of a road segmentation method provided by an embodiment of the present application. The road scene diagram can be obtained by shooting a road scene against light with a shooting device. Since it is against light, the image brightness of the road scene diagram is very large, resulting in blurry roads in the diagram. The application scene diagram includes roads, vehicles, trees, and the sky, etc. The road segmentation method can be applied to one or more computer devices 1, such as the computer device 1 shown in FIG7 . The computer device 1 communicates with the shooting device, which can be a monocular camera or other device with shooting function.
所述電腦設備1是一種能夠按照事先設定或儲存的指令,自動進行參數值計算和/或資訊處理的設備,其硬體包括,但不限於:微處理器、專用積體電路(Application Specific Integrated Circuit,ASIC)、可程式設計閘陣列 (Field-Programmable Gate Array,FPGA)、數位訊號處理器(Digital Signal Processor,DSP)、嵌入式設備等。所述電腦設備1可以是任何一種可與用戶進行人機交互的電腦產品,例如,個人電腦、平板電腦、智慧手機、個人數位助理(Personal Digital Assistant,PDA)、遊戲機、互動式模型電視(Internet Protocol Television,IPTV)、穿戴式智能設備等。 The computer device 1 is a device that can automatically perform parameter value calculation and/or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to: microprocessor, application specific integrated circuit (ASIC), field-programmable gate array (FPGA), digital signal processor (DSP), embedded device, etc. The computer device 1 can be any computer product that can interact with the user, such as a personal computer, tablet computer, smart phone, personal digital assistant (PDA), game console, interactive model television (IPTV), wearable smart device, etc.
所述電腦設備1還可以包括模型設備和/或使用者設備。其中,所述模型設備包括,但不限於單個模型伺服器、多個模型伺服器組成的伺服器組或基於雲計算(Cloud Computing)的由大量主機或模型伺服器構成的雲。所述電腦設備1還可以是車輛中的車載設備。所述電腦設備1所處的模型包括,但不限於:網際網路、廣域網路、都會區網路、區域網路、虛擬專用模型(Virtual Private Network,VPN)等。 The computer device 1 may also include a model device and/or a user device. The model device includes, but is not limited to, a single model server, a server group consisting of multiple model servers, or a cloud consisting of a large number of hosts or model servers based on cloud computing. The computer device 1 may also be a vehicle-mounted device in a vehicle. The model in which the computer device 1 is located includes, but is not limited to: the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (VPN), etc.
所述電腦設備1還可以為車載設備,當所述電腦設備1為車載設備時,所述拍攝設備可以為所述車載設備中的車載拍攝設備,例如:車載攝像頭或者行車記錄儀,所述車載設備與所述車載拍攝設備相通信。 The computer device 1 may also be a vehicle-mounted device. When the computer device 1 is a vehicle-mounted device, the shooting device may be a vehicle-mounted shooting device in the vehicle-mounted device, such as a vehicle-mounted camera or a driving recorder, and the vehicle-mounted device communicates with the vehicle-mounted shooting device.
如圖2所示,圖2是本申請實施例提供的一種道路分割方法的流程圖。根據不同的需求,所述流程圖中各個步驟的順序可以根據實際檢測要求進行調整,某些步驟可以省略。所述方法的執行主體為電腦設備。 As shown in FIG2, FIG2 is a flow chart of a road segmentation method provided in an embodiment of the present application. According to different requirements, the order of each step in the flow chart can be adjusted according to the actual detection requirements, and some steps can be omitted. The execution subject of the method is a computer device.
步驟S11,獲取道路圖像。 Step S11, obtaining road images.
在本申請的至少一個實施例中,所述道路圖像為三原色光(Red Green Blue,RGB)圖像,所述道路圖像中可以包含車輛,道路、車道線、行人、天空、樹木等對象。 In at least one embodiment of the present application, the road image is a three-primary color light (Red Green Blue, RGB) image, and the road image may include objects such as vehicles, roads, lane lines, pedestrians, sky, trees, etc.
在本申請的至少一個實施例中,所述電腦設備獲取道路圖像包括:所述電腦設備控制拍攝設備拍攝道路場景,得到所述道路圖像。其中,所述拍攝設備可以為單目相機或者車載攝像機等等,所述道路場景中可以包括車輛,道路、車道線、行人、天空、樹木等對象。 In at least one embodiment of the present application, the computer device acquires the road image including: the computer device controls the shooting device to shoot the road scene to obtain the road image. The shooting device may be a monocular camera or a vehicle-mounted camera, etc., and the road scene may include objects such as vehicles, roads, lane lines, pedestrians, sky, trees, etc.
在本實施例中,所述道路圖像包括逆光道路圖像,所述逆光道路 圖像為所述拍攝設備逆著光線對所述道路場景進行拍攝得到的圖像。 In this embodiment, the road image includes a backlit road image, and the backlit road image is an image obtained by the shooting device shooting the road scene against the light.
步驟S12,基於所述道路圖像,得到多個感興趣區域。 Step S12, based on the road image, obtain multiple areas of interest.
在本申請的至少一個實施例中,透過預設的一種或多種影像處理方式,獲得多個感興趣區域,其中,影像處理方式包括剪裁、道路檢測、霍夫變換、長條圖均衡化以及二值化處理等等。其中,所述長條圖均衡化處理包括灰度長條圖均衡化處理以及三通道長條圖均衡化處理等等。 In at least one embodiment of the present application, multiple regions of interest are obtained through one or more preset image processing methods, wherein the image processing methods include cropping, road detection, Hough transform, histogram equalization, and binarization processing, etc. The histogram equalization processing includes grayscale histogram equalization processing and three-channel histogram equalization processing, etc.
具體地,基於道路圖像進行的影像處理,可參考如圖3所示的實施例的影像處理流程圖。 Specifically, the image processing based on the road image can refer to the image processing flow chart of the embodiment shown in FIG3.
步驟S121,對所述道路圖像進行預處理,得到所述預處理區域。 Step S121, pre-process the road image to obtain the pre-processed area.
在本實施例中,對所述道路圖像進行初步檢測,確定道路在所述道路圖像中的位置。例如,所述道路圖像中,道路主要位於所述道路圖像的下半部分,所述道路部分的上半部分主要為遠景及天空,此時,所述電腦設備可選取所述道路圖像的下半部分作為所述預處理區域。例如,可透過目標檢測演算法對所述道路圖像進行初步檢測。其中,所述目標檢測演算法可以為R-CNN、Fast R-CNN、Faster R-CNN等等。 In this embodiment, the road image is preliminarily detected to determine the position of the road in the road image. For example, in the road image, the road is mainly located in the lower half of the road image, and the upper half of the road portion is mainly the distant view and the sky. At this time, the computer device can select the lower half of the road image as the pre-processing area. For example, the road image can be preliminarily detected by a target detection algorithm. The target detection algorithm can be R-CNN, Fast R-CNN, Faster R-CNN, etc.
在本實施例中,由於圖像裁剪能夠刪除所述道路圖像中不包含道路的部分,因此,能夠減少對道路檢測干擾。 In this embodiment, since image cropping can delete the portion of the road image that does not contain the road, interference with road detection can be reduced.
步驟S122,對所述預處理區域進行均衡化處理,得到所述第一均衡化區域以及所述第二均衡化區域。 Step S122, performing equalization processing on the pre-processed area to obtain the first equalized area and the second equalized area.
在本實施例中,所述電腦設備對所述預處理區域進行灰度長條圖均衡化處理,得到所述第一均衡化區域,然後所述電腦設備對所述預處理區域的每個通道進行長條圖均衡化處理,得到所述第二均衡化區域。在本實施例中,當所述道路圖像為逆光道路圖像時,對剪裁後生成的預處理區域進行灰度長條圖均衡化處理以及三通道長條圖均衡化處理,能夠降低所述第一均衡化區域以及所述第二均衡化區域的亮度,從而能夠降低亮度對道路檢測的影響。 In this embodiment, the computer device performs grayscale histogram equalization processing on the preprocessed area to obtain the first equalized area, and then the computer device performs histogram equalization processing on each channel of the preprocessed area to obtain the second equalized area. In this embodiment, when the road image is a backlit road image, grayscale histogram equalization processing and three-channel histogram equalization processing are performed on the preprocessed area generated after clipping, which can reduce the brightness of the first equalized area and the second equalized area, thereby reducing the impact of brightness on road detection.
步驟S123,對所述第一均衡化區域進行檢測,得到目標邊緣線。 Step S123, detect the first equalization area to obtain the target edge line.
在本實施例中,所述電腦設備對所述第一均衡化區域進行檢測,得到目標邊緣線包括:所述電腦設備對所述第一均衡化區域進行道路檢測,得到多條初始邊緣線,然後所述電腦設備基於每條初始邊緣線上的每個像素點在所述第一均衡化區域中的像素位置,計算每個像素點的極座標方程,進一步地,所述電腦設備基於多個所述極座標方程從所述多條初始邊緣線中選取所述目標邊緣線。其中,所述目標邊緣線包括第一目標邊緣線以及第二目標邊緣線,所述像素位置包括橫座標值以及縱座標值。所述極座標方程的格式為ρ=xcosθ+ysinθ,ρ表示因變量極徑,θ表示自變量極角度,x表示每個像素點的橫座標值,y表示每個像素點的縱座標值。 In this embodiment, the computer device detects the first equalization area to obtain the target edge line, including: the computer device performs road detection on the first equalization area to obtain multiple initial edge lines, and then the computer device calculates the polar coordinate equation of each pixel point on each initial edge line based on the pixel position in the first equalization area, and further, the computer device selects the target edge line from the multiple initial edge lines based on the multiple polar coordinate equations. The target edge line includes a first target edge line and a second target edge line, and the pixel position includes a horizontal coordinate value and a vertical coordinate value. The format of the polar coordinate equation is ρ = xcosθ + ysinθ , ρ represents the dependent variable polar diameter, θ represents the independent variable polar angle, x represents the horizontal coordinate value of each pixel point, and y represents the vertical coordinate value of each pixel point.
具體地,所述電腦設備對所述第一均衡化區域進行道路檢測,得到多條初始邊緣線包括:所述電腦設備對所述第一均衡化區域進行濾波處理,得到濾波區域;所述電腦設備計算所述濾波區域中每個像素點的梯度值;所述電腦設備根據預設的上限閥值以及預設的下限閥值對多個所述梯度值對應的多個像素點進行篩選,得到邊緣像素點。然後,所述電腦設備將多個相鄰的邊緣像素點構成的多條線確定為所述多條初始邊緣線。 Specifically, the computer device performs road detection on the first equalization area to obtain multiple initial edge lines, including: the computer device performs filtering processing on the first equalization area to obtain a filtering area; the computer device calculates the gradient value of each pixel in the filtering area; the computer device filters multiple pixels corresponding to the multiple gradient values according to a preset upper limit valve value and a preset lower limit valve value to obtain edge pixels. Then, the computer device determines multiple lines formed by multiple adjacent edge pixels as the multiple initial edge lines.
其中,所述電腦設備可以透過索貝爾運算元(Sobeloperator,Sobel)計算所述梯度值。所述上限閥值和所述下限閥值可以自行設置,本申請對此不作限制。例如,所述上限閥值可以為80,所述下限閥值可以為40。 Wherein, the computer device can calculate the gradient value through the Sobel operator (Sobel). The upper limit valve value and the lower limit valve value can be set by yourself, and this application does not impose any restrictions on this. For example, the upper limit valve value can be 80, and the lower limit valve value can be 40.
在本實施例中,透過對所述第一均衡化區域進行道路檢測,能夠初步檢測出所述第一均衡化區域中多個可能的道路的初始邊緣線。 In this embodiment, by performing road detection on the first equalization area, the initial edge lines of multiple possible roads in the first equalization area can be preliminarily detected.
具體地,所述電腦設備根據預設的卷積核尺寸從所述第一均衡化區域中選取對應的多個卷積像素點,並根據每個卷積像素點的像素位置生成對應的權重。所述電腦設備對多個所述權重進行歸一化,生成高斯濾波核,然後,所述電腦設備使用所述高斯濾波核對所述第一均衡化區域進行卷積,得到所述濾波區域。 Specifically, the computer device selects a plurality of corresponding convolution pixels from the first equalization region according to a preset convolution kernel size, and generates a corresponding weight according to the pixel position of each convolution pixel. The computer device normalizes the plurality of weights to generate a Gaussian filter kernel, and then the computer device uses the Gaussian filter kernel to perform convolution on the first equalization region to obtain the filter region.
其中,每個權重的計算公式為:
在一實施例中,透過對所述第一均衡化區域進行濾波處理,能夠濾除所述第一均衡區域中的雜訊,使得所述濾波區域中的道路的邊緣線更清晰。 In one embodiment, by filtering the first equalization area, the noise in the first equalization area can be filtered out, so that the edge line of the road in the filtering area is clearer.
具體地,所述電腦設備根據預設的上限閥值以及預設的下限閥值對多個所述梯度值對應的多個像素點進行篩選,得到邊緣像素點包括:所述電腦設備將大於或者等於所述上限閥值的梯度值對應的像素點確定為所述邊緣像素點,並將處於所述上限閥值與所述下限閥值之間的梯度值對應的像素點確定為中間像素點。若所述中間像素點直接與任一所述邊緣像素點相連,所述電腦設備將所述中間像素點確定為所述邊緣像素點,或者,若所述中間像素點不與任何邊緣像素點相連,所述電腦設備捨棄所述中間像素點。此外,所述電腦設備將小於或者等於所述下限閥值的梯度值對應的像素點進行捨棄。 Specifically, the computer device screens multiple pixel points corresponding to the multiple gradient values according to a preset upper limit valve value and a preset lower limit valve value, and obtains edge pixel points, including: the computer device determines the pixel points corresponding to the gradient value greater than or equal to the upper limit valve value as the edge pixel points, and determines the pixel points corresponding to the gradient value between the upper limit valve value and the lower limit valve value as the middle pixel points. If the middle pixel point is directly connected to any of the edge pixel points, the computer device determines the middle pixel point as the edge pixel point, or, if the middle pixel point is not connected to any edge pixel point, the computer device discards the middle pixel point. In addition, the computer device discards the pixel points corresponding to the gradient value less than or equal to the lower limit valve value.
在本實施例中,由於邊緣像素點的像素值與所述第一均衡區域中的其它像素點的像素值相差大、並且梯度值能夠表徵像素值的變化大小,因此,透過將大於所述上限閥值的梯度值對應的像素點作為所述邊緣像素點,能夠提高對邊緣像素點進行確認的準確性。 In this embodiment, since the pixel values of edge pixels differ greatly from the pixel values of other pixels in the first equalization area, and the gradient value can characterize the magnitude of the change in pixel value, the accuracy of confirming edge pixels can be improved by using the pixel corresponding to the gradient value greater than the upper limit value as the edge pixel.
具體地,所述電腦設備基於多個所述極座標方程從所述多條初始邊緣線中選取所述目標邊緣線包括:所述電腦設備繪製每個極座標方程對應的曲線,並基於多條所述曲線選取每條初始邊緣線的極角,所述電腦設備根據所述極角計算對應的初始邊緣線的邊緣線斜率,並選取最大的邊緣線斜率對應的初始邊緣線作為所述第一目標邊緣線,並選取最小的邊緣線斜率對應的初始邊緣線作為所述第二目標邊緣線。 Specifically, the computer device selects the target edge line from the multiple initial edge lines based on the multiple polar coordinate equations, including: the computer device draws a curve corresponding to each polar coordinate equation, and selects the polar angle of each initial edge line based on the multiple curves, the computer device calculates the edge line slope of the corresponding initial edge line according to the polar angle, and selects the initial edge line corresponding to the largest edge line slope as the first target edge line, and selects the initial edge line corresponding to the smallest edge line slope as the second target edge line.
其中,由於每個極座標方程中的因變量為極徑,引數為極角,因 此,所述曲線上的每個點的座標為極徑和極角,所述電腦設備選取所述多條曲線的交點對應的極角作為每條初始邊緣線對應的極角。在本實施例中,所述邊緣線斜率的符號存在正負號。因此,所述第一目標邊緣線的邊緣線斜率的符號為正號,所述第二目標邊緣線的邊緣線斜率的符號為負號。 Among them, since the dependent variable in each polar coordinate equation is the polar diameter and the argument is the polar angle, therefore, the coordinates of each point on the curve are the polar diameter and the polar angle, and the computer device selects the polar angle corresponding to the intersection of the multiple curves as the polar angle corresponding to each initial edge line. In this embodiment, the sign of the edge line slope has positive and negative signs. Therefore, the sign of the edge line slope of the first target edge line is positive, and the sign of the edge line slope of the second target edge line is negative.
在本實施例中,透過在所述多條初始邊緣線中選取所述目標邊緣線,能夠初步確定出所述第一均衡化區域中的道路區域。 In this embodiment, by selecting the target edge line from the multiple initial edge lines, the road area in the first equalization area can be preliminarily determined.
如圖4所示,是本申請實施例提供的初始邊緣線和初始邊緣線的示意圖。圖4的(a)中有多條初始邊緣線。每條初始邊緣線的斜率各不相同。由於圖4的(a)中最左邊的那條初始邊緣線的邊緣線斜率最大,最右邊的那條初始邊緣線的邊緣線斜率最小,因此,將圖4的(a)中最左邊的那條初始邊緣線確定為第一目標邊緣線,並將最右邊的那條初始邊緣線確定為第二目標邊緣線,得到圖4的(b)中的目標邊緣線。 As shown in FIG. 4 , it is a schematic diagram of the initial edge line and the initial edge line provided by the embodiment of the present application. There are multiple initial edge lines in FIG. 4 (a). The slope of each initial edge line is different. Since the edge line slope of the leftmost initial edge line in FIG. 4 (a) is the largest, and the edge line slope of the rightmost initial edge line is the smallest, therefore, the leftmost initial edge line in FIG. 4 (a) is determined as the first target edge line, and the rightmost initial edge line is determined as the second target edge line, and the target edge line in FIG. 4 (b) is obtained.
在本申請的其他實施例中,還可以使用其它邊緣檢測演算法對所述第一均衡化區域進行道路檢測。例如,Canny邊緣檢測演算法。 In other embodiments of the present application, other edge detection algorithms may be used to perform road detection on the first equalization area. For example, the Canny edge detection algorithm.
步驟S124,根據所述目標邊緣線以及所述第一均衡化區域生成所述目標區域。 Step S124, generating the target area according to the target edge line and the first equalization area.
在本實施例中,所述電腦設備根據所述目標邊緣線以及所述第一均衡化區域生成所述目標區域包括:所述電腦設備將所述第一目標邊緣線以及所述第二目標邊緣線在所述第一均衡化區域圍成的區域確定為道路區域,並基於所述道路區域對所述第一均衡化區域進行二值化處理,得到所述目標區域。 In this embodiment, the computer device generates the target area according to the target edge line and the first equalization area, including: the computer device determines the area enclosed by the first target edge line and the second target edge line in the first equalization area as a road area, and performs binarization processing on the first equalization area based on the road area to obtain the target area.
例如,所述電腦設備可以將所述道路區域中所有像素點的像素值調整為1,並將所述第一均衡化區域中除了所述道路區域之外的像素點的像素值調整為0。 For example, the computer device may adjust the pixel values of all pixels in the road area to 1, and adjust the pixel values of pixels in the first equalization area except the road area to 0.
在本實施例中,在本實施例中,由於所述第一目標邊緣線為最大的邊緣線斜率對應的初始邊緣線及所述第二目標邊緣線為最小的邊緣線斜率對應的初始邊緣線,因此能夠確保選取到所述第一均衡化區域中所有的道路區域, 此外透過對所述第一均衡化區域進行二值化處理,區分了所述第一均衡化區域中的道路區域與非道路區域,使得所述目標區域中的道路區域更加清晰。 In this embodiment, since the first target edge line is the initial edge line corresponding to the maximum edge line slope and the second target edge line is the initial edge line corresponding to the minimum edge line slope, it is possible to ensure that all road areas in the first equalized area are selected. In addition, by binarizing the first equalized area, the road area and the non-road area in the first equalized area are distinguished, making the road area in the target area clearer.
在本申請的至少一個實施例中,所述多個感興趣區域包括預處理區域、第一均衡化區域、第二均衡化區域以及目標區域。其中,所述預處理區域是指對所述道路圖像進行剪裁後生成的區域,所述第一均衡化區域是指對所述預處理區域進行灰度長條圖均衡化處理後生成的區域,所述第二均衡化區域是指對所述預處理區域的每個通道進行長條圖均衡化後生成的區域,所述目標區域是指對所述第一均衡化區域中的初始邊緣線進行篩選後生成的區域。 In at least one embodiment of the present application, the multiple regions of interest include a preprocessing region, a first equalization region, a second equalization region, and a target region. The preprocessing region refers to a region generated after clipping the road image, the first equalization region refers to a region generated after grayscale histogram equalization is performed on the preprocessing region, the second equalization region refers to a region generated after histogram equalization is performed on each channel of the preprocessing region, and the target region refers to a region generated after screening the initial edge line in the first equalization region.
步驟S13,基於多個感興趣區域生成拼接區域。 Step S13, generating a splicing region based on multiple regions of interest.
在本申請的至少一個實施例中,所述電腦設備基於所述多個感興趣區域生成拼接區域包括:所述電腦設備將所述第一均衡化區域與所述目標區域相互中對應的像素點的像素值進行相乘運算,得到第一像素值,並將所述第一均衡化區域中每個像素點的像素值調整為對應的第一像素值,得到第一區域;所述電腦設備將所述第二均衡化區域與所述目標區域中相互對應的像素點的像素值進行相乘運算,得到第二像素值,並將所述第二均衡化區域中每個像素點的像素值調整為對應的第二像素值,得到第二區域;所述電腦設備將所述預處理區域與所述目標區域中相互對應的像素點的像素值進行相乘運算,得到第三像素值,並將所述預處理區域中每個像素點的像素值調整為對應的第三像素值,得到第三區域;然後所述電腦設備將所述第一區域、所述第二區域及所述第三區域進行拼接,得到所述拼接區域。 In at least one embodiment of the present application, the computer device generates a stitching area based on the multiple regions of interest, including: the computer device multiplies the pixel values of the corresponding pixels in the first equalized area and the target area to obtain a first pixel value, and adjusts the pixel value of each pixel in the first equalized area to the corresponding first pixel value to obtain a first area; the computer device multiplies the pixel values of the corresponding pixels in the second equalized area and the target area to obtain The computer device calculates the second pixel value, and adjusts the pixel value of each pixel in the second equalization area to the corresponding second pixel value to obtain the second area; the computer device multiplies the pixel values of the corresponding pixels in the pre-processing area and the target area to obtain a third pixel value, and adjusts the pixel value of each pixel in the pre-processing area to the corresponding third pixel value to obtain the third area; then the computer device splices the first area, the second area and the third area to obtain the spliced area.
在本實施例中,將所述第一區域、所述第二區域及所述第三區域進行拼接,得到所述拼接區域,由於所述拼接區域融合了多個區域的道路特徵,因此能夠使得所述拼接區域的道路的特徵更加明顯。 In this embodiment, the first area, the second area and the third area are spliced to obtain the spliced area. Since the spliced area integrates the road features of multiple areas, the features of the road in the spliced area can be made more obvious.
具體地,所述電腦設備將所述第一區域、所述第二區域及所述第三區域進行拼接,得到所述拼接區域包括:所述電腦設備獲取所述第一區域對應的第一矩陣,獲取所述第二區域對應的第二矩陣,並獲取所述第三區域對應 的第三矩陣,然後所述電腦設備將所述第一矩陣、所述第二矩陣,以及所述第三矩陣進行拼接,得到所述拼接區域。其中,所述拼接區域可以為三維區域。 Specifically, the computer device splices the first area, the second area and the third area to obtain the spliced area, which includes: the computer device obtains the first matrix corresponding to the first area, obtains the second matrix corresponding to the second area, and obtains the third matrix corresponding to the third area, and then the computer device splices the first matrix, the second matrix, and the third matrix to obtain the spliced area. The spliced area can be a three-dimensional area.
步驟S14,將所述拼接區域輸入至預先訓練完成的道路分割模型,得到道路分割圖像以及所述道路分割圖像中的分割結果。 Step S14, input the spliced area into the pre-trained road segmentation model to obtain a road segmentation image and the segmentation result in the road segmentation image.
在本申請的至少一個實施例中,所述道路分割模型包括特徵提取層,所述特徵提取層包括卷積層、池化層以及批標準化層等等。其中,對道路分割模型進行的預先訓練可以參考如圖5所示的訓練流程圖。 In at least one embodiment of the present application, the road segmentation model includes a feature extraction layer, and the feature extraction layer includes a convolution layer, a pooling layer, and a batch normalization layer, etc. The pre-training of the road segmentation model can refer to the training flow chart shown in Figure 5.
步驟S141,獲取道路分割網路、道路訓練圖像以及所述道路訓練圖像的標註結果。 Step S141, obtaining a road segmentation network, a road training image, and the annotation results of the road training image.
在本實施例中,所述道路分割網路包括,但不限於:SegNet、U-Net、FCN等網路。所述道路訓練圖像為多張,每張道路訓練圖像中包含道路,所述多張道路訓練圖像中的標註結果包括每張道路訓練圖像中道路所對應的多個標註像素點、所述多個標註像素點的標註位置、所述多個標註像素點的標註數量以及所述多個標註像素點所構成的標註區域等等。其中,所述標註像素點為每張道路訓練圖像中的道路所對應的像素點。 In this embodiment, the road segmentation network includes, but is not limited to: SegNet, U-Net, FCN and other networks. There are multiple road training images, each of which contains roads. The annotation results in the multiple road training images include multiple annotation pixels corresponding to the roads in each road training image, the annotation positions of the multiple annotation pixels, the annotation quantity of the multiple annotation pixels, and the annotation area formed by the multiple annotation pixels, etc. Among them, the annotation pixels are the pixels corresponding to the roads in each road training image.
步驟S142,將所述道路訓練圖像輸入至所述道路分割網路中進行特徵提取,得到道路特徵圖。 Step S142, input the road training image into the road segmentation network to extract features and obtain a road feature map.
在本實施例中,所述電腦設備使用所述特徵提取層對所述道路訓練圖像進行特徵提取,得到所述道路特徵圖。 In this embodiment, the computer device uses the feature extraction layer to extract features from the road training image to obtain the road feature map.
步驟S143,對所述道路特徵圖中每個像素點進行道路預測,得到所述道路特徵圖的預測結果。 Step S143, performing road prediction on each pixel point in the road feature map to obtain the prediction result of the road feature map.
在本實施例中,所述預測結果包括所述道路訓練圖像中道路所對應的多個道路像素點、所述多個道路像素點的道路位置、所述多個道路像素點的像素數量以及所述多個道路像素點所構成的像素區域等等。 In this embodiment, the prediction result includes a plurality of road pixel points corresponding to the road in the road training image, the road positions of the plurality of road pixel points, the number of pixels of the plurality of road pixel points, and the pixel area formed by the plurality of road pixel points, etc.
在本實施例中,所述電腦設備對每張道路特徵圖中的每個像素點進行類別預測,得到每張道路特徵圖中每個像素點的多個預設的初始類別以及 每個初始類別對應的類別概率,其中,所述多個初始類別包括道路,所述電腦設備將最大的類別概率所對應的初始類別確定為所述目標類別,所述電腦設備將為所述道路類別的目標類別對應的多個像素點確定為所述多個道路像素點,然後所述電腦設備計算所述多個道路像素點的像素數量、獲取所述道路像素點的道路位置並確定所述多個道路像素點構成的像素區域。其中,所述多個初始類別可以自行設置本申請對此不作限制。例如,所述初始類別包括道路、樹木以及車輛等等。 In this embodiment, the computer device predicts the category of each pixel in each road feature map, obtains multiple preset initial categories for each pixel in each road feature map and the category probability corresponding to each initial category, wherein the multiple initial categories include roads, the computer device determines the initial category corresponding to the maximum category probability as the target category, and the computer device determines the multiple pixel points corresponding to the target category of the road category as the multiple road pixel points, and then the computer device calculates the number of pixels of the multiple road pixel points, obtains the road position of the road pixel points and determines the pixel area formed by the multiple road pixel points. The multiple initial categories can be set by themselves and this application does not limit this. For example, the initial categories include roads, trees, and vehicles, etc.
步驟S144,根據所述預測結果以及所述標註結果對所述道路分割網路的參數進行調整,得到訓練完成的道路分割模型。 Step S144, adjusting the parameters of the road segmentation network according to the prediction results and the annotation results to obtain a trained road segmentation model.
在本實施例中,所述電腦設備根據所述預測結果以及所述標註結果對所述道路分割網路的參數進行調整,得到訓練完成的道路分割模型包括:所述電腦設備根據所述預測結果以及所述標註結果計算所述道路分割網路的預測指標,並基於所述預測指標對所述道路分割網路進行參數調整,直至所述預測指標滿足預設條件,得到所述訓練完成的道路分割模型。 In this embodiment, the computer device adjusts the parameters of the road segmentation network according to the prediction result and the annotation result to obtain the trained road segmentation model, including: the computer device calculates the prediction index of the road segmentation network according to the prediction result and the annotation result, and adjusts the parameters of the road segmentation network based on the prediction index until the prediction index meets the preset conditions, thereby obtaining the trained road segmentation model.
其中,所述預測指標可以為預測準確率,所述預設條件可以為:所述預測準確率大於或者等於預設閥值或者所述預測準確率不再增大,所述預設閥值可以自行設置,本申請對此不作限制。 Among them, the prediction index can be the prediction accuracy, and the preset condition can be: the prediction accuracy is greater than or equal to the preset valve value or the prediction accuracy no longer increases. The preset valve value can be set by yourself, and this application does not impose any restrictions on this.
具體地,若所述預測指標為預測準確率,所述電腦設備根據所述預測結果以及所述標註結果計算所述道路分割網路的預測指標包括:所述電腦設備計算所述多張道路訓練圖像的訓練數量,並計算與對應的標註結果相同的預測結果的預測數量,進一步地,所述電腦設備計算所述預測數量與所述訓練數量的比值,得到所述預測準確率。 Specifically, if the prediction index is the prediction accuracy, the computer device calculates the prediction index of the road segmentation network according to the prediction result and the annotation result, including: the computer device calculates the training quantity of the plurality of road training images, and calculates the prediction quantity of the prediction results that are the same as the corresponding annotation results, and further, the computer device calculates the ratio of the prediction quantity to the training quantity to obtain the prediction accuracy.
所述道路分割圖像的生成過程與所述道路分割模型的訓練過程基本相同,故本實施例中不再重複描述。如圖6所示,是本申請實施例提供的道路分割圖像的示意圖。圖6中顏色較淺部分為所述道路分割圖像中的道路區域。 The generation process of the road segmentation image is basically the same as the training process of the road segmentation model, so it will not be repeated in this embodiment. As shown in Figure 6, it is a schematic diagram of the road segmentation image provided by the embodiment of this application. The lighter color part in Figure 6 is the road area in the road segmentation image.
在本實施例中,透過所述預測準確率確定所述道路分割網路是否 收斂,當所述道路分割網路收斂時,預測準確率最高,得到所述道路分割模型,因此,能夠確保所述道路分割模型的檢測準確性。 In this embodiment, the prediction accuracy is used to determine whether the road segmentation network converges. When the road segmentation network converges, the prediction accuracy is the highest, and the road segmentation model is obtained. Therefore, the detection accuracy of the road segmentation model can be ensured.
在本申請的至少一個實施例中,所述道路分割圖像的生成過程與所述道路分割模型的訓練過程基本相同,所述分割結果的生成過程與所述預測結果的生成過程基本相同,故本申請在此不作贅述。由於所述道路圖像也需要經過剪裁,因此,在得到所述道路分割圖像之後,還需要重新調整所述道路分割圖像的尺寸,使得所述道路分割圖像的尺寸大小與所述道路圖像的尺寸大小相同。 In at least one embodiment of the present application, the process of generating the road segmentation image is substantially the same as the process of training the road segmentation model, and the process of generating the segmentation result is substantially the same as the process of generating the prediction result, so the present application will not elaborate on this. Since the road image also needs to be cropped, after obtaining the road segmentation image, the size of the road segmentation image needs to be re-adjusted so that the size of the road segmentation image is the same as the size of the road image.
由上述技術方案可知,本申請對所述道路圖像進行影像處理,得到多個感興趣區域,所述影像處理包括圖像剪裁、二值化及均衡化、道路檢測以及霍夫變換,由於圖像裁剪能夠刪除所述道路圖像中不包含道路的部分,因此,能夠減少對道路檢測干擾。當所述道路圖像為逆光圖像時,透過對所述逆光圖像進行二值化及均衡化處理,能夠降低所述逆光圖像的亮度使得所述逆光圖像中更加清晰。透過對所述逆光圖像進行道路檢測,能夠檢測到所述逆光圖像中道路的多條可能的初始邊緣線,透過霍夫變換對所述多條可能的邊緣線進行篩選,得到目標邊緣線,因此能夠提高道路檢測的準確性。此外,由於所述多個感興趣區域中融合了更多道路資訊,因此基於所述多個感興趣區域生成拼接區域,能夠使得所述拼接區域中的道路更加清晰。此外,透過預先訓練完成的道路分割模型對所述拼接區域中的道路進行檢測,由於所述道路分割模型學習到了道路的位置特徵,因此,能夠更為準確地預測出所述拼接區域中道路的位置。 It can be seen from the above technical solution that the present application performs image processing on the road image to obtain multiple regions of interest. The image processing includes image cropping, binarization and equalization, road detection and Hough transform. Since image cropping can delete the part of the road image that does not contain the road, it can reduce the interference to the road detection. When the road image is a backlit image, by binarizing and equalizing the backlit image, the brightness of the backlit image can be reduced to make the backlit image clearer. By performing road detection on the backlit image, multiple possible initial edge lines of the road in the backlit image can be detected, and the multiple possible edge lines are screened by Hough transform to obtain the target edge line, thereby improving the accuracy of road detection. In addition, since more road information is integrated into the multiple regions of interest, the roads in the spliced regions can be made clearer by generating a spliced region based on the multiple regions of interest. In addition, the roads in the spliced region are detected by using a pre-trained road segmentation model. Since the road segmentation model has learned the location features of the roads, the location of the roads in the spliced region can be predicted more accurately.
如圖7所示,是本申請實施例提供的電腦設備的結構示意圖。 As shown in Figure 7, it is a schematic diagram of the structure of the computer device provided in the embodiment of this application.
在本申請的一個實施例中,所述電腦設備1包括,但不限於,儲存器12、處理器13,以及儲存在所述儲存器12中並可在所述處理器13上運行的電腦程式,例如道路分割程式。 In one embodiment of the present application, the computer device 1 includes, but is not limited to, a memory 12, a processor 13, and a computer program stored in the memory 12 and executable on the processor 13, such as a road segmentation program.
本領域技術人員可以理解,所述示意圖僅僅是電腦設備1的示例, 並不構成對電腦設備1的限定,可以包括比圖示更多或更少的部件,或者組合某些部件,或者不同的部件,例如所述電腦設備1還可以包括輸入輸出設備、模型接入設備、匯流排等。 Those skilled in the art can understand that the schematic diagram is only an example of the computer device 1, and does not constitute a limitation on the computer device 1. The computer device 1 may include more or fewer components than shown in the diagram, or may combine certain components, or may include different components. For example, the computer device 1 may also include input and output devices, model access devices, buses, etc.
所述處理器13可以是中央處理單元(Central Processing Unit,CPU),還可以是其他通用處理器、數位訊號處理器(Digital Signal Processor,DSP)、專用積體電路(Application Specific Integrated Circuit,ASIC)、現場可程式設計閘陣列(Field-Programmable Gate Array,FPGA)或者其他可程式設計邏輯器件、分立元器件門電路或者電晶體組件、分立硬體組件等。通用處理器可以是微處理器或者該處理器也可以是任何常規的處理器等,所述處理器13是所述電腦設備1的運算核心和控制中心,利用各種介面和線路連接整個電腦設備1的各個部分,及獲取所述電腦設備1的作業系統以及安裝的各類應用程式、程式碼等。 The processor 13 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete component gate circuits or transistor components, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor 13 is the computing core and control center of the computer device 1, and uses various interfaces and lines to connect various parts of the entire computer device 1, and obtain the operating system of the computer device 1 and various installed applications, program codes, etc.
所述處理器13獲取所述電腦設備1的作業系統以及安裝的各類應用程式。所述處理器13獲取所述應用程式以實現上述各個道路分割方法實施例中的步驟,例如圖2、圖3和圖5所示的步驟。 The processor 13 obtains the operating system of the computer device 1 and various installed applications. The processor 13 obtains the applications to implement the steps in the above-mentioned road segmentation method embodiments, such as the steps shown in Figures 2, 3 and 5.
示例性的,所述電腦程式可以被分割成一個或多個模組/單元,所述一個或者多個模組/單元被儲存在所述儲存器12中,並由所述處理器13獲取,以完成本申請。所述一個或多個模組/單元可以是能夠完成特定功能的一系列電腦程式指令段,該指令段用於描述所述電腦程式在所述電腦設備1中的獲取過程。 Exemplarily, the computer program may be divided into one or more modules/units, which are stored in the memory 12 and acquired by the processor 13 to complete the present application. The one or more modules/units may be a series of computer program instruction segments capable of completing a specific function, which are used to describe the acquisition process of the computer program in the computer device 1.
所述儲存器12可用於儲存所述電腦程式和/或模組,所述處理器13透過運行或獲取儲存在所述儲存器12內的電腦程式和/或模組,以及調用儲存在儲存器12內的資料,實現所述電腦設備1的各種功能。所述儲存器12可主要包括儲存程式區和儲存資料區,其中,儲存程式區可儲存作業系統、至少一個功能所需的應用程式(比如聲音播放功能、圖像播放功能等)等;儲存資料區可儲存根據電腦設備的使用所創建的資料等。此外,儲存器12可以包括 非易失性儲存器,例如硬碟、記憶體(memory)、插接式硬碟,智慧儲存卡(Smart Media Card,SMC),安全數位(Secure Digital,SD)卡,記憶卡(Flash Card)、至少一個磁碟儲存器件、記憶器件、或其他非易失性固態儲存器件。 The memory 12 can be used to store the computer program and/or module. The processor 13 realizes various functions of the computer device 1 by running or obtaining the computer program and/or module stored in the memory 12 and calling the data stored in the memory 12. The memory 12 can mainly include a program storage area and a data storage area, wherein the program storage area can store the operating system, at least one application required for a function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created according to the use of the computer device. In addition, the memory 12 may include a non-volatile memory, such as a hard disk, a memory (memory), a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a memory card (Flash Card), at least one disk storage device, a memory device, or other non-volatile solid-state storage devices.
所述儲存器12可以是電腦設備1的外部儲存器和/或內部儲存器。進一步地,所述儲存器12可以是具有實物形式的儲存器,如記憶條、TF卡(Trans-flash Card)等等。 The memory 12 may be an external memory and/or an internal memory of the computer device 1. Furthermore, the memory 12 may be a physical memory, such as a memory stick, a TF card (Trans-flash Card), etc.
所述電腦設備1集成的模組/單元如果以軟體功能單元的形式實現並作為獨立的產品銷售或使用時,可以儲存在一個電腦可讀取儲存介質中。基於這樣的理解,本申請實現上述實施例方法中的全部或部分流程,也可以透過電腦程式來指令相關的硬體來完成,所述的電腦程式可儲存於一電腦可讀儲存介質中,該電腦程式在被處理器獲取時,可實現上述各個方法實施例的步驟。 If the module/unit integrated in the computer device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application can implement all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is obtained by the processor, the steps of the above-mentioned method embodiments can be implemented.
其中,所述電腦程式包括電腦程式代碼,所述電腦程式代碼可以為原始程式碼形式、物件代碼形式、可獲取檔或某些中間形式等。所述電腦可讀介質可以包括:能夠攜帶所述電腦程式代碼的任何實體或裝置、記錄介質、隨身碟、移動硬碟、磁碟、光碟、電腦儲存器、唯讀記憶體(ROM,Read-Only Memory)。 The computer program includes computer program code, which may be in source code form, object code form, retrievable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, flash drive, mobile hard drive, magnetic disk, optical disk, computer storage, read-only memory (ROM).
結合圖2,所述電腦設備1中的所述儲存器12儲存多個指令以實現一種道路分割方法,所述處理器13可獲取所述多個指令從而實現:獲取道路圖像;對所述道路圖像進行影像處理,得到多個感興趣區域;基於所述多個感興趣區域生成拼接區域;將所述拼接區域輸入至預先訓練完成的道路分割模型,得到道路分割圖像以及所述道路分割圖像中的分割結果。 In conjunction with Figure 2, the memory 12 in the computer device 1 stores multiple instructions to implement a road segmentation method, and the processor 13 can obtain the multiple instructions to implement: obtaining a road image; performing image processing on the road image to obtain multiple regions of interest; generating a spliced area based on the multiple regions of interest; inputting the spliced area into a pre-trained road segmentation model to obtain a road segmentation image and a segmentation result in the road segmentation image.
具體地,所述處理器13對上述指令的具體實現方法可參考圖2對應實施例中相關步驟的描述,在此不贅述。 Specifically, the specific implementation method of the processor 13 for the above instructions can refer to the description of the relevant steps in the corresponding embodiment of Figure 2, which will not be elaborated here.
在本申請所提供的幾個實施例中,應該理解到,所揭露的系統,裝置和方法,可以透過其它的方式實現。例如,以上所描述的裝置實施例僅僅是示意性的,例如,所述模組的劃分,僅僅為一種邏輯功能劃分,實際實現時 可以有另外的劃分方式。 In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation.
所述作為分離部件說明的模組可以是或者也可以不是物理上分開的,作為模組顯示的部件可以是或者也可以不是物理單元,即可以處於一個地方,或者也可以分佈到多個模型單元上。可以根據實際的需要選擇其中的部分或者全部模組來實現本實施例方案的目的。 The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple model units. Some or all of the modules may be selected according to actual needs to achieve the purpose of this embodiment.
另外,在本申請各個實施例中的各功能模組可以集成在一個處理單元中,也可以是各個單元單獨物理存在,也可以兩個或兩個以上單元集成在一個單元中。上述集成的單元既可以採用硬體的形式實現,也可以採用硬體加軟體功能模組的形式實現。因此,無論從哪一點來看,均應將實施例看作是示範性的,而且是非限制性的,本申請的範圍由所附請求項而不是上述說明限定,因此旨在將落在請求項的等同要件的含義和範圍內的所有變化涵括在本申請內。不應將請求項中的任何附關聯圖標記視為限制所涉及的請求項。 In addition, each functional module in each embodiment of the present application may be integrated into a processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules. Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-restrictive. The scope of the present application is limited by the attached claims rather than the above description, so it is intended to include all changes within the meaning and scope of the equivalent elements of the claims in the present application. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
此外,顯然“包括”一詞不排除其他單元或步驟,單數不排除複數。本申請中陳述的多個單元或裝置也可以由一個單元或裝置透過軟體或者硬體來實現。第一、第二等詞語用來表示名稱,而並不表示任何特定的順序。 In addition, it is obvious that the word "including" does not exclude other units or steps, and the singular does not exclude the plural. The multiple units or devices described in this application can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any specific order.
最後應說明的是,以上實施例僅用以說明本申請的技術方案而非限制,儘管參照較佳實施例對本申請進行了詳細說明,本領域的普通技術人員應當理解,可以對本申請的技術方案進行修改或等同替換,而不脫離本申請技術方案的精神和範圍。 Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of this application and are not limiting. Although this application is described in detail with reference to the preferred embodiments, ordinary technicians in this field should understand that the technical solution of this application can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of this application.
S11~S14:步驟 S11~S14: Steps
Claims (9)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW111146059A TWI846177B (en) | 2022-11-30 | 2022-11-30 | Road image segmentation method, computer device and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW111146059A TWI846177B (en) | 2022-11-30 | 2022-11-30 | Road image segmentation method, computer device and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| TW202424777A TW202424777A (en) | 2024-06-16 |
| TWI846177B true TWI846177B (en) | 2024-06-21 |
Family
ID=92539827
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW111146059A TWI846177B (en) | 2022-11-30 | 2022-11-30 | Road image segmentation method, computer device and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| TW (1) | TWI846177B (en) |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110910497A (en) * | 2019-11-15 | 2020-03-24 | 北京信息科技大学 | Method and system for realizing augmented reality map |
| US10657390B2 (en) * | 2017-11-27 | 2020-05-19 | Tusimple, Inc. | System and method for large-scale lane marking detection using multimodal sensor data |
| CN113298810A (en) * | 2021-06-28 | 2021-08-24 | 浙江工商大学 | Trace detection method combining image enhancement and depth convolution neural network |
| CN113313071A (en) * | 2021-06-28 | 2021-08-27 | 浙江同善人工智能技术有限公司 | Road area identification method and system |
| CN114862889A (en) * | 2022-05-05 | 2022-08-05 | 国交空间信息技术(北京)有限公司 | Road edge extraction method and device based on remote sensing image |
| CN115116018A (en) * | 2022-06-30 | 2022-09-27 | 北京旋极信息技术股份有限公司 | Method and device for fitting lane line |
-
2022
- 2022-11-30 TW TW111146059A patent/TWI846177B/en active
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10657390B2 (en) * | 2017-11-27 | 2020-05-19 | Tusimple, Inc. | System and method for large-scale lane marking detection using multimodal sensor data |
| CN110910497A (en) * | 2019-11-15 | 2020-03-24 | 北京信息科技大学 | Method and system for realizing augmented reality map |
| CN113298810A (en) * | 2021-06-28 | 2021-08-24 | 浙江工商大学 | Trace detection method combining image enhancement and depth convolution neural network |
| CN113313071A (en) * | 2021-06-28 | 2021-08-27 | 浙江同善人工智能技术有限公司 | Road area identification method and system |
| CN114862889A (en) * | 2022-05-05 | 2022-08-05 | 国交空间信息技术(北京)有限公司 | Road edge extraction method and device based on remote sensing image |
| CN115116018A (en) * | 2022-06-30 | 2022-09-27 | 北京旋极信息技术股份有限公司 | Method and device for fitting lane line |
Also Published As
| Publication number | Publication date |
|---|---|
| TW202424777A (en) | 2024-06-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN112528878B (en) | Method and device for detecting lane line, terminal equipment and readable storage medium | |
| TWI766201B (en) | Methods and devices for biological testing and storage medium thereof | |
| CN110705583B (en) | Cell detection model training method, device, computer equipment and storage medium | |
| CN107274445B (en) | Image depth estimation method and system | |
| US10586152B2 (en) | Determining image forensics using gradient statistics at edges | |
| KR20180065889A (en) | Method and apparatus for detecting target | |
| US20240177499A1 (en) | Method for detecting lane lines and electronic device | |
| CN113537037A (en) | Pavement disease identification method, system, electronic device and storage medium | |
| CN115880177B (en) | Full resolution low illumination image enhancement method for aggregating context and enhancing detail | |
| CN111325107A (en) | Detection model training method and device, electronic equipment and readable storage medium | |
| CN113505702A (en) | Pavement disease identification method and system based on double neural network optimization | |
| CN114170565A (en) | A method, device and terminal equipment for image comparison based on UAV aerial photography | |
| WO2020259416A1 (en) | Image collection control method and apparatus, electronic device, and storage medium | |
| KR20220069845A (en) | Method and system for detecting and classifying lanes | |
| CN117789144A (en) | A cross network lane line detection method and device based on weight fusion | |
| CN111178200B (en) | Method for identifying instrument panel indicator lamp and computing equipment | |
| CN115689858A (en) | Construction method, device, automatic driving system and medium of image signal processor | |
| CN118172376A (en) | Road segmentation method, electronic device and storage medium | |
| KR101592087B1 (en) | Method for generating saliency map based background location and medium for recording the same | |
| TWI846177B (en) | Road image segmentation method, computer device and storage medium | |
| CN114255268A (en) | Disparity map processing and deep learning model training method and related equipment | |
| TWI807904B (en) | Method for training depth identification model, method for identifying depth of images and related devices | |
| CN117765493A (en) | Target recognition method for fish-eye image, electronic device and storage medium | |
| CN112446230A (en) | Method and device for recognizing lane line image | |
| CN116580230A (en) | Target detection method and training method of classification model |