WO2024251026A1 - 图像处理方法、装置、设备及存储介质 - Google Patents

图像处理方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2024251026A1
WO2024251026A1 PCT/CN2024/096350 CN2024096350W WO2024251026A1 WO 2024251026 A1 WO2024251026 A1 WO 2024251026A1 CN 2024096350 W CN2024096350 W CN 2024096350W WO 2024251026 A1 WO2024251026 A1 WO 2024251026A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
line segments
intersection
line
matching
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2024/096350
Other languages
English (en)
French (fr)
Inventor
张晟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Publication of WO2024251026A1 publication Critical patent/WO2024251026A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features

Definitions

  • an embodiment of the present disclosure provides an image processing method, the method comprising: extracting line features from a first image to be matched and a second image to be matched, respectively, to obtain a plurality of first line segments and a plurality of second line segments; determining a plurality of first intersection points corresponding to the plurality of first line segments and a plurality of second intersection points corresponding to the plurality of second line segments; matching the plurality of first intersection points and the plurality of second intersection points to obtain a plurality of matching point pairs, wherein each matching point pair comprises a first intersection point and a corresponding second intersection point; based on the plurality of matching point pairs, determining a plurality of matching target line segments in the first image and the second image.
  • an embodiment of the present disclosure provides an image processing device, the device comprising: an extraction module, used to extract line features of a first image and a second image to be matched, respectively, to obtain a plurality of first line segments and a plurality of second line segments; a first determination module, used to determine a plurality of first intersection points corresponding to the plurality of first line segments and a plurality of second intersection points corresponding to the plurality of second line segments; a matching module, used to match the plurality of first intersection points with the plurality of second intersection points, to obtain a plurality of matching point pairs, wherein each matching point pair comprises a first intersection point and a corresponding second intersection point; A second determination module is used to determine a plurality of target line segments that match the first image and the second image based on the plurality of matching point pairs.
  • an embodiment of the present disclosure provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the image processing method described in the first aspect and various possible designs of the first aspect.
  • an embodiment of the present disclosure provides a computer-readable storage medium, in which computer execution instructions are stored.
  • a processor executes the computer execution instructions, the image processing method described in the first aspect and various possible designs of the first aspect is implemented.
  • user information including but not limited to user device information, user personal information, etc.
  • data including but not limited to data used for analysis, stored data, displayed data, etc.
  • user information including but not limited to user device information, user personal information, etc.
  • data including but not limited to data used for analysis, stored data, displayed data, etc.
  • the posture information of the first image is determined, and the corresponding AR navigation special effects are added to the first image based on the posture information to obtain a special effect navigation image (such as the special effect navigation image in Figure 1), and finally the special effect navigation image is displayed in the terminal.
  • a special effect navigation image such as the special effect navigation image in Figure 1
  • image processing can use LBD (Line Binary Discriptor) to achieve line segment matching.
  • LBD Line Binary Discriptor
  • This method forms a strip area with a piece of pixels around the line segment, and calculates the gradient relationship of the pixels in the strip area.
  • the line segments in the two images are matched through the gradient relationship of the pixels in the strip area.
  • first line segment may be all line segments of the scene (such as the vehicle in the figure) in the combined image, or part of the line segments.
  • first line segment (or the second line segment) may be a boundary line segment of traffic indication lines such as a roadway, a driving direction, a road edge, a crosswalk, etc. in the first image, or a boundary line segment of a building outline such as an office building, a residential building, a gas station, etc., or a boundary line segment of a public facility such as a street lamp and a trash can.
  • S202 Determine a plurality of first intersection points corresponding to a plurality of first line segments and a plurality of second intersection points corresponding to a plurality of second line segments.
  • the extension directions of the plurality of first line segments are the same or different. Part of the first line segments can intersect (or the straight lines where the first line segments are located can intersect), and the intersection point where the first line segments (or the straight lines where the first line segments are located) intersect is the first intersection point. Similarly, the extension directions of the plurality of second line segments are the same or different. Part of the second line segments can intersect (or the straight lines where the second line segments are located can intersect), and the intersection point where the second line segments (or the straight lines where the second line segments are located) intersect is the second intersection point.
  • the endpoint of one first line segment intersects with the middle of another first line segment (i.e., two first line segments form a "T" shape).
  • the first intersection point is located at the endpoint of one first line segment and inside the other first line segment.
  • the two first line segments may intersect with the middle of the line segments (i.e., two first line segments form an "X" shape).
  • the first intersection point is located inside the two first line segments.
  • the extension line of the straight line where one first line segment is located intersects with the extension line of the straight line where the other first line segment is located (i.e., two first line segments form an "Eight" shape). In this case, the first intersection point is located outside the two first line segments.
  • S203 Matching the multiple first intersection points and the multiple second intersection points to obtain multiple matching point pairs, wherein each matching point pair includes a first intersection point and a corresponding second intersection point.
  • S204 Determine a plurality of target line segments that match the first image and the second image based on the plurality of matching point pairs.
  • At least one first line segment associated with the first intersection point and at least one second line segment associated with the second intersection point in the matching point pair are determined, and two line segments whose line segment attributes satisfy similarity conditions in the at least one first line segment and the at least one second line segment are determined to be target line segments that match in the first image and the second image, and finally multiple target line segments are obtained.
  • the plurality of matching point pairs include: a first intersection point A and a second intersection point A', and a first intersection point B and a second intersection point B'.
  • at least one first line segment associated with the first intersection point A includes a first line segment A and a first line segment B
  • at least one first line segment associated with the first intersection point B includes a first line segment C and a first line segment D.
  • at least one second line segment associated with the second intersection point A' includes a second line segment A' and a second line segment B'
  • at least one first line segment associated with the second intersection point B' includes a second line segment C' and a second line segment D'.
  • line features are extracted from the first image and the second image to be matched, respectively, to obtain a plurality of first line segments and a plurality of second line segments. Then, a plurality of first intersection points corresponding to the plurality of first line segments and a plurality of second intersection points corresponding to the plurality of second line segments are determined. Finally, the plurality of first intersection points and the plurality of second intersection points are matched to obtain a plurality of matching point pairs, and based on the plurality of matching point pairs, a plurality of matching target line segments in the first image and the second image are determined.
  • the line segments are matched through the association relationship between points and lines.
  • the stability and accuracy of point feature matching are high, thereby improving the accuracy and robustness of the image processing method for matching line segments.
  • FIG. 3 is a second flow chart of the image processing method provided by the embodiment of the present disclosure. Based on the embodiment shown in Figure 2, this embodiment further refines step S201.
  • LSD Line Segment Detector, straight line extraction algorithm
  • this embodiment further refines step S201.
  • LSD Line Segment Detector, straight line extraction algorithm
  • the following steps may be included:
  • performing Gaussian downsampling on the first image can reduce or even eliminate the jagged effect that appears in the image.
  • the degree of Gaussian downsampling processing can be represented by a scaling factor.
  • the scaling factor is a value between 0 and 1. The smaller the scaling factor, the more obvious the effect of reducing the jagged effect by Gaussian downsampling, but the image clarity will decrease due to the reduction in the number of collected pixels. Exemplarily, the scaling factor is 0.8.
  • the first image is scaled to 80% of the original in both the x and y directions, that is, the total number of pixels is scaled to 64% of the original.
  • the gradient of a pixel is the degree of change in brightness of the pixel, and the gradient of the pixel can be determined by the grayscale value of the pixel.
  • the gradient of each first pixel can be determined by the grayscale value of each first pixel and the grayscale values of the four first pixels below and to the right of the pixel.
  • the specific implementation method is a prior art and will not be described in detail.
  • the gradient of each second pixel can also be determined by the grayscale value of each second pixel and the grayscale values of the four second pixels below and to the right of the pixel.
  • line feature extraction can be achieved by performing region growing through seed pixels. Accordingly, this step is: based on the gradients of multiple first pixels, determine the gradient direction of each first pixel. Select a first seed pixel from multiple first pixels, perform region growing on the first seed pixel based on the gradient direction of each first pixel, obtain a first line support area, and determine a first line segment based on the first line support area. Based on the gradients of multiple second pixels, determine the gradient direction of each second pixel. Select a second seed pixel from multiple second pixels, perform region growing on the second seed pixel based on the gradient direction of each second pixel, obtain a second line support area, and determine a second line segment based on the second line support area.
  • the first pixel with a small gradient direction change and adjacent to the first seed pixel can be used as a connected domain for region growth to obtain a line support area.
  • the line support area is a strip rectangle, that is, a first line segment.
  • the first seed pixel can be randomly selected, and the number of first seed pixels is a preset number.
  • the first seed pixels can also be selected in order from small to large according to the grayscale value of the first pixel. For example, the grayscale value of the first pixel is divided into 0-255 categories from small to large, and one or more first pixels are selected as the first seed pixel in each category.
  • the second pixel with a small gradient direction change and adjacent to the second seed pixel can be used as a connected domain for region growth to obtain a line support area, and the line support area is a strip rectangle, that is, a second line segment.
  • FIG. 4 is a flow chart of the image processing method provided by the embodiment of the present disclosure. Based on the embodiment shown in FIG. 2 , this embodiment further refines step S203.
  • ASL Articleerial Spin Labeling
  • ASL can be used to match multiple first intersection points and multiple second intersection points to obtain multiple matching point pairs.
  • the following steps can be specifically included:
  • S401 extracting first eigenvectors of a plurality of first intersections and second eigenvectors of a plurality of second intersections by using arterial spin labeling (ASL).
  • ASL arterial spin labeling
  • the first feature vector may include the first feature information corresponding to the first intersection.
  • the first feature information is used to represent any attribute information of the first intersection.
  • the first feature information includes one or more of position information, domain information, and color information.
  • the dimension of the first feature vector is related to the amount of attribute information represented by the first feature information.
  • the first feature information includes position information, and the first feature vector of the first intersection A is (x1, y1); wherein x1 represents the horizontal coordinate of the first intersection A, and y1 represents the vertical coordinate of the first intersection A.
  • the first feature vector is a two-dimensional vector.
  • the second feature vector may include second feature information corresponding to the second intersection.
  • the second feature information is used to represent any attribute information of the second intersection.
  • the second feature information includes one or more of position information, domain information, and color information.
  • the dimension of the second feature vector is related to the amount of attribute information represented by the second feature information.
  • the second feature information includes position information, and the second feature vector of the second intersection A' is (x2, y2); wherein x2 represents the abscissa of the second intersection A', and y2 represents the ordinate of the second intersection A'.
  • the second feature vector is a two-dimensional vector.
  • the second feature information includes position information and color information
  • the second feature vector of the second intersection A' is (x2, y2, c2), wherein x2 represents the abscissa of the second intersection A', y2 represents the ordinate of the second intersection A', and c2 represents the grayscale of the second intersection A'.
  • the second feature vector is a three-dimensional vector.
  • the collected ASL data can be subjected to deep learning to train an intersection extraction model.
  • the first feature vectors of multiple first intersections and the second feature vectors of multiple second intersections are then extracted through the model.
  • the intersection extraction model can be a deep convolutional neural network model.
  • the first feature vector includes first feature information corresponding to a plurality of first intersections
  • the second feature vector includes second feature information corresponding to a plurality of second intersections. Accordingly, this step is: for each first intersection, based on the first feature information of the first intersection and the second feature vector of the plurality of second intersections, The second feature information corresponding to the fork point is used to determine the distance between the first intersection point and the multiple second intersection points. A second intersection point that reaches a preset distance threshold and has the smallest distance is selected from the multiple second intersection points, and is combined with the first intersection point as a matching point pair to obtain multiple matching point pairs.
  • the value of the preset distance threshold is not specifically limited and can be set and modified as needed. Exemplarily, the preset distance threshold can be set to 0.5, 1, or 2.
  • the distance between the first intersection point and the second intersection point is also the distance between the first eigenvector and the second eigenvector.
  • the first feature information includes position information
  • the first feature vector of the first intersection A is (x1, y1), where x1 represents the abscissa of the first intersection A, and y1 represents the ordinate of the first intersection A.
  • the second feature information includes position information.
  • the first feature vector of the second intersection A' is (x2, y2); where x2 represents the abscissa of the second intersection A', and y2 represents the ordinate of the second intersection A'.
  • the distance D between the first intersection A and the second intersection A' is:
  • the first feature information includes position information and color information
  • the first feature vector of the first intersection A is (x1, y1, c1)
  • x1 represents the abscissa of the first intersection A
  • y1 represents the ordinate of the first intersection A
  • c1 represents the grayscale of the first intersection A
  • the second feature information includes position information and color information
  • the second feature vector of the second intersection A' is (x2, y2, c2)
  • x2 represents the abscissa of the second intersection A'
  • y2 represents the ordinate of the second intersection A'
  • c2 represents the grayscale of the second intersection A'.
  • the distance D between the first intersection A and the second intersection A' is:
  • the ASL technology is used to match the multiple first intersection points and the multiple second intersection points, and the ASL technology can improve the efficiency of intersection extraction; and the ASL technology can reduce image noise, further improving the accuracy of intersection extraction.
  • the extraction module 601 is specifically used to: perform Gaussian downsampling processing on the first image to obtain multiple first pixels, and perform Gaussian downsampling processing on the second image to obtain multiple second pixels; determine the gradients of the multiple first pixels and the gradients of the multiple second pixels; perform line feature extraction on the first image based on the gradients of the multiple first pixels to obtain multiple first line segments, and perform line feature extraction on the second image based on the gradients of the multiple second pixels to obtain multiple second line segments.
  • processor 701 and the memory 702 are connected via a bus 703 .
  • the electronic device 700 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 701, which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 to a random access memory (RAM) 703.
  • a processing device 701 e.g., a central processing unit, a graphics processing unit, etc.
  • RAM random access memory
  • Various programs and data required for the operation of the electronic device 700 are also stored in the RAM 703.
  • the processing device 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704.
  • An input/output (I/O) interface 705 is also connected to the bus 704.
  • the following devices may be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 708 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 709.
  • the communication device 709 may allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data.
  • FIG. 7 shows an electronic device 700 having various devices, it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
  • an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart.
  • the computer program can be downloaded and installed from a network through the communication device 709, or installed from the storage device 708, or downloaded from the ROM. 702 is installed.
  • the processing device 701 the above functions defined in the method of the embodiment of the present disclosure are performed.
  • the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above.
  • Computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device.
  • a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried.
  • This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above.
  • the computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device.
  • the program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
  • the computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
  • the computer-readable medium carries one or more programs.
  • the electronic device executes the method shown in the above embodiment.
  • Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server.
  • the remote computer can be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or it can be connected to an external computer (for example, through the Internet using an Internet service provider).
  • LAN Local Area Network
  • WAN Wide Area Network
  • each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function.
  • the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved.
  • each square box in the block diagram and/or flow chart, and the combination of the square boxes in the block diagram and/or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
  • exemplary types of hardware logic components include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
  • FPGAs field programmable gate arrays
  • ASICs application specific integrated circuits
  • ASSPs application specific standard products
  • SOCs systems on chips
  • CPLDs complex programmable logic devices
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device.
  • a machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • a machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing.
  • machine-readable storage media would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fibers, a portable compact disk read-only memory, or a computer programmable read-only memory. (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • RAM random access memory
  • ROM read-only memory
  • EPROM or flash memory erasable programmable read-only memory
  • CD-ROM compact disk read-only memory
  • CD-ROM compact disk read-only memory
  • magnetic storage device or any suitable combination of the above.
  • the method of performing line feature extraction on the first image and the second image to be matched respectively to obtain a plurality of first line segments and a plurality of second line segments includes: performing Gaussian downsampling processing on the first image to obtain a plurality of first pixels, and performing Gaussian downsampling processing on the second image to obtain a plurality of second pixels; determining the gradients of the plurality of first pixels and the gradients of the plurality of second pixels; performing line feature extraction on the first image based on the gradients of the plurality of first pixels to obtain a plurality of first line segments, and performing line feature extraction on the second image based on the gradients of the plurality of second pixels to obtain a plurality of second line segments.
  • the line feature extraction of the first image based on the gradients of the multiple first pixels to obtain multiple first line segments, and the line feature extraction of the second image based on the gradients of the multiple second pixels to obtain multiple second line segments include: determining the gradient direction of each first pixel based on the gradients of the multiple first pixels, selecting a first seed pixel from the multiple first pixels, performing region growing on the first seed pixel based on the gradient direction of each first pixel to obtain a first line support region, and determining the first line segment based on the first line support region; determining the gradient direction of each second pixel based on the gradients of the multiple second pixels, selecting a second seed pixel from the multiple second pixels, performing region growing on the second seed pixel based on the gradient direction of each second pixel to obtain a second line support region, and determining the second line segment based on the second line support region.
  • determining a plurality of first intersection points corresponding to the plurality of first line segments and a plurality of second intersection points corresponding to the plurality of second line segments includes: determining a plurality of first straight lines where the plurality of first line segments are located, determining the intersection points of any two of the plurality of first straight lines, and obtaining a plurality of first intersection points; determining a plurality of second straight lines where the plurality of second line segments are located, determining the intersection points of any two of the plurality of second straight lines, and obtaining a plurality of second intersection points.
  • the matching of the multiple first intersection points and the multiple second intersection points to obtain multiple matching point pairs includes: using arterial spin labeling (ASL) to extract first eigenvectors of the multiple first intersection points and second eigenvectors of the multiple second intersection points; and determining the multiple matching point pairs based on the distance between the first eigenvector and the second eigenvector.
  • ASL arterial spin labeling
  • the first feature vector includes first feature information corresponding to multiple first intersections
  • the second feature vector includes second feature information corresponding to multiple second intersections
  • determining the multiple matching point pairs based on the distance between the first feature vector and the second feature vector includes: for each first intersection, determining the distance between the first intersection and the multiple second intersections based on the first feature information of the first intersection and the second feature information corresponding to the multiple second intersections; selecting a second intersection that reaches a preset distance threshold and has the smallest distance from the multiple second intersections, and combining it with the first intersection as a matching point pair to obtain multiple matching point pairs.
  • determining multiple target line segments that match in the first image and the second image based on the multiple matching point pairs includes: for each matching point pair, determining a first target line segment associated with a first intersection point and a second target line segment associated with a second intersection point; determining a first slope of a straight line where the first target line segment is located and a second slope of a straight line where the second target line segment is located; and determining multiple target line segments that match in the first image and the second image based on the first slope and the second slope.
  • determining multiple matching target line segments in the first image and the second image based on the first slope and the second slope includes: determining the slope difference between the first slope and the second slope; if the slope difference is less than a preset threshold, determining that the first target line segment and the second target line segment are matching target line segments, thereby obtaining multiple matching target line segments in the first image and the second image.
  • the first image is image data collected in real time by a camera
  • the second image is image data corresponding to the first image confirmed by a map based on visual data.
  • an image processing device comprising: an extraction module, configured to extract line features from a first image to be matched and a second image to be matched, respectively, to obtain a plurality of first line segments and a plurality of second line segments; a first determination module, configured to determine the plurality of first line segments A plurality of first intersection points corresponding to the plurality of second line segments and a plurality of second intersection points corresponding to the plurality of first intersection points; a matching module, used to match the plurality of first intersection points and the plurality of second intersection points to obtain a plurality of matching point pairs, wherein each matching point pair includes a first intersection point and a corresponding second intersection point; a second determination module, used to determine a plurality of matching target line segments in the first image and the second image based on the plurality of matching point pairs.
  • the extraction module performs line feature extraction on the first image based on the gradients of multiple first pixels to obtain multiple first line segments, and performs line feature extraction on the second image based on the gradients of multiple second pixels to obtain multiple second line segments.
  • the extraction module is specifically used to: determine the gradient direction of each first pixel based on the gradients of multiple first pixels, select a first seed pixel from the multiple first pixels, perform region growth on the first seed pixel based on the gradient direction of each first pixel to obtain a first line support area, and determine the first line segment based on the first line support area; determine the gradient direction of each second pixel based on the gradients of multiple second pixels, select a second seed pixel from the multiple second pixels, perform region growth on the second seed pixel based on the gradient direction of each second pixel to obtain a second line support area, and determine the second line segment based on the second line support area.
  • the first determination module is specifically used to: determine multiple first straight lines where multiple first line segments are located, determine the intersection points of any two of the multiple first straight lines, and obtain multiple first intersection points; determine multiple second straight lines where multiple second line segments are located, determine the intersection points of any two of the multiple second straight lines, and obtain multiple second intersection points.
  • the matching module is specifically used to: extract first feature vectors of multiple first intersection points and second feature vectors of multiple second intersection points using arterial spin labeling (ASL); and determine multiple matching point pairs based on the distance between the first feature vector and the second feature vector.
  • ASL arterial spin labeling
  • the first feature vector includes first feature information corresponding to a plurality of first intersection points
  • the second feature vector includes second feature information corresponding to a plurality of second intersection points
  • the matching module determines a plurality of matching point pairs based on the distance between the first feature vector and the second feature vector, specifically for: for each first intersection point, based on the first feature information of the first intersection point and the second feature information of the second intersection point, The second feature information corresponding to the intersection is used to determine the distance between the first intersection and multiple second intersections; a second intersection point that reaches a preset distance threshold and has the smallest distance is selected from the multiple second intersection points, and is combined with the first intersection point into a matching point pair to obtain multiple matching point pairs.
  • the second determination module is specifically used to: for each matching point pair, determine the first target line segment associated with the first intersection point and the second target line segment associated with the second intersection point; determine the first slope of the straight line where the first target line segment is located and the second slope of the straight line where the second target line segment is located; based on the first slope and the second slope, determine multiple target line segments that match in the first image and the second image.
  • the second determination module determines multiple matching target line segments in the first image and the second image based on the first slope and the second slope, it is specifically used to: determine the slope difference between the first slope and the second slope; if the slope difference is less than a preset threshold, determine the first target line segment and the second target line segment as matching target line segments, and obtain multiple matching target line segments in the first image and the second image.
  • an electronic device comprising: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the image processing method described in the first aspect and various possible designs of the first aspect.
  • a computer-readable storage medium stores computer execution instructions.
  • the image processing method described in the first aspect and various possible designs of the first aspect is implemented.
  • an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the image processing method as described in the first aspect and various possible designs of the first aspect.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

本公开实施例提供一种图像处理方法、装置、设备及存储介质,该方法包括:对待匹配的第一图像和第二图像分别进行线特征提取,得到多个第一线段和多个第二线段;确定所述多个第一线段对应的多个第一交叉点和所述多个第二线段对应的多个第二交叉点;对所述多个第一交叉点和所述多个第二交叉点进行匹配,得到多个匹配点对,其中每个匹配点对包括一个第一交叉点和一个对应的第二交叉点;基于所述多个匹配点对,确定所述第一图像和所述第二图像中相匹配的多个目标线段。

Description

图像处理方法、装置、设备及存储介质
本申请要求2023年6月6日递交的、标题为“图像处理方法、装置、设备及存储介质”、申请号为202310667205.4的中国发明专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
技术领域
本公开实施例涉及图像处理技术领域,尤其涉及一种图像处理方法、装置、设备及存储介质。
背景技术
随着图像处理技术的发展,技术人员开发了越来越多的图像处理场景。例如,图像识别场景、增强现实场景等。在众多图像处理场景中,都需要对两个图像中的线段进行匹配,识别出两个图像中相同的线段。
发明内容
本公开实施例提供一种图像处理方法、装置、设备及存储介质。
第一方面,本公开实施例提供一种图像处理方法,所述方法包括:对待匹配的第一图像和第二图像分别进行线特征提取,得到多个第一线段和多个第二线段;确定所述多个第一线段对应的多个第一交叉点和所述多个第二线段对应的多个第二交叉点;对所述多个第一交叉点和所述多个第二交叉点进行匹配,得到多个匹配点对,其中每个匹配点对包括一个第一交叉点和一个对应的第二交叉点;基于所述多个匹配点对,确定所述第一图像和所述第二图像中相匹配的多个目标线段。
第二方面,本公开实施例提供一种图像处理装置,所述装置包括:提取模块,用于对待匹配的第一图像和第二图像分别进行线特征提取,得到多个第一线段和多个第二线段;第一确定模块,用于确定所述多个第一线段对应的多个第一交叉点和所述多个第二线段对应的多个第二交叉点;匹配模块,用于对所述多个第一交叉点和所述多个第二交叉点进行匹配,得到多个匹配点对,其中每个匹配点对包括一个第一交叉点和一个对应的第二交叉点;第 二确定模块,用于基于所述多个匹配点对,确定所述第一图像和所述第二图像中相匹配的多个目标线段。
第三方面,本公开实施例提供一种电子设备,所述电子设备包括:处理器,以及与所述处理器通信连接的存储器;所述存储器存储计算机执行指令;所述处理器执行所述存储器存储的计算机执行指令,以实现如上第一方面以及第一方面各种可能的设计所述的图像处理方法。
第四方面,本公开实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如上第一方面以及第一方面各种可能的设计所述的图像处理方法。
第五方面,本公开实施例提供一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现如上第一方面以及第一方面各种可能的设计所述的图像处理方法。
附图说明
为了更清楚地说明本公开实施例或相关技术中的技术方案,下面将对实施例或相关技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本公开实施例提供的图像处理方法的一种应用场景图;
图2为本公开实施例提供的图像处理方法的流程示意图一;
图3为本公开实施例提供的图像处理方法的流程示意图二;
图4为本公开实施例提供的图像处理方法的流程示意图三;
图5为本公开实施例提供的图像处理方法的流程示意图四;
图6为本公开实施例提供的图像处理装置的结构框图;
图7为本公开实施例提供的电子设备的硬件结构示意图。
具体实施方式
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本公开一部分实施例,而不是全部的实施例。基于 本公开中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。
需要说明的是,本申请所涉及的用户信息(包括但不限于用户设备信息、用户个人信息等)和数据(包括但不限于用于分析的数据、存储的数据、展示的数据等),均为经用户授权或者经过各方充分授权的信息和数据,并且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准,并提供有相应的操作入口,供用户选择授权或者拒绝。
下面对本公开实施例的应用场景进行解释:
本公开实施例提供的图像处理方法,可以应用于多个场景中。例如,可以应用于图像对比场景,再如,可以应用于AR(Augmented Reality,增强现实)导航场景中。图1为本公开实施例提供的图像处理方法的一种应用场景图。具体地,如图1所示,终端实时拍摄得到图像(图1中的第一图像)。将该图像作为查询帧在已构建的视觉地图中检索到最接近的关键帧,然后通过本申请中的图像处理方法,对第一图像和关键帧进行局部特征匹配。在此基础上确定第一图像的位姿信息,并基于位姿信息在第一图像中添加相应的AR导航特效,得到特效导航图像(如图1中的特效导航图像),最后在终端中显示该特效导航图像。
相关技术中,图像处理可以采用LBD(Line Binary Discriptor,线二进制描述符)实现线段匹配。该方法将线段周围的一片像素组成一个条带区域,并计算条带区域中像素的梯度关系,通过条带区域中像素的梯度关系,对两个图像中的线段进行匹配。
在上述应用场景中,由于采用LBD对两个图像中的线段进行匹配时,对第一图像和第二图像的清晰度的要求较高。在采集图像设备发生抖动或者拍摄图像的像素较低的情况下,将会影响条带区域中像素梯度的准确性,进而导致线段匹配的准确性较差。
因此,图像处理采用LBD对线段进行匹配的鲁棒性较差。
为了解决上述问题,本实施例提供了一种图像处理方法、装置、设备及存储介质,首先,对待匹配的第一图像和第二图像分别进行线特征提取,得到多个第一线段和多个第二线段。然后确定多个第一线段对应的多个第一交叉点和多个第二线段对应的多个第二交叉点。最后,对多个第一交叉点和多 个第二交叉点进行匹配,得到多个匹配点对,基于多个匹配点对,确定第一图像和第二图像中相匹配的多个目标线段。由于通过提取第一图像和第二图像中的线特征,对图像中的线段进行提取。然后确定线段对应的交叉点,实现了通过点线的关联关系对线段进行匹配,而点特征匹配的稳定性和准确性较高,因此提高了该图像处理方法对线段进行匹配的准确性和鲁棒性。
参考图2,图2为本公开实施例提供的图像处理方法的流程示意图一。本实施例的方法可以应用在终端设备、服务器等电子设备中,该图像处理方法包括:
S201:对待匹配的第一图像和第二图像分别进行线特征提取,得到多个第一线段和多个第二线段。
在一些实施例中,第一图像可以为基于相机实时采集的图像数据,第二图像可以是基于视觉数据的地图确认的与第一图像对应的图像数据。其中,对第一图像进行线特征提取得到多个第一线段,对第二图像进行线特征提取得到多个第二线段。示例性的,第一图像可以是通过相机实时采集的街道图像数据。其中,图像数据可以是图片,也可以是视频中的一个视频帧。示例性的,第二图像可以是已构建的AR导航地图中确定的与第一图像(相机实时采集的街道图像数据)对应的图像数据。
需要说明的是,第一线段(或第二线段)可以是组合图像中景物(例如图中的车辆)的全部线段,也可以部分线段。示例性的,第一线段(或第二线段)可以是第一图像中组成车行道、行驶方向、路面边缘、人行横道等交通指示线的边界线段,也可以是写字楼、小区楼、加油站等房屋轮廓的边界线段,还可以是路灯、垃圾桶等公共设施的边界线段。
S202:确定多个第一线段对应的多个第一交叉点和多个第二线段对应的多个第二交叉点。
在一些实施例中,多个第一线段的延伸方向相同或不同。其中,部分第一线段能够相交(或者第一线段所在的直线能够相交),第一线段(或者第一线段所在的直线)相交的交点,即为第一交叉点。类似的,多个第二线段的延伸方向相同或不同。其中,部分第二线段能够相交(或者第二线段所在的直线能够相交),第二线段(或者第二线段所在的直线)相交的交点,即为第二交叉点。
可选地,确定多个第一交叉点和多个第一交叉点的具体步骤可以包括:确定多个第一线段所在的多个第一直线,确定多个第一直线中任两个直线的交叉点,得到多个第一交叉点。以及确定多个第二线段所在的多个第二直线,确定多个第二直线中任两个直线的交叉点,得到多个第二交叉点。
其中,第一交叉点可以位于第一线段的端点、内部或外部。在一些可能的情况下,第一交叉点位于第一线段的端点。例如,两条第一线段的端点相交并重合于一点(即构成“L”型的两条第一线段),此种情况下,第一交叉点位于两条第一线段的端点。又如,三条第一线段的端点相交并重合于一点(即构成“Y”型的三条第一线段),此种情况下,第一交叉点即三条第一线段的端点。需要说明的一点是,两条或多条第一线段的端点重合可以是端点对应的像素坐标相同,也可以是端点对应的像素坐标距离小于一个预设阈值,此处不再赘述。
在另一些可能的情况下,一条第一线段的端点与另一条第一线段的中部相交(即构成“T”型的两条第一线段),此种情况下,第一交叉点位于一条第一线段的端点,并且位于另一条第一线段的内部。在另一些可能的情况下,两条第一线段可以是线段中部与线段中部相交(即构成“X”型的两条第一线段),此种情况下,第一交叉点位于两条第一线段的内部。在另一些可能的情况下,一条第一线段所在直线的延伸线与另一条第一线段所在直线的延伸线相交(即构成“八”型的两条第一线段),此种情况下,第一交叉点位于两条第一线段的外部。
需要说明的是,在多个第一线段对应的多个第一交叉点之后,还可以将第一交叉点及其所属的第一线段的位置关系进行关联,得到第一交叉点与第一线段的位置关系信息。例如,位置关系信息为:第一交叉点A位于第一线段A的内部,且位于第一线段B的端点。
其中,第二交叉点可以位于第二线段的端点、内部或外部。第二交叉点与第二线段的位置关系与第一交叉点与第一线段的位置关系的相同,此处不再赘述。
S203:对多个第一交叉点和多个第二交叉点进行匹配,得到多个匹配点对,其中每个匹配点对包括一个第一交叉点和一个对应的第二交叉点。
在一些实施例中,可以通过对第一图像和第二图像进行点特征匹配,得 到多个匹配点对。可选地,匹配点对中的第一交叉点所表征的真实景象的特征点与该匹配点对中的第二交叉点所表征的真实景象的特征点是同一特征点。示例性的,第一交叉点可以是第一图像中路灯A与路面边缘L的交叉点,第二交叉点可以是第二图像中路灯A与路面边缘L的交叉点。
S204:基于多个匹配点对,确定第一图像和第二图像中相匹配的多个目标线段。
在一些实施例中,对于每个匹配点对,确定该匹配点对中与第一交叉点关联的至少一条第一线段以及与第二交叉点关联的至少一条第二线段。并且确定至少一条第一线段和至少一条第二线段中线段属性满足相似条件的两条线段,为第一图像和第二图像中相匹配的目标线段,最终得到多个目标线段。
可选地,线段属性可以包括:线段与图像中基准线的夹角,或者利用深度学习模型提取用于表征线段几何和/或颜色信息的特征向量,或者利用现有的可以对线段进行描述/表征的方式确定的线段属性。相应地,线段属性满足相似条件包括:线段斜率相同/相近(也即线段与图像中基准线的夹角相同/相近),或者表征线段几何和/或颜色信息的特征向量相同/相近,或者利用现有的可以对线段进行描述/表征的方式确定的线段属性相同/相近。
示例性的,多个匹配点对包括:第一交叉点A与第二交叉点A’、第一交叉点B与第二交叉点B’。其中,与第一交叉点A关联的至少一条第一线段包括第一线段A和第一线段B;与第一交叉点B关联的至少一条第一线段包括第一线段C和第一线段D。其中,与第二交叉点A’关联的至少一条第二线段包括第二线段A’和第二线段B’;与第二交叉点B’关联的至少一条第一线段包括第二线段C’和第二线段D’。
在一些实施例中,可以通过判断第一线段A、B、C、D和第二线段A’、B’、C’、D’是否满足线段属性相似条件,确定相匹配的多个目标线段。以判断第一线段A与第二线段A’是否为相匹配的目标线段为例:若第一线段A与第二线段A’满足线段属性相似条件,则确定第一线段A与第二线段A’为相匹配的目标线段;若第一线段A与第二线段A’不满足线段属性相似条件,则确定第一线段A与第二线段A’不是相匹配的目标线段。示例性的,判断第一线段A、B、C、D和第二线段A’、B’、C’、D’中,满足线段属性相似条件的目标线段包括3个,分别为:第一线段A与第二线段 A’、第一线段C与第二线段C’、第一线段D与第二线段D’(第一线段B与第二线段B’不满足线段属性相似条件)。
在本实施例中,首先对待匹配的第一图像和第二图像分别进行线特征提取,得到多个第一线段和多个第二线段。然后确定多个第一线段对应的多个第一交叉点和多个第二线段对应的多个第二交叉点。最后对多个第一交叉点和多个第二交叉点进行匹配,得到多个匹配点对,基于多个匹配点对,确定第一图像和第二图像中相匹配的多个目标线段。通过提取第一图像和第二图像中的线特征,对图像中的线段进行提取,然后确定线段对应的交叉点,实现了通过点线的关联关系对线段进行匹配。并且点特征匹配的稳定性和准确性较高,因此提高了该图像处理方法对线段进行匹配的准确性和鲁棒性。
参考图3,图3为本公开实施例提供的图像处理方法的流程示意图二。本实施例在图2所示实施例的基础上,进一步对步骤S201进行细化。本实施例中可以采用LSD(Line Segment Detector,直线提取算法)对待匹配的第一图像和第二图像分别进行线特征提取,得到多个第一线段和多个第二线段。具体可以包括以下步骤:
S301、对第一图像进行高斯降采样处理得到多个第一像素,对第二图像进行高斯降采样处理得到多个第二像素。
在一些实施例中,对第一图像进行高斯降采样处理可以减弱甚至消除图像中出现的锯齿效应。其中,通过缩放因子可以表示高斯降采样的处理程度。缩放因子是0-1之间的数值,缩放因子越小,通过高斯降采样降低锯齿效应的效果越明显,但图像清晰度会因采集像素的数量降低而下降。示例性地,缩放因子为0.8,此时,第一图像在x方向和y方向都缩放为原来的80%,即总的像素数量缩放为原来的64%。
S302、确定多个第一像素的梯度和多个第二像素的梯度。
在一些实施例中,像素的梯度为像素的明暗变化程度,可以通过像素的灰度值,确定像素的梯度。示例性的,对于每个第一像素的梯度,可以通过每个第一像素的灰度值及其右边下方的四个第一像素的灰度值来确定,具体实现方法为现有技术,不再赘述。类似的,对于每个第二像素的梯度,也可以通过每个第二像素的灰度值及其右边下方的四个第二像素的灰度值来确定。
S303、基于多个第一像素的梯度对第一图像进行线特征提取得到多个第一线段,基于多个第二像素的梯度对第二图像进行线特征提取,得到多个第二线段。
在一些实施例中,可以通过种子像素进行区域生长,实现线特征提取。相应的,本步骤为:基于多个第一像素的梯度,确定每个第一像素的梯度方向。从多个第一像素中选取第一种子像素,基于每个第一像素的梯度方向,对第一种子像素进行区域生长,得到第一线支持区域,并根据第一线支持区域确定第一线段。基于多个第二像素的梯度,确定每个第二像素的梯度方向。从多个第二像素中选取第二种子像素,基于每个第二像素的梯度方向,对第二种子像素进行区域生长,得到第二线支持区域,并根据第二线支持区域确定第二线段。
需要说明的是,在基于每个第一种子像素的梯度方向,可以对该第一种子像素梯度方向变化小且相邻的第一像素作为一个连通域进行区域生长,得到的线支持区域。该线支持区域为条形矩形,也即是第一线段。在一些实施例中,第一种子像素可以是随机选取的,第一种子像素数量为预设数量。在另一些实施例中,第一种子像素也可以是按照第一像素的灰度值从小到大的顺序依次选取的。例如,将第一像素的灰度值从小到大依次分为0-255个类别,每个类别中选取一个或多个第一像素作为第一种子像素。类似的,在基于每个第二种子像素的梯度方向,可以对该第二种子像素梯度方向变化小且相邻的第二像素作为一个连通域进行区域生长,得到的线支持区域,该线支持区域为条形矩形,也即是第二线段。
在本实施例中,由于采用LSD对待匹配的第一图像和第二图像分别进行线特征提取,而该技术能够减弱甚至消除图像中出现的锯齿效应,且能够降低对梯度的依赖性,降低噪声影响,这样对有噪声的图像进行线特征提取时,更具有鲁棒性。
参考图4,图4为本公开实施例提供的图像处理方法的流程示意图三。本实施例在图2所示实施例的基础上,进一步对步骤S203进行细化。本实施例中可以采用ASL(Arterial Spin Labeling,动脉自旋标记成像)对多个第一交叉点和多个第二交叉点进行匹配,得到多个匹配点对。如图4所示,具体可以包括以下步骤:
S401、采用动脉自旋标记ASL提取多个第一交叉点的第一特征向量和多个第二交叉点的第二特征向量。
在一些实施例中,第一特征向量可以包括第一交叉点对应的第一特征信息。其中,第一特征信息用于表示第一交叉点的任一属性信息。可选地,第一特征信息包括位置信息、领域信息、颜色信息中的一个或多个。第一特征向量的维数与第一特征信息表示的属性信息的数量相关。示例性的,第一特征信息包括位置信息,第一交叉点A的第一特征向量为(x1,y1);其中,x1表示第一交叉点A的横坐标,y1表示第一交叉点A的纵坐标。在此情况下,第一特征向量为二维向量。示例性的,第一特征信息包括位置信息和颜色信息,第一交叉点A的第一特征向量为(x1,y1,c1),其中,x1表示第一交叉点A的横坐标,y1表示第一交叉点A的纵坐标,c1表示第一交叉点A的灰度。在此情况下,第一特征向量为三维向量。
在一些实施例中,第二特征向量可以包括第二交叉点对应的第二特征信息。其中,第二特征信息用于表示第二交叉点的任一属性信息。可选地,第二特征信息包括位置信息、领域信息、颜色信息中的一个或多个。第二特征向量的维数与第二特征信息表示的属性信息的数量相关。示例性的,第二特征信息包括位置信息,第二交叉点A’的第二特征向量为(x2,y2);其中,x2表示第二交叉点A’的横坐标,y2表示第二交叉点A’的纵坐标。在此情况下,第二特征向量为二维向量。示例性的,第二特征信息包括位置信息和颜色信息,第二交叉点A’的第二特征向量为(x2,y2,c2),其中,x2表示第二交叉点A’的横坐标,y2表示第二交叉点A’的纵坐标,c2表示第二交叉点A’的灰度。在此情况下,第二特征向量为三维向量。
在一种可能的实现方式中,可以对采集的ASL数据进行深度学习,训练得到交叉点提取模型。然后通过该模型提取多个第一交叉点的第一特征向量和多个第二交叉点的第二特征向量。示例性的,交叉点提取模型可以是深度卷积神经网络模型。
S402、基于第一特征向量和第二特征向量的距离,确定多个匹配点对。
在一些实施例中,第一特征向量包括多个第一交叉点对应的第一特征信息,第二特征向量包括多个第二交叉点对应的第二特征信息。相应的,本步骤为:对于每个第一交叉点,基于第一交叉点的第一特征信息与多个第二交 叉点对应的第二特征信息,确定第一交叉点与多个第二交叉点之间的距离。从多个第二交叉点中选取达到预设距离阈值且距离最小的第二交叉点,并与第一交叉点组合为匹配点对,得到多个匹配点对。在本公开实施例中对预设距离阈值的数值不作具体限定,可以根据需要进行设定并修改。示例性的,预设距离阈值可以设定为0.5、1、2。
可选地,第一交叉点与第二交叉点之间的距离也即是第一特征向量与第二特征向量的距离。
示例性的,第一特征信息包括位置信息,第一交叉点A的第一特征向量为(x1,y1),其中,x1表示第一交叉点A的横坐标,y1表示第一交叉点A的纵坐标。第二特征信息包括位置信息。第二交叉点A’的第一特征向量为(x2,y2);其中,x2表示第二交叉点A’的横坐标,y2表示第二交叉点A’的纵坐标。第一交叉点A与第二交叉点A’之间的距离D为:
示例性的,第一特征信息包括位置信息和颜色信息,第一交叉点A的第一特征向量为(x1,y1,c1);其中,x1表示第一交叉点A的横坐标,y1表示第一交叉点A的纵坐标,c1表示第一交叉点A的灰度。第二特征信息包括位置信息和颜色信息,第二交叉点A’的第二特征向量为(x2,y2,c2);其中,x2表示第二交叉点A’的横坐标,y2表示第二交叉点A’的纵坐标,c2表示第二交叉点A’的灰度。第一交叉点A与第二交叉点A’之间的距离D为:
在本实施例中,由于采用ASL技术对多个第一交叉点和多个第二交叉点进行匹配,而ASL技术能够提高交叉点的提取效率;并且,通过ASL技术可以减低图像噪声,进一步够提高提取交叉点的准确性。
参考图5,图5为本公开实施例提供的图像处理方法的流程示意图四。本实施例在图2所示实施例的基础上,对步骤S104中基于多个匹配点对,确定第一图像和第二图像中相匹配的多个目标线段的具体实现方法进行了详细说明。如图5所示,该方法包括:
S501、对于每个匹配点对,确定第一交叉点所关联的第一目标线段和第二交叉点所关联的第二目标线段。
在一些实施例中,电子设备内存储有第一交叉点与第一线段的关联关系, 第二交叉点与第二线段的关联关系。相应的,本步骤为:对于每个匹配点对,根据第一交叉点与第一线段的关联关系确定第一交叉点所关联的第一目标线段。以及根据第二交叉点与第二线段的关联关系确定第二交叉点所关联的第二目标线段。
可选地,第一交叉点与第一线段的关联关系为第一交叉点与第一线段的位置关系。示例性的,通过该关联关系确定第一目标线段的步骤包括:对于匹配点对中的第一交叉点A,若已存储的关联关系为:第一交叉点A位于第一线段A的内部,且位于第一线段B的端点;则确定第一交叉点A所关联的第一目标线段为:第一线段A和第一线段B。可选地,第二交叉点与第二线段的关联关系为第二交叉点与第二线段的位置关系。其中,确定第二目标线段的具体步骤与确定第一目标线段的具体步骤相同,在此不再赘述。
S502、确定第一目标线段所在直线的第一斜率和第二目标线段所在直线的第二斜率。
在一些实施例中,第一目标线段所在直线的第一斜率为第一目标线段与第一图像x轴的正半轴所成角的正切值。第二目标线段所在直线的第二斜率为第二目标线段与第二图像x轴的正半轴所成角的正切值。
S503、基于第一斜率和第二斜率,确定第一图像和第二图像中相匹配的多个目标线段。
在一些实施例中,可以通过第一目线段和第二目标线段的斜率差,筛掉匹配点对中斜率差相差过大的目标线段。相应的,具体步骤为:确定第一斜率和第二斜率的斜率差。若斜率差小于预设阈值,则确定第一目标线段和第二目标线段为相匹配的目标线段,得到第一图像和第二图像中相匹配的多个目标线段。若斜率差大于或等于该预设阈值,则确定第一目标线段和第二目标线段为不匹配。在本公开实施例中对预设阈值的数值不作具体限定,可以根据需要进行设定并修改。示例性的,预设阈值可以设定为0.1、0.2、0.3。
在本实施例中,由于先通过匹配点对,初步确定相匹配的多个目标线段。然后再通过斜率差,筛掉斜率差相差过大的匹配点对。由于斜率差相差过大的目标线段大概率不是第一图像和第二图像中同一位置的线段(相匹配的目标线段),因此提高了确定相匹配的多个目标线段的准确性。
对应于上文实施例的图像处理方法,图6为本公开实施例提供的图像处 理装置的结构框图。为了便于说明,仅示出了与本公开实施例相关的部分。参考图6,该图像处理装置包括:提取模块601、第一确定模块602、匹配模块603和第二确定模块604。其中,提取模块601,用于对待匹配的第一图像和第二图像分别进行线特征提取,得到多个第一线段和多个第二线段;第一确定模块602,用于确定多个第一线段对应的多个第一交叉点和多个第二线段对应的多个第二交叉点;
匹配模块603,用于对多个第一交叉点和多个第二交叉点进行匹配,得到多个匹配点对,其中每个匹配点对包括一个第一交叉点和一个对应的第二交叉点;
第二确定模块604,用于基于多个匹配点对,确定第一图像和第二图像中相匹配的多个目标线段。
在本公开的一个实施例中,提取模块601,具体用于:对第一图像进行高斯降采样处理得到多个第一像素,对第二图像进行高斯降采样处理得到多个第二像素;确定多个第一像素的梯度和多个第二像素的梯度;基于多个第一像素的梯度对第一图像进行线特征提取得到多个第一线段,基于多个第二像素的梯度对第二图像进行线特征提取,得到多个第二线段。
在本公开的一个实施例中,提取模块601基于多个第一像素的梯度对第一图像进行线特征提取得到多个第一线段,基于多个第二像素的梯度对第二图像进行线特征提取,得到多个第二线段时,具体用于:基于多个第一像素的梯度,确定每个第一像素的梯度方向,从多个第一像素中选取第一种子像素,基于每个第一像素的梯度方向,对第一种子像素进行区域生长,得到第一线支持区域,并根据第一线支持区域确定第一线段;基于多个第二像素的梯度,确定每个第二像素的梯度方向,从多个第二像素中选取第二种子像素,基于每个第二像素的梯度方向,对第二种子像素进行区域生长,得到第二线支持区域,并根据第二线支持区域确定第二线段。
在本公开的一个实施例中,第一确定模块602,具体用于:确定多个第一线段所在的多个第一直线,确定多个第一直线中任两个直线的交叉点,得到多个第一交叉点;确定多个第二线段所在的多个第二直线,确定多个第二直线中任两个直线的交叉点,得到多个第二交叉点。
在本公开的一个实施例中,匹配模块603,具体用于:采用动脉自旋标 记ASL提取多个第一交叉点的第一特征向量和多个第二交叉点的第二特征向量;基于第一特征向量和第二特征向量的距离,确定多个匹配点对。
在本公开的一个实施例中,第一特征向量包括多个第一交叉点对应的第一特征信息,第二特征向量包括多个第二交叉点对应的第二特征信息;匹配模块603,基于第一特征向量和第二特征向量的距离,确定多个匹配点对时,具体用于:对于每个第一交叉点,基于第一交叉点的第一特征信息与多个第二交叉点对应的第二特征信息,确定第一交叉点与多个第二交叉点之间的距离;从多个第二交叉点中选取达到预设距离阈值且距离最小的第二交叉点,并与第一交叉点组合为匹配点对,得到多个匹配点对。
在本公开的一个实施例中,第二确定模块604,具体用于:对于每个匹配点对,确定第一交叉点所关联的第一目标线段和第二交叉点所关联的第二目标线段;确定第一目标线段所在直线的第一斜率和第二目标线段所在直线的第二斜率;基于第一斜率和第二斜率,确定第一图像和第二图像中相匹配的多个目标线段。
在本公开的一个实施例中,第二确定模块604基于第一斜率和第二斜率,确定第一图像和第二图像中相匹配的多个目标线段时,具体用于:确定第一斜率和第二斜率的斜率差;若斜率差小于预设阈值,则确定第一目标线段和第二目标线段为相匹配的目标线段,得到第一图像和第二图像中相匹配的多个目标线段。
其中,提取模块601、第一确定模块602、匹配模块603和第二确定模块604依次连接。本实施例提供的图像处理装置可以执行上述方法实施例的技术方案,其实现原理和技术效果类似,本实施例此处不再赘述。
图7为本公开实施例提供的一种电子设备的结构示意图,如图7所示,该电子设备7包括处理器701,以及与所述处理器701通信连接的存储器702;所述存储器702存储计算机执行指令;所述处理器701执行所述存储器702存储的计算机执行指令,以实现如图2-图5所示实施例中的图像处理方法。
其中,可选地,处理器701和存储器702通过总线703连接。
相关说明可以对应参见图2-图5所对应的实施例中的步骤所对应的相关描述和效果进行理解,此处不做过多赘述。
本公开实施例提供一种计算机可读存储介质,计算机可读存储介质中存 储有计算机执行指令,计算机执行指令被处理器执行时用于实现本申请图2-图5所对应的实施例中任一实施例提供的图像处理。
参考图7,其示出了适于用来实现本公开实施例的电子设备700的结构示意图,该电子设备700可以为终端设备或服务器。其中,终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、个人数字助理(Personal Digital Assistant,简称PDA)、平板电脑(Portable Android Device,简称PAD)、便携式多媒体播放器(Portable Media Player,简称PMP)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图7示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图7所示,电子设备700可以包括处理装置(例如中央处理器、图形处理器等)701,其可以根据存储在只读存储器(Read Only Memory,简称ROM)702中的程序或者从存储装置708加载到随机访问存储器(Random Access Memory,简称RAM)703中的程序而执行各种适当的动作和处理。在RAM 703中,还存储有电子设备700操作所需的各种程序和数据。处理装置701、ROM 702以及RAM 703通过总线704彼此相连。输入/输出(I/O)接口705也连接至总线704。
通常,以下装置可以连接至I/O接口705:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置706;包括例如液晶显示器(Liquid Crystal Display,简称LCD)、扬声器、振动器等的输出装置707;包括例如磁带、硬盘等的存储装置708;以及通信装置709。通信装置709可以允许电子设备700与其他设备进行无线或有线通信以交换数据。虽然图7示出了具有各种装置的电子设备700,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置709从网络上被下载和安装,或者从存储装置708被安装,或者从ROM  702被安装。在该计算机程序被处理装置701执行时,执行本公开实施例的方法中限定的上述功能。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备执行上述实施例所示的方法。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远 程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(Local Area Network,简称LAN)或广域网(Wide Area Network,简称WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,模块的名称在某种情况下并不构成对该模块本身的限定,例如,第一获取模块还可以被描述为“获取至少两个网际协议地址的模块”。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器 (CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
第一方面,根据本公开的一个或多个实施例,提供了一种图像处理方法,包括:对待匹配的第一图像和第二图像分别进行线特征提取,得到多个第一线段和多个第二线段;确定所述多个第一线段对应的多个第一交叉点和所述多个第二线段对应的多个第二交叉点;对所述多个第一交叉点和所述多个第二交叉点进行匹配,得到多个匹配点对,其中每个匹配点对包括一个第一交叉点和一个对应的第二交叉点;基于所述多个匹配点对,确定所述第一图像和所述第二图像中相匹配的多个目标线段。
根据本公开的一个或多个实施例,所述对待匹配的第一图像和第二图像分别进行线特征提取,得到多个第一线段和多个第二线段,包括:对所述第一图像进行高斯降采样处理得到多个第一像素,对所述第二图像进行高斯降采样处理得到多个第二像素;确定所述多个第一像素的梯度和所述多个第二像素的梯度;基于所述多个第一像素的梯度对所述第一图像进行线特征提取得到多个第一线段,基于所述多个第二像素的梯度对所述第二图像进行线特征提取,得到多个第二线段。
根据本公开的一个或多个实施例,所述基于所述多个第一像素的梯度对所述第一图像进行线特征提取得到多个第一线段,基于所述多个第二像素的梯度对所述第二图像进行线特征提取,得到多个第二线段,包括:基于所述多个第一像素的梯度,确定每个第一像素的梯度方向,从所述多个第一像素中选取第一种子像素,基于所述每个第一像素的梯度方向,对所述第一种子像素进行区域生长,得到第一线支持区域,并根据所述第一线支持区域确定第一线段;基于所述多个第二像素的梯度,确定每个第二像素的梯度方向,从所述多个第二像素中选取第二种子像素,基于所述每个第二像素的梯度方向,对所述第二种子像素进行区域生长,得到第二线支持区域,并根据所述第二线支持区域确定第二线段。
根据本公开的一个或多个实施例,所述确定所述多个第一线段对应的多个第一交叉点和所述多个第二线段对应的多个第二交叉点,包括:确定所述多个第一线段所在的多个第一直线,确定所述多个第一直线中任两个直线的交叉点,得到多个第一交叉点;确定所述多个第二线段所在的多个第二直线,确定所述多个第二直线中任两个直线的交叉点,得到多个第二交叉点。
根据本公开的一个或多个实施例,所述对所述多个第一交叉点和所述多个第二交叉点进行匹配,得到多个匹配点对,包括:采用动脉自旋标记ASL提取所述多个第一交叉点的第一特征向量和所述多个第二交叉点的第二特征向量;基于所述第一特征向量和所述第二特征向量的距离,确定所述多个匹配点对。
根据本公开的一个或多个实施例,所述第一特征向量包括多个第一交叉点对应的第一特征信息,所述第二特征向量包括多个第二交叉点对应的第二特征信息;所述基于所述第一特征向量和所述第二特征向量的距离,确定所述多个匹配点对,包括:对于每个第一交叉点,基于所述第一交叉点的第一特征信息与所述多个第二交叉点对应的第二特征信息,确定所述第一交叉点与所述多个第二交叉点之间的距离;从所述多个第二交叉点中选取达到预设距离阈值且距离最小的第二交叉点,并与所述第一交叉点组合为匹配点对,得到多个匹配点对。
根据本公开的一个或多个实施例,所述基于所述多个匹配点对,确定所述第一图像和所述第二图像中相匹配的多个目标线段,包括:对于每个匹配点对,确定第一交叉点所关联的第一目标线段和第二交叉点所关联的第二目标线段;确定所述第一目标线段所在直线的第一斜率和所述第二目标线段所在直线的第二斜率;基于所述第一斜率和所述第二斜率,确定所述第一图像和所述第二图像中相匹配的多个目标线段。
根据本公开的一个或多个实施例,所述基于所述第一斜率和所述第二斜率,确定所述第一图像和所述第二图像中相匹配的多个目标线段,包括:确定所述第一斜率和所述第二斜率的斜率差;若所述斜率差小于预设阈值,则确定所述第一目标线段和所述第二目标线段为相匹配的目标线段,得到所述第一图像和所述第二图像中相匹配的多个目标线段。
根据本公开的一个或多个实施例,所述第一图像为基于相机实时采集的图像数据,所述第二图像为基于视觉数据的地图确认的与所述第一图像对应的图像数据。
第二方面,根据本公开的一个或多个实施例,提供了一种图像处理设备,包括:提取模块,用于对待匹配的第一图像和第二图像分别进行线特征提取,得到多个第一线段和多个第二线段;第一确定模块,用于确定多个第一线段 对应的多个第一交叉点和多个第二线段对应的多个第二交叉点;匹配模块,用于对多个第一交叉点和多个第二交叉点进行匹配,得到多个匹配点对,其中每个匹配点对包括一个第一交叉点和一个对应的第二交叉点;第二确定模块,用于基于多个匹配点对,确定第一图像和第二图像中相匹配的多个目标线段。
在本公开的一个实施例中,提取模块,具体用于:对第一图像进行高斯降采样处理得到多个第一像素,对第二图像进行高斯降采样处理得到多个第二像素;确定多个第一像素的梯度和多个第二像素的梯度;基于多个第一像素的梯度对第一图像进行线特征提取得到多个第一线段,基于多个第二像素的梯度对第二图像进行线特征提取,得到多个第二线段。
在本公开的一个实施例中,提取模块基于多个第一像素的梯度对第一图像进行线特征提取得到多个第一线段,基于多个第二像素的梯度对第二图像进行线特征提取,得到多个第二线段时,具体用于:基于多个第一像素的梯度,确定每个第一像素的梯度方向,从多个第一像素中选取第一种子像素,基于每个第一像素的梯度方向,对第一种子像素进行区域生长,得到第一线支持区域,并根据所述第一线支持区域确定第一线段;基于多个第二像素的梯度,确定每个第二像素的梯度方向,从多个第二像素中选取第二种子像素,基于每个第二像素的梯度方向,对第二种子像素进行区域生长,得到第二线支持区域,并根据所述第二线支持区域确定第二线段。
在本公开的一个实施例中,第一确定模块,具体用于:确定多个第一线段所在的多个第一直线,确定多个第一直线中任两个直线的交叉点,得到多个第一交叉点;确定多个第二线段所在的多个第二直线,确定多个第二直线中任两个直线的交叉点,得到多个第二交叉点。
在本公开的一个实施例中,匹配模块,具体用于:采用动脉自旋标记ASL提取多个第一交叉点的第一特征向量和多个第二交叉点的第二特征向量;基于第一特征向量和第二特征向量的距离,确定多个匹配点对。
在本公开的一个实施例中,第一特征向量包括多个第一交叉点对应的第一特征信息,第二特征向量包括多个第二交叉点对应的第二特征信息;匹配模块,基于第一特征向量和第二特征向量的距离,确定多个匹配点对时,具体用于:对于每个第一交叉点,基于第一交叉点的第一特征信息与多个第二 交叉点对应的第二特征信息,确定第一交叉点与多个第二交叉点之间的距离;从多个第二交叉点中选取达到预设距离阈值且距离最小的第二交叉点,并与第一交叉点组合为匹配点对,得到多个匹配点对。
在本公开的一个实施例中,第二确定模块,具体用于:对于每个匹配点对,确定第一交叉点所关联的第一目标线段和第二交叉点所关联的第二目标线段;确定第一目标线段所在直线的第一斜率和第二目标线段所在直线的第二斜率;基于第一斜率和第二斜率,确定第一图像和第二图像中相匹配的多个目标线段。
在本公开的一个实施例中,第二确定模块基于第一斜率和第二斜率,确定第一图像和第二图像中相匹配的多个目标线段时,具体用于:确定第一斜率和第二斜率的斜率差;若斜率差小于预设阈值,则确定第一目标线段和第二目标线段为相匹配的目标线段,得到第一图像和第二图像中相匹配的多个目标线段。
第三方面,根据本公开的一个或多个实施例,提供了一种电子设备,包括:处理器,以及与所述处理器通信连接的存储器;所述存储器存储计算机执行指令;所述处理器执行所述存储器存储的计算机执行指令,以实现如上第一方面以及第一方面各种可能的设计所述的图像处理方法。
第四方面,根据本公开的一个或多个实施例,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如上第一方面以及第一方面各种可能的设计所述的图像处理方法。
第五方面,本公开实施例提供一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现如上第一方面以及第一方面各种可能的设计所述的图像处理方法。
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。

Claims (13)

  1. 一种图像处理方法,包括:
    对待匹配的第一图像和第二图像分别进行线特征提取,得到多个第一线段和多个第二线段;
    确定所述多个第一线段对应的多个第一交叉点和所述多个第二线段对应的多个第二交叉点;
    对所述多个第一交叉点和所述多个第二交叉点进行匹配,得到多个匹配点对,其中每个匹配点对包括一个第一交叉点和一个对应的第二交叉点;
    基于所述多个匹配点对,确定所述第一图像和所述第二图像中相匹配的多个目标线段。
  2. 根据权利要求1所述的方法,其中,所述对待匹配的第一图像和第二图像分别进行线特征提取,得到多个第一线段和多个第二线段,包括:
    对所述第一图像进行高斯降采样处理得到多个第一像素,对所述第二图像进行高斯降采样处理得到多个第二像素;
    确定所述多个第一像素的梯度和所述多个第二像素的梯度;
    基于所述多个第一像素的梯度对所述第一图像进行线特征提取得到多个第一线段,基于所述多个第二像素的梯度对所述第二图像进行线特征提取,得到多个第二线段。
  3. 根据权利要求2所述的方法,其中,所述基于所述多个第一像素的梯度对所述第一图像进行线特征提取得到多个第一线段,基于所述多个第二像素的梯度对所述第二图像进行线特征提取,得到多个第二线段,包括:
    基于所述多个第一像素的梯度,确定每个第一像素的梯度方向,从所述多个第一像素中选取第一种子像素,基于所述每个第一像素的梯度方向,对所述第一种子像素进行区域生长,得到第一线支持区域,并根据所述第一线支持区域确定第一线段;
    基于所述多个第二像素的梯度,确定每个第二像素的梯度方向,从所述多个第二像素中选取第二种子像素,基于所述每个第二像素的梯度方向,对所述第二种子像素进行区域生长,得到第二线支持区域,并根据所述第二线支持区域确定第二线段。
  4. 根据权利要求1所述的方法,其中,所述确定所述多个第一线段对应 的多个第一交叉点和所述多个第二线段对应的多个第二交叉点,包括:
    确定所述多个第一线段所在的多个第一直线,确定所述多个第一直线中任两个直线的交叉点,得到多个第一交叉点;
    确定所述多个第二线段所在的多个第二直线,确定所述多个第二直线中任两个直线的交叉点,得到多个第二交叉点。
  5. 根据权利要求1所述的方法,其中,所述对所述多个第一交叉点和所述多个第二交叉点进行匹配,得到多个匹配点对,包括:
    采用动脉自旋标记ASL提取所述多个第一交叉点的第一特征向量和所述多个第二交叉点的第二特征向量;
    基于所述第一特征向量和所述第二特征向量的距离,确定所述多个匹配点对。
  6. 根据权利要求5所述的方法,其中,所述第一特征向量包括多个第一交叉点对应的第一特征信息,所述第二特征向量包括多个第二交叉点对应的第二特征信息;
    所述基于所述第一特征向量和所述第二特征向量的距离,确定所述多个匹配点对,包括:
    对于每个第一交叉点,基于所述第一交叉点的第一特征信息与所述多个第二交叉点对应的第二特征信息,确定所述第一交叉点与所述多个第二交叉点之间的距离;
    从所述多个第二交叉点中选取达到预设距离阈值且距离最小的第二交叉点,并与所述第一交叉点组合为匹配点对,得到多个匹配点对。
  7. 根据权利要求1所述的方法,其中,所述基于所述多个匹配点对,确定所述第一图像和所述第二图像中相匹配的多个目标线段,包括:
    对于每个匹配点对,确定第一交叉点所关联的第一目标线段和第二交叉点所关联的第二目标线段;
    确定所述第一目标线段所在直线的第一斜率和所述第二目标线段所在直线的第二斜率;
    基于所述第一斜率和所述第二斜率,确定所述第一图像和所述第二图像中相匹配的多个目标线段。
  8. 根据权利要求7所述的方法,其中,所述基于所述第一斜率和所述第 二斜率,确定所述第一图像和所述第二图像中相匹配的多个目标线段,包括:
    确定所述第一斜率和所述第二斜率的斜率差;
    若所述斜率差小于预设阈值,则确定所述第一目标线段和所述第二目标线段为相匹配的目标线段,得到所述第一图像和所述第二图像中相匹配的多个目标线段。
  9. 根据权利要求1-8任一项所述的方法,其中,所述第一图像为基于相机实时采集的图像数据,所述第二图像为基于视觉数据的地图确认的与所述第一图像对应的图像数据。
  10. 一种图像处理装置,包括:
    提取模块,用于对待匹配的第一图像和第二图像分别进行线特征提取,得到多个第一线段和多个第二线段;
    第一确定模块,用于确定所述多个第一线段对应的多个第一交叉点和所述多个第二线段对应的多个第二交叉点;
    匹配模块,用于对所述多个第一交叉点和所述多个第二交叉点进行匹配,得到多个匹配点对,其中每个匹配点对包括一个第一交叉点和一个对应的第二交叉点;
    第二确定模块,用于基于所述多个匹配点对,确定所述第一图像和所述第二图像中相匹配的多个目标线段。
  11. 一种电子设备,包括:处理器,以及与所述处理器通信连接的存储器;
    所述存储器存储计算机执行指令;
    所述处理器执行所述存储器存储的计算机执行指令,以实现如权利要求1至9中任一项所述的方法。
  12. 一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如权利要求1至9任一项所述的图像处理方法。
  13. 一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现权利要求1至9中任一项所述的图像处理方法。
PCT/CN2024/096350 2023-06-06 2024-05-30 图像处理方法、装置、设备及存储介质 Ceased WO2024251026A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202310667205.4 2023-06-06
CN202310667205.4A CN119091164A (zh) 2023-06-06 2023-06-06 图像处理方法、装置、设备及存储介质

Publications (1)

Publication Number Publication Date
WO2024251026A1 true WO2024251026A1 (zh) 2024-12-12

Family

ID=93700145

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/096350 Ceased WO2024251026A1 (zh) 2023-06-06 2024-05-30 图像处理方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN119091164A (zh)
WO (1) WO2024251026A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160180536A1 (en) * 2013-09-20 2016-06-23 Fujitsu Limited Image processing apparatus, image processing method, and storage medium
CN107292922A (zh) * 2017-06-23 2017-10-24 电子科技大学 一种用于光学与合成孔径雷达图像配准的方法
CN108447016A (zh) * 2018-02-05 2018-08-24 西安电子科技大学 基于直线交点的光学图像和sar图像的匹配方法
CN112488128A (zh) * 2020-12-10 2021-03-12 武汉大学 一种基于贝塞尔曲线的任意畸变图像线段检测方法
US11100361B1 (en) * 2017-08-01 2021-08-24 Goertek Inc. Method and apparatus for processing feature point matching result

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160180536A1 (en) * 2013-09-20 2016-06-23 Fujitsu Limited Image processing apparatus, image processing method, and storage medium
CN107292922A (zh) * 2017-06-23 2017-10-24 电子科技大学 一种用于光学与合成孔径雷达图像配准的方法
US11100361B1 (en) * 2017-08-01 2021-08-24 Goertek Inc. Method and apparatus for processing feature point matching result
CN108447016A (zh) * 2018-02-05 2018-08-24 西安电子科技大学 基于直线交点的光学图像和sar图像的匹配方法
CN112488128A (zh) * 2020-12-10 2021-03-12 武汉大学 一种基于贝塞尔曲线的任意畸变图像线段检测方法

Also Published As

Publication number Publication date
CN119091164A (zh) 2024-12-06

Similar Documents

Publication Publication Date Title
CN113989450B (zh) 图像处理方法、装置、电子设备和介质
CN111696176B (zh) 图像处理方法、装置、电子设备及计算机可读介质
WO2022237811A1 (zh) 图像处理方法、装置及设备
CN109816769A (zh) 基于深度相机的场景地图生成方法、装置及设备
CN113763438B (zh) 一种点云配准方法、装置、设备及存储介质
CN110781823B (zh) 录屏检测方法、装置、可读介质及电子设备
CN115331099A (zh) 路面点云数据的获取方法、装置、电子设备及存储介质
CN111626919B (zh) 图像合成方法、装置、电子设备及计算机可读存储介质
CN110298785A (zh) 图像美化方法、装置及电子设备
CN112712036A (zh) 交通标志识别方法、装置、电子设备及计算机存储介质
CN111783777B (zh) 图像处理方法、装置、电子设备和计算机可读介质
US20240221353A1 (en) Method and apparatus for object localization in discontinuous observation scene, and storage medium
WO2024093641A1 (zh) 多模态融合的高精地图要素识别方法、装置、设备及介质
CN113362420A (zh) 道路标注生成方法、装置、设备以及存储介质
CN110211195B (zh) 生成图像集合的方法、装置、电子设备和计算机可读存储介质
CN114972020B (zh) 一种图像处理方法、装置、存储介质及电子设备
CN116343152A (zh) 车道线检测方法、装置及电子设备
US20240221126A1 (en) Image splicing method and apparatus, and device and medium
CN110619597A (zh) 一种半透明水印去除方法、装置、电子设备及存储介质
CN112257598B (zh) 图像中四边形的识别方法、装置、可读介质和电子设备
CN103765477A (zh) 通过图形匹配和环形检测而用自动模型初始化进行线跟踪
CN115115535A (zh) 深度图的去噪方法、装置、介质及设备
WO2024251026A1 (zh) 图像处理方法、装置、设备及存储介质
CN116188583B (zh) 相机位姿信息生成方法、装置、设备和计算机可读介质
CN113963000B (zh) 图像分割方法、装置、电子设备及程序产品

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 24818558

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE