Image Processing Method, Related Device and Computer Program Product
By identifying the travelable area in the vehicle navigation guide image and performing dynamic cropping, the image deformation problem caused by full-screen filling is solved, the display quality and adaptability of the navigation guide image is improved, and it is suitable for different screen sizes.
Patent Information
- Application Number
- CN202210012545.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-06
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2042-01-06
AI Technical Summary
The prior art shows the navigation guide image through full-screen filling technology in vehicle AR navigation, which causes image elements to deform, reducing the display quality of the navigation guide image.
By identifying the vehicle's travelable area in the navigation guide image and dynamically cropping according to the size of the screen area, an adaptive navigation guide image is generated to avoid stretching or compression processing, ensuring that the image elements do not deform.
It improves the display quality and adaptability of navigation and guidance images, is suitable for any screen size, and is highly extensible, avoiding image elements deformation.
Smart Images

Figure CN114399517B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet technologies, specifically to the field of image processing technologies, and particularly to an image processing method, related devices, and computer program products. Background Art
[0002] With the development of science and technology, more and more vehicles support the AR navigation (Augmented Reality Navigation) function. The so-called AR navigation refers to a navigation form in which the scene images collected during the vehicle's driving process and virtual guidance information are fused, and then the fused navigation guidance image is displayed on the display screen configured in the vehicle. Currently, the full-screen filling technology is usually used to display the navigation guidance image on the display screen. The so-called full-screen filling technology is a technology used to make the displayed navigation guidance image fill the entire display screen. It mainly stretches and compresses the navigation guidance image to be displayed according to the size of the display screen, so that the size of the processed navigation guidance image adapts to the size of the display screen. However, stretching, compressing, etc. of the navigation guidance image will cause the image elements in the displayed navigation guidance image to deform, which will reduce the display quality of the navigation guidance image. Summary of the Invention
[0003] Embodiments of this application provide an image processing method, related devices, and computer program products, which can improve the display quality of the navigation guidance image while ensuring the display adaptability of the navigation guidance image.
[0004] On the one hand, embodiments of this application provide an image processing method, the method includes:
[0005] During the driving process of the vehicle, obtain a target navigation guidance image generated based on a scene image; the vehicle is configured with a screen area for displaying a navigation guidance image, and the scene image is obtained by photographing the road scene in front of the vehicle in the driving direction of the vehicle;
[0006] Identify the drivable area of the target navigation guidance image to obtain the current drivable area of the vehicle in the target navigation guidance image;
[0007] According to the regional sizes of the current drivable area and the screen area, dynamically crop the target navigation guidance image to obtain an adapted navigation guidance image with an image size adapted to the regional size;
[0008] Display the adapted navigation guidance image in the screen area of the vehicle.
[0009] On the other hand, an embodiment of the present application provides an image processing apparatus, the apparatus comprising:
[0010] An acquisition unit, configured to acquire a target navigation guidance image generated based on a scene image during the driving of a vehicle; the vehicle is configured with a screen area for displaying a navigation guidance image, and the scene image is obtained by photographing a road scene in front of the vehicle in the driving direction of the vehicle;
[0011] A processing unit, configured to identify a drivable area of the target navigation guidance image to obtain a current drivable area of the vehicle in the target navigation guidance image;
[0012] The processing unit is further configured to dynamically crop the target navigation guidance image according to the current drivable area and the area size of the screen area, so as to obtain an adapted navigation guidance image with an image size adapted to the area size;
[0013] A display unit, configured to display the adapted navigation guidance image in the screen area of the vehicle.
[0014] On yet another aspect, an embodiment of the present application provides a computer device, the computer device comprising an input interface and an output interface, and the computer device further comprising:
[0015] A processor, adapted to implement one or more instructions; and a computer storage medium;
[0016] Wherein, the computer storage medium stores one or more instructions, and the one or more instructions are adapted to be loaded and executed by the processor to perform the above-mentioned image processing method.
[0017] On yet another aspect, an embodiment of the present application provides a computer storage medium, the computer storage medium storing one or more instructions, and the one or more instructions are adapted to be loaded and executed by a processor to perform the above-mentioned image processing method.
[0018] On yet another aspect, an embodiment of the present application provides a computer program product, the computer program product comprising a computer program; when the computer program is executed by a processor, the above-mentioned image processing method is implemented.
[0019] After obtaining the target navigation guidance image generated based on the scene image in the embodiment of the present application, the drivable area of the target navigation guidance image can be recognized to identify the current drivable area of the vehicle. Then, according to the drivable area and the area size of the screen area, the target navigation guidance image can be dynamically cropped. On the one hand, by referring to the area size of the screen area, it can be ensured that an adapted navigation guidance image with an image size adapted to the area size can be finally obtained, thus ensuring the display adaptability of the navigation guidance image. On the other hand, by referring to the current drivable area, on-demand cropping can be achieved, avoiding cropping off the important image area of the drivable area, so as to ensure that the drivable area of the vehicle can still be included in the finally obtained adapted navigation guidance image, improving the guiding effect and display quality of the navigation guidance image. It can be seen that by dynamically cropping the target navigation guidance image, it is possible to achieve the adaptation between the target navigation guidance image and the screen area without stretching, compressing, etc. processing the target navigation guidance image, which can avoid the deformation of image elements in the target navigation guidance image and further improve the display quality of the navigation guidance image. Moreover, since the embodiment of the present application can ensure the display adaptability of the navigation guidance image through the above steps for any size of the screen area, it can be known that the embodiment of the present application can be extended to any size of the screen area, indicating that the embodiment of the present application has high adaptability and scalability. Description of the Drawings
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0021] Figure 1a It is a schematic diagram of the generation of a navigation guidance image provided by an embodiment of the present application;
[0022] Figure 1b It is a schematic diagram of an image processing solution provided by an embodiment of the present application;
[0023] Figure 1c It is a schematic diagram of various display screens configured in a vehicle provided by an embodiment of the present application;
[0024] Figure 1d It is a schematic diagram of displaying a navigation guidance image on various display screens provided by an embodiment of the present application;
[0025] Figure 2 It is a schematic diagram of the flowchart of an image processing method provided by an embodiment of the present application;
[0026] Figure 3aIt is a schematic diagram of the recognition principle of a segmentation model provided by an embodiment of the present application;
[0027] Figure 3b It is a schematic diagram of recognizing a current drivable area from a target navigation guidance image provided by an embodiment of the present application;
[0028] Figure 3c It is another schematic diagram of recognizing a current drivable area from a target navigation guidance image provided by an embodiment of the present application;
[0029] Figure 3d It is a schematic diagram of dynamically cropping a target navigation guidance image to obtain an adapted navigation guidance image provided by an embodiment of the present application;
[0030] Figure 4 It is a schematic flowchart of an image processing method provided by another embodiment of the present application;
[0031] Figure 5a It is a schematic diagram of the size relationship between an initial navigation guidance image and a screen area provided by an embodiment of the present application;
[0032] Figure 5b It is another schematic diagram of the size relationship between an initial navigation guidance image and a screen area provided by an embodiment of the present application;
[0033] Figure 5c It is a schematic diagram of determining a distance identifier of an identification line provided by an embodiment of the present application;
[0034] Figure 5d It is a schematic diagram of determining a new drivable area based on a current drivable area provided by an embodiment of the present application;
[0035] Figure 5e It is another schematic diagram of determining a new drivable area based on a current drivable area provided by an embodiment of the present application;
[0036] Figure 5f It is a schematic diagram of a cropping value provided by an embodiment of the present application;
[0037] Figure 5g It is a schematic diagram of cropping an area to be cropped from a target navigation guidance image provided by an embodiment of the present application;
[0038] Figure 6 It is a schematic structural diagram of an image processing device provided by an embodiment of the present application;
[0039] Figure 7 It is a schematic structural diagram of a computer device provided by an embodiment of the present application. Specific embodiments
[0040] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application.
[0041] In the embodiments of the present application, the navigation guidance image can also be referred to as an AR navigation map surface (abbreviated as an AR map surface), which can be understood as a map that can be used for navigation and present real-world information. Specifically, the navigation guidance image can refer to: an image obtained by fusing virtual guidance information and scene images collected in real time during the vehicle's driving process based on the AR navigation function. Among them, the virtual guidance information refers to the guidance information drawn according to actual navigation needs, which can include but is not limited to: driving path indication information, turning indication information, vehicle speed, road speed limit, and so on; taking the virtual guidance information including driving path indication information and turning indication information as an example, a schematic diagram of fusing the virtual guidance information and the scene image to obtain the navigation guidance image can be seen Figure 1a as shown.
[0042] In order to improve the display quality and display adaptability of the navigation guidance image (i.e., the AR map surface), the embodiments of the present application propose an image processing solution based on artificial intelligence (AI) technology. The AI technology mentioned here refers to the theory, method, technology, and application system that uses a digital computer or a machine controlled by a digital computer to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to obtain the best results. AI technology is a comprehensive discipline, which mainly includes several major directions such as computer vision technology (CV), natural language processing technology, and machine learning (ML) / deep learning. Among them, computer vision technology is a science that studies how to make a machine "see". More specifically, it refers to using a camera and a computer to replace the human eye to identify and measure targets, etc., for machine vision, and further perform graphic processing to make the computer process the image into a more suitable image for human eye observation or transmission to an instrument for detection. Computer vision technology usually includes technologies such as image processing, image recognition, image semantic understanding, image retrieval, video processing, video semantic understanding, video content / behavior recognition, augmented reality, simultaneous localization and mapping.
[0043] Specifically, the image processing solution proposed in the embodiments of the present application mainly extracts the drivable area in the AR map based on the image recognition method in AI technology, and calculates the cropping parameters of the AR map (the size of the image area to be cropped off) according to the drivable area, so as to achieve the purpose of adapting the AR map to display screens of different sizes. Among them, the drivable area mentioned here refers to the area in the AR map where the vehicle is allowed to drive; for example, a vehicle is usually allowed to drive in a lane, so the drivable area can be the display area formed by one or more lane roads in the AR map. Further, the general principle of this image processing solution is as follows: First, a scene image can be obtained during the driving of the vehicle. The scene image can be taken of the road scene in front of the vehicle in the driving direction of the vehicle; and, an initial AR map is obtained by fusing the scene image and the virtual guidance information. Then, the initial image size (i.e., the initial size) of the initial AR map can be determined, as well as the area size of the screen area in the vehicle for displaying the AR map (i.e., the size of the AR map display); among them, the image size can be equal to the resolution of the corresponding image, and the area size can be equal to the resolution of the screen area. If the initial image size and the area size are the same, the initial AR map can be directly displayed in the screen area; if the initial image size and the area size are different, any of the following scaling and cropping processing logics can be used to implement the display of the AR map:
[0044] (1) The processing strategy logic of scaling first and then cropping: The initial AR map can be processed to be enlarged, reduced or unchanged as needed according to the difference between the initial image size and the area size to obtain a target AR map. Then, if the target image size of the target AR map is greater than the area size of the screen area, the current drivable area can be extracted from the target AR map based on the image recognition method, and the cropping parameters of the target AR map can be calculated according to the current drivable area, so that the image size of the target AR map can be dynamically cropped from the target image size to the area size according to the cropping parameters, to obtain an adapted AR map with the image size adapted to the area size, so as to perform on-screen display on the adapted AR map, that is, display the cropped adapted AR map in the screen area for display.
[0045] (2) Processing logic of first cropping and then scaling: Directly use the initial AR image surface as the target AR image surface, and based on the method of image recognition, extract the current drivable area from the target AR image surface. Then, according to the aspect ratio of the current drivable area and the screen area, calculate the cropping parameters of the target AR image surface, so as to dynamically crop the target AR image surface based on the cropping parameters, making the aspect ratio of the cropped target AR image surface equal to the aspect ratio of the screen area. Then, according to the size relationship between the cropped target AR image surface and the screen area, dynamically scale the cropped target AR image surface to obtain an adapted AR image surface with the image size adapted to the area size, and then display the adapted AR image surface on the screen.
[0046] In specific implementation, the above-mentioned image processing solution can be executed by a computer device, which can be a terminal or a server. Among them, the terminal mentioned here can include but is not limited to: smart phones, tablets, laptop computers, desktop computers, smart wearable devices (such as smart watches, smart glasses), smart TVs, smart vehicle terminals, etc. The server mentioned here can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, etc. Further, the computer device can be located inside or outside the blockchain network, and this is not limited. Even further, the computer device can also upload any data stored internally to the blockchain network for storage to prevent the data stored internally from being tampered with and improve data security.
[0047] Alternatively, the image processing solution can be jointly executed by the terminal and the server. Taking the implementation of the AR graphic display using a processing strategy of first scaling and then cropping as an example: For example, the terminal can call the camera component configured in the vehicle to capture the road scene in front of the vehicle in the driving direction of the vehicle to obtain a scene image, and obtain an initial AR graphic based on the scene image, and then send the initial AR graphic to the server. The server is responsible for determining the initial image size of the initial AR graphic and the area size of the screen area, and then performing subsequent processing based on the initial image size and the area size. For example, when the initial image size and the area size are different, processing to obtain a target AR graphic based on the initial AR graphic, and when the target image size of the target AR graphic is larger than the area size, performing processing such as extracting the drivable area, dynamically cropping, and displaying on the screen for the target AR graphic. Among them, when the server performs the processing of displaying on the screen in this case, it can be to send the AR graphic to be displayed to the vehicle, and the vehicle displays the AR graphic to be displayed in the screen area, as Figure 1b shown. Another example is that the terminal can be responsible for obtaining the scene image and the initial AR graphic, and when the initial image size and the area size are the same, directly display the initial AR graphic in the screen area; when the initial image size and the area size are different, obtain a target AR graphic based on the initial AR graphic, and then send the target AR graphic to the server, so that the server is responsible for processing such as extracting the drivable area, dynamically cropping, and displaying on the screen for the target AR graphic.
[0048] Among them, the above-mentioned screen area can refer to: a partial area or the entire area of the display screen in the vehicle for displaying the AR graphic, which can depend on the display strategy adopted by different display screens for the AR graphic. For example, see Figure 1cAs shown in the figure, the display screens in the vehicle that can support the display of AR graphics may include, but are not limited to: the central control screen, the instrument screen, the HUD (Head-Up Display) screen, etc. Among them, ① the central control screen refers to the display screen on the central console, which is mainly used to display vehicle audio, navigation, vehicle information, reverse image, etc.; since the central control screen may display the AR graphics in full screen or in split screen, when the AR graphics are displayed through the central control screen, the screen area mentioned above may be the entire area or part of the area of the central control screen. ② The instrument screen refers to the display screen used to display the vehicle instrument. The physical size of the instrument screen is relatively smaller than that of the central control screen, and the resolution of the instrument screen is usually lower than that of the central control screen. Its display effect needs to be adapted according to the resolution of the screen; since the instrument screen can support the display of AR graphics in the remaining area outside the area where the instrument is located, when the AR graphics are displayed through the instrument screen, the screen area mentioned above may be part of the area of the instrument screen. ③ The HUD screen is a display screen located on the front windshield of the driver's seat. By displaying the AR graphics on the HUD screen, the real scene and the virtual guidance information can be integrated and presented as an overall picture in the user's field of vision; since it can display the AR graphics in full screen, when the AR graphics are displayed through the HUD screen, the screen area mentioned above may be the entire area of the HUD screen.
[0049] Based on this, assume that the initial image size (i.e., resolution) of the initial AR graphics is 1280×720, and the screen size of the central control screen is 1280×720. Then, when the AR graphics are displayed through the central control screen, if the entire screen of the central control screen is used to display the AR graphics, that is, the area size of the screen area mentioned above is 1280×720, then the resolution of the AR graphics displayed in the screen area through the image processing solution proposed above is 1280×720, as shown in Figure 1d the first figure in. When the AR graphics are displayed through the central control screen, if the central control screen displays the AR image and the SD navigation (Standard Dimension Navigation) graphics in split screen, and the area size of the screen area mentioned above is 790×720, then the resolution of the AR graphics displayed in the screen area through the image processing solution proposed above is 790×720, as shown in Figure 1d the second figure in. When the AR graphics are displayed through the instrument screen, if the area size of the screen area mentioned above is 800×555, then the resolution of the AR graphics displayed in the screen area through the image processing solution proposed above is 800×555, as shown in Figure 1dThe third figure in []. When displaying the AR graphic on the HUD screen, if the area size of the above-mentioned screen area is 1280×720, then the resolution of the AR graphic displayed in the screen area through the above-mentioned image processing solution is 1280×720, as shown in Figure 1d The fourth figure in [].
[0050] It should be understood that Figure 1d only exemplarily lists the display forms of the AR graphic on some currently common display screens. With the iterative upgrade of the screen product form, the display position and area of the AR graphic in the display screen can change accordingly; in this case, the image processing solution proposed in the embodiments of the present application can be used to adaptively process the AR graphic according to the screen type and the area size of the screen area used to display the AR graphic in the screen, so as to realize the display of the AR graphic on different screens. It can be seen that the image processing solution proposed in the embodiments of the present application can achieve the adaptability of multiple scenarios (i.e., the scenarios of displaying the AR graphic on different display screens), effectively reducing the adaptation cost.
[0051] Based on the above description of the image processing solution, embodiments of the present application propose an image processing method. This image processing method can be executed by the above-mentioned computer device (such as a terminal or a server), or can be jointly executed by the terminal and the server; for the convenience of explanation, in the following, it will be described by taking the computer device executing this image processing method as an example. Please refer to Figure 2 , this image processing method may include the following steps S201-S204:
[0052] S201, during the driving process of the vehicle, obtain a target navigation guidance image generated based on the scene image.
[0053] Among them, the vehicle is configured with a screen area for displaying a navigation guidance image (i.e., an AR graphic). The scene image is obtained by photographing the road scene in front of the vehicle in the driving direction of the vehicle; specifically, one or more camera components with different orientations can be configured on the vehicle, and this scene image can be obtained by calling the camera component that matches the driving direction of the vehicle to photograph the road scene in front of the vehicle. Further, when executing step S201, the vehicle may be in a forward driving state or a reverse state, which is not limited. If the vehicle is in a forward driving state, the driving direction refers to: based on the vehicle body, the direction where the front of the vehicle is located; then in this case, in the driving direction of the vehicle, the road scene in front of the vehicle refers to: the road scene in front of the vehicle head. If the vehicle is in a reverse state, the driving direction refers to: based on the vehicle body, the direction where the rear of the vehicle is located; then in this case, in the driving direction of the vehicle, the road scene in front of the vehicle refers to: the road scene behind the vehicle tail.
[0054] In the specific implementation of step S201, the computer device can obtain a scene image during the driving of the vehicle, and generate an initial navigation guidance image by using the scene image and virtual guidance information. Secondly, the computer device can determine the initial image size of the initial navigation guidance image and the area size of the screen area configured on the vehicle for displaying the navigation guidance image. Among them, the area size includes: the first size value in the height dimension and the first size value in the width dimension; the initial image size can include: the second size value in the height dimension and the second size value in the width dimension. It should be noted that: the size value in the height dimension mentioned here can be called the height value, and the size value in the width dimension can be called the width value; that is to say, the area size includes the height value of the screen area and the width value of the screen area, and the initial image size includes the height value of the initial navigation guidance image and the width value of the initial navigation guidance image.
[0055] After determining the area size and the initial image size, the computer device can directly determine the initial navigation guidance image as the target navigation guidance image. Or, the computer device can also determine the image processing strategy of the initial navigation guidance image according to the initial image size and the area size, so as to perform image processing on the initial navigation guidance image according to the image processing strategy to obtain the target navigation guidance image. It should be noted that the image processing strategy mentioned here can be used to indicate the processing of enlarging, reducing or remaining unchanged for the initial navigation guidance image; and after performing image processing on the initial navigation guidance image through the image processing strategy, the target image size of the obtained target navigation guidance image is equal to or greater than the area size of the screen area.
[0056] Among them, the target image size of the target navigation guidance image can include: the target size value (i.e., the target height value) of the target navigation guidance image in the height dimension and the target size value (i.e., the target width value) of the target navigation guidance image in the width dimension. The target image size being greater than the area size means that: there is at least one target size value in the target image size that is greater than the first size value in the corresponding dimension of the area size, and there is no target size value less than the corresponding first size value. For example, if the target height value in the target image size is greater than the height value in the area size, and the target width value in the target image size is equal to the width value in the area size, it can be determined that the target image size is greater than the area size. Another example, if the target height value in the target image size is greater than the height value in the area size, and the target width value in the target image size is less than the width value in the area size, it can be determined that the target image size is not greater than the area size.
[0057] Further, the above-mentioned two methods for determining the target navigation guidance image are mentioned. In practical applications, the computer device can select one of the two determination methods to determine the target navigation guidance image according to the scaling and cropping processing logic adopted by the computer device. Specifically, if the computer device adopts the processing logic of cropping first and then scaling, the first determination method can be selected to determine the target navigation guidance image, that is, directly use the initial navigation guidance image as the target navigation guidance image; if the computer device adopts the processing logic of scaling first and then cropping, the second determination method can be selected to determine the target navigation guidance image.
[0058] S202. Identify the drivable area of the target navigation guidance image to obtain the current drivable area of the vehicle in the target navigation guidance image.
[0059] In a specific implementation, considering that during the driving process of the vehicle, the drivable area in the navigation guidance image is usually referred to for driving the vehicle to avoid the vehicle driving out of the drivable area; it can be seen that the drivable area in the navigation guidance image is a relatively important area. Based on this, the computer device can identify the drivable area of the target navigation guidance image to identify the current drivable area of the vehicle in the target navigation guidance image, so that the target navigation guidance image can be dynamically cropped in combination with the current drivable area subsequently, thereby avoiding cropping off important image areas in the target navigation guidance image and enhancing the guiding role of the subsequent displayed navigation guidance image. Herein, the current drivable area mentioned refers to: the area allowed for the vehicle to drive, identified from the target navigation guidance image based on the image recognition method.
[0060] In an implementation manner of step S202, the computer device can determine the current drivable area of the vehicle in the target navigation guidance image by means of lane line detection. In the specific implementation process, the computer device can first perform lane line detection on the target navigation guidance image to obtain multiple lane lines in the target navigation guidance image; specifically, the computer device can call a segmentation model to perform lane line detection on the target navigation guidance image to determine multiple lane lines. Exemplarily, the segmentation model here can be a model adopting the structural paradigm of downsampling + upsampling; in this case, the recognition principle of the segmentation model can be referred to Figure 3a as shown: first perform downsampling processing on the input target navigation guidance image, and then perform upsampling processing on the result of the downsampling to obtain a binary feature map of the same scale as the target navigation guidance image, so as to identify which pixels in the target navigation guidance image belong to the lane lines and which pixels belong to the background based on the binary feature map, and thus determine multiple lane lines from the target navigation guidance image based on the recognition result.
[0061] After identifying multiple lane lines, the computer device can determine a first lane line and a second lane line from the multiple lane lines; among them, the first lane line and the second lane line meet the following conditions: among the multiple lane lines, other lane lines except the first lane line and the second lane line are all located between the first lane line and the second lane line; that is to say, the first lane line and the second lane line are the lane lines located on the leftmost side and the rightmost side among the multiple lane lines in the driving direction of the vehicle. Then, the lane line endpoints of the first lane line displayed in the target navigation guidance image can be determined as the first lane line endpoints, and the lane line endpoints of the second lane line can be determined as the second lane line endpoints; and according to the first lane line endpoints, the second lane line endpoints, and one or more image edges of the target navigation guidance image, the first lane line and the second lane line are closed, so as to determine the area obtained after the closing process as the current drivable area of the vehicle.
[0062] Specifically, the endpoint of the first lane line that is close to the bottom edge of the target navigation guidance image can be called the first starting endpoint, and the endpoint of the first lane line that is far from the bottom edge can be called the first ending endpoint; and the endpoint of the second lane line that is close to the bottom edge of the target navigation guidance image can be called the second starting endpoint, and the endpoint of the second lane line that is far from the bottom edge can be called the second ending endpoint. If the first ending endpoint and the second ending endpoint are not closed, the first ending endpoint and the second ending endpoint can be connected to achieve the closing of the ending endpoints between the first lane line and the second lane line; if the first ending endpoint and the second ending endpoint are closed, it means that the first lane line and the second lane line are connected to each other at this time, and no processing needs to be performed on the first ending endpoint and the second ending endpoint. In addition, the first starting endpoint and the second starting endpoint can be connected through one or more image edges to achieve the closing of the starting endpoints between the first lane line and the second lane line. Then, the enclosed area formed by the first lane line and the second lane line after the starting endpoints and the ending endpoints are both closed can be used as the current drivable area of the vehicle.
[0063] For example, see Figure 3b as shown: the first ending endpoint and the second ending endpoint are closed, and the first starting endpoint and the second starting endpoint are respectively located on the left image edge and the right image edge of the target navigation guidance image; then the first starting endpoint and the second starting endpoint can be connected through the left image edge, the right image edge, and the bottom image edge to obtain the current drivable area ( Figure 3b the black transparent area in). Another example, see Figure 3cAs shown: it is not closed between the first end point and the second end point, and both the first start point and the second start point are located on the bottom image edge of the target navigation guidance image; then, the first end point and the second end point can be connected to make these two end points closed to each other, and the first start point and the second start point can be connected through the bottom image edge, so as to obtain the current drivable area ( Figure 3c the black transparent area in
[0064] In another implementation manner of step S202, the computer device can determine the current drivable area of the vehicle in the target navigation guidance image by means of region connectivity. In the specific implementation process, the computer device can perform category detection on each pixel point in the target virtual guidance image to obtain the category label of each pixel point; specifically, the computer device can call an optimized category detection model to perform category detection on each pixel point in the target navigation guidance image to obtain the category label of each pixel point. The category label of any pixel point is used to indicate the category to which any pixel point belongs, and this category can include but is not limited to: road category, scenery category, etc. Secondly, the computer device can determine the pixel points belonging to the road category from the target virtual guidance image according to the category labels of each pixel point; then, region connectivity processing can be performed on each pixel point belonging to the road category to obtain the current drivable area of the vehicle. Here, the region connectivity processing can be understood as a process of forming a region by using each pixel point belonging to the road category.
[0065] In another implementation manner of step S202, the computer device can determine the current drivable area of the vehicle in the target navigation guidance image by means of deep learning. The so-called deep learning refers to a technology of machine learning using a deep neural network system; and machine learning is the core of AI and the way to make the computer device have intelligence; the so-called machine learning is an interdisciplinary subject involving multiple fields such as probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory; it specifically studies how the computer device simulates or realizes human learning behavior to acquire new knowledge or skills and reorganize the existing knowledge structure to continuously improve its own performance. In the specific implementation, a deep learning model for identifying the drivable area can be pre-constructed, and a large number of sample images and the annotation information of the drivable area corresponding to each sample image are used to perform supervised model training on the deep learning model to continuously optimize the model parameters of the deep learning model, so that when step S203 is executed, the optimized deep learning model can be called to identify the drivable area of the target navigation guidance image, and then the current drivable area of the vehicle in the target navigation guidance image can be identified.
[0066] S203. Dynamically crop the target navigation guidance image according to the regional sizes of the current drivable area and the screen area, so as to obtain an adapted navigation guidance image whose image size is adapted to the regional sizes.
[0067] In one case, if the computer device adopts the processing logic of cropping first and then scaling, it can be known from the foregoing that in this case, the target navigation guidance image can be the initial navigation guidance image, and the target image size of the target navigation guidance image may be larger than the regional size or smaller than the regional size, and this is not limited. In this case, the specific implementation manner of step S203 can be: calculate the aspect ratio of the screen area according to the first size value in the width dimension and the first size value in the height dimension of the regional size; and determine a target image area from the target navigation guidance image according to the aspect ratio of the screen area, the height value and the width value of the current drivable area, where the target image area includes the current drivable area and the aspect ratio of the target image area is equal to the aspect ratio of the screen area. Then, the areas other than the target image area in the target navigation guidance image can be cropped off to obtain the cropped target navigation guidance image. If the size of the cropped target navigation guidance image is equal to the regional size, the cropped target navigation guidance image can be directly used as the adapted navigation guidance image; if the size of the cropped target navigation guidance image is not equal to the regional size, the cropped target navigation guidance image can be reduced or enlarged based on the height ratio or width ratio between the screen area and the cropped target navigation guidance image to obtain an adapted navigation guidance image whose image size is adapted to the regional sizes. For example, as shown in Figure 3d Suppose the regional size is 120*60, the target image size of the target navigation guidance image is 110*60, and the size of the current drivable area is 100*40. Then, the size of the target image area determined from the target navigation guidance image according to the above steps can be 100*50; then, the target image area can be cropped from the target navigation guidance image to obtain the cropped target navigation guidance image, and the cropped target navigation guidance image can be enlarged by 1.2 (120 / 100 = 1.2, or 60 / 50 = 1.2) times to obtain the adapted navigation guidance image.
[0068] Optionally, considering that there may be a situation where it is impossible to determine the target image area from the target navigation guidance image based on the aspect ratio of the screen area and the height value and width value of the current drivable area due to the large height value or width value of the current drivable area. For example, the target image size of the target navigation guidance image is 120*160, and the size of the current drivable area is 120*50, that is, the width value of the current drivable area is equal to the width value of the target navigation guidance image; if the area size of the screen area is 120*180, then according to the aspect ratio of the screen area and the width value of the current drivable area, the minimum size of the target image area calculated should be 120*180. Since the height value in this size is greater than the height value of the target navigation guidance image, it will cause the target image area to not be determined from the target navigation guidance image. Based on this, in order to improve the success rate of determining the target image area, when the computer device determines the target image area from the target navigation guidance image according to the aspect ratio of the screen area and the height value and width value of the current drivable area, it can first determine the current driving speed of the vehicle at the current moment, where the current moment refers to the moment when the scene image is captured; and predict the drivable area of the vehicle at the next moment in the target navigation guidance image according to the current driving speed and the current drivable area, to obtain a new drivable area, and the size of the new drivable area is smaller than the size of the current drivable area. Then, the target image area can be determined from the target navigation guidance image according to the aspect ratio of the screen area and the height value and width value of the new drivable area. It should be noted that the method of determining the target image area based on the new drivable area is similar to the method of determining the target image area based on the current drivable area mentioned above, and will not be elaborated here.
[0069] In another case, if the computer device adopts the processing logic of scaling first and then cropping, it can be known from the foregoing that in this case, the target navigation guidance image is obtained by processing the initial navigation guidance image by reducing, enlarging or keeping it unchanged, and the target image size of the target navigation guidance image is greater than or equal to the area size of the screen area. Based on this, the computer device can determine the target image size of the target navigation guidance image. If the target image size is equal to the area size, it can be explained that the target navigation guidance image can be exactly full-screen displayed in the screen area; then in this case, the computer device can directly display the target navigation guidance image in the screen area, that is, there is no need to dynamically crop the target navigation guidance image through step S203. If the target image size is greater than the area size, it can be explained that all the image elements in the target navigation guidance image cannot be displayed in the screen area, and it is necessary to trigger the execution of step S203 to crop the target navigation guidance image; then in this case, the specific implementation manner of step S203 can be: determining the cropping requirement information of the target navigation guidance image according to the size difference between the target image size and the area size; the cropping requirement information can be used to indicate at least one of the following: the size value that needs to be cropped off from the target navigation guidance image in the width direction, and the size value that needs to be cropped off from the target navigation guidance image in the height direction. Then, the computer device can dynamically crop the target navigation guidance image according to the current drivable area and the cropping requirement information to obtain an adapted navigation guidance image with an image size adapted to the area size.
[0070] S204, display the adapted navigation guidance image in the screen area of the vehicle.
[0071] After obtaining the target navigation guidance image generated based on the scene image in the embodiment of the present application, the target navigation guidance image can be recognized for the drivable area to identify the current drivable area of the vehicle. Then, according to the current drivable area and the area size of the screen area, the target navigation guidance image can be dynamically cropped. On the one hand, by referring to the area size of the screen area, it can be ensured that an adapted navigation guidance image with an image size adapted to the area size can be finally obtained, thereby ensuring the display adaptability of the navigation guidance image. On the other hand, by referring to the current drivable area, on-demand cropping can be achieved, avoiding cropping off this important image area of the drivable area, so as to ensure that the final obtained adapted navigation guidance image can still contain the drivable area of the vehicle, improving the guiding effect and display quality of the navigation guidance image. It can be seen that by dynamically cropping the target navigation guidance image, the adaptation between the target navigation guidance image and the screen area can be achieved without stretching, compressing, etc. the target navigation guidance image, which can avoid the deformation of the image elements in the target navigation guidance image and further improve the display quality of the navigation guidance image. Moreover, since the embodiment of the present application can ensure the display adaptability of the navigation guidance image through the above steps for any size of the screen area, it can be known that the embodiment of the present application can be extended to any size of the screen area, indicating that the embodiment of the present application has high adaptability and scalability.
[0072] Based on the above Figure 2 related description of the method embodiment shown, the embodiment of the present application proposes another more specific image processing method. In the embodiment of the present application, it is still described by taking a computer device executing the image processing method as an example; and the embodiment of the present application mainly takes the processing logic of first scaling and then cropping by the computer device to realize the display of the navigation guidance image as an example. Please refer to Figure 4 , the image processing method may include the following steps S401 - S407:
[0073] S401, during the driving of the vehicle, obtain the initial navigation guidance image generated based on the scene image; and determine the initial image size of the initial navigation guidance image and the area size of the screen area.
[0074] S402, according to the initial image size and the area size, determine the image processing strategy of the initial navigation guidance image.
[0075] Among them, the region size includes: the first size value in the height dimension (subsequently denoted as sH) and the first size value in the width dimension (subsequently denoted as sW); the initial image size includes: the second size value in the height dimension (subsequently denoted as imgH) and the second size value in the width dimension (subsequently denoted as imgW). In a specific implementation of step S402, the computer device can directly compare the size relationship between the initial image size and the region size. If the initial image size is greater than or equal to the region size, it can be determined that the image processing strategy includes: the strategy of keeping the initial navigation guidance image unchanged. If the initial image size is less than the region size, in order to facilitate the subsequent full-region display of the navigation guidance image on the screen area, it can be determined that the image processing strategy includes: the strategy of magnifying the initial navigation guidance image according to the difference between the initial image size and the region size.
[0076] In another specific implementation of step S402, the computer device can first calculate the ratio between the first size value (sH) in the height dimension of the region size and the second size value (imgH) in the height dimension of the initial image size to obtain the height ratio (denoted as screeImgHeightRatio); and calculate the ratio between the first size value in the width dimension of the region size and the second size value in the width dimension of the initial image size to obtain the width ratio (denoted as screeImgWidthRatio). Then, a ratio can be selected from the height ratio and the width ratio as the target ratio. Among them, when the height ratio is greater than or equal to the width ratio, the target ratio can be the height ratio; otherwise, the target ratio is the width ratio. Optionally, in other embodiments, when the height ratio is equal to the width ratio, the width ratio can also be selected as the target ratio.
[0077] After determining the target ratio, the first size value in the target dimension of the region size can be used as the first target value, and the second size value in the target dimension of the initial image size can be used as the second target value; where the target dimension refers to the dimension corresponding to the target ratio. That is to say, if the target ratio is the height ratio, the target dimension is the height dimension; then the computer device can use the first size value (sH) in the height dimension of the region size as the first target value and the second size value (imgH) in the height dimension of the initial image size as the second target value. If the target ratio is the width ratio, the target dimension is the width dimension; then the computer device can use the first size value (sW) in the width dimension of the region size as the first target value and the second size value (imgW) in the width dimension of the initial image size as the second target value.
[0078] Then, the computer device can determine the magnitude relationship between the first target value and the second target value according to the target ratio. Specifically, the computer device can compare the target ratio with the reference value (value 1). If the target ratio is greater than the reference value, it is determined that the first target value is greater than the second target value. If the target ratio is equal to the reference value, it is determined that the first target value is equal to the second target value. If the target ratio is less than the reference value, it is determined that the first target value is less than the second target value. It should be understood that in other embodiments, the computer can also directly compare the magnitudes of the first target value and the second target value without using the target ratio, so as to determine the magnitude relationship between the first target value and the second target value. After determining the magnitude relationship between the first target value and the second target value, the computer device can determine the image processing strategy for the initial navigation guidance image based on the magnitude relationship between the first target value and the second target value. Specifically, the implementation manner of this step can be as follows:
[0079] When the first target value is greater than the second target value, it can be shown that the second size value of the initial navigation guidance image in at least one dimension is smaller than the first size value of the screen area in the corresponding dimension. The reasons are as follows: If the target ratio is the height ratio, that is, the height ratio is greater than the width ratio; then the first target value is the first size value (sH) of the screen area in the height dimension, and the second target value is the second size value (imgH) of the initial navigation guidance image in the height dimension. Thus, it can be at least determined that the second size value of the initial navigation guidance image in the height dimension is smaller than the first size value of the screen area in the height dimension. Further, when the height ratio is greater than the width ratio (sW / imgW), if the width ratio is greater than 1, it can be determined that the second size value (imgW) of the initial navigation guidance image in the width dimension is smaller than the first size value (sW) of the screen area in the width dimension. The magnitude relationship between the initial navigation guidance image (represented by a dashed box) and the screen area (represented by a solid box) at this time can be seen in Figure 5a the first figure shown in; if the width ratio is equal to 1, it can be determined that imgW is equal to sW. The magnitude relationship between the initial navigation guidance image and the screen area at this time can be seen in Figure 5a the second figure shown in; if the width ratio is less than 1, it can be determined that imgW is greater than sW. The magnitude relationship between the initial navigation guidance image and the screen area at this time can be seen in Figure 5a the third figure shown in. It should be understood that when the target ratio is the width ratio, the reasoning process is similar and will not be elaborated here. And based on Figure 5a the three figures shown, when the first target value is greater than the second target value, the initial navigation guidance image cannot completely fill the entire screen area. Based on this, when the first target value is greater than the second target value, the computer device can determine that the image processing strategy for the initial navigation guidance image includes: the strategy of magnifying the initial navigation guidance image according to the target ratio.
[0080] When the first target value is equal to the second target value, it can be stated that the second size value of the initial navigation guidance image in the target dimension is equal to the first size value of the screen area in the target dimension, and the second size value of the initial navigation guidance image in another dimension other than the target dimension is greater than the first size value of the screen area in this other dimension. The reasons are as follows: If the target ratio is the height ratio, that is, the height ratio is greater than the width ratio; then the first target value is the first size value (sH) of the screen area in the height dimension, and the second target value is the second size value (imgH) of the initial navigation guidance image in the height dimension. Thus, the second size value of the initial navigation guidance image in the height dimension can be first determined to be equal to the first size value of the screen area in the height dimension. Further, since the first target value is equal to the second target value, it can be determined that the height ratio is equal to 1; and since the height ratio is greater than the width ratio, and the width ratio is equal to sW / imgW, it can be determined that 1 > sW / imgW, and thus it can be determined that imgW is greater than sW, that is, the second size value (imgW) of the initial navigation guidance image in the width dimension is greater than the first size value (sW) of the screen area in the width dimension. The size relationship between the initial navigation guidance image and the screen area at this time can be seen in the left figure in Figure 5b shown in. It should be understood that when the target ratio is the width ratio, the reasoning process is similar and will not be elaborated here. And based on Figure 5b the left figure in, it can be known that when the first target value is equal to the second target value, the initial navigation guidance image can completely fill the entire screen area; based on this, when the first target value is equal to the second target value, the computer device can determine that the image processing strategy of the initial navigation guidance image includes: the strategy of keeping the initial navigation guidance image unchanged.
[0081] When the first target value is less than the second target value, it can be shown that the second size value of the initial navigation guidance image in each dimension is greater than the first size value of the screen area in the corresponding dimension. The reasons are as follows: If the target ratio is the height ratio, that is, the height ratio is greater than the width ratio; then the first target value is the first size value (sH) of the screen area in the height dimension, and the second target value is the second size value (imgH) of the initial navigation guidance image in the height dimension. Thus, the second size value of the initial navigation guidance image in the height dimension can be first determined to be greater than the first size value of the screen area in the height dimension. Further, since the first target value is less than the second target value, it can be determined that the height ratio is less than 1; and since the height ratio is greater than the width ratio, and the width ratio is equal to sW / imgW, it can be determined that 1 > sW / imgW, and thus it can be determined that imgW is greater than sW, that is, the second size value (imgW) of the initial navigation guidance image in the width dimension is greater than the first size value (sW) of the screen area in the width dimension. The size relationship between the initial navigation guidance image and the screen area at this time can be seen in Figure 5b as shown in the right figure in. It should be understood that when the target ratio is the width ratio, the reasoning process is similar and will not be elaborated here. And based on Figure 5b the right figure in, when the first target value is less than the second target value, the initial navigation guidance image can completely fill the entire screen area; based on this, when the first target value is less than the second target value, the computer device can determine that the image processing strategy of the initial navigation guidance image includes: a strategy of keeping the initial navigation guidance image unchanged, or a strategy of shrinking the initial navigation guidance image according to the target ratio.
[0082] Further, when the first target value is less than the second target value, the computer device can randomly select one of the two strategies, namely the strategy of keeping the initial navigation guidance image unchanged and the strategy of shrinking the initial navigation guidance image according to the target ratio, as the image processing strategy of the initial navigation guidance image. Or, the computer device can further detect whether the initial navigation guidance image allows shrinking. If the initial navigation guidance image does not allow shrinking, the image processing strategy of the initial navigation guidance image can include: a strategy of keeping the initial navigation guidance image unchanged; if the initial navigation guidance image allows shrinking, the image processing strategy of the initial navigation guidance image can include: a strategy of shrinking the initial navigation guidance image according to the target ratio. Even further, it can be set in advance by business personnel according to business requirements whether the initial navigation guidance image allows shrinking, so that the computer device determines whether the initial navigation guidance image allows shrinking according to the settings of the business personnel. It can also be that the computer device automatically determines whether the initial navigation guidance image allows shrinking according to the area size and the initial image size; specifically:
[0083] The computer device can calculate the area of the screen region based on the first size value in the height dimension of the region size and the first size value in the width dimension of the region size; and calculate the image area of the initial navigation guidance image based on the second size value in the height dimension of the initial image size and the second size value in the width dimension of the initial image size. If the difference between the region area and the image area is greater than the difference threshold, it can be shown that the initial navigation guidance image is much larger than the screen region. At this time, to avoid cropping too many image elements during subsequent dynamic cropping and affecting the guiding effect of the navigation guidance image, the computer device can obtain the target navigation guidance image by shrinking the initial navigation guidance image. Therefore, if the difference between the region area and the image area is greater than the difference threshold, it can be determined that the initial navigation guidance image is allowed to be shrunk; correspondingly, if the difference between the region area and the image area is less than or equal to the difference threshold, it can be determined that the initial navigation guidance image is not allowed to be shrunk.
[0084] S403. Perform image processing on the initial navigation guidance image according to the image processing strategy to obtain the target navigation guidance image.
[0085] In a specific implementation, if the image processing strategy includes: the strategy of magnifying the initial navigation guidance image according to the target ratio, the specific implementation of step S403 can include: magnifying the initial navigation guidance image according to the target ratio, and using the magnified initial navigation guidance image as the target navigation guidance image. Among them, the target size value of the target navigation guidance image in the target dimension is equal to the first target value, and the target size value of the target navigation guidance image in another dimension other than the target dimension is greater than the first size value of the screen region in the other dimension. For example, assume that the target dimension is the height dimension. As can be seen from the foregoing, in this case, sH in the height dimension > imgH, and (sH / imgH) > (sW / imgW), then it can be obtained that ((sH / imgH) × imgW) > sW. Since (sH / imgH) × imgW here refers to: the target size value of the target navigation guidance image obtained after magnifying the initial navigation guidance image according to the target ratio in the width dimension; therefore, it can be known that the target size value of the target navigation guidance image in the width dimension is greater than the first size value of the screen region in the width dimension. It should be understood that when the target ratio is the width ratio, the reasoning process is similar and will not be elaborated here.
[0086] In another specific implementation, if the image processing strategy includes the strategy of keeping the initial navigation guidance image unchanged, the specific implementation of step S403 may include: using the initial navigation guidance image as the target navigation guidance image. Based on the relevant description of the foregoing step S402, if this image processing strategy is determined when the first target value is equal to the second target value, it can be determined that the target size value of the target navigation guidance image in the target dimension is equal to the first size value of the screen area in the target dimension, and the target size value of the target navigation guidance image in another dimension other than the target dimension is greater than the first size value of the screen area in this other dimension. If this image processing strategy is determined when the first target value is less than the second target value, it can be determined that the target size value of the target navigation guidance image in each dimension is greater than the first size value of the screen area in the corresponding dimension.
[0087] In another specific implementation, if the image processing strategy includes the strategy of reducing the initial navigation guidance image according to a target ratio, the specific implementation of step S403 may include: reducing the initial navigation guidance image according to the target ratio, and using the reduced initial navigation guidance image as the target navigation guidance image. Wherein, the target size value of the target navigation guidance image in the target dimension is equal to the first target value, and the target size value of the target navigation guidance image in another dimension other than the target dimension is greater than the first size value of the screen area in this other dimension. For example, assuming that the target dimension is the height dimension, as can be seen from the foregoing, in this case, sH < imgH in the height dimension, and (sH / imgH) > (sW / imgW), then it can be obtained that ((sH / imgH) × imgW) > sW, so that it can be determined that the target size value of the target navigation guidance image in the width dimension is greater than the first size value of the screen area in the width dimension. It should be understood that when the target ratio is the width ratio, the reasoning process is similar and will not be elaborated here.
[0088] Furthermore, from the above description, it can be seen that the target image size of the target navigation guidance image obtained through step S403 may be equal to the area size of the screen area or may be greater than the area size of the screen area. Based on this, when the target image size is equal to the area size, it can be determined that there is no need to dynamically crop the target navigation guidance image, and the target navigation guidance image can be directly displayed in the screen area. When the target image size is greater than the area size, the target navigation guidance image needs to be dynamically cropped, so the subsequent steps S404 - S407 can be continued. Thus, it can be seen that the embodiments of the present application can achieve the on-demand selection of dynamic or static adjustment.
[0089] S404. Determine the cropping requirement information of the target navigation guidance image according to the size difference between the target image size and the area size.
[0090] In a specific implementation, the computer device can determine the cropping requirement information of the target navigation guidance image from two dimensions, namely the height dimension and the width dimension, according to the size difference between the target image size and the region size. As described above, the target image size may include: the target size value (i.e., the target height value) of the target navigation guidance image in the height dimension, and the target size value (i.e., the target width value) of the target navigation guidance image in the width dimension; and, in the case of executing step S404, the target size value of the target image size in any dimension is not less than the first size value of the region size in the corresponding dimension. Based on this, when the computer device executes step S404, it can start from two dimensions, namely the height dimension and the width dimension, and judge whether there is a cropping requirement for the target navigation guidance image in each dimension according to the size difference between the target image size and the region size, so as to calculate the cropping requirement value in the dimension with a cropping requirement, so as to obtain the cropping requirement information of the target navigation guidance image. Based on this, the processing logic in each dimension is as follows:
[0091] In the height dimension, the computer device can first judge whether the target size value (i.e., the target height value) of the target image size in the height dimension is equal to or greater than the first size value of the region size in the height dimension. If they are equal, it can be determined that there is no cropping requirement in the height dimension; if it is greater, it can be determined that there is a cropping requirement in the height dimension. In this case, the computer device can calculate the difference between the target size value (i.e., the target height value) of the target image size in the height dimension and the first size value of the region size in the height dimension to obtain the cropping requirement value in the height dimension, and then add the cropping requirement value in the height dimension to the cropping requirement information of the target navigation guidance image. Among them, the cropping requirement value in the height dimension can be understood as: the size value that the target navigation guidance image needs to be cropped in the height dimension, that is, the height value that the target navigation guidance image needs to be cropped off.
[0092] In the width dimension, the computer device can first judge whether the target size value (i.e., the target width value) of the target image size in the width dimension is equal to or greater than the first size value of the region size in the width dimension. If they are equal, it can be determined that there is no cropping requirement in the width dimension; if it is greater, it can be determined that there is a cropping requirement in the width dimension. In this case, the computer device can calculate the difference between the target size value (i.e., the target width value) of the target image size in the width dimension and the first size value of the region size in the width dimension to obtain the cropping requirement value in the width dimension, and then add the cropping requirement value in the width dimension to the cropping requirement information of the target navigation guidance image. Among them, the cropping requirement value in the width dimension can be understood as: the size value that the target navigation guidance image needs to be cropped in the width dimension, that is, the width value that the target navigation guidance image needs to be cropped off.
[0093] Based on the relevant descriptions of the above steps S403 - S404, the specific implementation manners of the above steps S403 - S404 can be summarized into the following two solutions:
[0094] Solution 1: No - reduction - downward solution (i.e., the initial navigation - guiding image is not allowed to be reduced)
[0095] First, according to the width value (sW) and height value (sH) of the screen area, as well as the width value (imgW) and height value (imgH) of the initial navigation - guiding image, calculate the height ratio (screeImgHeightRatio) between the height value of the screen area and the height value of the initial navigation - guiding image, and calculate the width ratio screenImgWidthRatio between the width value of the screen area and the width value of the initial navigation - guiding image.
[0096] (1) If screeImgHeightRatio > screeImgWidthRatio, then:
[0097] a) If screenImgHeightRatio > 1, then magnify the initial navigation - guiding image by screeImgHeight times to obtain the target navigation - guiding image. The target height value (scaleH) of the target navigation - guiding image is the same as the height value of the screen area (scaleH = sH), and the target width value (scaleW) of the target navigation - guiding image is greater than the width value of the screen area (i.e., scaleW > sW). And, the cropping - requirement information includes the cropping - requirement value (clipW) in the width dimension, clipW = scaleW - sW.
[0098] b) If screenImgHeightRatio < 1, then determine the initial navigation - guiding image as the target navigation - guiding image, scaleH > sH, scaleW > sW. And, the cropping - requirement information includes the cropping - requirement value (clipH) in the height dimension and the cropping - requirement value (clipW) in the width dimension, clipH = imgH – sH, clipW = imgW – sW.
[0099] c) If screenImgHeightRatio = 1, then determine the initial navigation - guiding image as the target navigation - guiding image, scaleH = sH, scaleW > sW. And, the cropping - requirement information includes the cropping - requirement value (represented by clipW) in the width dimension, clipW = imgW – sW.
[0100] (2) If screeImgHeightRatio < screeImgWidthRatio, then:
[0101] a) If screeImgWidthRatio > 1, magnify the initial navigation guidance image by screeImgWidthRatio times to obtain the target navigation guidance image. scaleW = sW, scaleH > sH. Moreover, the cropping requirement information includes the cropping requirement value (clipH) in the height dimension, clipH = scaleH - sH.
[0102] b) If screeImgWidthRatio < 1, determine the initial navigation guidance image as the target navigation guidance image, scaleH > sH, scaleW > sW. Moreover, the cropping requirement information includes the cropping requirement value (clipH) in the height dimension and the cropping requirement value (clipW) in the width dimension, clipH = imgH – sH, clipW = imgW – sW.
[0103] c) If screeImgWidthRatio = 1, determine the initial navigation guidance image as the target navigation guidance image, scaleH > sH, scaleW = sW. Moreover, the cropping requirement information includes the cropping requirement value (represented by clipH) in the height dimension, clipH = imgH – sH.
[0104] (3) If screenImgHeightRatio = screeImgWidthRatio, then:
[0105] a) If screenImgHeightRatio ≥ 1, magnify the initial navigation guidance image by screeImgHeight times to obtain the target navigation guidance image. scaleH = sH, scaleW = sW. In this case, it can be determined that no cropping is required for the target navigation guidance image, that is, there is no cropping requirement information.
[0106] b) If screenImgHeightRatio < 1, determine the initial navigation guidance image as the target navigation guidance image, scaleH > sH, scaleW > sW. Moreover, the cropping requirement information includes the cropping requirement value (clipH) in the height dimension and the cropping requirement value (clipW) in the width dimension, clipH = imgH – sH, clipW = imgW – sW.
[0107] Solution 2: Downscaling solution (i.e., the initial navigation guidance image is allowed to be downscaled)
[0108] First, according to the width value (sW) and height value (sH) of the screen area, as well as the width value (imgW) and height value (imgH) of the initial navigation guide image, calculate the height ratio (screeImgHeightRatio) between the height value of the screen area and the height value of the initial navigation guide image, and calculate the width ratio screenImgWidthRatio between the width value of the screen area and the width value of the initial navigation guide image.
[0109] (1) If screeImgHeightRatio > screeImgWidthRatio, then:
[0110] a) If screenImgHeightRatio > 1, it is the same as step a) in point (1) of the above Scheme 1.
[0111] b) If screeImgHeightRatio < 1, the computer device can reduce the initial navigation guide image by screeImgHeightRatio times to obtain the target navigation guide image, scaleH = sH, scaleW > sW. And the cropping requirement information includes the cropping requirement value (clipW) in the width dimension, clipW = imgW - sW.
[0112] c) If screenImgHeightRatio = 1, it is the same as step c) in point (1) of the above Scheme 1.
[0113] (2) If screeImgHeightRatio < screeImgWidthRatio, then:
[0114] a) If screeImgWidthRatio > 1, it is the same as step a) in point (2) of the above Scheme 1.
[0115] b) If screeImgWidthRatio < 1, the computer device can reduce the initial navigation guide image by screeImgWidthRatio times to obtain the target navigation guide image, scaleH > sH, scaleW = sW. And the cropping requirement information includes the cropping requirement value (clipH) in the height dimension, clipH = imgH - sH.
[0116] c) If screeImgWidthRatio = 1, it is the same as step c) in point (2) of the above Scheme 1.
[0117] (3) If screenImgHeightRatio = screeImgWidthRatio, then:
[0118] a) If screenImgHeightRatio ≥ 1, it is the same as step a) in point (3) of the above solution 1.
[0119] b) If screenImgHeightRatio < 1, the computer device can reduce the initial navigation guidance image by a factor of screenImgHeightRatio to obtain the target navigation guidance image, where scaleH = sH and scaleW = sW. In this case, it can be determined that no cropping is required for the target navigation guidance image, that is, there is no cropping requirement information.
[0120] S405. Identify the drivable area of the vehicle from the target navigation guidance image to obtain the current drivable area of the vehicle in the target navigation guidance image.
[0121] S406. Dynamically crop the target navigation guidance image according to the current drivable area and the cropping requirement information to obtain an adapted navigation guidance image with an image size adapted to the area size.
[0122] In a specific implementation, the specific implementation manner of step S406 may be: directly determine one or more areas to be cropped from the target navigation guidance image based on the current drivable area and the cropping requirement information; among them, each determined area to be cropped needs to meet the following conditions: ① Any area to be cropped does not overlap with the current drivable area; ② If the cropping requirement information includes the cropping requirement value in the width dimension, the sum of the width values of each determined area to be cropped needs to be equal to the cropping requirement value in the width dimension; ③ If the cropping requirement information includes the cropping requirement in the height dimension, the sum of the height values of each determined area to be cropped needs to be equal to the cropping requirement in the height dimension. Then, crop each area to be cropped in the target navigation guidance image to obtain an adapted navigation guidance image with an image size adapted to the area size.
[0123] In another specific implementation, considering that there may be a situation where the size value (such as height value or width value) of the current drivable area in a certain dimension is the same as the target size value (such as target height value or target width value) of the target navigation guidance image in the corresponding dimension. In this case, if there is a cropping requirement value in the cropping requirement information for this dimension, it may make it impossible to determine the area to be cropped from the target navigation guidance image according to the cropping requirement value for this dimension without cropping the current drivable area. Based on this, in order to improve the success rate of determining the area to be cropped, when the computer device executes step S406, it can further predict a smaller new drivable area from the target navigation guidance image based on the current drivable area, and thus, with reference to the new drivable area and the cropping requirement information, dynamically crop the target navigation guidance image. Based on this, the specific implementation manner of step S406 may include the following steps s11 - s13:
[0124] s11, determine the current driving speed of the vehicle at the current moment, where the current moment refers to the moment when the scene image is captured.
[0125] s12, according to the current driving speed and the current drivable area, predict the drivable area of the vehicle at the next moment in the target navigation guidance image to obtain a new drivable area.
[0126] In one implementation manner, the computer device can determine a reference point from the current drivable area and determine the mapping position of the vehicle in the target navigation guidance image. Among them, if the target navigation guidance image does not contain an image of any vehicle part of the vehicle, the mapping position can be understood as the bottom edge in the target navigation guidance image; if the target navigation guidance image contains an image of a certain vehicle part (such as the vehicle head) of the vehicle, the mapping position can be understood as the display position of this vehicle part in the target navigation guidance image. And the specific way to determine a reference point from the current drivable area can be: by performing image element recognition on the current drivable area, and thus using any recognized image element (such as a vehicle beside, a pedestrian, a ground sign, a traffic sign, etc.) as the reference point; it should be noted that if no image element is recognized from the current drivable area, the first end point of the first lane line or the second end point of the second lane line used to determine the current drivable area can be used as the reference point.
[0127] Secondly, the computer device can draw multiple identification lines between the reference point and the mapping position, and draw a distance identification for each identification line according to the target physical distance value between the position point of the reference point in the road scene and the vehicle; one identification line corresponds to a physical position point in the road scene, and the distance identification of any identification line is used to indicate: the physical distance value between the corresponding physical position point and the vehicle. Specifically, the image distance value between the reference point and the mapping position can be determined, and then according to the ratio between the target physical distance value and the image distance value, and the distance value between each identification line and the mapping position, the distance identification of each identification line can be obtained. For example, see Figure 5c As shown: for the identification line 11 closest to the bottom edge of the target navigation guidance image, if the image distance value is 10 cm, the target physical value is 100 m, and the distance value between the identification line 11 and the mapping position is 0.3 cm, then the distance identification of the identification line 11 can be calculated as: 100 m / 10 cm × 0.3 cm = 3 m.
[0128] Then, the computer device can determine the driving distance value that the vehicle travels from the current moment to the next moment based on the current driving speed. Specifically, assume that the frame rate of AR navigation is 10 Hertz (HZ), and the frame interval is 0.1 second, that is, the time interval between the current moment and the next moment is 0.1 second; then if the current driving speed of the vehicle is V km / h, the driving distance value that the vehicle travels from the current moment to the next moment is equal to: V km / h × 0.1 s; since the speed unit of km / h is equivalent to the speed unit of 1000 m / 3600 s, it can be obtained that the driving distance value is equal to V / 36 m, that is, the distance traveled by the vehicle during the display of each frame of navigation guidance image is V / 36 m.
[0129] After determining the driving distance value, the computer device can determine the target identification line from multiple identification lines according to the driving distance value and the distance identification of each identification line; among them, the physical distance value indicated by the distance identification of the target identification line matches the driving distance value. For example, if the driving distance value is 3 m, then Figure 5cThe identification line 11 therein is determined as the target identification line. Then, the computer device can determine a new drivable area from the current drivable area according to the position of the target identification line in the current drivable area. Specifically, the computer device can determine the first intersection point and the second intersection point corresponding to the target identification line according to the position of the target identification line in the current drivable area. Among them, if there are obstacles (such as pedestrians, vehicles, etc.) in the current drivable area on the left side of the vehicle, the first intersection point refers to the point where the target identification line intersects the obstacle; if there are no obstacles in the current drivable area on the left side of the vehicle, the first intersection point refers to the point where the target identification line intersects the left boundary line of the current drivable area; similarly, the definition of the second intersection point is similar to the definition of the first intersection point and will not be elaborated here. After determining the first intersection point and the second intersection point, a new drivable area can be determined based on these four points: the first intersection point, the second intersection point, the first end point of the first lane line, and the second end point of the second lane line.
[0130] In one implementation, the computer device can directly use the area formed by these four points: the first intersection point, the second intersection point, the first end point, and the second end point, as the new drivable area. For example, see Figure 5d As shown, let the first intersection point be point P, the second intersection point be point Q, and the first end point and the second end point both be point O. Then the new drivable area is the area formed by O - P - Q. In another implementation, the computer device can determine the perpendicular points of each intersection point perpendicular to the bottom edge of the current drivable area, and use the area formed by the determined intersection points, the perpendicular point corresponding to each intersection point, the first end point, and the second end point, as the new drivable area. For example, see Figure 5e As shown: Let the first intersection point be point P, the second intersection point be point Q, the perpendicular point corresponding to the first intersection point be point M, the perpendicular point corresponding to the second intersection point be point N, and the first end point and the second end point both be point O. Then the new drivable area is the area formed by O - P - M - N - Q - O.
[0131] s13. Dynamically crop the target navigation guidance image based on the new drivable area and the cropping requirement information to obtain an adapted navigation guidance image with an image size adapted to the area size.
[0132] In a specific implementation, the computer device may first determine one or more regions to be cropped from the target navigation guidance image based on the new drivable area and the cropping requirement information; then, crop each region to be cropped in the target navigation guidance image to obtain an adapted navigation guidance image with an image size adapted to the region size. Among them, the cropping requirement information includes at least one of the following: the cropping requirement value in the width dimension and the cropping requirement value in the height dimension; based on this, when the computer device determines one or more regions to be cropped from the target navigation guidance image based on the new drivable area and the cropping requirement information, the following steps may be specifically executed:
[0133] First, it is possible to traverse the cropping requirement values in each dimension of the cropping requirement information, determine the current cropping requirement value of the currently traversed current dimension as the current cropping requirement value, and determine the two cropping directions indicated by the current dimension. Among them, if the current dimension is the width dimension, the two cropping directions indicated by the current dimension are the cropping direction from left to right and the cropping direction from right to left; if the current dimension is the height dimension, the two cropping directions indicated by the current dimension are the cropping direction from bottom to top and the cropping direction from top to bottom.
[0134] After determining the two cropping directions indicated by the current dimension, the computer device may determine the croppable value of the target navigation guidance image in each of the two cropping directions according to the position of the new drivable area in the target navigation guidance image. Specifically, considering that the determination methods of the croppable values for the width dimension and the height dimension are similar, for the convenience of description, here, taking the current dimension as the width dimension as an example, the determination method of the croppable value is described. Specifically, according to the position of the new drivable area in the target navigation guidance image, the vertical distance between the left boundary line of the new drivable area and the left image edge of the target navigation guidance image may be determined as the croppable value of the target navigation guidance image in the cropping direction from left to right (denoted by clipLeftW); and, the vertical distance between the right boundary line of the new drivable area and the right image edge of the target navigation guidance image may be determined as the croppable value of the target navigation guidance image in the cropping direction from right to left (denoted by clipRightW), as Figure 5f shown.
[0135] After determining two clippable values, the computer device may use the larger clippable value of the two determined clippable values as the first clippable value, and use the smaller clippable value as the second clippable value; and calculate the clippable value difference (denoted by deltaW) between the first clippable value and the second clippable value. Among them, the clipping direction corresponding to the first clippable value is the first clipping direction, and the direction corresponding to the second clippable value is the second clipping direction. Still taking the current dimension as the width dimension as an example, if clipLeftW > clipRightW, then use clipLeftW as the first clippable value and clipRightW as the second clippable value; the first clipping direction is the clipping direction from left to right, and the second clipping direction is the clipping direction from right to left; in this case, deltaW = clipLeftW – clipRightW. If clipLeftW < clipRightW, then the computer device may use clipRightW as the first clippable value and clipLeftW as the second clippable value; the first clipping direction is the clipping direction from right to left, and the second clipping direction is the clipping direction from left to right; in this case, deltaW = clipRightW – clipLeftW.
[0136] Then, at least one area to be clipped can be determined in the target navigation guidance image according to the size relationship between the clippable value difference and the current clipping requirement value, and along at least one of the two clipping directions. Specifically, when the clippable value difference is greater than the current clipping requirement value, one area to be clipped can be determined in the target navigation guidance image along the first clipping direction according to the current clipping requirement value, and the size value of the determined area to be clipped in the current dimension is equal to the current clipping requirement value. When the clippable value difference is less than the current clipping requirement value, according to the clippable value difference and the current clipping requirement value, one area to be clipped can be determined in the target navigation guidance image along the first clipping direction, and another area to be clipped can be determined in the target navigation guidance image along the second clipping direction. Among them, the sum of the size values of the two determined areas to be clipped in the current dimension is equal to the current clipping requirement value; further, the difference between the size values of the two determined areas to be clipped in the current dimension is equal to the clippable value difference, and the size value of the area to be clipped determined along the first clipping direction in the current dimension is greater than the size value of the area to be clipped determined along the second clipping direction in the current dimension, so as to ensure the clipping symmetry of the target navigation guidance image while meeting the clipping requirement value.
[0137] Further, the size value of the area to be cropped determined along the first cropping direction in the current dimension is equal to: half of the difference between the current cropping requirement value and the croppable value difference, plus the croppable value difference; the size value of the area to be cropped determined along the second cropping direction in the current dimension is equal to: half of the difference between the current cropping requirement value and the croppable value difference. For example, still taking the current dimension as the width dimension, let the first cropping direction be the cropping direction from left to right, and the second cropping direction be the cropping direction from right to left; then the width value clipResultW of the left area to be cropped determined along the first cropping direction is clipResultW = deltaW + (clipW – deltaW) / 2; the width value clipResultW of the right area to be cropped determined along the second cropping direction is clipResultW = (clipW – deltaW) / 2. Optionally, the height value of the left area to be cropped determined along the first cropping direction can be equal to the target height value of the target navigation guidance image, and the height value of the right area to be cropped determined along the second cropping direction can be equal to the target height value of the target navigation guidance image. The left area to be cropped and the right area to be cropped in this case can be seen in Figure 5g the upper side figure shown in Figure 5g Figure 5g . It should be noted that Figure 5g in the upper side figure in Figure 5g , the black transparent area is only used to identify the new drivable area, and the black transparent area will not be displayed in the actual target navigation guidance image. Therefore, the navigation guidance image obtained after cropping the left area to be cropped and the right area to be cropped from the target navigation guidance image does not display the black transparent area, as shown in Figure 5g the lower side figure shown in Figure 5g . And Figure 5g it is only an exemplary representation of the schematic diagram of cropping the area to be cropped from the target navigation guidance image, and is not limited thereto; in practical applications, if there are also upper and lower areas to be cropped in the target navigation guidance image, the upper and lower areas to be cropped can also be cropped from the target navigation guidance image.
[0138] Based on the above description, taking the current dimension as the width dimension as an example, the method for determining the area to be cropped in the current dimension mentioned above can be summarized as follows:
[0139] (1) If clipLeftW < clipRightW, then deltaW = clipRightW – clipLeftW.
[0140] a) If deltaW < clipW, then:
[0141] ① The width value clipResultW of the right area to be cropped is clipResultW = deltaW + (clipW – deltaW) / 2;
[0142] ② The width value of the left area to be cropped clipResultW = (clipW – deltaW) / 2.
[0143] b) If deltaW > clipW, then:
[0144] ① No cropping is required on the left;
[0145] ② The width value of the right area to be cropped is equal to clipW.
[0146] (2) If clipLeftW > clipRightW, then deltaW = clipLeftW – clipRightW.
[0147] a) If deltaW < clipW, then:
[0148] ① The width value of the left area to be cropped clipResultW = deltaW + (clipW – deltaW) / 2;
[0149] ② The width value of the right area to be cropped clipResultW = (clipW – deltaW) / 2.
[0150] b) If deltaW > clipW, then:
[0151] ① No cropping is required on the right;
[0152] ② The width value of the left area to be cropped is equal to clipW.
[0153] S407, Display the adapted navigation guidance image in the screen area of the vehicle.
[0154] After obtaining the target navigation guidance image generated based on the scene image in the embodiment of the present application, the current drivable area of the vehicle can be recognized by identifying the drivable area of the target navigation guidance image. Then, according to the current drivable area and the area size of the screen area, the target navigation guidance image can be dynamically cropped. On the one hand, by referring to the area size of the screen area, it can be ensured that an adapted navigation guidance image with an image size adapted to the area size can be finally obtained, thus ensuring the display adaptability of the navigation guidance image. On the other hand, by referring to the current drivable area, on-demand cropping can be achieved, avoiding cropping off the important image area of the drivable area, so as to ensure that the finally obtained adapted navigation guidance image can still contain the drivable area of the vehicle, improving the guiding effect and display quality of the navigation guidance image. It can be seen that by dynamically cropping the target navigation guidance image, it is possible to automatically achieve the adaptation between the target navigation guidance image and the screen area without stretching, compressing, etc. processing on the target navigation guidance image, which can avoid deformation of the image elements in the target navigation guidance image and further improve the display quality of the navigation guidance image. Moreover, since the embodiment of the present application can ensure the display adaptability of the navigation guidance image through the above steps for any size of the screen area, it can be known that the embodiment of the present application can be extended to any size of the screen area, indicating that the embodiment of the present application has high adaptability and scalability.
[0155] Based on the description of the embodiment of the above image processing method, the embodiment of the present application also discloses an image processing device, and the image processing device may be a computer program (including program code) running in a computer device. This image processing device can execute Figure 2 or Figure 4 the image processing method shown. Please refer to Figure 6 , and the image processing device can run the following units:
[0156] An acquisition unit 601, configured to obtain a target navigation guidance image generated based on a scene image during the driving process of the vehicle; the vehicle is configured with a screen area for displaying the navigation guidance image, and the scene image is obtained by photographing the road scene in front of the vehicle in the driving direction of the vehicle;
[0157] A processing unit 602, configured to identify the drivable area of the target navigation guidance image to obtain the current drivable area of the vehicle in the target navigation guidance image;
[0158] The processing unit 602 is further configured to dynamically crop the target navigation guidance image according to the current drivable area and the area size of the screen area to obtain an adapted navigation guidance image with an image size adapted to the area size;
[0159] A display unit 603, configured to display the adapted navigation guidance image in the screen area of the vehicle.
[0160] In one embodiment, when the processing unit 602 is used to identify the drivable area of the target navigation guidance image to obtain the current drivable area of the vehicle in the target navigation guidance image, it may specifically be configured to:
[0161] Perform lane line detection on the target navigation guidance image to obtain multiple lane lines in the target navigation guidance image;
[0162] Determine a first lane line and a second lane line from the multiple lane lines, where the first lane line and the second lane line satisfy the following conditions: among the multiple lane lines, other lane lines except the first lane line and the second lane line are all located between the first lane line and the second lane line;
[0163] Determine the lane line endpoints of the first lane line displayed in the target navigation guidance image as the first lane line endpoints, and determine the lane line endpoints of the second lane line as the second lane line endpoints;
[0164] Perform a closing process on the first lane line and the second lane line according to the first lane line endpoints, the second lane line endpoints, and one or more image edges of the target navigation guidance image;
[0165] Determine the area obtained after the closing process as the current drivable area of the vehicle in the target navigation guidance image.
[0166] In another embodiment, the processing unit 602 may also be configured to:
[0167] Determine the target image size of the target navigation guidance image;
[0168] If the target image size is greater than the area size of the screen area, trigger the step of dynamically cropping the target navigation guidance image according to the current drivable area and the area size to obtain an adapted navigation guidance image with an image size adapted to the area size;
[0169] Wherein, the dynamically cropping the target navigation guidance image according to the current drivable area and the area size to obtain an adapted navigation guidance image with an image size adapted to the area size includes:
[0170] Determine the cropping requirement information of the target navigation guidance image according to the size difference between the target image size and the area size;
[0171] Dynamically crop the target navigation guidance image according to the current drivable area and the cropping requirement information to obtain an adapted navigation guidance image with an image size adapted to the area size.
[0172] In another implementation, when the processing unit 602 is used to dynamically crop the target navigation guidance image according to the current drivable area and the cropping requirement information to obtain an adapted navigation guidance image with an image size adapted to the area size, it may specifically be used for:
[0173] Determine the current driving speed of the vehicle at the current moment, where the current moment refers to the moment when the scene image is captured;
[0174] According to the current driving speed and the current drivable area, predict the drivable area of the vehicle at the next moment in the target navigation guidance image to obtain a new drivable area;
[0175] Based on the new drivable area and the cropping requirement information, dynamically crop the target navigation guidance image to obtain an adapted navigation guidance image with an image size adapted to the area size.
[0176] In another implementation, when the processing unit 602 is used to predict the drivable area of the vehicle at the next moment in the target navigation guidance image according to the current driving speed and the current drivable area to obtain a new drivable area, it may specifically be used for:
[0177] Determine a reference point from the current drivable area and determine the mapped position of the vehicle in the target navigation guidance image;
[0178] Draw multiple identification lines between the reference point and the mapped position, and draw a distance identification for each identification line according to the target physical distance value between the position point of the reference point in the road scene and the vehicle; one identification line corresponds to a physical position point in the road scene, and the distance identification of any identification line is used to indicate: the physical distance value between the corresponding physical position point and the vehicle;
[0179] Based on the current driving speed, determine the driving distance value traveled by the vehicle from the current moment to the next moment; and according to the driving distance value and the distance identification of each identification line, determine a target identification line from the multiple identification lines, where the physical distance value indicated by the distance identification of the target identification line matches the driving distance value;
[0180] According to the position of the target identification line in the current drivable area, determine a new drivable area from the current drivable area.
[0181] In another implementation, when the processing unit 602 is used to dynamically crop the target navigation guidance image based on the new drivable area and the cropping requirement information to obtain an adapted navigation guidance image with an image size adapted to the area size, it can be specifically used for:
[0182] Based on the new drivable area and the cropping requirement information, determine one or more areas to be cropped from the target navigation guidance image;
[0183] Crop each area to be cropped in the target navigation guidance image to obtain an adapted navigation guidance image with an image size adapted to the area size.
[0184] In another implementation, the cropping requirement information includes at least one of the following: a cropping requirement value in the width dimension and a cropping requirement value in the height dimension; correspondingly, when the processing unit 602 is used to determine one or more areas to be cropped from the target navigation guidance image based on the new drivable area and the cropping requirement information, it can be specifically used for:
[0185] Traverse the cropping requirement values in each dimension of the cropping requirement information, determine the current cropping requirement value of the currently traversed current dimension as the current cropping requirement value, and determine the two cropping directions indicated by the current dimension;
[0186] According to the position of the new drivable area in the target navigation guidance image, determine the croppable value of the target navigation guidance image in each of the two cropping directions;
[0187] Take the larger croppable value of the two determined croppable values as the first croppable value, and take the smaller croppable value as the second croppable value; and calculate the croppable value difference between the first croppable value and the second croppable value;
[0188] According to the magnitude relationship between the croppable value difference and the current cropping requirement value, and along at least one of the two cropping directions, determine at least one area to be cropped in the target navigation guidance image.
[0189] In another implementation, the cropping direction corresponding to the first croppable value is the first cropping direction, and the direction corresponding to the second croppable value is the second cropping direction; correspondingly, when the processing unit 602 is used to determine at least one area to be cropped in the target navigation guidance image according to the magnitude relationship between the croppable value difference and the current cropping requirement value and along at least one of the two cropping directions, it can be specifically used for:
[0190] When the difference between the clippable value and the current clipping requirement value is less than the current clipping requirement value, according to the difference between the clippable value and the current clipping requirement value, a to-be-clipped area is determined in the target navigation guidance image along the first clipping direction, and another to-be-clipped area is determined in the target navigation guidance image along the second clipping direction; wherein, the sum of the size values of the two determined to-be-clipped areas in the current dimension is equal to the current clipping requirement value;
[0191] When the difference between the clippable value and the current clipping requirement value is greater than the current clipping requirement value, a to-be-clipped area is determined in the target navigation guidance image along the first clipping direction according to the current clipping requirement value, and the size value of the determined to-be-clipped area in the current dimension is equal to the current clipping requirement value.
[0192] In another implementation manner, when the obtaining unit 601 is used to obtain a target navigation guidance image generated based on a scene image during the driving process of the vehicle, it may specifically be used for:
[0193] During the driving process of the vehicle, obtain an initial navigation guidance image generated based on a scene image;
[0194] Determine the initial image size of the initial navigation guidance image and the area size of the screen area;
[0195] According to the initial image size and the area size, determine the image processing strategy for the initial navigation guidance image;
[0196] Perform image processing on the initial navigation guidance image according to the image processing strategy to obtain a target navigation guidance image.
[0197] In another implementation manner, the area size includes: a first size value in the height dimension and a first size value in the width dimension; the initial image size includes: a second size value in the height dimension and a second size value in the width dimension; correspondingly, when the obtaining unit 601 is used to determine the image processing strategy for the initial navigation guidance image according to the initial image size and the area size, it may specifically be used for:
[0198] Calculate the ratio between the first size value in the height dimension in the area size and the second size value in the height dimension in the initial image size to obtain a height ratio; and calculate the ratio between the first size value in the width dimension in the area size and the second size value in the width dimension in the initial image size to obtain a width ratio;
[0199] Select one of the height ratio and the width ratio as the target ratio; wherein, when the height ratio is greater than or equal to the width ratio, the target ratio is the height ratio, otherwise, the target ratio is the width ratio;
[0200] Take the first size value of the region size in the target dimension as the first target value, and take the second size value of the initial image size in the target dimension as the second target value; wherein, the target dimension refers to the dimension corresponding to the target ratio;
[0201] Determine the size relationship between the first target value and the second target value according to the target ratio, and determine the image processing strategy of the initial navigation guidance image based on the size relationship between the first target value and the second target value.
[0202] In another implementation manner, when the obtaining unit 601 is used to determine the image processing strategy of the initial navigation guidance image based on the size relationship between the first target value and the second target value, it may specifically be used for:
[0203] When the first target value is greater than the second target value, determining that the image processing strategy of the initial navigation guidance image includes: a strategy of enlarging the initial navigation guidance image according to the target ratio;
[0204] When the first target value is equal to the second target value, determining that the image processing strategy of the initial navigation guidance image includes: a strategy of keeping the initial navigation guidance image unchanged;
[0205] When the first target value is less than the second target value, determining that the image processing strategy of the initial navigation guidance image includes: a strategy of keeping the initial navigation guidance image unchanged, or a strategy of reducing the initial navigation guidance image according to the target ratio.
[0206] In another implementation manner, the obtaining unit 601 may also be used for:
[0207] Calculate the area of the screen region according to the first size value of the region size in the height dimension and the first size value of the region size in the width dimension;
[0208] Calculate the image area of the initial navigation guidance image according to the second size value of the initial image size in the height dimension and the second size value of the initial image size in the width dimension;
[0209] If the difference between the region area and the image area is greater than the difference threshold, determine that the initial navigation guidance image is allowed to be reduced;
[0210] If the difference between the area of the region and the area of the image is less than or equal to the difference threshold, it is determined that the initial navigation guidance image is not allowed to be reduced.
[0211] According to another embodiment of the present application, Figure 6 Each unit in the illustrated image processing apparatus can be respectively or all combined into one or several other units to form, or a certain (some) unit can be further split into a plurality of smaller units in terms of function to form, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above units are divided based on logical functions. In actual applications, the function of one unit can also be realized by multiple units, or the functions of multiple units can be realized by one unit. In other embodiments of the present application, the image processing apparatus may also include other units. In actual applications, these functions can also be assisted by other units and can be realized by the cooperation of multiple units.
[0212] According to another embodiment of the present application, it can be achieved by running a computer program (including program code) capable of executing the respective steps involved in the corresponding method shown in Figure 2 or Figure 4 on a general computing device such as a computer including processing elements and storage elements such as a central processing unit (CPU), a random access storage medium (RAM), and a read-only storage medium (ROM), to construct an image processing apparatus device as shown in Figure 6 and to implement the image processing method of the embodiments of the present application. The computer program can be recorded on, for example, a computer-readable recording medium, loaded into the above computing device through the computer-readable recording medium, and run therein.
[0213] After the embodiment of the present application obtains the target navigation guidance image generated based on the scene image, it can identify the drivable area of the target navigation guidance image to identify the current drivable area of the vehicle. Then, according to the region size of the current drivable area and the screen area, the target navigation guidance image can be dynamically cropped. On the one hand, by referring to the region size of the screen area, it can be ensured that an adapted navigation guidance image with an image size adapted to the region size can be finally obtained, thus ensuring the display adaptability of the navigation guidance image. On the other hand, by referring to the current drivable area, on-demand cropping can be achieved, avoiding cropping off this important image area of the drivable area, so as to ensure that the final obtained adapted navigation guidance image can still contain the drivable area of the vehicle, improving the guiding effect and display quality of the navigation guidance image. It can be seen that by dynamically cropping the target navigation guidance image, it is possible to achieve the adaptation between the target navigation guidance image and the screen area without stretching, compressing or other processing of the target navigation guidance image, which can avoid the deformation of the image elements in the target navigation guidance image and further improve the display quality of the navigation guidance image. Moreover, since the embodiment of the present application can ensure the display adaptability of the navigation guidance image through the above steps for any size of the screen area, it can be known that the embodiment of the present application can be extended to any size of the screen area, indicating that the embodiment of the present application has high adaptability and scalability.
[0214] Based on the descriptions of the above method embodiments and apparatus embodiments, the embodiments of the present application further provide a computer device. Please refer to Figure 7 , this computer device at least includes a processor 701, an input interface 702, an output interface 703, and a computer storage medium 704. Among them, the processor 701, the input interface 702, the output interface 703, and the computer storage medium 704 in the computer device can be connected through a bus or other means. The computer storage medium 704 can be stored in the memory of the computer device. The computer storage medium 704 is used to store a computer program, and the computer program includes program instructions. The processor 701 is used to execute the program instructions stored in the computer storage medium 704. The processor 701 (or CPU (Central Processing Unit, central processor)) is the computing core and control core of the computer device, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding function.
[0215] In one embodiment, the processor 701 described in the embodiments of the present application can be used to perform a series of image processing operations, specifically including: during the driving of the vehicle, obtaining a target navigation guidance image generated based on a scene image; the vehicle is configured with a screen area for displaying the navigation guidance image, and the scene image is obtained by photographing the road scene in front of the vehicle in the driving direction of the vehicle; identifying the drivable area of the vehicle from the target navigation guidance image to obtain the current drivable area of the vehicle in the target navigation guidance image; dynamically cropping the target navigation guidance image according to the current drivable area and the area size of the screen area to obtain an adapted navigation guidance image with an image size adapted to the area size; and displaying the adapted navigation guidance image in the screen area of the vehicle, and so on.
[0216] The embodiments of the present application also provide a computer storage medium (Memory). The computer storage medium is a memory device in a computer device and is used to store programs and data. It can be understood that the computer storage medium here can include both the built-in storage medium in the computer device and, of course, the extended storage medium supported by the computer device. The computer storage medium provides a storage space, which stores the operating system of the computer device. And, in this storage space, one or more instructions suitable for being loaded and executed by the processor are also stored, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory; optionally, it can also be at least one computer storage medium located far from the aforementioned processor.
[0217] In one embodiment, one or more instructions stored in the computer storage medium can be loaded and executed by the processor to implement the corresponding steps of the method in the above-mentioned Figure 2 or Figure 4 shown method embodiments of image processing; in a specific implementation, one or more instructions in the computer storage medium are loaded and executed by the processor as follows:
[0218] During the driving of the vehicle, obtain a target navigation guidance image generated based on a scene image; the vehicle is configured with a screen area for displaying the navigation guidance image, and the scene image is obtained by photographing the road scene in front of the vehicle in the driving direction of the vehicle;
[0219] Identify the drivable area from the target navigation guidance image to obtain the current drivable area of the vehicle in the target navigation guidance image;
[0220] Dynamically crop the target navigation guidance image according to the region sizes of the current drivable region and the screen region, so as to obtain an adapted navigation guidance image with an image size adapted to the region sizes;
[0221] In the screen region of the vehicle, display the adapted navigation guidance image.
[0222] In one implementation, when identifying the drivable region of the target navigation guidance image to obtain the current drivable region of the vehicle in the target navigation guidance image, the one or more instructions can be loaded and specifically executed by a processor:
[0223] Perform lane line detection on the target navigation guidance image to obtain multiple lane lines in the target navigation guidance image;
[0224] Determine a first lane line and a second lane line from the multiple lane lines, where the first lane line and the second lane line satisfy the following conditions: among the multiple lane lines, other lane lines except the first lane line and the second lane line are all located between the first lane line and the second lane line;
[0225] Determine the lane line endpoints of the first lane line displayed in the target navigation guidance image as the first lane line endpoints, and determine the lane line endpoints of the second lane line as the second lane line endpoints;
[0226] Perform a closing process on the first lane line and the second lane line according to the first lane line endpoints, the second lane line endpoints, and one or more image edges of the target navigation guidance image;
[0227] Determine the region obtained after the closing process as the current drivable region of the vehicle in the target navigation guidance image.
[0228] In another implementation, the one or more instructions can be loaded and specifically executed by a processor:
[0229] Determine the target image size of the target navigation guidance image;
[0230] If the target image size is greater than the region size of the screen region, trigger the execution of the step of dynamically cropping the target navigation guidance image according to the current drivable region and the region size, so as to obtain an adapted navigation guidance image with an image size adapted to the region size;
[0231] Among them, dynamically cropping the target navigation guidance image according to the current drivable area and the area size to obtain an adapted navigation guidance image with an image size adapted to the area size includes:
[0232] Determine the cropping requirement information of the target navigation guidance image according to the size difference between the target image size and the area size;
[0233] Dynamically crop the target navigation guidance image according to the current drivable area and the cropping requirement information to obtain an adapted navigation guidance image with an image size adapted to the area size.
[0234] In another implementation, when dynamically cropping the target navigation guidance image according to the current drivable area and the cropping requirement information to obtain an adapted navigation guidance image with an image size adapted to the area size, the one or more instructions can be loaded and specifically executed by a processor:
[0235] Determine the current driving speed of the vehicle at the current moment, where the current moment refers to the moment when the scene image is captured;
[0236] Predict the drivable area of the vehicle at the next moment in the target navigation guidance image according to the current driving speed and the current drivable area to obtain a new drivable area;
[0237] Dynamically crop the target navigation guidance image based on the new drivable area and the cropping requirement information to obtain an adapted navigation guidance image with an image size adapted to the area size.
[0238] In another implementation, when predicting the drivable area of the vehicle at the next moment in the target navigation guidance image according to the current driving speed and the current drivable area to obtain a new drivable area, the one or more instructions can be loaded and specifically executed by a processor:
[0239] Determine a reference point from the current drivable area and determine the mapped position of the vehicle in the target navigation guidance image;
[0240] Draw multiple identification lines between the reference point and the mapped position, and draw a distance identification for each identification line according to the target physical distance value between the position point of the reference point in the road scene and the vehicle; one identification line corresponds to a physical position point in the road scene, and the distance identification of any identification line is used to indicate: the physical distance value between the corresponding physical position point and the vehicle;
[0241] Based on the current driving speed, determine the driving distance value that the vehicle travels from the current moment to the next moment; and based on the driving distance value and the distance identifier of each identification line, determine a target identification line from the multiple identification lines, where the physical distance value indicated by the distance identifier of the target identification line matches the driving distance value;
[0242] Based on the position of the target identification line in the current drivable area, determine a new drivable area from the current drivable area.
[0243] In another implementation, when dynamically cropping the target navigation guidance image based on the new drivable area and the cropping requirement information to obtain an adapted navigation guidance image with an image size adapted to the area size, the one or more instructions can be loaded and specifically executed by a processor:
[0244] Based on the new drivable area and the cropping requirement information, determine one or more areas to be cropped from the target navigation guidance image;
[0245] Crop each area to be cropped in the target navigation guidance image to obtain an adapted navigation guidance image with an image size adapted to the area size.
[0246] In another implementation, the cropping requirement information includes at least one of the following: a cropping requirement value in the width dimension and a cropping requirement value in the height dimension; correspondingly, when determining one or more areas to be cropped from the target navigation guidance image based on the new drivable area and the cropping requirement information, the one or more instructions can be loaded and specifically executed by a processor:
[0247] Traverse the cropping requirement values in each dimension of the cropping requirement information, determine the current cropping requirement value of the currently traversed current dimension as the current cropping requirement value, and determine the two cropping directions indicated by the current dimension;
[0248] Based on the position of the new drivable area in the target navigation guidance image, determine the croppable value of the target navigation guidance image in each of the two cropping directions;
[0249] Take the larger croppable value of the two determined croppable values as the first croppable value, and take the smaller croppable value as the second croppable value; and calculate the croppable value difference between the first croppable value and the second croppable value;
[0250] Determine at least one area to be cropped in the target navigation guidance image according to the magnitude relationship between the croppable value difference and the current cropping requirement value, and along at least one of the two cropping directions.
[0251] In another embodiment, the cropping direction corresponding to the first croppable value is the first cropping direction, and the direction corresponding to the second croppable value is the second cropping direction; correspondingly, when determining at least one area to be cropped in the target navigation guidance image according to the magnitude relationship between the croppable value difference and the current cropping requirement value, and along at least one of the two cropping directions, the one or more instructions may be loaded and specifically executed by a processor:
[0252] When the croppable value difference is less than the current cropping requirement value, determine one area to be cropped in the target navigation guidance image along the first cropping direction according to the croppable value difference and the current cropping requirement value, and determine another area to be cropped in the target navigation guidance image along the second cropping direction; wherein, the sum of the size values of the two determined areas to be cropped in the current dimension is equal to the current cropping requirement value;
[0253] When the croppable value difference is greater than the current cropping requirement value, determine one area to be cropped in the target navigation guidance image along the first cropping direction according to the current cropping requirement value, and the size value of the determined area to be cropped in the current dimension is equal to the current cropping requirement value.
[0254] In another embodiment, during the driving of the vehicle, when obtaining a target navigation guidance image generated based on a scene image, the one or more instructions may be loaded and specifically executed by a processor:
[0255] During the driving of the vehicle, obtain an initial navigation guidance image generated based on a scene image;
[0256] Determine the initial image size of the initial navigation guidance image and the area size of the screen area;
[0257] According to the initial image size and the area size, determine the image processing strategy for the initial navigation guidance image;
[0258] Perform image processing on the initial navigation guidance image according to the image processing strategy to obtain a target navigation guidance image.
[0259] In another implementation, the region size includes: a first size value in the height dimension and a first size value in the width dimension; the initial image size includes: a second size value in the height dimension and a second size value in the width dimension; correspondingly, when determining the image processing strategy of the initial navigation guidance image according to the initial image size and the region size, the one or more instructions can be loaded and specifically executed by a processor:
[0260] Calculate the ratio between the first size value in the height dimension of the region size and the second size value in the height dimension of the initial image size to obtain a height ratio; and calculate the ratio between the first size value in the width dimension of the region size and the second size value in the width dimension of the initial image size to obtain a width ratio;
[0261] Select one of the height ratio and the width ratio as the target ratio; where when the height ratio is greater than or equal to the width ratio, the target ratio is the height ratio, otherwise, the target ratio is the width ratio;
[0262] Use the first size value in the target dimension of the region size as the first target value, and use the second size value in the target dimension of the initial image size as the second target value; where the target dimension refers to the dimension corresponding to the target ratio;
[0263] Determine the size relationship between the first target value and the second target value according to the target ratio, and based on the size relationship between the first target value and the second target value, determine the image processing strategy of the initial navigation guidance image.
[0264] In another implementation, when determining the image processing strategy of the initial navigation guidance image based on the size relationship between the first target value and the second target value, the one or more instructions can be loaded and specifically executed by a processor:
[0265] When the first target value is greater than the second target value, determining the image processing strategy of the initial navigation guidance image includes: a strategy of magnifying the initial navigation guidance image according to the target ratio;
[0266] When the first target value is equal to the second target value, determining the image processing strategy of the initial navigation guidance image includes: a strategy of keeping the initial navigation guidance image unchanged;
[0267] When the first target value is less than the second target value, determining the image processing strategy for the initial navigation guidance image includes: a strategy of keeping the initial navigation guidance image unchanged, or a strategy of reducing the initial navigation guidance image according to the target ratio.
[0268] In another implementation, the one or more instructions may be loaded and specifically executed by a processor:
[0269] Calculate the area of the screen region according to the first dimension value in the height dimension among the region dimensions and the first dimension value in the width dimension among the region dimensions;
[0270] Calculate the image area of the initial navigation guidance image according to the second dimension value in the height dimension among the initial image dimensions and the second dimension value in the width dimension among the initial image dimensions;
[0271] If the gap between the area of the region and the area of the image is greater than the gap threshold, it is determined that the initial navigation guidance image is allowed to be reduced;
[0272] If the gap between the area of the region and the area of the image is less than or equal to the gap threshold, it is determined that the initial navigation guidance image is not allowed to be reduced.
[0273] After obtaining the target navigation guidance image generated based on the scene image in the embodiment of the present application, the target navigation guidance image can be recognized for the drivable area to recognize the current drivable area of the vehicle. Then, according to the current drivable area and the area size of the screen area, the target navigation guidance image can be dynamically cropped. On the one hand, by referring to the area size of the screen area, it can be ensured that finally an adapted navigation guidance image with an image size adapted to the area size can be obtained, thereby ensuring the display adaptability of the navigation guidance image. On the other hand, by referring to the current drivable area, on-demand cropping can be realized, avoiding cropping off an important image area of the drivable area, so as to ensure that the finally obtained adapted navigation guidance image can still include the drivable area of the vehicle, improving the guiding effect and display quality of the navigation guidance image. Thus, it can be seen that by dynamically cropping the target navigation guidance image, it is possible to achieve the adaptation between the target navigation guidance image and the screen area without stretching, compressing, etc. the target navigation guidance image, which can avoid the deformation of the image elements in the target navigation guidance image and further improve the display quality of the navigation guidance image. And since the embodiment of the present application can ensure the display adaptability of the navigation guidance image through the above steps for any size of the screen area, it can be known that the embodiment of the present application can be extended to any size of the screen area, and it can be seen that the embodiment of the present application has high adaptability and scalability.
[0274] It should be noted that according to one aspect of the present application, a computer program product or a computer program is further provided. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above Figure 2 or Figure 4 methods provided in various alternative ways in the embodiments of the image processing method shown.
[0275] Moreover, it should be understood that the above-disclosed are only the preferred embodiments of the present application. Of course, the scope of the rights of the present application cannot be limited thereby. Therefore, equivalent changes made according to the claims of the present application still fall within the scope covered by the present application.
Claims
1. An image processing method, characterized in that, Including: During the driving of the vehicle, obtain a target navigation guidance image generated based on a scene image; The vehicle is configured with a screen area for displaying a navigation guidance image. The scene image is obtained by photographing the road scene in front of the vehicle in the driving direction of the vehicle. The target navigation guidance image includes the scene image and is used for navigation and presenting real - scene information; Identify the drivable area of the vehicle in the target navigation guidance image to obtain the current drivable area of the vehicle in the target navigation guidance image. The current drivable area is obtained by performing a closing process on the first lane line and the second lane line based on the lane - line endpoints of the first lane line, the lane - line endpoints of the second lane line, and one or more image edges of the target navigation guidance image. The first lane line and the second lane line are respectively the left - most lane line and the right - most lane line in the driving direction; Dynamically crop the target navigation guidance image according to the current drivable area and the area size of the screen area to obtain an adapted navigation guidance image with an image size adapted to the area size; Display the adapted navigation guidance image in the screen area of the vehicle.
2. The method according to claim 1, characterized in that, The step of identifying the drivable area of the vehicle in the target navigation guidance image to obtain the current drivable area of the vehicle in the target navigation guidance image includes: Perform lane - line detection on the target navigation guidance image to obtain multiple lane lines in the target navigation guidance image; Determine a first lane line and a second lane line from the multiple lane lines. The first lane line and the second lane line satisfy the following condition: Among the multiple lane lines, other lane lines except the first lane line and the second lane line are all located between the first lane line and the second lane line; Determine the lane - line endpoints of the first lane line displayed in the target navigation guidance image as the first lane - line endpoints, and determine the lane - line endpoints of the second lane line as the second lane - line endpoints; Perform a closing process on the first lane line and the second lane line according to the first lane - line endpoints, the second lane - line endpoints, and one or more image edges of the target navigation guidance image; Determine the area obtained after the closing process as the current drivable area of the vehicle in the target navigation guidance image.
3. The method according to claim 1, wherein The method further includes: Determine the target image size of the target navigation guidance image; If the target image size is greater than the area size of the screen area, trigger the step of dynamically cropping the target navigation guidance image according to the current drivable area and the area size to obtain an adapted navigation guidance image with an image size adapted to the area size; Wherein, the step of dynamically cropping the target navigation guidance image according to the current drivable area and the area size to obtain an adapted navigation guidance image with an image size adapted to the area size includes: Determine the cropping requirement information of the target navigation guidance image according to the dimensional difference between the target image size and the regional size; Dynamically crop the target navigation guidance image according to the current drivable area and the cropping requirement information to obtain an adapted navigation guidance image with an image size adapted to the regional size.
4. The method according to claim 3, wherein The dynamically cropping the target navigation guidance image according to the current drivable area and the cropping requirement information to obtain an adapted navigation guidance image with an image size adapted to the regional size includes: Determine the current driving speed of the vehicle at the current moment, where the current moment refers to the moment when the scene image is captured; Predict the drivable area of the vehicle at the next moment in the target navigation guidance image according to the current driving speed and the current drivable area to obtain a new drivable area; Dynamically crop the target navigation guidance image based on the new drivable area and the cropping requirement information to obtain an adapted navigation guidance image with an image size adapted to the regional size.
5. The method according to claim 4, wherein The predicting the drivable area of the vehicle at the next moment in the target navigation guidance image according to the current driving speed and the current drivable area to obtain a new drivable area includes: Determine a reference point from the current drivable area and determine the mapping position of the vehicle in the target navigation guidance image; Draw multiple identification lines between the reference point and the mapping position, and draw a distance identification for each identification line according to the target physical distance value between the position point of the reference point in the road scene and the vehicle; one identification line corresponds to a physical position point in the road scene, and the distance identification of any identification line is used to indicate: the physical distance value between the corresponding physical position point and the vehicle; Based on the current driving speed, determine the driving distance value traveled by the vehicle from the current moment to the next moment; and according to the driving distance value and the distance identification of each identification line, determine a target identification line from the multiple identification lines, where the physical distance value indicated by the distance identification of the target identification line matches the driving distance value; Determine a new drivable area from the current drivable area according to the position of the target identification line in the current drivable area.
6. The method according to claim 4, wherein The dynamically cropping the target navigation guidance image based on the new drivable area and the cropping requirement information to obtain an adapted navigation guidance image with an image size adapted to the regional size includes: Determine one or more areas to be cropped from the target navigation guidance image based on the new drivable area and the cropping requirement information; Crop each area to be cropped in the target navigation guidance image to obtain an adapted navigation guidance image with an image size adapted to the regional size.
7. The method according to claim 6, wherein The cropping requirement information includes at least one of the following: a cropping requirement value in the width dimension and a cropping requirement value in the height dimension; Determining one or more regions to be cropped from the target navigation guidance image based on the new drivable region and the cropping requirement information includes: Traversing the cropping requirement values under each dimension in the cropping requirement information, determining the currently traversed cropping requirement value under the current dimension as the current cropping requirement value, and determining two cropping directions indicated by the current dimension; Determining the croppable value of the target navigation guidance image in each of the two cropping directions according to the position of the new drivable region in the target navigation guidance image; Taking the larger croppable value of the two determined croppable values as the first croppable value, and taking the smaller croppable value as the second croppable value; and calculating the croppable value difference between the first croppable value and the second croppable value; Determining at least one region to be cropped in the target navigation guidance image according to the magnitude relationship between the croppable value difference and the current cropping requirement value, and along at least one of the two cropping directions.
8. The method according to claim 7, wherein The cropping direction corresponding to the first croppable value is the first cropping direction, and the direction corresponding to the second croppable value is the second cropping direction; The determining at least one region to be cropped in the target navigation guidance image according to the magnitude relationship between the croppable value difference and the current cropping requirement value, and along at least one of the two cropping directions includes: When the croppable value difference is less than the current cropping requirement value, determining one region to be cropped in the target navigation guidance image along the first cropping direction according to the croppable value difference and the current cropping requirement value, and determining another region to be cropped in the target navigation guidance image along the second cropping direction; wherein, the sum of the size values of the two determined regions to be cropped under the current dimension is equal to the current cropping requirement value; When the croppable value difference is greater than the current cropping requirement value, determining one region to be cropped in the target navigation guidance image along the first cropping direction and according to the current cropping requirement value, and the size value of the determined region to be cropped under the current dimension is equal to the current cropping requirement value.
9. The method according to claim 1, wherein During the driving of the vehicle, obtaining a target navigation guidance image generated based on a scene image includes: During the driving of the vehicle, obtaining an initial navigation guidance image generated based on a scene image; Determining the initial image size of the initial navigation guidance image and the region size of the screen region; Determining the image processing strategy of the initial navigation guidance image according to the initial image size and the region size; Performing image processing on the initial navigation guidance image according to the image processing strategy to obtain a target navigation guidance image.
10. The method according to claim 9, wherein The region size includes: a first size value in the height dimension and a first size value in the width dimension; the initial image size includes: a second size value in the height dimension and a second size value in the width dimension; Determining an image processing strategy for the initial navigation guidance image according to the initial image size and the region size includes: Calculating a ratio between a first size value in the height dimension of the region size and a second size value in the height dimension of the initial image size to obtain a height ratio; and calculating a ratio between a first size value in the width dimension of the region size and a second size value in the width dimension of the initial image size to obtain a width ratio; Selecting one of the height ratio and the width ratio as a target ratio; wherein, when the height ratio is greater than or equal to the width ratio, the target ratio is the height ratio, otherwise, the target ratio is the width ratio; Taking the first size value in the target dimension of the region size as a first target value, and taking the second size value in the target dimension of the initial image size as a second target value; wherein, the target dimension refers to the dimension corresponding to the target ratio; Determining the size relationship between the first target value and the second target value according to the target ratio, and determining the image processing strategy for the initial navigation guidance image based on the size relationship between the first target value and the second target value.
11. The method according to claim 10, wherein The determining the image processing strategy for the initial navigation guidance image based on the size relationship between the first target value and the second target value includes: When the first target value is greater than the second target value, determining that the image processing strategy for the initial navigation guidance image includes: a strategy of enlarging the initial navigation guidance image according to the target ratio; When the first target value is equal to the second target value, determining that the image processing strategy for the initial navigation guidance image includes: a strategy of keeping the initial navigation guidance image unchanged; When the first target value is less than the second target value, determining that the image processing strategy for the initial navigation guidance image includes: a strategy of keeping the initial navigation guidance image unchanged, or a strategy of reducing the initial navigation guidance image according to the target ratio.
12. The method according to claim 11, wherein When the first target value is less than the second target value: If the initial navigation guidance image is not allowed to be reduced, the image processing strategy for the initial navigation guidance image includes: a strategy of keeping the initial navigation guidance image unchanged; If the initial navigation guidance image is allowed to be reduced, the image processing strategy for the initial navigation guidance image includes: a strategy of reducing the initial navigation guidance image according to the target ratio.
13. The method according to claim 12, wherein The method further includes: Calculating the area of the screen region according to the first size value in the height dimension of the region size and the first size value in the width dimension of the region size; Calculating the image area of the initial navigation guidance image according to the second size value in the height dimension of the initial image size and the second size value in the width dimension of the initial image size; If the difference between the area of the region and the area of the image is greater than a difference threshold, it is determined that the initial navigation guidance image is allowed to be reduced; If the difference between the area of the region and the area of the image is less than or equal to the difference threshold, it is determined that the initial navigation guidance image is not allowed to be reduced.
14. An image processing apparatus, characterized in that, Including: An acquisition unit configured to acquire a target navigation guidance image generated based on a scene image during the driving of the vehicle; The vehicle is configured with a screen area for displaying a navigation guidance image, and the scene image is obtained by photographing a road scene in front of the vehicle in the driving direction of the vehicle; The target navigation guidance image includes the scene image and is used for navigation and presenting real-time scene information; A processing unit configured to identify a drivable area of the target navigation guidance image to obtain a current drivable area of the vehicle in the target navigation guidance image; the current drivable area is obtained by performing a closing process on the first lane line and the second lane line based on the lane line endpoints of the first lane line, the lane line endpoints of the second lane line, and one or more image edges of the target navigation guidance image, and the first lane line and the second lane line are respectively the leftmost lane line and the rightmost lane line in the driving direction; The processing unit is further configured to perform dynamic cropping on the target navigation guidance image according to the region sizes of the current drivable area and the screen area to obtain an adapted navigation guidance image with an image size adapted to the region size; A display unit configured to display the adapted navigation guidance image in the screen area of the vehicle.
15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the image processing method according to any one of claims 1-13.
16. A computer device includes an input interface and an output interface, characterized in that, Further including: A processor adapted to implement one or more instructions; and, a computer storage medium; Wherein, the computer storage medium stores one or more instructions, and the one or more instructions are adapted to be loaded and executed by the processor to implement the image processing method according to any one of claims 1-13.
17. A computer storage medium, characterized in that, The computer storage medium stores one or more instructions, and the one or more instructions are adapted to be loaded and executed by a processor to implement the image processing method according to any one of claims 1-13.
Citation Information
Patent Citations
ARHUD and live-action fused navigation curve guiding method and system
CN113701773A