WO2018214151A1 - Image processing method, terminal device and computer storage medium - Google Patents

Image processing method, terminal device and computer storage medium Download PDF

Info

Publication number
WO2018214151A1
WO2018214151A1 PCT/CN2017/086100 CN2017086100W WO2018214151A1 WO 2018214151 A1 WO2018214151 A1 WO 2018214151A1 CN 2017086100 W CN2017086100 W CN 2017086100W WO 2018214151 A1 WO2018214151 A1 WO 2018214151A1
Authority
WO
WIPO (PCT)
Prior art keywords
pixel
image
contour line
pixels
entropy
Prior art date
Application number
PCT/CN2017/086100
Other languages
French (fr)
Chinese (zh)
Inventor
阳光
Original Assignee
深圳配天智能技术研究院有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳配天智能技术研究院有限公司 filed Critical 深圳配天智能技术研究院有限公司
Priority to PCT/CN2017/086100 priority Critical patent/WO2018214151A1/en
Priority to CN201780028671.0A priority patent/CN109478326B/en
Publication of WO2018214151A1 publication Critical patent/WO2018214151A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis

Definitions

  • the present invention relates to the field of computer vision, and in particular to an image processing method, a terminal device, and a computer storage medium.
  • the recognition of the corresponding points on the two images is an important form of machine vision. It is based on the principle of parallax and uses the imaging device to acquire two images of the measured object from different positions. By calculating the positional deviation between the corresponding points of the image, A method for obtaining three-dimensional geometric information of an object. Among them, binocular stereo vision has been widely used in robot navigation, precision industrial measurement, object recognition, virtual reality, scene reconstruction and surveying.
  • each pixel in one image and each pixel in another image are separately calculated for each other. This method is feasible, but due to the large amount of computation. Greatly reduced image processing speed.
  • the technical problem to be solved by the present invention is to provide an image processing method, a terminal device and a computer storage medium, which can greatly improve the speed of image processing.
  • the technical solution adopted by the present invention is to provide an image processing method, including: acquiring a first image and a second image, wherein a first image and a second image have a corresponding relationship; Performing an edge calculation on the second image to determine a first contour line in the first image, a second contour line in the second image, and determining a pixel in the second contour line corresponding to the pixel in the first contour line to Determining a correspondence relationship between the first contour line and the second contour line; using the correspondence relationship to determine pixels in the second image corresponding to pixels in a region other than the first contour line in the first image.
  • the technical solution adopted by the present invention is: providing a terminal device, the terminal device comprising: a processor, a memory, a computer operation instruction and data stored in the memory, and the processor executing the computer operation instruction, for: Acquiring a first image and a second image from the memory, wherein the first image has a corresponding relationship with the second image; performing edge calculation on the first image and the second image respectively to determine a first contour line in the first image, a second contour line in the second image; determining the second contour line a pixel corresponding to a pixel in the first contour line to determine a correspondence relationship between the first contour line and the second contour line; using the correspondence relationship to determine the second image and the first contour line in the first image The pixel corresponding to the pixel in the area.
  • another technical solution adopted by the present invention is to provide a computer storage medium, the device stores program data, and the program data can be executed to implement the corresponding method as above.
  • the invention has the beneficial effects that, in the image processing process, the corresponding relationship between the second contour line and the first contour line is first determined, and the corresponding relationship is used to determine the second image and A pixel corresponding to a pixel in a region other than the first contour line in the first image.
  • the technical solution of the present invention utilizes the correspondence between the first contour line and the second contour line, thereby reducing the number of pixel points that need to be aligned when calculating corresponding pixels of pixels other than the first contour line. In turn, the amount of calculation is reduced, and the speed of image processing is improved.
  • FIG. 1 is a schematic flow chart of an embodiment of an image processing method according to the present invention.
  • step S13 is a schematic flowchart of step S13 in an embodiment of an image processing method according to the present invention
  • FIG. 3 is a schematic diagram showing an example of acquiring an epipolar line in an embodiment of an image processing method according to the present invention
  • step S14 is a schematic flowchart of step S14 in an embodiment of an image processing method according to the present invention.
  • FIG. 5 is a schematic diagram of an example of step S14 in an embodiment of the image processing method of the present invention.
  • step S132 is a schematic flowchart of step S132 in an embodiment of an image processing method according to the present invention.
  • FIG. 7 is a schematic flowchart of step S132 in an embodiment of an image processing method according to the present invention.
  • FIG. 8 is a schematic diagram showing an example of entropy calculation in an embodiment of an image processing method according to the present invention.
  • step S132 is a schematic flowchart of step S132 in an embodiment of an image processing method according to the present invention.
  • FIG. 10 is a schematic flowchart of step S143 in an embodiment of an image processing method according to the present invention.
  • step S143 is a schematic flowchart of step S143 in an embodiment of an image processing method according to the present invention.
  • step S143 is a schematic flowchart of step S143 in an embodiment of an image processing method according to the present invention.
  • FIG. 13 is a schematic diagram of a frame of an embodiment of a terminal device of the present invention.
  • Figure 14 is a schematic diagram of a frame of another embodiment of the terminal device of the present invention.
  • FIG. 1 is an embodiment of an image processing method according to the present invention, including:
  • Step S11 acquiring a first image and a second image
  • the first image and the second image are two images respectively acquired by two cameras of the binocular camera, and the two images have both differences and corresponding relationships, based on the correspondence relationship.
  • the image is subjected to operations such as matching processing.
  • the binocular camera can be used for direct shooting acquisition when acquiring the two images.
  • the two images may not be two images corresponding to the dual purpose, but two images of the same or similar relationship may exist, for example, the user may separately use the terminal device having the camera function.
  • the scenes in the two images need to have overlapping parts.
  • the user may photograph the same object, the scene, and the like from different angles by using a camera or the like, thereby obtaining the first image and the second image having the corresponding relationship to perform image processing.
  • Step S12 Perform edge calculation on the first image and the second image respectively to obtain a first contour line in the first image and a second contour line in the second image;
  • the edge calculation of the image is performed to detect the edge contour of the object in the image to obtain the contour of the object in the image, and then the contour is used to divide the image into different regions.
  • the first contour line and the second contour line obtained may be one, or multiple, and the area enclosed by the contour line may be a closed area or an open area. It is not specifically limited.
  • edge detection there are many types of methods for edge detection, such as differential operator method, template matching method, wavelet detection method, neural network method, etc. Each type of detection method has different specific methods. Edge recognition based on differential operators is currently a more common method, usually using first or second derivatives to detect edges. In the differential operator method, there are detection methods such as Roberts, Sobel, Prewitt, Canny, Laplacian, Log and MATLAB simulation. In the application, different operators can be selected according to the actual situation. The specific algorithm is not limited in the present invention.
  • Step S13 determining pixels in the second contour line corresponding to pixels in the first contour line to determine a correspondence relationship between the first contour line and the second contour line;
  • the first contour line is a line having a width of a first preset value
  • the second contour line is a line having a width of a second preset value.
  • the width of the first preset value refers to a width that can cover a certain number of pixels, for example, 5 pixels, 10 pixels, and the like, and is not limited thereto; similarly, the width is the second preset value.
  • the second preset value may be the same as or different from the first preset value; in an application scenario, The second preset value is greater than the first preset value, such that when determining the correspondence between the first contour line and the second contour line, the determination can be made by using pixels in a relatively larger range in the second image, thereby improving the above The accuracy of the correspondence.
  • any image corresponding recognition technology may be adopted when determining the pixels in the second contour line corresponding to the pixels in the first contour line, which is not limited herein.
  • Step S14 Using the correspondence relationship to determine pixels in the second image corresponding to pixels in a region other than the first contour line in the first image.
  • the corresponding relationship between the second contour line and the first contour line is first determined, and the corresponding relationship is used to determine the area in the second image and the area other than the first contour line in the first image.
  • the pixel corresponding to the pixel utilizes the correspondence between the first contour line and the second contour line, thereby reducing the number of pixel points that need to be aligned when calculating corresponding pixels of pixels other than the first contour line. In turn, the amount of calculation is reduced, and the speed of image processing is improved.
  • step S13 includes: sub-step S131 and sub-step S132.
  • Sub-step S131 acquiring a first constraint line of the first pixel of the first contour line in the first image, and a second constraint line corresponding to the second image, and obtaining the second constraint line and the second contour line Intersection point
  • the constraint line may specifically be a polar line, where the polar line refers to the intersection of the pole face in the opposite pole geometry and the plane of the two images.
  • one of the first pixels J is randomly set in the first image, and the projection centers corresponding to the first image and the second image are respectively known as C 1 and C 2 , and then the plane JC 1
  • the intersection lines x and y of C 2 and the planes ⁇ and ⁇ of the first image and the second image respectively are the polar lines corresponding to the first pixel J in the first image and the second image, that is, the first constraint line and the second line. Constraint line.
  • the intersection of the second constraint line and the second contour line in the second image can be simply obtained.
  • Sub-step S132 searching for the mutual information of the pixel of the first pixel and the intersection point one by one, and determining the second pixel of the second contour line corresponding to the first pixel in the second image to determine the first contour line and the second The correspondence of the outlines.
  • the intersection point of the second constraint line and the second contour line is, to some extent, a small line segment having a certain length. At this time, mutual information is obtained for the first pixel and the pixel located at the intersection point, that is, mutual information is obtained for the first pixel and the pixel located on the small line segment.
  • the mutual information indicates the degree of correlation between a certain pixel in the first image and a certain pixel in the second image, wherein the greater the mutual information, the greater the degree of correlation between the two pixels.
  • the first pixel Since the first pixel is located on the first contour line, it is easy to understand that the first pixel is necessarily located at an intersection of the first contour line and the first constraint line, and corresponding to the first pixel in the second image according to the correspondence relationship
  • the two pixels also correspond to the intersection of the second contour line and the second constraint line, that is, a certain pixel in the small line segment. In this case, it is only necessary to obtain mutual information for the pixels at the intersection of the first pixel and the second constraint line and the second contour line, and determine the pixels in the second image corresponding to the obtained maximum mutual information value. It is a second pixel corresponding to the first pixel.
  • step S14 includes: sub-step S141, sub-step S142, and sub-step S143.
  • Sub-step S141 acquiring a third constraint line of the third pixel of the area outside the first contour line in the first image, and a fourth constraint line corresponding to the second image, to obtain the first contour line and the third constraint line All first intersecting line segments obtained by intersecting, and all second intersecting line segments obtained by intersecting the second contour line with the fourth constraint line;
  • Sub-step S142 acquiring a second intersecting line segment corresponding to the first intersecting line segment where the third pixel is located according to the correspondence relationship, and acquiring an end point of the second intersecting line segment;
  • the correspondence relationship refers to a correspondence relationship between the first contour line in the first image and the second contour line in the second image. Since the correspondence relationship between the first contour line and the second contour line is determined, the positional relationship between the first intersecting line segment and the first contour line and the positional relationship between the second intersecting line segment and the second contour line can be determined and the first a second intersecting line segment in the second image corresponding to the first intersecting line segment where the first pixel is located in the image.
  • Sub-step S143 searching for the mutual information of the third pixel and the pixel corresponding to the second intersecting line segment after the endpoint is removed, and obtaining a fourth pixel corresponding to the third pixel in the second image to obtain the second image.
  • the pixels on the second contour line correspond to the pixels on the first contour line in the first image, and therefore, the first contour line is acquired
  • the pixels corresponding to the pixels in the area other than the pixels do not need to consider the pixels on the second contour line, That is, there is no need to consider the pixels on the endpoints of the second intersecting line segment.
  • the first constraint line 212 of the first pixel M in the first image 21 and the second constraint line 222 corresponding to the second image 22 are obtained by the method for calculating the polar line in the prior art. . Then, according to the above steps S131 and S132, all the pixels on the first contour line 211 in the first image 21 are uniformly found in the corresponding pixels in the second image 22, and obtained in the second image 22, and the first image.
  • the first contour line 211 in the image 21 corresponds to the contour line 223.
  • first intersecting line segment wired segments K 1 G 1 , G 1 H 1 , H 1 I 1 , I 1 E 1 , E 1 F 1 , F 1 L 1 the second intersecting line segment wired segments K 2 G 2 , G 2 H 2 , H 2 I 2 , I 2 E 2 , E 2 F 2 , F 2 L 2 .
  • the second pixel in the second image corresponding to one pixel M is also correspondingly defined in a second intersection between the contour lines 223a and 223b corresponding to the first intersecting line segment E 1 F 1 in the first image 21 in the second image 22 .
  • On the line segment E 2 F 2 when acquiring the second pixel corresponding to the first pixel M in the second image 22, only the second intersecting line segment of the first pixel M and the second image 22 is needed. It is sufficient to remove the pixel of the endpoint from the E 2 F 2 to obtain mutual information, and it is not necessary to obtain mutual information for all the pixels on the first pixel M and the corresponding second intersecting line segment E 2 F 2 .
  • the pixel in the second image can be further limited to be located at the third pixel
  • the first intersecting line segment corresponding to the second intersecting line segment after the end point is removed, thereby greatly reducing the amount of calculation, and can significantly improve the speed of image processing.
  • step S132 includes: sub-step S1321, sub-step S1322:
  • Sub-step S1321 using all pixels in the first image and all pixels in the second image, calculating a first edge entropy of the first pixel, a first edge entropy of the fifth pixel of the intersection, and the first pixel and the fifth The first joint entropy of the pixel;
  • Sub-step S1322 calculating mutual information between the first pixel and the fifth pixel according to the first edge entropy of the first pixel, the first edge entropy of the fifth pixel, and the first joint entropy of the first pixel and the fifth pixel, a second pixel of the second contour line in the second image corresponding to the first pixel to obtain a correspondence relationship between the first contour line and the second contour line.
  • H(x), H(y) represent the edge entropy of pixel x, y, respectively
  • H(x, y) represents pixel x and pixel y.
  • Joint entropy The entropy referred to here is information entropy, variable The greater the uncertainty, the greater the entropy.
  • the pixel having the largest mutual information value is the second pixel corresponding to the first pixel.
  • step S132 includes: sub-step S1323, sub-step S1324;
  • Sub-step S1323 calculating a second edge entropy of the first pixel, a second edge entropy of the sixth pixel of the intersection, and using a first contour line pixel in the first image and a second contour line pixel in the second image a second joint entropy of the first pixel and the sixth pixel;
  • Sub-step S1324 calculating mutual information between the first pixel and the sixth pixel according to the second edge entropy of the first pixel, the second edge entropy of the sixth pixel, and the second joint entropy of the first pixel and the sixth pixel, a second pixel of the second contour line in the second image corresponding to the first pixel to obtain a correspondence relationship between the first contour line and the second contour line.
  • edge contour of an object refers to the most significant part of the image local intensity change in the image, that is, the region where the pixel value abruptly changes. Then, the pixel value in other regions except the contour line changes very little. Uniform, to some extent even negligible.
  • the area enclosed by the contour line is regarded as a blank, that is, the pixels therein are ignored.
  • the regions i′, j′′, k′ enclosed by the first contour line in the first image 21 and the second contour line in the second image 22 may be included.
  • step S132 includes: sub-step S1325, sub-step S1326, sub-step S1327;
  • Sub-step S1325 respectively obtaining the respective mean values of the pixels surrounding the first contour line and the second contour line in the first image and the second contour line, respectively, and enclosing the first contour line and the second contour line respectively All pixels of each region are set to a single pixel having respective mean values;
  • Sub-step S1326 using a first contour line pixel in the first image, a single pixel having a respective mean value of a region surrounded by all the first contour lines, a second contour line pixel in the second image, and all second contour lines a single pixel having respective mean values of the enclosed regions, calculating a third edge entropy of the first pixel, a third edge entropy of the seventh pixel of the intersection, and a third joint entropy of the first pixel and the seventh pixel;
  • Sub-step S1327 calculating mutual information of the first pixel and the seventh pixel according to the third edge entropy of the first pixel, the third edge entropy of the seventh pixel, and the third joint entropy of the first pixel and the seventh pixel, a second pixel in the second image corresponding to the first pixel to obtain a correspondence relationship between the first contour line and the second contour line.
  • the respective mean values of the pixels surrounding the first contour line and the second contour line respectively mean that the pixel values of all the pixels in the region surrounded by the contour lines are averaged, and the obtained average values are The respective mean values of the pixels that surround each region.
  • a single pixel refers to a region surrounded by a first contour line and a second contour line as a pixel, and the pixel value of the pixel is the mean value of the enclosed region.
  • the pixel values of the pixels in other regions than the contour line change very little and are relatively uniform, and can be considered to be a plurality of pixels having the same pixel value to some extent.
  • the present embodiment by considering the pixels of the area surrounded by the contour lines as individual pixels, it is only necessary to use the pixels of the contour line and the above-mentioned individual pixels when performing entropy calculation in the process of seeking mutual information, and thus The amount of computation is reduced.
  • the pixel value of a single pixel is an average value of the pixel values of all the pixels in the contoured area, the calculation of the mutual information does not bring too much error, that is, the present embodiment guarantees mutual The accuracy of information calculation greatly reduces the amount of calculation and improves the speed of image processing.
  • step S143 includes: sub-step S1431, sub-step S1432:
  • Sub-step S1431 using all the pixels in the first image and all the pixels in the second image, calculating the fourth edge entropy of the third pixel, and removing the fourth edge of the eighth pixel of the corresponding second intersecting line segment after the endpoint is removed Edge entropy and fourth joint entropy of the third pixel and the prime eighth pixel;
  • Sub-step S1432 calculating mutual information between the third pixel and the eighth pixel according to the fourth edge entropy of the third pixel, the fourth edge entropy of the eighth pixel, and the fourth joint entropy of the third pixel and the eighth pixel. And a fourth pixel in the second image corresponding to the third pixel to acquire a pixel in the second image corresponding to a pixel in a region other than the first contour line in the first image.
  • the method for calculating mutual information and the relationship between edge entropy and joint entropy are The beneficial effects and the like of the present embodiment are similar to those in the above embodiment. For details, refer to the above embodiment, and details are not described herein again.
  • step S143 includes: sub-step S1433, sub-step S1434;
  • Sub-step S1433 calculating the fifth edge entropy of the third pixel and the corresponding second intersecting line segment after removing the endpoint by using the first contour line pixel in the first image and the second contour line pixel in the second image a fifth edge entropy of nine pixels and a fifth joint entropy of the third pixel and the ninth pixel;
  • Sub-step S1434 calculating the mutual information of the third pixel and the ninth pixel according to the fifth edge entropy of the third pixel, the fifth edge entropy of the ninth pixel, and the fifth joint entropy of the third pixel and the ninth pixel. And a fourth pixel in the second image corresponding to the third pixel to acquire a pixel in the second image corresponding to a pixel in a region other than the first contour line in the first image.
  • step S143 includes: sub-step S1435, sub-step S1435, sub-step S1437;
  • Sub-step S1435 respectively obtaining the respective mean values of the pixels surrounding the first contour line and the second contour line in the first image and the second contour line, respectively, and enclosing the first contour line and the second contour line respectively All pixels of each region are set to a single pixel having respective mean values;
  • Sub-step S1436 using a first contour line pixel in the first image, a single pixel having a respective mean value of a region surrounded by all the first contour lines, a second contour line pixel in the second image, and all second contour lines a single pixel having respective mean values of the enclosed regions, calculating a sixth edge entropy of the third pixel, a sixth edge entropy of the tenth pixel of the corresponding second intersecting line segment after removing the endpoint, and the third pixel and the third pixel Sixth joint entropy of ten pixels;
  • Sub-step S1437 calculating mutual information between the third pixel and the tenth pixel according to the sixth edge entropy of the third pixel, the sixth edge entropy of the tenth pixel, and the sixth joint entropy of the third pixel and the tenth pixel. And a fourth pixel in the second image corresponding to the third pixel to acquire a pixel in the second image corresponding to a pixel in a region other than the first contour line in the first image.
  • an embodiment of the terminal device of the present invention includes a processor 31 and a memory 32 , wherein the memory 32 is coupled to the processor 31 .
  • the computer 32 stores the computer operation instructions and data
  • the processor 31 executes the computer operation instructions for: acquiring the first image and the second image from the memory 32, wherein the first image and the second image have a corresponding relationship; An image and a second image respectively perform edge calculation to determine a first contour line in the first image and a second contour line in the second image; and determine the first contour line and the first contour line a pixel corresponding to the pixel, determining a correspondence relationship between the first contour line and the second contour line; using a correspondence relationship to determine a pixel in the second image corresponding to a region other than the first contour line in the first image Pixels.
  • the processor 31 executes a computer operation instruction, and is further configured to: acquire a first constraint line of the first pixel of the first contour line in the first image, and a second corresponding to the second image Constraining the line, and obtaining an intersection of the second constraint line and the second contour line; obtaining mutual information for the pixels of the first pixel and the intersection point, and determining the second contour line corresponding to the first pixel in the second image a second pixel to determine a correspondence between the first contour line and the second contour line.
  • the processor 31 determines pixels in the second contour line corresponding to the first contour line pixels to determine a correspondence between the first contour line and the second contour line.
  • the method includes: acquiring a third constraint line of the third pixel of the area outside the first contour line in the first image, and corresponding to the fourth constraint line in the second image, to obtain the first contour line intersecting the third constraint line Obtaining all the first intersecting line segments, and all the second intersecting line segments obtained by intersecting the second contour line and the fourth constraint line; acquiring a second intersecting line segment corresponding to the first intersecting line segment where the third pixel is located according to the correspondence relationship, and Obtaining an endpoint of the second intersecting line segment; searching for the mutual information of the third pixel and the pixel corresponding to the second intersecting line segment after removing the end point, and obtaining a fourth pixel corresponding to the third pixel in the second image, Pixels in the second image corresponding to pixels in a region other than the first contour line in the first image are acquired.
  • the processor 31 uses the correspondence to determine pixels in the second image that correspond to pixels in a region other than the first contour in the first image, including: utilizing Calculating a first edge entropy of the first pixel, a first edge entropy of the fifth pixel of the intersection, and a first of the first pixel and the fifth pixel, all pixels in the first image and all pixels in the second image Joint entropy; calculating mutual information of the first pixel and the fifth pixel according to the first edge entropy of the first pixel, the first edge entropy of the fifth pixel, and the first joint entropy of the first pixel and the fifth pixel.
  • the processor 31 obtains mutual information for the first pixel and the pixels of the intersection point, including: utilizing a first contour line pixel in the first image and a second contour in the second image a line pixel, calculating a second edge entropy of the first pixel, a second edge entropy of the sixth pixel of the intersection, and a second joint entropy of the first pixel and the sixth pixel; according to the second edge entropy of the first pixel, The second edge entropy of the sixth pixel and the second joint entropy of the first pixel and the sixth pixel calculate mutual information of the first pixel and the sixth pixel.
  • the processor 31 obtains mutual information for the first pixel and the pixels of the intersection point, including: obtaining a first contour, a first contour, and a second contour in the second image, respectively.
  • the processor 31 obtains mutual information for the pixels of the third pixel and the corresponding second intersecting line segment after removing the endpoint, including: utilizing all the first images a pixel and all pixels in the second image, calculating a fourth edge entropy of the third pixel, removing a fourth edge entropy of the eighth pixel of the corresponding second intersecting line segment after the endpoint, and the third pixel and a fourth joint entropy of the eighth pixel; calculating a mutual relationship between the third pixel and the eighth pixel according to the fourth edge entropy of the third pixel, the fourth edge entropy, and the fourth joint entropy of the third pixel and the eighth pixel information.
  • the processor 31 obtains mutual information for the pixels of the third pixel and the corresponding second intersecting line segment after removing the endpoint, including: using the first image a contour line pixel and a second contour line pixel in the second image, calculating a fifth edge entropy of the third pixel, and a fifth of the ninth pixel of the corresponding second intersecting line segment after the end point is removed Edge entropy and fifth joint entropy of the third pixel and the ninth pixel; calculating according to the fifth edge entropy of the third pixel, the fifth edge entropy of the ninth pixel, and the fifth joint entropy of the third pixel and the ninth pixel Mutual information between three pixels and ninth pixels.
  • the processor 31 obtains mutual information for the pixels of the third pixel and the corresponding second intersecting line segment after the endpoint is removed, including: obtaining the first image, respectively The first contour line and the second contour line in the two images respectively represent the respective mean values of the pixels of the region, and all the pixels of each region surrounded by the first contour line and the second contour line are respectively set to respectively a single pixel having a respective mean value; utilizing a first contour line pixel in the first image, a single pixel having a respective mean of the regions enclosed by all of the first contour lines, a second contour line pixel in the second image, and all of a single pixel having a respective mean value of a region enclosed by the two contour lines, calculating a sixth edge entropy of the third pixel, and a tenth pixel of the corresponding second intersecting line segment after the end point is removed Six edge entropy and a sixth joint entropy of the third pixel and the tenth pixel; calculating according to the sixth edge en
  • the terminal device further includes: a first camera 33 and a second camera 34; the first camera 33 and the second camera 34 are respectively configured to acquire the first image and the second image, and The first image and the second image are stored in the memory 32.
  • the apparatus stores program data, and the program data can be executed to implement the method in the image processing method embodiment of the present invention.
  • the computer storage medium may be at least one of a floppy disk drive, a hard disk drive, a CD-ROM reader, a magneto-optical disk reader, a CPU (for RAM), and the like.

Abstract

An image processing method, a terminal device and a computer storage medium. The method comprises: acquiring a first image and a second image (S11), wherein the first image has a correlation with the second image; respectively performing edge calculation on the first image and the second image, so as to obtain a first contour line in the first image and a second contour line in the second image (S12); determining pixels in the second contour line corresponding to pixels in the first contour line, so as to determine a correlation between the first contour line and the second contour line (S13); and determining, by using the correlation, pixels in the second image corresponding to pixels in a region outside the first contour line in the first image (S14). By means of the implementation of the method, the speed of image processing can be greatly improved.

Description

一种图像处理方法、终端设备及计算机存储介质Image processing method, terminal device and computer storage medium 【技术领域】[Technical Field]
本发明涉及计算机视觉领域,特别是涉及一种图像处理方法、终端设备及计算机存储介质。The present invention relates to the field of computer vision, and in particular to an image processing method, a terminal device, and a computer storage medium.
【背景技术】【Background technique】
两个图像上的对应点的识别是机器视觉的一种重要形式,它是基于视差原理并利用成像设备从不同的位置获取被测物体的两幅图像,通过计算图像对应点间的位置偏差,来获取物体三维几何信息的方法。其中的双目立体视觉目前已广泛应用在机器人导航、精密工业测量、物体识别、虚拟现实、场景重建以及勘测等领域。The recognition of the corresponding points on the two images is an important form of machine vision. It is based on the principle of parallax and uses the imaging device to acquire two images of the measured object from different positions. By calculating the positional deviation between the corresponding points of the image, A method for obtaining three-dimensional geometric information of an object. Among them, binocular stereo vision has been widely used in robot navigation, precision industrial measurement, object recognition, virtual reality, scene reconstruction and surveying.
通常,在进行图像对应识别时,分别将一幅图像中每个像素点与另一幅图像中的所有像素点分别进行互信息求算,这种方法固然可行,但却由于运算量极大而大大降低了图像处理速度。Generally, when performing image corresponding recognition, each pixel in one image and each pixel in another image are separately calculated for each other. This method is feasible, but due to the large amount of computation. Greatly reduced image processing speed.
【发明内容】[Summary of the Invention]
本发明主要解决的技术问题是提供一种图像处理方法、终端设备及计算机存储介质,能够极大得提升图像处理的速度。The technical problem to be solved by the present invention is to provide an image processing method, a terminal device and a computer storage medium, which can greatly improve the speed of image processing.
为解决上述技术问题,本发明采用的技术方案是:提供一种图像处理方法,包括:获取第一图像、第二图像,其中,第一图像与第二图像存在对应关系;对第一图像、第二图像分别进行边缘计算,以确定第一图像中的第一轮廓线、第二图像中的第二轮廓线;确定第二轮廓线中与第一轮廓线中的像素相对应的像素,以确定第一轮廓线与第二轮廓线的对应关系;利用对应关系以确定第二图像中与第一图像中第一轮廓线之外的区域中的像素相对应的像素。In order to solve the above technical problem, the technical solution adopted by the present invention is to provide an image processing method, including: acquiring a first image and a second image, wherein a first image and a second image have a corresponding relationship; Performing an edge calculation on the second image to determine a first contour line in the first image, a second contour line in the second image, and determining a pixel in the second contour line corresponding to the pixel in the first contour line to Determining a correspondence relationship between the first contour line and the second contour line; using the correspondence relationship to determine pixels in the second image corresponding to pixels in a region other than the first contour line in the first image.
为解决上述技术问题,本发明又采用的技术方案是:提供一种终端设备,终端设备包括:处理器、存储器,存储器中存储中计算机操作指令及数据,处理器执行计算机操作指令,用于:从存储器中获取第一图像、第二图像,其中,第一图像与第二图像存在对应关系;对第一图像、第二图像分别进行边缘计算,以确定第一图像中的第一轮廓线、第二图像中的第二轮廓线;确定第二轮廓线 中与第一轮廓线中的像素相对应的像素,以确定第一轮廓线与第二轮廓线的对应关系;利用对应关系以确定第二图像中与第一图像中第一轮廓线之外的区域中的像素相对应的像素。In order to solve the above technical problem, the technical solution adopted by the present invention is: providing a terminal device, the terminal device comprising: a processor, a memory, a computer operation instruction and data stored in the memory, and the processor executing the computer operation instruction, for: Acquiring a first image and a second image from the memory, wherein the first image has a corresponding relationship with the second image; performing edge calculation on the first image and the second image respectively to determine a first contour line in the first image, a second contour line in the second image; determining the second contour line a pixel corresponding to a pixel in the first contour line to determine a correspondence relationship between the first contour line and the second contour line; using the correspondence relationship to determine the second image and the first contour line in the first image The pixel corresponding to the pixel in the area.
为解决上述技术问题,本发明另采用的技术方案是:提供一种计算机存储介质,装置存储有程序数据,程序数据能够被执行以实现如上对应的方法。In order to solve the above technical problem, another technical solution adopted by the present invention is to provide a computer storage medium, the device stores program data, and the program data can be executed to implement the corresponding method as above.
本发明的有益效果是:区别于现有技术的情况,本发明在图像处理过程中,先确定在第二轮廓线与第一轮廓线的对应关系,再利用对应关系以确定第二图像中与第一图像中第一轮廓线之外的区域中的像素相对应的像素。本发明的技术方案利用所述第一轮廓线与第二轮廓线的对应关系,进而缩小在计算所述第一轮廓线之外的像素的对应像素时所需要比对的像素点的个数,进而降低运算量,提升图像处理的速度。The invention has the beneficial effects that, in the image processing process, the corresponding relationship between the second contour line and the first contour line is first determined, and the corresponding relationship is used to determine the second image and A pixel corresponding to a pixel in a region other than the first contour line in the first image. The technical solution of the present invention utilizes the correspondence between the first contour line and the second contour line, thereby reducing the number of pixel points that need to be aligned when calculating corresponding pixels of pixels other than the first contour line. In turn, the amount of calculation is reduced, and the speed of image processing is improved.
【附图说明】[Description of the Drawings]
图1是本发明图像处理方法一实施方式的流程示意图;1 is a schematic flow chart of an embodiment of an image processing method according to the present invention;
图2是本发明图像处理方法一实施方式中步骤S13的流程示意图;2 is a schematic flowchart of step S13 in an embodiment of an image processing method according to the present invention;
图3是本发明图像处理方法一实施方式中获取极线的示例示意图;3 is a schematic diagram showing an example of acquiring an epipolar line in an embodiment of an image processing method according to the present invention;
图4是本发明图像处理方法一实施方式中步骤S14的流程示意图;4 is a schematic flowchart of step S14 in an embodiment of an image processing method according to the present invention;
图5是本发明图像处理方法一实施方式中步骤S14的示例的示意图;FIG. 5 is a schematic diagram of an example of step S14 in an embodiment of the image processing method of the present invention; FIG.
图6是本发明图像处理方法一实施方式中步骤S132的流程示意图;6 is a schematic flowchart of step S132 in an embodiment of an image processing method according to the present invention;
图7是本发明图像处理方法一实施方式中步骤S132的流程示意图;FIG. 7 is a schematic flowchart of step S132 in an embodiment of an image processing method according to the present invention; FIG.
图8是本发明图像处理方法一实施方式中熵求算示例示意图;FIG. 8 is a schematic diagram showing an example of entropy calculation in an embodiment of an image processing method according to the present invention; FIG.
图9是本发明图像处理方法一实施方式中步骤S132的流程示意图;9 is a schematic flowchart of step S132 in an embodiment of an image processing method according to the present invention;
图10是本发明图像处理方法一实施方式中步骤S143的流程示意图;FIG. 10 is a schematic flowchart of step S143 in an embodiment of an image processing method according to the present invention; FIG.
图11是本发明图像处理方法一实施方式中步骤S143的流程示意图;11 is a schematic flowchart of step S143 in an embodiment of an image processing method according to the present invention;
图12是本发明图像处理方法一实施方式中步骤S143的流程示意图;12 is a schematic flowchart of step S143 in an embodiment of an image processing method according to the present invention;
图13是本发明终端设备一实施方式的框架示意图;13 is a schematic diagram of a frame of an embodiment of a terminal device of the present invention;
图14是本发明终端设备另一实施方式的框架示意图。Figure 14 is a schematic diagram of a frame of another embodiment of the terminal device of the present invention.
【具体实施方式】【detailed description】
请参阅图1,图1为本发明的图像处理方法一实施方式,包括:Please refer to FIG. 1. FIG. 1 is an embodiment of an image processing method according to the present invention, including:
步骤S11:获取第一图像、第二图像; Step S11: acquiring a first image and a second image;
需要指明的是,第一图像与第二图像存在对应关系。It should be noted that there is a correspondence between the first image and the second image.
在一个应用场景中,第一图像与第二图像是对应双目相机的两个摄像头所分别获取的两幅图像,两幅图像既具有差别,也具有对应关系,基于这种对应关系对这两幅图像进行匹配处理等操作。此时,在获取该两幅图像时可利用双目相机进行直接拍摄获取。In an application scenario, the first image and the second image are two images respectively acquired by two cameras of the binocular camera, and the two images have both differences and corresponding relationships, based on the correspondence relationship. The image is subjected to operations such as matching processing. At this time, the binocular camera can be used for direct shooting acquisition when acquiring the two images.
当然,在其它应用场景中,上述两幅图像也可以不是对应双目的两幅图像,而是存在对应关系的相同或相似的两幅图像,例如可以是用户利用具有拍照功能的终端设备分别从不同角度拍摄同一物体所获得的图像,需要指出的是,这两幅图像中的景物需有重叠的部分。此时可以是用户利用相机等对同一物体、场景等分别从不同的角度进行拍摄,从而获得具有对应关系的第一图像和第二图像,以进行图像处理。Of course, in other application scenarios, the two images may not be two images corresponding to the dual purpose, but two images of the same or similar relationship may exist, for example, the user may separately use the terminal device having the camera function. To take images of the same object at different angles, it should be noted that the scenes in the two images need to have overlapping parts. At this time, the user may photograph the same object, the scene, and the like from different angles by using a camera or the like, thereby obtaining the first image and the second image having the corresponding relationship to perform image processing.
步骤S12:对第一图像、第二图像分别进行边缘计算,以获得第一图像中的第一轮廓线、第二图像中的第二轮廓线;Step S12: Perform edge calculation on the first image and the second image respectively to obtain a first contour line in the first image and a second contour line in the second image;
其中,对图像进行边缘计算即对图像中物体的边缘轮廓进行检测,以获得图像中物体的轮廓线,进而利用轮廓线将图像划分成不同的区域。在本实施方式中,所获得的第一轮廓线和第二轮廓线均可以为一条,或者多条,轮廓线所围成的区域可以是封闭的区域,也可以是开放的区域,本实施方式中并不具体限定。Wherein, the edge calculation of the image is performed to detect the edge contour of the object in the image to obtain the contour of the object in the image, and then the contour is used to divide the image into different regions. In this embodiment, the first contour line and the second contour line obtained may be one, or multiple, and the area enclosed by the contour line may be a closed area or an open area. It is not specifically limited.
其中,对边缘检测的方法的种类很多,如微分算子法、样板匹配法、小波检测法、神经网络法等,每一类检测法又有不同的具体方法。基于微分算子的边缘识别是目前较为常用的方法,通常用一阶或二阶导数来检测边缘。微分算子法中有Roberts,Sobel,Prewitt,Canny,Laplacian,Log以及MATLAB仿真等检测方法,在应用中可根据实际情况选择不同的算子。本发明中对具体的算法不做限定。Among them, there are many types of methods for edge detection, such as differential operator method, template matching method, wavelet detection method, neural network method, etc. Each type of detection method has different specific methods. Edge recognition based on differential operators is currently a more common method, usually using first or second derivatives to detect edges. In the differential operator method, there are detection methods such as Roberts, Sobel, Prewitt, Canny, Laplacian, Log and MATLAB simulation. In the application, different operators can be selected according to the actual situation. The specific algorithm is not limited in the present invention.
步骤S13:确定第二轮廓线中与第一轮廓线中的像素相对应的像素,以确定第一轮廓线与第二轮廓线的对应关系;Step S13: determining pixels in the second contour line corresponding to pixels in the first contour line to determine a correspondence relationship between the first contour line and the second contour line;
在一个应用场景中,第一轮廓线是宽度为第一预设值的线,第二轮廓线为宽度为第二预设值的线。宽度为第一预设值是指能够覆盖一定数量像素的宽度,例如5个像素、10个像素等,具体不做限定;同样地,宽度为第二预设值也是如此。In an application scenario, the first contour line is a line having a width of a first preset value, and the second contour line is a line having a width of a second preset value. The width of the first preset value refers to a width that can cover a certain number of pixels, for example, 5 pixels, 10 pixels, and the like, and is not limited thereto; similarly, the width is the second preset value.
其中,第二预设值与第一预设值可相同,也可不同;在一个应用场景中, 第二预设值大于第一预设值,这样使得在确定第一轮廓线与第二轮廓线的对应关系时,能够利用第二图像中相对更大的范围内的像素进行确定,进而提高上述对应关系的准确性。The second preset value may be the same as or different from the first preset value; in an application scenario, The second preset value is greater than the first preset value, such that when determining the correspondence between the first contour line and the second contour line, the determination can be made by using pixels in a relatively larger range in the second image, thereby improving the above The accuracy of the correspondence.
需要指出的是,确定第二轮廓线中与第一轮廓线中的像素相对应的像素时,可以采用任何图像对应识别技术,此处不做限定。It should be noted that any image corresponding recognition technology may be adopted when determining the pixels in the second contour line corresponding to the pixels in the first contour line, which is not limited herein.
步骤S14:利用对应关系以确定第二图像中与第一图像中第一轮廓线之外的区域中的像素相对应的像素。Step S14: Using the correspondence relationship to determine pixels in the second image corresponding to pixels in a region other than the first contour line in the first image.
本实施方式在图像处理过程中,先确定在第二轮廓线与第一轮廓线的对应关系,再利用对应关系以确定第二图像中与第一图像中第一轮廓线之外的区域中的像素相对应的像素。本发明的技术方案利用所述第一轮廓线与第二轮廓线的对应关系,进而缩小在计算所述第一轮廓线之外的像素的对应像素时所需要比对的像素点的个数,进而降低运算量,提升图像处理的速度。In the image processing process, the corresponding relationship between the second contour line and the first contour line is first determined, and the corresponding relationship is used to determine the area in the second image and the area other than the first contour line in the first image. The pixel corresponding to the pixel. The technical solution of the present invention utilizes the correspondence between the first contour line and the second contour line, thereby reducing the number of pixel points that need to be aligned when calculating corresponding pixels of pixels other than the first contour line. In turn, the amount of calculation is reduced, and the speed of image processing is improved.
其中,请参阅图2,在一实施方式中,步骤S13包括:子步骤S131和子步骤S132。Referring to FIG. 2, in an embodiment, step S13 includes: sub-step S131 and sub-step S132.
子步骤S131,获取第一轮廓线的第一像素在第一图像中的第一约束线,以及对应在第二图像中的第二约束线,并得出第二约束线与第二轮廓线的交点;Sub-step S131, acquiring a first constraint line of the first pixel of the first contour line in the first image, and a second constraint line corresponding to the second image, and obtaining the second constraint line and the second contour line Intersection point
在本实施方式中,约束线具体可以是极线,此处的极线是指对极几何中极面与两幅图像所在平面的交线。In this embodiment, the constraint line may specifically be a polar line, where the polar line refers to the intersection of the pole face in the opposite pole geometry and the plane of the two images.
请参阅图3,本实施方式中,在第一图像中随机设定其中一个第一像素J,已知第一图像和第二图像分别对应的投影中心为C1和C2,则平面JC1C2分别与第一图像、第二图像所在平面γ、σ的交线x、y分别为第一像素J对应在第一图像、第二图像中的极线,即第一约束线、第二约束线。Referring to FIG. 3, in the embodiment, one of the first pixels J is randomly set in the first image, and the projection centers corresponding to the first image and the second image are respectively known as C 1 and C 2 , and then the plane JC 1 The intersection lines x and y of C 2 and the planes γ and σ of the first image and the second image respectively are the polar lines corresponding to the first pixel J in the first image and the second image, that is, the first constraint line and the second line. Constraint line.
获得第一约束线、第二约束线以及第一轮廓线、第二轮廓线后,即可简单得出在第二图像中,第二约束线被第二轮廓线的交点。After obtaining the first constraint line, the second constraint line, and the first contour line and the second contour line, the intersection of the second constraint line and the second contour line in the second image can be simply obtained.
子步骤S132,对第一像素与交点的像素一一求互信息,在第二图像中确定与第一像素相对应的第二轮廓线中的第二像素,以确定第一轮廓线与第二轮廓线的对应关系。Sub-step S132, searching for the mutual information of the pixel of the first pixel and the intersection point one by one, and determining the second pixel of the second contour line corresponding to the first pixel in the second image to determine the first contour line and the second The correspondence of the outlines.
需要指出的是,由于第二轮廓线具有一定的线宽,因此,从某种程度上来说,第二约束线与第二轮廓线的交点是具有一定长度的小线段。此时,对第一像素与位于交点的像素一一求互信息,即对第一像素与位于该小线段上的像素一一求互信息。 It should be noted that since the second contour line has a certain line width, the intersection point of the second constraint line and the second contour line is, to some extent, a small line segment having a certain length. At this time, mutual information is obtained for the first pixel and the pixel located at the intersection point, that is, mutual information is obtained for the first pixel and the pixel located on the small line segment.
本实施例中,互信息表示了第一图像中某一像素与第二图像中某一像素的相关程度,其中,互信息越大,则两个像素之间的相关程度越大。In this embodiment, the mutual information indicates the degree of correlation between a certain pixel in the first image and a certain pixel in the second image, wherein the greater the mutual information, the greater the degree of correlation between the two pixels.
由于第一像素位于第一轮廓线上,容易理解地,该第一像素必然位于第一轮廓线与第一约束线的交点上,根据对应关系,在第二图像中与第一像素对应的第二像素也对应为第二轮廓线与第二约束线的交点即上述小线段中的某一像素。此时,仅需对第一像素与第二约束线与第二轮廓线的交点上的像素求互信息即可,将所求出的最大的互信息值所对应的第二图像中的像素认定为与第一像素对应的第二像素。Since the first pixel is located on the first contour line, it is easy to understand that the first pixel is necessarily located at an intersection of the first contour line and the first constraint line, and corresponding to the first pixel in the second image according to the correspondence relationship The two pixels also correspond to the intersection of the second contour line and the second constraint line, that is, a certain pixel in the small line segment. In this case, it is only necessary to obtain mutual information for the pixels at the intersection of the first pixel and the second constraint line and the second contour line, and determine the pixels in the second image corresponding to the obtained maximum mutual information value. It is a second pixel corresponding to the first pixel.
本实施方式中,在确定第二图像中与第一图像中的第一轮廓线的像素相对应的像素时,根据极线约束,将仅需对第一像素与第二约束线和第二轮廓线的交点即上述小线段所覆盖的像素求互信息即可,大大减少了运算量,进而提升图像处理的速度。In this embodiment, when determining a pixel in the second image corresponding to the pixel of the first contour line in the first image, according to the polar line constraint, only the first pixel and the second constraint line and the second contour are needed. The intersection of the lines, that is, the pixels covered by the small line segments described above, can obtain mutual information, which greatly reduces the amount of calculation, thereby improving the speed of image processing.
其中,请参阅图4,在一实施方式中,步骤S14包括:子步骤S141,子步骤S142和子步骤S143。Referring to FIG. 4, in an embodiment, step S14 includes: sub-step S141, sub-step S142, and sub-step S143.
子步骤S141,获取第一图像中第一轮廓线之外区域的第三像素的第三约束线,以及对应在第二图像中的第四约束线,以获得第一轮廓线与第三约束线相交得到的所有第一相交线段,以及第二轮廓线与第四约束线相交得到的所有第二相交线段;Sub-step S141, acquiring a third constraint line of the third pixel of the area outside the first contour line in the first image, and a fourth constraint line corresponding to the second image, to obtain the first contour line and the third constraint line All first intersecting line segments obtained by intersecting, and all second intersecting line segments obtained by intersecting the second contour line with the fourth constraint line;
子步骤S142,根据对应关系获取与第三像素所在的第一相交线段相对应的第二相交线段,并获取第二相交线段的端点;Sub-step S142, acquiring a second intersecting line segment corresponding to the first intersecting line segment where the third pixel is located according to the correspondence relationship, and acquiring an end point of the second intersecting line segment;
其中,对应关系是指第一图像中第一轮廓线与第二图像中第二轮廓线的对应关系。由于第一轮廓线与第二轮廓线的对应关系已确定,那么,根据第一相交线段与第一轮廓线的位置关系以及第二相交线段与第二轮廓线的位置关系,能够确定与第一图像中第一像素所在的第一相交线段对应的第二图像中的第二相交线段。The correspondence relationship refers to a correspondence relationship between the first contour line in the first image and the second contour line in the second image. Since the correspondence relationship between the first contour line and the second contour line is determined, the positional relationship between the first intersecting line segment and the first contour line and the positional relationship between the second intersecting line segment and the second contour line can be determined and the first a second intersecting line segment in the second image corresponding to the first intersecting line segment where the first pixel is located in the image.
子步骤S143,对第三像素与除去端点后的相对应的第二相交线段的像素一一求互信息,得出第二图像中与第三像素相对应的第四像素,以获取第二图像中与第一图像中第一轮廓线之外的区域中的像素相对应的像素。Sub-step S143, searching for the mutual information of the third pixel and the pixel corresponding to the second intersecting line segment after the endpoint is removed, and obtaining a fourth pixel corresponding to the third pixel in the second image to obtain the second image. a pixel corresponding to a pixel in a region other than the first contour line in the first image.
由于第二相交线段的端点位于第二轮廓线上,根据约束原理,第二轮廓线上的像素是与第一图像中第一轮廓线上的像素相对应的,因此,在获取第一轮廓线之外的区域中的像素相对应的像素时,不需要考虑第二轮廓线上的像素, 即不需要考虑第二相交线段的端点上的像素。Since the end point of the second intersecting line segment is located on the second contour line, according to the constraint principle, the pixels on the second contour line correspond to the pixels on the first contour line in the first image, and therefore, the first contour line is acquired When the pixels corresponding to the pixels in the area other than the pixels do not need to consider the pixels on the second contour line, That is, there is no need to consider the pixels on the endpoints of the second intersecting line segment.
例如,请参阅图5,利用现有技术中极线的求算方法获取第一像素M在第一图像21中的第一约束线212,以及对应在第二图像22中的第二约束线222。再根据上述步骤S131和步骤S132将第一图像21中第一轮廓线211上的所有像素在第二图像22中的对应像素均一一对应找出,得到在第二图像22中,与第一图像21中的第一轮廓线211相对应的轮廓线223。其中,第一相交线段有线段K1G1、G1H1、H1I1、I1E1、E1F1、F1L1,第二相交线段有线段K2G2、G2H2、H2I2、I2E2、E2F2、F2L2。此时,由于在本实施方式中第一像素M在第一图像21中的方位已确定为在第一轮廓线211a与211b之间的第一相交线段E1F1上,相应地,与第一像素M对应的第二图像中的第二像素也相应的限定在第二图像22中与第一图像21中第一相交线段E1F1对应的轮廓线223a与223b之间的第二相交线段E2F2上,那么,此时,在获取第二图像22中与第一像素M相对应的第二像素时,仅需对第一像素M与上述第二图像22中第二相交线段E2F2上除去端点的像素求互信息即可,而并不需要对第一像素M与对应第二相交线段E2F2上的所有像素求互信息。For example, referring to FIG. 5, the first constraint line 212 of the first pixel M in the first image 21 and the second constraint line 222 corresponding to the second image 22 are obtained by the method for calculating the polar line in the prior art. . Then, according to the above steps S131 and S132, all the pixels on the first contour line 211 in the first image 21 are uniformly found in the corresponding pixels in the second image 22, and obtained in the second image 22, and the first image. The first contour line 211 in the image 21 corresponds to the contour line 223. Wherein, the first intersecting line segment wired segments K 1 G 1 , G 1 H 1 , H 1 I 1 , I 1 E 1 , E 1 F 1 , F 1 L 1 , the second intersecting line segment wired segments K 2 G 2 , G 2 H 2 , H 2 I 2 , I 2 E 2 , E 2 F 2 , F 2 L 2 . At this time, since the orientation of the first pixel M in the first image 21 has been determined to be on the first intersecting line segment E 1 F 1 between the first contour lines 211a and 211b in the present embodiment, correspondingly, The second pixel in the second image corresponding to one pixel M is also correspondingly defined in a second intersection between the contour lines 223a and 223b corresponding to the first intersecting line segment E 1 F 1 in the first image 21 in the second image 22 . On the line segment E 2 F 2 , then, at this time, when acquiring the second pixel corresponding to the first pixel M in the second image 22, only the second intersecting line segment of the first pixel M and the second image 22 is needed. It is sufficient to remove the pixel of the endpoint from the E 2 F 2 to obtain mutual information, and it is not necessary to obtain mutual information for all the pixels on the first pixel M and the corresponding second intersecting line segment E 2 F 2 .
通过上述方式,在获取第二图像中与第一图像中第一轮廓线之外的区域中的第三像素相对应的像素时,能够将第二图像中的像素进一步限定在与第三像素所在的第一相交线段相对应的除去端点后的第二相交线段上,从而大大降低运算量,且能够明显提升图像处理的速度。In the above manner, when the pixel corresponding to the third pixel in the region other than the first contour line in the first image is acquired in the second image, the pixel in the second image can be further limited to be located at the third pixel The first intersecting line segment corresponding to the second intersecting line segment after the end point is removed, thereby greatly reducing the amount of calculation, and can significantly improve the speed of image processing.
其中,请参阅图6,在一实施方式中,步骤S132包括:子步骤S1321、子步骤S1322:Referring to FIG. 6, in an embodiment, step S132 includes: sub-step S1321, sub-step S1322:
子步骤S1321,利用第一图像中的所有像素以及第二图像中的所有像素,求算第一像素的第一边缘熵、交点的第五像素像素的第一边缘熵以及第一像素与第五像素的第一联合熵;Sub-step S1321, using all pixels in the first image and all pixels in the second image, calculating a first edge entropy of the first pixel, a first edge entropy of the fifth pixel of the intersection, and the first pixel and the fifth The first joint entropy of the pixel;
子步骤S1322,根据第一像素的第一边缘熵、第五像素的第一边缘熵以及第一像素与第五像素的第一联合熵求算第一像素与第五像素的互信息,得出与第一像素相对应的第二图像中第二轮廓线中的第二像素,以获得第一轮廓线与第二轮廓线的对应关系。Sub-step S1322, calculating mutual information between the first pixel and the fifth pixel according to the first edge entropy of the first pixel, the first edge entropy of the fifth pixel, and the first joint entropy of the first pixel and the fifth pixel, a second pixel of the second contour line in the second image corresponding to the first pixel to obtain a correspondence relationship between the first contour line and the second contour line.
对像素x、y求互信息的运算为I(x,y)=H(x)+H(y)-H(x,y)。The operation for obtaining mutual information for the pixels x and y is I(x, y) = H(x) + H(y) - H(x, y).
其中,I(x,y)为像素x与像素y的互信息,H(x)、H(y)分别表示像素x、y的边缘熵,H(x,y)则表示像素x与像素y的联合熵。此处所指的熵为信息熵,变量 的不确定性越大,熵就越大。Where I(x, y) is the mutual information of pixel x and pixel y, H(x), H(y) represent the edge entropy of pixel x, y, respectively, and H(x, y) represents pixel x and pixel y. Joint entropy. The entropy referred to here is information entropy, variable The greater the uncertainty, the greater the entropy.
其中,本实施方式中,例如在对第一图像中的第一像素求边缘熵时,第一图像中所有的像素均需参与运算;类似地,在对该第一像素与第二图像中某一像素求联合熵时,则第一图像和第二图像中的所有像素均需参与运算。In this embodiment, for example, when edge entropy is obtained for the first pixel in the first image, all pixels in the first image need to participate in the operation; similarly, in the first pixel and the second image When a pixel finds joint entropy, all pixels in the first image and the second image need to participate in the operation.
根据上述方法,在对第一图像中的第一像素与第二图像的交点所覆盖的像素求算出互信息后,互信息值最大的像素即为与第一像素对应的第二像素。According to the above method, after the mutual information is calculated for the pixel covered by the intersection of the first pixel and the second image in the first image, the pixel having the largest mutual information value is the second pixel corresponding to the first pixel.
其中,请参阅图7,在一实施方式中,步骤S132包括:子步骤S1323,子步骤S1324;Referring to FIG. 7, in an embodiment, step S132 includes: sub-step S1323, sub-step S1324;
子步骤S1323:利用第一图像中的第一轮廓线像素以及第二图像中第二轮廓线像素,求算第一像素的第二边缘熵、所述交点的第六像素的第二边缘熵以及第一像素与第六像素的第二联合熵;Sub-step S1323: calculating a second edge entropy of the first pixel, a second edge entropy of the sixth pixel of the intersection, and using a first contour line pixel in the first image and a second contour line pixel in the second image a second joint entropy of the first pixel and the sixth pixel;
子步骤S1324:根据第一像素的第二边缘熵、第六像素的第二边缘熵以及第一像素与第六像素的第二联合熵求算第一像素与第六像素的互信息,得出与第一像素相对应的第二图像中第二轮廓线中的第二像素,以获得第一轮廓线与第二轮廓线的对应关系。Sub-step S1324: calculating mutual information between the first pixel and the sixth pixel according to the second edge entropy of the first pixel, the second edge entropy of the sixth pixel, and the second joint entropy of the first pixel and the sixth pixel, a second pixel of the second contour line in the second image corresponding to the first pixel to obtain a correspondence relationship between the first contour line and the second contour line.
容易理解地,物体的边缘轮廓在图像中是指图像局部强度变化最显著的部分,即像素值发生突变的区域,那么,在轮廓线以外的其它区域中的像素值则变化非常之小,较为均一,在某种程度上甚至可以忽略。It is easy to understand that the edge contour of an object refers to the most significant part of the image local intensity change in the image, that is, the region where the pixel value abruptly changes. Then, the pixel value in other regions except the contour line changes very little. Uniform, to some extent even negligible.
在本实施方式中,在求互信息的过程中,对边缘熵和联合熵进行求算时,将轮廓线所围成的区域看作空白,即忽略其中的像素。请参阅图8,例如可将第一图像21中第一轮廓线所围成的区域i、j、k和第二图像22中第二轮廓线所围成的区域i’、j’、k’看作空白,例如在求第一图像中第一像素N的边缘熵时仅利用第一图像中第一轮廓线的像素进行求算,而不考虑轮廓线所围成区域的像素,由于该其它区域所包含的像素数量非常多,那么在此种情况下进行求算能够大大得减少求熵的运算量,从而间接减少求互信息的运算量,进而进一步大大提升图像处理的速度。In the present embodiment, in the process of seeking mutual information, when calculating the edge entropy and the joint entropy, the area enclosed by the contour line is regarded as a blank, that is, the pixels therein are ignored. Referring to FIG. 8 , for example, the regions i′, j′′, k′ enclosed by the first contour line in the first image 21 and the second contour line in the second image 22 may be included. As a blank, for example, when the edge entropy of the first pixel N in the first image is obtained, only the pixels of the first contour line in the first image are used for calculation, regardless of the pixels of the area enclosed by the contour line, because the other Since the number of pixels included in the region is very large, calculation in this case can greatly reduce the amount of computation for entropy, thereby indirectly reducing the amount of computation for mutual information, thereby further increasing the speed of image processing.
其中,请参阅图9,在一实施方式中,步骤S132包括:子步骤S1325,子步骤S1326,子步骤S1327;Referring to FIG. 9, in an embodiment, step S132 includes: sub-step S1325, sub-step S1326, sub-step S1327;
子步骤S1325,分别获得第一图像、第二图像中的第一轮廓线、第二轮廓线所分别围成区域的像素的各自均值,并将第一轮廓线、第二轮廓线所分别围成的每个区域的所有像素设定为分别具有各自均值的单个像素; Sub-step S1325, respectively obtaining the respective mean values of the pixels surrounding the first contour line and the second contour line in the first image and the second contour line, respectively, and enclosing the first contour line and the second contour line respectively All pixels of each region are set to a single pixel having respective mean values;
子步骤S1326,利用第一图像中的第一轮廓线像素、所有第一轮廓线所围成的区域的具有各自均值的单个像素、第二图像中第二轮廓线像素、以及所有第二轮廓线所围成的区域的具有各自均值的单个像素,求算第一像素的第三边缘熵、所述交点的第七像素的第三边缘熵以及第一像素与第七像素的第三联合熵;Sub-step S1326, using a first contour line pixel in the first image, a single pixel having a respective mean value of a region surrounded by all the first contour lines, a second contour line pixel in the second image, and all second contour lines a single pixel having respective mean values of the enclosed regions, calculating a third edge entropy of the first pixel, a third edge entropy of the seventh pixel of the intersection, and a third joint entropy of the first pixel and the seventh pixel;
子步骤S1327,根据第一像素的第三边缘熵、第七像素的第三边缘熵以及第一像素、第七像素的第三联合熵求算第一像素与第七像素的互信息,得出与第一像素相对应的第二图像中的第二像素,以获得第一轮廓线与第二轮廓线的对应关系。Sub-step S1327, calculating mutual information of the first pixel and the seventh pixel according to the third edge entropy of the first pixel, the third edge entropy of the seventh pixel, and the third joint entropy of the first pixel and the seventh pixel, a second pixel in the second image corresponding to the first pixel to obtain a correspondence relationship between the first contour line and the second contour line.
其中,第一轮廓线、第二轮廓线所分别围成区域的像素的各自均值是指对各轮廓线所围成的区域中的所有像素的像素值求平均值,所得到的各平均值即为各围成区域的像素的各自均值。The respective mean values of the pixels surrounding the first contour line and the second contour line respectively mean that the pixel values of all the pixels in the region surrounded by the contour lines are averaged, and the obtained average values are The respective mean values of the pixels that surround each region.
单个像素则指将第一轮廓线、第二轮廓线所分别围成区域看作一个像素,该像素的像素值即该围成区域的均值。A single pixel refers to a region surrounded by a first contour line and a second contour line as a pixel, and the pixel value of the pixel is the mean value of the enclosed region.
如上一实施方式,在轮廓线以外的其它区域中的像素的像素值则变化非常之小,较为均一,在某种程度上可以认为是具有相同的像素值的多个像素。In the above embodiment, the pixel values of the pixels in other regions than the contour line change very little and are relatively uniform, and can be considered to be a plurality of pixels having the same pixel value to some extent.
因此,本实施方式通过将各轮廓线所围成的区域的像素看作各个单个像素,在求互信息过程中进行熵运算时仅需利用轮廓线的像素以及上述各单个像素即可,进而大大地减少了运算量。同时,由于单个像素所具有的像素值为该轮廓线该围成区域中所有像素的像素值的平均值,因此不会对互信息的计算带来太大的误差,即本实施方式在保证互信息计算的准确度的基础上大大地减少了运算量,提高了图像处理的速度。Therefore, in the present embodiment, by considering the pixels of the area surrounded by the contour lines as individual pixels, it is only necessary to use the pixels of the contour line and the above-mentioned individual pixels when performing entropy calculation in the process of seeking mutual information, and thus The amount of computation is reduced. At the same time, since the pixel value of a single pixel is an average value of the pixel values of all the pixels in the contoured area, the calculation of the mutual information does not bring too much error, that is, the present embodiment guarantees mutual The accuracy of information calculation greatly reduces the amount of calculation and improves the speed of image processing.
其中,请参阅图10,在一实施方式中,步骤S143包括:子步骤S1431、子步骤S1432:Referring to FIG. 10, in an embodiment, step S143 includes: sub-step S1431, sub-step S1432:
子步骤S1431,利用第一图像中的所有像素以及第二图像中的所有像素,求算第三像素的第四边缘熵、除去端点后的相对应的第二相交线段的第八像素的第四边缘熵以及第三像素与素第八像素的第四联合熵;Sub-step S1431, using all the pixels in the first image and all the pixels in the second image, calculating the fourth edge entropy of the third pixel, and removing the fourth edge of the eighth pixel of the corresponding second intersecting line segment after the endpoint is removed Edge entropy and fourth joint entropy of the third pixel and the prime eighth pixel;
子步骤S1432,根据第三像素的第四边缘熵、第八像素的第四边缘熵以及第三像素与第八像素的第四联合熵,求算第三像素与第八像素的互信息,得出与第三像素相对应的第二图像中的第四像素,以获取第二图像中与第一图像中第一轮廓线之外的区域中的像素相对应的像素。Sub-step S1432, calculating mutual information between the third pixel and the eighth pixel according to the fourth edge entropy of the third pixel, the fourth edge entropy of the eighth pixel, and the fourth joint entropy of the third pixel and the eighth pixel. And a fourth pixel in the second image corresponding to the third pixel to acquire a pixel in the second image corresponding to a pixel in a region other than the first contour line in the first image.
本实施方式中,关于互信息的求算方法,及与边缘熵、联合熵的关系,以 及本实施方式的有益效果等与上述实施方式中的相似,详细内容请参见上述实施方式,此处不再赘述。In the present embodiment, the method for calculating mutual information and the relationship between edge entropy and joint entropy are The beneficial effects and the like of the present embodiment are similar to those in the above embodiment. For details, refer to the above embodiment, and details are not described herein again.
其中,请参阅图11,在一实施方式中,步骤S143包括:子步骤S1433,子步骤S1434;Referring to FIG. 11, in an embodiment, step S143 includes: sub-step S1433, sub-step S1434;
子步骤S1433:利用第一图像中的第一轮廓线像素以及第二图像中第二轮廓线像素,求算第三像素的第五边缘熵、除去端点后的相对应的第二相交线段的第九像素的第五边缘熵以及第三像素与第九像素的第五联合熵;Sub-step S1433: calculating the fifth edge entropy of the third pixel and the corresponding second intersecting line segment after removing the endpoint by using the first contour line pixel in the first image and the second contour line pixel in the second image a fifth edge entropy of nine pixels and a fifth joint entropy of the third pixel and the ninth pixel;
子步骤S1434:根据第三像素的第五边缘熵、第九像素的第五边缘熵以及第三像素与第九像素的第五联合熵,求算第三像素与第九像素的互信息,得出与第三像素相对应的第二图像中的第四像素,以获取第二图像中与第一图像中第一轮廓线之外的区域中的像素相对应的像素。Sub-step S1434: calculating the mutual information of the third pixel and the ninth pixel according to the fifth edge entropy of the third pixel, the fifth edge entropy of the ninth pixel, and the fifth joint entropy of the third pixel and the ninth pixel. And a fourth pixel in the second image corresponding to the third pixel to acquire a pixel in the second image corresponding to a pixel in a region other than the first contour line in the first image.
其中,请参阅图12,在一实施方式中,步骤S143包括:子步骤S1435,子步骤S1435,子步骤S1437;Referring to FIG. 12, in an embodiment, step S143 includes: sub-step S1435, sub-step S1435, sub-step S1437;
子步骤S1435,分别获得第一图像、第二图像中的第一轮廓线、第二轮廓线所分别围成区域的像素的各自均值,并将第一轮廓线、第二轮廓线所分别围成的每个区域的所有像素设定为分别具有各自均值的单个像素;Sub-step S1435, respectively obtaining the respective mean values of the pixels surrounding the first contour line and the second contour line in the first image and the second contour line, respectively, and enclosing the first contour line and the second contour line respectively All pixels of each region are set to a single pixel having respective mean values;
子步骤S1436,利用第一图像中的第一轮廓线像素、所有第一轮廓线所围成的区域的具有各自均值的单个像素、第二图像中第二轮廓线像素、以及所有第二轮廓线所围成的区域的具有各自均值的单个像素,求算第三像素的第六边缘熵、除去端点后的相对应的第二相交线段的第十像素的第六边缘熵以及第三像素与第十像素的第六联合熵;Sub-step S1436, using a first contour line pixel in the first image, a single pixel having a respective mean value of a region surrounded by all the first contour lines, a second contour line pixel in the second image, and all second contour lines a single pixel having respective mean values of the enclosed regions, calculating a sixth edge entropy of the third pixel, a sixth edge entropy of the tenth pixel of the corresponding second intersecting line segment after removing the endpoint, and the third pixel and the third pixel Sixth joint entropy of ten pixels;
子步骤S1437,根据第三像素的第六边缘熵、第十像素的第六边缘熵以及第三像素与第十像素的第六联合熵,求算第三像素与第十像素的互信息,得出与第三像素相对应的第二图像中的第四像素,以获取第二图像中与第一图像中第一轮廓线之外的区域中的像素相对应的像素。Sub-step S1437, calculating mutual information between the third pixel and the tenth pixel according to the sixth edge entropy of the third pixel, the sixth edge entropy of the tenth pixel, and the sixth joint entropy of the third pixel and the tenth pixel. And a fourth pixel in the second image corresponding to the third pixel to acquire a pixel in the second image corresponding to a pixel in a region other than the first contour line in the first image.
请参阅图13,本发明终端设备一实施方式包括:处理器31、存储器32,其中,存储器32耦接于处理器31。Referring to FIG. 13 , an embodiment of the terminal device of the present invention includes a processor 31 and a memory 32 , wherein the memory 32 is coupled to the processor 31 .
存储器32中存储中计算机操作指令及数据,处理器31执行计算机操作指令,用于:从存储器32中获取第一图像、第二图像,其中,第一图像与第二图像存在对应关系;对第一图像、第二图像分别进行边缘计算,以确定第一图像中的第一轮廓线、第二图像中的第二轮廓线;确定第二轮廓线中与第一轮廓线 中的像素相对应的像素,以确定第一轮廓线与第二轮廓线的对应关系;利用对应关系以确定第二图像中与第一图像中第一轮廓线之外的区域中的像素相对应的像素。The computer 32 stores the computer operation instructions and data, and the processor 31 executes the computer operation instructions for: acquiring the first image and the second image from the memory 32, wherein the first image and the second image have a corresponding relationship; An image and a second image respectively perform edge calculation to determine a first contour line in the first image and a second contour line in the second image; and determine the first contour line and the first contour line a pixel corresponding to the pixel, determining a correspondence relationship between the first contour line and the second contour line; using a correspondence relationship to determine a pixel in the second image corresponding to a region other than the first contour line in the first image Pixels.
其中,在一实施方式中,处理器31执行计算机操作指令,还用于:获取第一轮廓线的第一像素在第一图像中的第一约束线,以及对应在第二图像中的第二约束线,并得出第二约束线与第二轮廓线的交点;对第一像素与交点的像素一一求互信息,在第二图像中确定与第一像素相对应的第二轮廓线中的第二像素,以确定第一轮廓线与第二轮廓线的对应关系。In an embodiment, the processor 31 executes a computer operation instruction, and is further configured to: acquire a first constraint line of the first pixel of the first contour line in the first image, and a second corresponding to the second image Constraining the line, and obtaining an intersection of the second constraint line and the second contour line; obtaining mutual information for the pixels of the first pixel and the intersection point, and determining the second contour line corresponding to the first pixel in the second image a second pixel to determine a correspondence between the first contour line and the second contour line.
其中,在一实施方式中,处理器31确定所述第二轮廓线中与所述第一轮廓线像素相对应的像素,以确定所述第一轮廓线与所述第二轮廓线的对应关系,包括:获取第一图像中第一轮廓线之外区域的第三像素的第三约束线,以及对应在第二图像中的第四约束线,以获得第一轮廓线与第三约束线相交得到的所有第一相交线段,以及第二轮廓线与第四约束线相交得到的所有第二相交线段;根据对应关系获取与第三像素所在的第一相交线段相对应的第二相交线段,并获取第二相交线段的端点;对第三像素与除去端点后的相对应的第二相交线段的像素一一求互信息,得出第二图像中与第三像素相对应的第四像素,以获取第二图像中与第一图像中第一轮廓线之外的区域中的像素相对应的像素。In one embodiment, the processor 31 determines pixels in the second contour line corresponding to the first contour line pixels to determine a correspondence between the first contour line and the second contour line. The method includes: acquiring a third constraint line of the third pixel of the area outside the first contour line in the first image, and corresponding to the fourth constraint line in the second image, to obtain the first contour line intersecting the third constraint line Obtaining all the first intersecting line segments, and all the second intersecting line segments obtained by intersecting the second contour line and the fourth constraint line; acquiring a second intersecting line segment corresponding to the first intersecting line segment where the third pixel is located according to the correspondence relationship, and Obtaining an endpoint of the second intersecting line segment; searching for the mutual information of the third pixel and the pixel corresponding to the second intersecting line segment after removing the end point, and obtaining a fourth pixel corresponding to the third pixel in the second image, Pixels in the second image corresponding to pixels in a region other than the first contour line in the first image are acquired.
其中,在一实施方式中,处理器31利用所述对应关系以确定所述第二图像中与所述第一图像中第一轮廓线之外的区域中的像素相对应的像素,包括:利用第一图像中的所有像素以及第二图像中的所有像素,求算第一像素的第一边缘熵、所述交点的第五像素的第一边缘熵以及第一像素与第五像素的第一联合熵;根据第一像素的第一边缘熵、第五像素的第一边缘熵以及第一像素与第五像素的第一联合熵求算第一像素与第五像素的互信息。Wherein, in an embodiment, the processor 31 uses the correspondence to determine pixels in the second image that correspond to pixels in a region other than the first contour in the first image, including: utilizing Calculating a first edge entropy of the first pixel, a first edge entropy of the fifth pixel of the intersection, and a first of the first pixel and the fifth pixel, all pixels in the first image and all pixels in the second image Joint entropy; calculating mutual information of the first pixel and the fifth pixel according to the first edge entropy of the first pixel, the first edge entropy of the fifth pixel, and the first joint entropy of the first pixel and the fifth pixel.
其中,在一实施方式中,处理器31对所述第一像素与所述交点的像素一一求互信息,包括:利用第一图像中的第一轮廓线像素以及第二图像中第二轮廓线像素,求算第一像素的第二边缘熵、所述交点的第六像素的第二边缘熵以及第一像素与第六像素的第二联合熵;根据第一像素的第二边缘熵、第六像素的第二边缘熵以及第一像素与第六像素的第二联合熵求算第一像素与第六像素的互信息。In one embodiment, the processor 31 obtains mutual information for the first pixel and the pixels of the intersection point, including: utilizing a first contour line pixel in the first image and a second contour in the second image a line pixel, calculating a second edge entropy of the first pixel, a second edge entropy of the sixth pixel of the intersection, and a second joint entropy of the first pixel and the sixth pixel; according to the second edge entropy of the first pixel, The second edge entropy of the sixth pixel and the second joint entropy of the first pixel and the sixth pixel calculate mutual information of the first pixel and the sixth pixel.
其中,在一实施方式中,处理器31对所述第一像素与所述交点的像素一一求互信息,包括:分别获得第一图像、第二图像中的第一轮廓线、第二轮廓线 所分别围成区域的像素的各自均值,并将第一轮廓线、第二轮廓线所分别围成的每个区域的所有像素设定为分别具有各自均值的单个像素;利用第一图像中的第一轮廓线像素、所有第一轮廓线所围成的区域的具有各自均值的单个像素、第二图像中第二轮廓线像素、以及所有第二轮廓线所围成的区域的具有各自均值的单个像素,求算第一像素的第三边缘熵、所述交点的第七像素的第三边缘熵以及第一像素与第七像素的第三联合熵;根据第一像素的第三边缘熵、第七像素的第三边缘熵以及第一像素、第七像素的第三联合熵求算第一像素与第七像素的互信息系。In one embodiment, the processor 31 obtains mutual information for the first pixel and the pixels of the intersection point, including: obtaining a first contour, a first contour, and a second contour in the second image, respectively. Line Separating the respective mean values of the pixels of the region, and setting all the pixels of each region surrounded by the first contour line and the second contour line into individual pixels each having a respective mean value; using the first image a first contour line pixel, a single pixel having a respective mean value of a region surrounded by all first contour lines, a second contour line pixel in the second image, and a region surrounded by all the second contour lines having respective mean values a single pixel, calculating a third edge entropy of the first pixel, a third edge entropy of the seventh pixel of the intersection, and a third joint entropy of the first pixel and the seventh pixel; according to the third edge entropy of the first pixel, The third edge entropy of the seventh pixel and the third joint entropy of the first pixel and the seventh pixel calculate a mutual information system of the first pixel and the seventh pixel.
其中,在一实施方式中,处理器31对所述第三像素与除去所述端点后的所述相对应的第二相交线段的像素一一求互信息,包括:利用第一图像中的所有像素以及第二图像中的所有像素,求算第三像素的第四边缘熵、除去所述端点后的所述相对应的第二相交线段的第八像素的第四边缘熵以及第三像素与第八像素的第四联合熵;根据第三像素的第四边缘熵、该的第四边缘熵以及第三像素与该第八像素的第四联合熵求算第三像素与第八像素的互信息。In one embodiment, the processor 31 obtains mutual information for the pixels of the third pixel and the corresponding second intersecting line segment after removing the endpoint, including: utilizing all the first images a pixel and all pixels in the second image, calculating a fourth edge entropy of the third pixel, removing a fourth edge entropy of the eighth pixel of the corresponding second intersecting line segment after the endpoint, and the third pixel and a fourth joint entropy of the eighth pixel; calculating a mutual relationship between the third pixel and the eighth pixel according to the fourth edge entropy of the third pixel, the fourth edge entropy, and the fourth joint entropy of the third pixel and the eighth pixel information.
其中,在一实施方式中,处理器31对所述第三像素与除去所述端点后的所述相对应的第二相交线段的像素一一求互信息,包括:利用第一图像中的第一轮廓线像素以及第二图像中第二轮廓线像素,求算第三像素的第五边缘熵、所述除去所述端点后的所述相对应的第二相交线段的第九像素的第五边缘熵以及第三像素与第九像素的第五联合熵;根据第三像素的第五边缘熵、第九像素的第五边缘熵以及第三像素与第九像素的第五联合熵求算第三像素与第九像素的互信息。In one embodiment, the processor 31 obtains mutual information for the pixels of the third pixel and the corresponding second intersecting line segment after removing the endpoint, including: using the first image a contour line pixel and a second contour line pixel in the second image, calculating a fifth edge entropy of the third pixel, and a fifth of the ninth pixel of the corresponding second intersecting line segment after the end point is removed Edge entropy and fifth joint entropy of the third pixel and the ninth pixel; calculating according to the fifth edge entropy of the third pixel, the fifth edge entropy of the ninth pixel, and the fifth joint entropy of the third pixel and the ninth pixel Mutual information between three pixels and ninth pixels.
其中,在一实施方式中,处理器31对所述第三像素与除去所述端点后的所述相对应的第二相交线段的像素一一求互信息,包括:分别获得第一图像、第二图像中的第一轮廓线、第二轮廓线所分别围成区域的像素的各自均值,并将第一轮廓线、第二轮廓线所分别围成的每个区域的所有像素设定为分别具有各自均值的单个像素;利用第一图像中的第一轮廓线像素、所有第一轮廓线所围成的区域的具有各自均值的单个像素、第二图像中第二轮廓线像素、以及所有第二轮廓线所围成的区域的具有各自均值的单个像素,求算第三像素的第六边缘熵、所述除去所述端点后的所述相对应的第二相交线段的第十像素的第六边缘熵以及第三像素与第十像素的第六联合熵;根据第三像素的第六边缘熵、第十像素的第六边缘熵以及第三像素与第十像素的第六联合熵求算第三像素与第 十像素的互信息。In one embodiment, the processor 31 obtains mutual information for the pixels of the third pixel and the corresponding second intersecting line segment after the endpoint is removed, including: obtaining the first image, respectively The first contour line and the second contour line in the two images respectively represent the respective mean values of the pixels of the region, and all the pixels of each region surrounded by the first contour line and the second contour line are respectively set to respectively a single pixel having a respective mean value; utilizing a first contour line pixel in the first image, a single pixel having a respective mean of the regions enclosed by all of the first contour lines, a second contour line pixel in the second image, and all of a single pixel having a respective mean value of a region enclosed by the two contour lines, calculating a sixth edge entropy of the third pixel, and a tenth pixel of the corresponding second intersecting line segment after the end point is removed Six edge entropy and a sixth joint entropy of the third pixel and the tenth pixel; calculating according to the sixth edge entropy of the third pixel, the sixth edge entropy of the tenth pixel, and the sixth joint entropy of the third pixel and the tenth pixel First The first pixel Ten-pixel mutual information.
其中,请参阅图14,在一实施方式中,终端设备进一步包括:第一摄像头33和第二摄像头34;第一摄像头33、第二摄像头34分别用于获取第一图像、第二图像,并将第一图像、第二图像存储于存储器32中。Referring to FIG. 14 , in an embodiment, the terminal device further includes: a first camera 33 and a second camera 34; the first camera 33 and the second camera 34 are respectively configured to acquire the first image and the second image, and The first image and the second image are stored in the memory 32.
本发明计算机存储介质一实施方式中,该装置存储有程序数据,程序数据能够被执行以实现如本发明图像处理方法实施方式中的方法。In an embodiment of the computer storage medium of the present invention, the apparatus stores program data, and the program data can be executed to implement the method in the image processing method embodiment of the present invention.
其中,上述计算机存储介质具体可以是软盘驱动器、硬盘驱动器、CD-ROM读取器、磁光盘读取器、CPU(针对RAM)等中的至少一种。The computer storage medium may be at least one of a floppy disk drive, a hard disk drive, a CD-ROM reader, a magneto-optical disk reader, a CPU (for RAM), and the like.
其它相关内容的详细说明请参见上述方法部分,在此不再赘述。For details of other related content, please refer to the above method section, which will not be described here.
以上仅为本发明的实施方式,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。 The above is only the embodiment of the present invention, and is not intended to limit the scope of the invention, and the equivalent structure or equivalent process transformation made by the specification and the drawings of the present invention may be directly or indirectly applied to other related technical fields. The same is included in the scope of patent protection of the present invention.

Claims (20)

  1. 一种图像处理方法,其特征在于,包括:An image processing method, comprising:
    获取第一图像、第二图像,其中,所述第一图像与所述第二图像存在对应关系;Obtaining a first image and a second image, wherein the first image has a corresponding relationship with the second image;
    对所述第一图像、所述第二图像分别进行边缘计算,以确定所述第一图像中的第一轮廓线、所述第二图像中的第二轮廓线;Performing edge calculation on the first image and the second image respectively to determine a first contour line in the first image and a second contour line in the second image;
    确定所述第二轮廓线中与所述第一轮廓线中的像素相对应的像素,以确定所述第一轮廓线与所述第二轮廓线的对应关系;Determining pixels of the second contour line corresponding to pixels in the first contour line to determine a correspondence relationship between the first contour line and the second contour line;
    利用所述对应关系以确定所述第二图像中与所述第一图像中第一轮廓线之外的区域中的像素相对应的像素。The correspondence is used to determine pixels in the second image that correspond to pixels in a region other than the first contour in the first image.
  2. 根据权利要求1所述的方法,其特征在于,所述确定所述第二轮廓线中与所述第一轮廓线像素相对应的像素,以确定所述第一轮廓线与所述第二轮廓线的对应关系,包括:The method of claim 1 wherein said determining a pixel of said second contour line corresponding to said first contour line pixel to determine said first contour line and said second contour line Correspondence of lines, including:
    获取所述第一轮廓线的第一像素在所述第一图像中的第一约束线,以及对应在所述第二图像中的第二约束线,并得出所述第二约束线与所述第二轮廓线的交点;Obtaining a first constraint line of the first pixel of the first contour line in the first image, and a second constraint line corresponding to the second image, and obtaining the second constraint line The intersection of the second contour line;
    对所述第一像素与所述交点的像素一一求互信息,在所述第二图像中确定与所述第一像素相对应的所述第二轮廓线中的第二像素,以确定所述第一轮廓线与所述第二轮廓线的对应关系。Mutual information is obtained for the first pixel and the pixel of the intersection point, and a second pixel of the second contour line corresponding to the first pixel is determined in the second image to determine Corresponding relationship between the first contour line and the second contour line.
  3. 根据权利要求1所述的方法,其特征在于,所述利用所述对应关系以确定所述第二图像中与所述第一图像中第一轮廓线之外的区域中的像素相对应的像素,包括:The method according to claim 1, wherein said utilizing said correspondence relationship determines pixels in said second image corresponding to pixels in a region other than said first contour line in said first image ,include:
    获取所述第一图像中所述第一轮廓线之外区域的第三像素的第三约束线,以及对应在所述第二图像中的第四约束线,以获得所述第一轮廓线与所述第三约束线相交得到的所有第一相交线段,以及所述第二轮廓线与所述第四约束线相交得到的所有第二相交线段;Obtaining a third constraint line of the third pixel of the region outside the first contour line in the first image, and a fourth constraint line corresponding to the second image to obtain the first contour line All first intersecting line segments obtained by intersecting the third constraint line, and all second intersecting line segments obtained by intersecting the second contour line with the fourth constraint line;
    根据所述对应关系获取与所述第三像素所在的所述第一相交线段相对应的所述第二相交线段,并获取所述第二相交线段的端点;Acquiring, according to the correspondence, the second intersecting line segment corresponding to the first intersecting line segment where the third pixel is located, and acquiring an end point of the second intersecting line segment;
    对所述第三像素与除去所述端点后的所述相对应的第二相交线段的像素一 一求互信息,得出第二图像中与所述第三像素相对应的第四像素,以获取所述第二图像中与所述第一图像中第一轮廓线之外的区域中的像素相对应的像素。Pixel to the third pixel and the corresponding second intersecting line segment after the end point is removed Obtaining a mutual information, obtaining a fourth pixel corresponding to the third pixel in the second image, to acquire pixels in the second image and a region other than the first contour line in the first image Corresponding pixels.
  4. 根据权利要求2所述的方法,其特征在于,所述对所述第一像素与所述交点的像素一一求互信息,包括:The method according to claim 2, wherein the mutual information of the first pixel and the pixel of the intersection point comprises:
    利用所述第一图像中的所有像素以及所述第二图像中的所有像素,求算所述第一像素的第一边缘熵、所述交点的第五像素的第一边缘熵以及所述第一像素与所述第五像素的第一联合熵;Calculating a first edge entropy of the first pixel, a first edge entropy of a fifth pixel of the intersection, and the first using all pixels in the first image and all pixels in the second image a first joint entropy of a pixel and the fifth pixel;
    根据所述第一像素的第一边缘熵、所述第五像素的第一边缘熵以及所述第一像素与所述第五像素的第一联合熵求算所述第一像素与所述第五像素的互信息。Calculating the first pixel and the first according to a first edge entropy of the first pixel, a first edge entropy of the fifth pixel, and a first joint entropy of the first pixel and the fifth pixel Five-pixel mutual information.
  5. 根据权利要求2所述的方法,其特征在于,所述对所述第一像素与所述交点的像素一一求互信息,包括:The method according to claim 2, wherein the mutual information of the first pixel and the pixel of the intersection point comprises:
    利用所述第一图像中的所述第一轮廓线像素以及所述第二图像中所述第二轮廓线像素,求算所述第一像素的第二边缘熵、所述交点的第六像素的第二边缘熵以及所述第一像素与所述第六像素的第二联合熵;Calculating a second edge entropy of the first pixel and a sixth pixel of the intersection by using the first contour line pixel in the first image and the second contour line pixel in the second image a second edge entropy and a second joint entropy of the first pixel and the sixth pixel;
    根据所述第一像素的第二边缘熵、所述第六像素的第二边缘熵以及所述第一像素与所述第六像素的第二联合熵求算所述第一像素与所述第六像素的互信息。Calculating the first pixel and the first according to a second edge entropy of the first pixel, a second edge entropy of the sixth pixel, and a second joint entropy of the first pixel and the sixth pixel Six-pixel mutual information.
  6. 根据权利要求2所述的方法,其特征在于,所述对所述第一像素与所述交点的像素一一求互信息包括:The method according to claim 2, wherein the mutual information of the pixels of the first pixel and the intersection point comprises:
    分别获得所述第一图像、所述第二图像中的所述第一轮廓线、所述第二轮廓线所分别围成区域的像素的各自均值,并将所述第一轮廓线、所述第二轮廓线所分别围成的每个区域的所有像素设定为分别具有所述各自均值的单个像素;Obtaining, respectively, respective mean values of pixels of the first image, the first contour line, and the second contour line in the second image, and the first contour line, the first contour line All pixels of each region surrounded by the second contour line are set as individual pixels each having the respective mean values;
    利用所述第一图像中的所述第一轮廓线像素、所有所述第一轮廓线所围成的区域的所述具有所述各自均值的单个像素、所述第二图像中所述第二轮廓线像素、以及所有所述第二轮廓线所围成的区域的所述具有所述各自均值的单个像素,求算所述第一像素的第三边缘熵、所述交点的第七像素的第三边缘熵以及所述第一像素与所述第七像素的第三联合熵;Using the first contour line pixel in the first image, the single pixel having the respective mean values of the area enclosed by all the first contour lines, and the second of the second image a single pixel having the respective mean values of the contour pixels and a region surrounded by all of the second contour lines, calculating a third edge entropy of the first pixel, and a seventh pixel of the intersection a third edge entropy and a third joint entropy of the first pixel and the seventh pixel;
    根据所述第一像素的第三边缘熵、所述第七像素的第三边缘熵以及所述第一像素、所述第七像素的第三联合熵求算所述第一像素与所述第七像素的互信 息。Calculating the first pixel and the first according to a third edge entropy of the first pixel, a third edge entropy of the seventh pixel, and a third joint entropy of the first pixel and the seventh pixel Seven-pixel mutual trust interest.
  7. 根据权利要求3所述的方法,其特征在于,所述对所述第三像素与除去所述端点后的所述相对应的第二相交线段的像素一一求互信息,包括:The method according to claim 3, wherein the mutual information is obtained by the pixel of the third pixel and the corresponding second intersecting line segment after the endpoint is removed, including:
    利用所述第一图像中的所有像素以及所述第二图像中的所有像素,求算所述第三像素的第四边缘熵、所述除去所述端点后的所述相对应的第二相交线段的第八像素的第四边缘熵以及所述第三像素与所述第八像素的第四联合熵;Calculating a fourth edge entropy of the third pixel, and a corresponding second intersection after removing the endpoint by using all pixels in the first image and all pixels in the second image a fourth edge entropy of the eighth pixel of the line segment and a fourth joint entropy of the third pixel and the eighth pixel;
    根据所述第三像素的第四边缘熵、所述第八像素的第四边缘熵以及所述第三像素与所述第八像素的第四联合熵,求算所述第三像素与所述第八像素的互信息。Calculating the third pixel and the fourth pixel according to a fourth edge entropy of the third pixel, a fourth edge entropy of the eighth pixel, and a fourth joint entropy of the third pixel and the eighth pixel The mutual information of the eighth pixel.
  8. 根据权利要求3所述的方法,其特征在于,所述对所述第三像素与除去所述端点后的所述相对应的第二相交线段的像素一一求互信息,包括:The method according to claim 3, wherein the mutual information is obtained by the pixel of the third pixel and the corresponding second intersecting line segment after the endpoint is removed, including:
    利用所述第一图像中的所述第一轮廓线像素以及所述第二图像中所述第二轮廓线像素,求算所述第三像素的第五边缘熵、所述除去所述端点后的所述相对应的第二相交线段的第九像素的第五边缘熵以及所述第三像素与所述第九像素的第五联合熵;Calculating a fifth edge entropy of the third pixel by using the first contour line pixel in the first image and the second contour line pixel in the second image, after removing the endpoint a fifth edge entropy of a ninth pixel of the corresponding second intersecting line segment and a fifth joint entropy of the third pixel and the ninth pixel;
    根据所述第三像素的第五边缘熵、所述第九像素的第五边缘熵以及所述第三像素与所述第九像素的第五联合熵求算所述第三像素与所述第九像素的互信息。Calculating the third pixel and the first according to a fifth edge entropy of the third pixel, a fifth edge entropy of the ninth pixel, and a fifth joint entropy of the third pixel and the ninth pixel Nine-pixel mutual information.
  9. 根据权利要求3所述的方法,其特征在于,所述对所述第三像素与除去所述端点后的所述相对应的第二相交线段的像素一一求互信息,包括:The method according to claim 3, wherein the mutual information is obtained by the pixel of the third pixel and the corresponding second intersecting line segment after the endpoint is removed, including:
    分别获得所述第一图像、所述第二图像中的所述第一轮廓线、所述第二轮廓线所分别围成区域的像素的各自均值,并将所述第一轮廓线、所述第二轮廓线所分别围成的每个区域的所有像素设定为分别具有所述各自均值的单个像素;Obtaining, respectively, respective mean values of pixels of the first image, the first contour line, and the second contour line in the second image, and the first contour line, the first contour line All pixels of each region surrounded by the second contour line are set as individual pixels each having the respective mean values;
    利用所述第一图像中的所述第一轮廓线像素、所有所述第一轮廓线所围成的区域的所述具有所述各自均值的单个像素、所述第二图像中所述第二轮廓线像素、以及所有所述第二轮廓线所围成的区域的所述具有所述各自均值的单个像素,求算所述第三像素的第六边缘熵、所述除去所述端点后的所述相对应的第二相交线段的第十像素的第六边缘熵以及所述第三像素与所述第十像素的第六联合熵;Using the first contour line pixel in the first image, the single pixel having the respective mean values of the area enclosed by all the first contour lines, and the second of the second image a single pixel having the respective mean values of the contour pixels and a region surrounded by all of the second contour lines, calculating a sixth edge entropy of the third pixel, the removing the endpoint a sixth edge entropy of the tenth pixel of the corresponding second intersecting line segment and a sixth joint entropy of the third pixel and the tenth pixel;
    根据所述第三像素的第六边缘熵、所述第十像素的第六边缘熵以及所述第 三像素与所述第十像素的第六联合熵求算所述第三像素与所述第十像素的互信息。a sixth edge entropy of the third pixel, a sixth edge entropy of the tenth pixel, and the The sixth joint entropy of the three pixels and the tenth pixel calculates the mutual information of the third pixel and the tenth pixel.
  10. 根据权利要求1至9任一项所述的图像处理方法,其特征在于,所述第一轮廓线是宽度为第一预设值的线,所述第二轮廓线为宽度为第二预设值的线。The image processing method according to any one of claims 1 to 9, wherein the first contour line is a line having a width of a first preset value, and the second contour line is a width of a second preset. The line of values.
  11. 一种终端设备,其特征在于,所述终端设备包括:处理器、存储器,所述存储器中存储中计算机操作指令及数据,所述处理器执行所述计算机操作指令,用于:A terminal device, comprising: a processor, a memory, wherein the memory is stored in a computer operation instruction and data, and the processor executes the computer operation instruction for:
    从存储器中获取第一图像、第二图像,其中,所述第一图像与所述第二图像存在对应关系;Obtaining a first image and a second image from a memory, wherein the first image has a corresponding relationship with the second image;
    对所述第一图像、所述第二图像分别进行边缘计算,以确定所述第一图像中的第一轮廓线、所述第二图像中的第二轮廓线;Performing edge calculation on the first image and the second image respectively to determine a first contour line in the first image and a second contour line in the second image;
    确定所述第二轮廓线中与所述第一轮廓线中的像素相对应的像素,以确定所述第一轮廓线与所述第二轮廓线的对应关系;Determining pixels of the second contour line corresponding to pixels in the first contour line to determine a correspondence relationship between the first contour line and the second contour line;
    利用所述对应关系以确定所述第二图像中与所述第一图像中第一轮廓线之外的区域中的像素相对应的像素。The correspondence is used to determine pixels in the second image that correspond to pixels in a region other than the first contour in the first image.
  12. 根据权利要求11所述的终端设备,其特征在于,所述处理器确定所述第二轮廓线中与所述第一轮廓线像素相对应的像素,以确定所述第一轮廓线与所述第二轮廓线的对应关系,包括:The terminal device according to claim 11, wherein said processor determines pixels of said second contour line corresponding to said first contour line pixels to determine said first contour line and said Correspondence of the second contour line, including:
    获取所述第一轮廓线的第一像素在所述第一图像中的第一约束线,以及对应在所述第二图像中的第二约束线,并得出所述第二约束线与所述第二轮廓线的交点;Obtaining a first constraint line of the first pixel of the first contour line in the first image, and a second constraint line corresponding to the second image, and obtaining the second constraint line The intersection of the second contour line;
    对所述第一像素与所述交点的像素一一求互信息,在所述第二图像中确定与所述第一像素相对应的所述第二轮廓线中的第二像素,以确定所述第一轮廓线与所述第二轮廓线的对应关系。Mutual information is obtained for the first pixel and the pixel of the intersection point, and a second pixel of the second contour line corresponding to the first pixel is determined in the second image to determine Corresponding relationship between the first contour line and the second contour line.
  13. 根据权利要求11所述的终端设备,其特征在于,所述处理器利用所述对应关系以确定所述第二图像中与所述第一图像中第一轮廓线之外的区域中的像素相对应的像素,包括:The terminal device according to claim 11, wherein said processor uses said correspondence relationship to determine pixels in said second image that are outside a first contour line in said first image Corresponding pixels, including:
    获取所述第一图像中所述第一轮廓线之外区域的第三像素的第三约束线,以及对应在所述第二图像中的第四约束线,以获得所述第一轮廓线与所述第三约束线相交得到的所有第一相交线段,以及所述第二轮廓线与所述第四约束线相交得到的所有第二相交线段; Obtaining a third constraint line of the third pixel of the region outside the first contour line in the first image, and a fourth constraint line corresponding to the second image to obtain the first contour line All first intersecting line segments obtained by intersecting the third constraint line, and all second intersecting line segments obtained by intersecting the second contour line with the fourth constraint line;
    根据所述对应关系获取与所述第三像素所在的所述第一相交线段相对应的所述第二相交线段,并获取所述第二相交线段的端点;Acquiring, according to the correspondence, the second intersecting line segment corresponding to the first intersecting line segment where the third pixel is located, and acquiring an end point of the second intersecting line segment;
    对所述第三像素与除去所述端点后的所述相对应的第二相交线段的像素一一求互信息,得出第二图像中与所述第三像素相对应的第四像素,以获取所述第二图像中与所述第一图像中第一轮廓线之外的区域中的像素相对应的像素。Obtaining mutual information for the pixels of the third pixel and the corresponding second intersecting line segment after removing the end point, and obtaining a fourth pixel corresponding to the third pixel in the second image, to Pixels in the second image corresponding to pixels in a region other than the first contour line in the first image are acquired.
  14. 根据权利要求12所述的终端设备,其特征在于,所述处理器对所述第一像素与所述交点的像素一一求互信息,包括:The terminal device according to claim 12, wherein the processor seeks mutual information for the pixels of the first pixel and the intersection point, including:
    利用所述第一图像中的所有像素以及所述第二图像中的所有像素,求算所述第一像素的第一边缘熵、所述交点的第五像素的第一边缘熵以及所述第一像素与所述第五像素的第一联合熵;Calculating a first edge entropy of the first pixel, a first edge entropy of a fifth pixel of the intersection, and the first using all pixels in the first image and all pixels in the second image a first joint entropy of a pixel and the fifth pixel;
    根据所述第一像素的第一边缘熵、所述第五像素的第一边缘熵以及所述第一像素与所述第五像素的第一联合熵求算所述第一像素与所述第五像素的互信息。Calculating the first pixel and the first according to a first edge entropy of the first pixel, a first edge entropy of the fifth pixel, and a first joint entropy of the first pixel and the fifth pixel Five-pixel mutual information.
  15. 根据权利要求12所述的终端设备,其特征在于,所述处理器对所述第一像素与所述交点的像素一一求互信息,包括:The terminal device according to claim 12, wherein the processor seeks mutual information for the pixels of the first pixel and the intersection point, including:
    利用所述第一图像中的所述第一轮廓线像素以及所述第二图像中所述第二轮廓线像素,求算所述第一像素的第二边缘熵、所述交点的第六像素的第二边缘熵以及所述第一像素与所述第六像素的第二联合熵;Calculating a second edge entropy of the first pixel and a sixth pixel of the intersection by using the first contour line pixel in the first image and the second contour line pixel in the second image a second edge entropy and a second joint entropy of the first pixel and the sixth pixel;
    根据所述第一像素的第二边缘熵、所述第六像素的第二边缘熵以及所述第一像素与所述第六像素的第二联合熵求算所述第一像素与所述第六像素的互信息。Calculating the first pixel and the first according to a second edge entropy of the first pixel, a second edge entropy of the sixth pixel, and a second joint entropy of the first pixel and the sixth pixel Six-pixel mutual information.
  16. 根据权利要求12所述的终端设备,其特征在于,所述处理器对所述第一像素与所述交点的像素一一求互信息包括:The terminal device according to claim 12, wherein the determining, by the processor, the mutual information of the first pixel and the pixel of the intersection includes:
    分别获得所述第一图像、所述第二图像中的所述第一轮廓线、所述第二轮廓线所分别围成区域的像素的各自均值,并将所述第一轮廓线、所述第二轮廓线所分别围成的每个区域的所有像素设定为分别具有所述各自均值的单个像素;Obtaining, respectively, respective mean values of pixels of the first image, the first contour line, and the second contour line in the second image, and the first contour line, the first contour line All pixels of each region surrounded by the second contour line are set as individual pixels each having the respective mean values;
    利用所述第一图像中的所述第一轮廓线像素、所有所述第一轮廓线所围成的区域的所述具有所述各自均值的单个像素、所述第二图像中所述第二轮廓线像素、以及所有所述第二轮廓线所围成的区域的所述具有所述各自均值的单个像素,求算所述第一像素的第三边缘熵、所述交点的第七像素的第三边缘熵以 及所述第一像素与所述第七像素的第三联合熵;Using the first contour line pixel in the first image, the single pixel having the respective mean values of the area enclosed by all the first contour lines, and the second of the second image a single pixel having the respective mean values of the contour pixels and a region surrounded by all of the second contour lines, calculating a third edge entropy of the first pixel, and a seventh pixel of the intersection Third edge entropy And a third joint entropy of the first pixel and the seventh pixel;
    根据所述第一像素的第三边缘熵、所述第七像素的第三边缘熵以及所述第一像素、所述第七像素的第三联合熵求算所述第一像素与所述第七像素的互信息。Calculating the first pixel and the first according to a third edge entropy of the first pixel, a third edge entropy of the seventh pixel, and a third joint entropy of the first pixel and the seventh pixel Seven-pixel mutual information.
  17. 根据权利要求13所述的终端设备,其特征在于,所述处理器对所述第三像素与除去所述端点后的所述相对应的第二相交线段的像素一一求互信息,包括:The terminal device according to claim 13, wherein the processor obtains mutual information for the pixels of the third pixel and the corresponding second intersecting line segment after removing the endpoint, including:
    利用所述第一图像中的所有像素以及所述第二图像中的所有像素,求算所述第三像素的第四边缘熵、所述除去所述端点后的所述相对应的第二相交线段的第八像素的第四边缘熵以及所述第三像素与所述第八像素的第四联合熵;Calculating a fourth edge entropy of the third pixel, and a corresponding second intersection after removing the endpoint by using all pixels in the first image and all pixels in the second image a fourth edge entropy of the eighth pixel of the line segment and a fourth joint entropy of the third pixel and the eighth pixel;
    根据所述第三像素的第四边缘熵、所述第八像素的第四边缘熵以及所述第三像素与所述第八像素的第四联合熵求算所述第三像素与所述第八像素的互信息。Calculating the third pixel and the first according to a fourth edge entropy of the third pixel, a fourth edge entropy of the eighth pixel, and a fourth joint entropy of the third pixel and the eighth pixel Eight-pixel mutual information.
  18. 根据权利要求13所述的终端设备,其特征在于,所述处理器对所述第三像素与除去所述端点后的所述相对应的第二相交线段的像素一一求互信息,包括:The terminal device according to claim 13, wherein the processor obtains mutual information for the pixels of the third pixel and the corresponding second intersecting line segment after removing the endpoint, including:
    利用所述第一图像中的所述第一轮廓线像素以及所述第二图像中所述第二轮廓线像素,求算所述第三像素的第五边缘熵、所述除去所述端点后的所述相对应的第二相交线段的第九像素的第五边缘熵以及所述第三像素与所述第九像素的第五联合熵;Calculating a fifth edge entropy of the third pixel by using the first contour line pixel in the first image and the second contour line pixel in the second image, after removing the endpoint a fifth edge entropy of a ninth pixel of the corresponding second intersecting line segment and a fifth joint entropy of the third pixel and the ninth pixel;
    根据所述第三像素的第五边缘熵、所述第九像素的第五边缘熵以及所述第三像素与所述第九像素的第五联合熵求算所述第三像素与所述第九像素的互信息。Calculating the third pixel and the first according to a fifth edge entropy of the third pixel, a fifth edge entropy of the ninth pixel, and a fifth joint entropy of the third pixel and the ninth pixel Nine-pixel mutual information.
  19. 根据权利要求13所述的终端设备,其特征在于,所述处理器对所述第三像素与除去所述端点后的所述相对应的第二相交线段的像素一一求互信息,包括:The terminal device according to claim 13, wherein the processor obtains mutual information for the pixels of the third pixel and the corresponding second intersecting line segment after removing the endpoint, including:
    分别获得所述第一图像、所述第二图像中的所述第一轮廓线、所述第二轮廓线所分别围成区域的像素的各自均值,并将所述第一轮廓线、所述第二轮廓线所分别围成的每个区域的所有像素设定为分别具有所述各自均值的单个像素;Obtaining, respectively, respective mean values of pixels of the first image, the first contour line, and the second contour line in the second image, and the first contour line, the first contour line All pixels of each region surrounded by the second contour line are set as individual pixels each having the respective mean values;
    利用所述第一图像中的所述第一轮廓线像素、所有所述第一轮廓线所围成 的区域的所述具有所述各自均值的单个像素、所述第二图像中所述第二轮廓线像素、以及所有所述第二轮廓线所围成的区域的所述具有所述各自均值的单个像素,求算所述第三像素的第六边缘熵、所述除去所述端点后的所述相对应的第二相交线段的第十像素的第六边缘熵以及所述第三像素与所述第十像素的第六联合熵;Enclosing the first contour line pixel in the first image, all the first contour lines The individual pixels of the region having the respective mean values, the second contour line pixels in the second image, and the regions surrounded by all of the second contour lines having the respective mean values Calculating a sixth edge entropy of the third pixel, a sixth edge entropy of a tenth pixel of the corresponding second intersecting line segment after removing the endpoint, and the third pixel and the a sixth joint entropy of the tenth pixel;
    根据所述第三像素的第六边缘熵、所述第十像素的第六边缘熵以及所述第三像素与所述第十像素的第六联合熵求算所述第三像素与所述第十像素的互信息。Calculating the third pixel and the first according to a sixth edge entropy of the third pixel, a sixth edge entropy of the tenth pixel, and a sixth joint entropy of the third pixel and the tenth pixel Ten-pixel mutual information.
  20. 一种计算机存储介质,其特征在于,所述计算机存储介质中存储有程序数据,所述程序数据能够被执行以实现如权利要求1-10任一项所述的方法。 A computer storage medium, characterized in that program data is stored in the computer storage medium, the program data being executable to implement the method of any of claims 1-10.
PCT/CN2017/086100 2017-05-26 2017-05-26 Image processing method, terminal device and computer storage medium WO2018214151A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2017/086100 WO2018214151A1 (en) 2017-05-26 2017-05-26 Image processing method, terminal device and computer storage medium
CN201780028671.0A CN109478326B (en) 2017-05-26 2017-05-26 Image processing method, terminal equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/086100 WO2018214151A1 (en) 2017-05-26 2017-05-26 Image processing method, terminal device and computer storage medium

Publications (1)

Publication Number Publication Date
WO2018214151A1 true WO2018214151A1 (en) 2018-11-29

Family

ID=64395197

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/086100 WO2018214151A1 (en) 2017-05-26 2017-05-26 Image processing method, terminal device and computer storage medium

Country Status (2)

Country Link
CN (1) CN109478326B (en)
WO (1) WO2018214151A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100166319A1 (en) * 2008-12-26 2010-07-01 Fujifilm Corporation Image processing apparatus, image processing method, and image processing program
CN103761708A (en) * 2013-12-30 2014-04-30 浙江大学 Image restoration method based on contour matching
CN104021568A (en) * 2014-06-25 2014-09-03 山东大学 Automatic registering method of visible lights and infrared images based on polygon approximation of contour
CN105957009A (en) * 2016-05-06 2016-09-21 安徽伟合电子科技有限公司 Image stitching method based on interpolation transition

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040101184A1 (en) * 2002-11-26 2004-05-27 Radhika Sivaramakrishna Automatic contouring of tissues in CT images
JP4490987B2 (en) * 2007-04-26 2010-06-30 株式会社東芝 High resolution device and method
CN101312539B (en) * 2008-07-03 2010-11-10 浙江大学 Hierarchical image depth extracting method for three-dimensional television
JP6015267B2 (en) * 2012-09-13 2016-10-26 オムロン株式会社 Image processing apparatus, image processing program, computer-readable recording medium recording the same, and image processing method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100166319A1 (en) * 2008-12-26 2010-07-01 Fujifilm Corporation Image processing apparatus, image processing method, and image processing program
CN103761708A (en) * 2013-12-30 2014-04-30 浙江大学 Image restoration method based on contour matching
CN104021568A (en) * 2014-06-25 2014-09-03 山东大学 Automatic registering method of visible lights and infrared images based on polygon approximation of contour
CN105957009A (en) * 2016-05-06 2016-09-21 安徽伟合电子科技有限公司 Image stitching method based on interpolation transition

Also Published As

Publication number Publication date
CN109478326B (en) 2021-11-05
CN109478326A (en) 2019-03-15

Similar Documents

Publication Publication Date Title
CN106558080B (en) Monocular camera external parameter online calibration method
KR102647351B1 (en) Modeling method and modeling apparatus using 3d point cloud
US10559090B2 (en) Method and apparatus for calculating dual-camera relative position, and device
Gomez-Ojeda et al. PL-SVO: Semi-direct monocular visual odometry by combining points and line segments
JP7173772B2 (en) Video processing method and apparatus using depth value estimation
CN107077744B (en) Method and system for three-dimensional model generation using edges
US8447099B2 (en) Forming 3D models using two images
US8452081B2 (en) Forming 3D models using multiple images
CN107507277B (en) Three-dimensional point cloud reconstruction method and device, server and readable storage medium
CN106570913B (en) monocular SLAM rapid initialization method based on characteristics
JP2018523881A (en) Method and system for aligning data
US8009899B2 (en) Image filling methods
CN110310331B (en) Pose estimation method based on combination of linear features and point cloud features
JP6662382B2 (en) Information processing apparatus and method, and program
JP6557640B2 (en) Camera calibration apparatus, camera calibration method, and camera calibration program
US11475629B2 (en) Method for 3D reconstruction of an object
WO2019019160A1 (en) Method for acquiring image information, image processing device, and computer storage medium
WO2018214151A1 (en) Image processing method, terminal device and computer storage medium
CN109341530B (en) Object point positioning method and system in binocular stereo vision
CN111210476B (en) Method and device for simultaneously positioning and mapping
JP2017085297A (en) Image processing apparatus, image processing method, and program
Sun et al. NCC feature matching optimized algorithm based on constraint fusion
Du et al. Optimization of stereo vision depth estimation using edge-based disparity map
CN116721109B (en) Half global matching method for binocular vision images
CN110470228B (en) Binocular vision distance measurement method and system by utilizing attitude angle estimation

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: 17910996

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17910996

Country of ref document: EP

Kind code of ref document: A1