Summary of the invention
The side of infrared image object profile is shown in visible images in consideration of it, the object of the present invention is to provide a kind ofMethod and relevant device realize the object profile for showing that infrared image determines in visible images, overcome existing skillDefect existing for art.
To achieve the above object, the invention provides the following technical scheme:
A method of showing infrared image object profile in visible images, comprising:
Obtain the infrared light image and visible images that shoots in synchronization to Same Scene, the infrared light image withEach pixel of visible images corresponds respectively;
First-order Gradient is calculated to each pixel of the infrared light image, according to the single order of each pixel of the infrared light imageGradient calculates as a result, determining the pixel of expression object profile in the infrared light image;
According to the location of pixels for the expression object profile determined, corresponding pixel is dashed forward in the visible imagesIt shows out.
Preferably, the First-order Gradient calculated result according to each pixel of the infrared light image, in the infrared light figureDetermine that the pixel for indicating object profile includes: as in
By the gradient magnitude ratio of other pixels in the gradient magnitude of the pixel of the infrared light image and its default fieldCompared with if the gradient magnitude maximum of the pixel, is determined as doubtful contour pixel for the pixel;
Judgement is confirmed as the gradient magnitude of doubtful contour pixel whether in the first preset range, if so, this is doubtedIt is determined as real contour pixel like contour pixel.
Preferably, the gradient magnitude of the pixel by the infrared light image and other pixels in its default fieldGradient magnitude relatively includes:
Each pixel gradient magnitude of the pixel of the infrared light image is adjacent with the pixel, around the pixelGradient magnitude is respectively compared.
Preferably, first preset range is more than or equal to threshold value;
The method for setting the threshold value includes: successively by the gradient magnitude of the First-order Gradient of each pixel of the infrared light imageIt is cumulative, when accumulated pixel quantity reaches the second preset range, using obtained accumulated value as the threshold value.
Preferably, further includes:
It, will be adjacent with real contour pixel is confirmed as, around the contour pixel in the infrared light imageEach pixel placement is contour pixel.
A kind of device showing infrared image object profile in visible images, comprising:
Module is obtained, for obtaining the infrared light image and visible images that shoot in synchronization to Same Scene;
Determining module calculates First-order Gradient for each pixel to the infrared light image, according to the infrared light figureAs the First-order Gradient calculated result of each pixel, the pixel for indicating object profile is determined in the infrared light image;
Display module, for the location of pixels according to the expression object profile determined, in the visible imagesCorresponding pixel is highlighted.
Preferably, the determining module includes:
Comparing unit, for the gradient magnitude of the pixel of the infrared light image to be preset other pixels in field with itGradient magnitude compare, if the gradient magnitude of the pixel is maximum, which is determined as doubtful contour pixel;
Judging unit, for judge the gradient magnitude for being confirmed as doubtful contour pixel whether in the first preset range,If so, the doubtful contour pixel is determined as real contour pixel.
Preferably, further include expanding module, in the infrared light image, will be confirmed as real wire-frame imageElement it is adjacent, around the contour pixel each pixel placement be contour pixel.
A kind of equipment showing infrared image object profile in visible images, comprising:
Memory, for storing computer program;
Processor is realized when for executing the computer program and shows infrared image in visible images as described aboveThe step of method of object profile.
A kind of computer readable storage medium is stored with computer program on the computer readable storage medium, describedThe side for showing infrared image object profile in visible images as described above is realized when computer program is executed by processorThe step of method.
As shown from the above technical solution, provided by the present invention that infrared image object profile is shown in visible imagesMethod, the infrared light image and visible images that shoot in synchronization to Same Scene are obtained first, then to infrared lightEach pixel of image calculates First-order Gradient, according to the First-order Gradient calculated result of each pixel of infrared light image, in infrared light figureThe pixel of expression object profile is determined as in, the location of pixels for the expression object profile that further basis is determined,Corresponding pixel is highlighted in visible images, shows infrared image object wheel in visible images to realizeIt is wide.
A kind of device showing infrared image object profile in visible images provided in an embodiment of the present invention, canReach above-mentioned beneficial effect.
A kind of equipment showing infrared image object profile in visible images provided in an embodiment of the present invention, canReach above-mentioned beneficial effect.
A kind of computer readable storage medium provided in an embodiment of the present invention, can reach above-mentioned beneficial effect.
Specific embodiment
Technical solution in order to enable those skilled in the art to better understand the present invention, below in conjunction with of the invention realThe attached drawing in example is applied, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described implementationExample is only a part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, this field is commonTechnical staff's every other embodiment obtained without making creative work, all should belong to protection of the present inventionRange.
Referring to FIG. 1, one kind provided in an embodiment of the present invention shows infrared image object profile in visible imagesMethod, comprising the following steps:
S10: the infrared light image and visible images shot in synchronization to Same Scene is obtained.
Infrared light image refers to that imaging sensor capture is recorded the image of formation by the infrared light that object in scene issues,Visible images refer to that imaging sensor capture is recorded the image of formation by the visible light that object in scene issues.
The infrared light image and each pixel of visible images shot in synchronization to Same Scene corresponds respectively, i.e.,The a certain pixel of infrared light image and the respective pixel of visible images correspond to scene same position.
S11: First-order Gradient is calculated to each pixel of the infrared light image, according to each pixel of the infrared light imageFirst-order Gradient calculated result determines the pixel for indicating object profile in the infrared light image.
Object in infrared light image refer to according to the gray scale that infrared light image is shown show it is outstanding, be set to meshTarget object, people or animal.
First-order Gradient is calculated to the pixel of infrared light image and refers to the default neighbour calculated in infrared light image in the pixelAlong the rate of gray level of preset direction in domain.The First-order Gradient of a certain pixel reflects the image grayscale at the pixel in imageSituation of change, be specifically able to reflect out in the default neighborhood of the pixel along preset direction image grayscale increase or reduce andIncrease, reduction amount.
According to the First-order Gradient calculated result of each pixel of infrared light image, can determine to indicate mesh in infrared light imageMark the pixel of object profile.
S12: according to the location of pixels for the expression object profile determined, by corresponding picture in the visible imagesElement highlights.
Infrared light image and each pixel of visible images correspond respectively, according to the table being determined in infrared light imageThe location of pixels for showing object profile highlights corresponding pixel in visible images, thus in visible imagesShow infrared image object profile.
Therefore, the method that the present embodiment shows infrared image object profile in visible images, realizes visibleInfrared image object profile is shown in light image.
Show infrared image object profile in visible images to the present embodiment With reference to embodimentMethod is described in detail.
The method provided in this embodiment that infrared image object profile is shown in visible images, including following stepIt is rapid:
S10: the infrared light image and visible images shot in synchronization to Same Scene is obtained.
The pixel of acquired infrared light image and the respective pixel of visible images correspond to scene same position.HavingWhen body is implemented, for double light picture pick-up devices, the optical axis of two cameras can be adjusted when manufacturing, makes two camerasField angle is consistent, and optical axis is parallel, to guarantee that two cameras are distinguished one by one in each pixel of two images that synchronization is shotIt is corresponding.
Alternatively, can use image processor if the field angle of two cameras is inconsistent and shot to by two camerasImage cropping, a part needed in entire image is selected by cutting, so that obtained portion after cutting to two imagesDivide each pixel that can correspond.When this method is inconsistent suitable for the field angle of two cameras, changing visual field size makesThe two resolution ratio is consistent, corresponds pixel in visual field.
Alternatively, if the field angle of two cameras is identical, but resolution ratio is different, such case can to the image of shooting intoRow zooms in or out, and zooming in or out to image is referred to and zoomed in or out entire image to needs using preset algorithmResolution ratio.It is zoomed in or out by the image shot to two cameras, making that treated, two images resolution ratio is consistent,Each pixel can correspond in image.
It is further to note that in practical applications, can select that above-mentioned each method is used alone according to the actual situationOne of, it either can also arbitrarily select two kinds or three kinds of methods are used in mixed way.
S11: First-order Gradient is calculated to each pixel of the infrared light image, according to each pixel of the infrared light imageFirst-order Gradient calculated result determines the pixel for indicating object profile in the infrared light image.
In the specific implementation, each pixel of image can be traversed using the algorithm for seeking First-order Gradient to image, calculates imageThe First-order Gradient of each pixel.Illustratively, Sobel operator traversal each pixel of image can be used to be calculated, but not limited to this,Other algorithms for seeking gradient of image and gray scale can also be used in other embodiments to be calculated, also all protect model in the present inventionIn enclosing.
Specifically referring to FIG. 2, in this step, according to the First-order Gradient calculated result of each pixel of infrared light image, redDetermined in outer light image indicate object profile pixel method the following steps are included:
S110: by the gradient width of other pixels in the gradient magnitude of the pixel of the infrared light image and its default fieldValue compares, if the gradient magnitude of the pixel is maximum, which is determined as doubtful contour pixel.
The gradient magnitude of image pixel refers to the value for calculating the image pixel gradient vector obtained after First-order Gradient.
By the gradient magnitude of pixel to be judged in infrared light image and the other pixels being somebody's turn to do in pixel default neighborhood to be judgedGradient magnitude be compared, the size of default neighborhood can carry out flexible according to the requirement in practical applications to computational accuracyIt is arranged, in the present embodiment and without limitation.
Illustratively, in a specific embodiment, specially by the gradient magnitude of the pixel of infrared light image withThe gradient magnitude of adjacent, around the pixel each pixel of the pixel is respectively compared.For example, if pixel to be judged is in imagePortion, then the gradient magnitude difference of the 8 pixels gradient magnitude of pixel to be judged is adjacent with the pixel, around the pixelCompare.If pixel to be judged is in image border, the gradient magnitude of pixel to be judged is adjacent with the pixel, around shouldThe gradient magnitude of 5 pixels of pixel is respectively compared.
If the gradient magnitude of pixel to be judged is maximum in the default neighborhood of pixel to be judged, this includes pixel to be judgedGradient magnitude is greater than the gradient magnitude of other all pixels in its neighborhood, further includes the gradient magnitude and its neighborhood of pixel to be judgedThe gradient magnitude of interior some pixels is equal, but still is the maximum value in its neighborhood in each pixel.
S111: judgement is confirmed as the gradient magnitude of doubtful contour pixel whether in the first preset range, if so, willThe doubtful contour pixel is determined as real contour pixel.
In one embodiment, first preset range is more than or equal to threshold value.Set the method packet of the threshold valueIt includes: successively the gradient magnitude of the First-order Gradient of each pixel of the infrared light image adding up, when accumulated pixel quantity reachesWhen to the second preset range, using obtained accumulated value as the threshold value.
Specifically, second preset range is the N more than or equal to infrared light image total pixel number amount and total pixel number amount/ mono- difference, N are the positive integer greater than zero.The resolution ratio of piece image be W × H, i.e., the total pixel number amount of image be W ×H, when accumulated pixel quantity is more than or equal to W × H-W × H/N, the value to add up is set as threshold value.Wherein, NValue can flexible setting, with specific reference to object profile display effect require be configured, N value is bigger, by determiningThe object profile that contour pixel out is sketched the contours of is sharper keen, but N value is excessive, and obtained contour pixel quantity is fewer.ExampleProperty, the value of N can be 128,256,64 or 32, be determined that 128 can according to actual display effect in the present embodimentSo that the profile display effect of object is best, pixel quantity accumulated at this time is about the 99% of total pixel number amount.ThisCalculate using this formula in method and program can be facilitated to calculate, helps to save resources of chip.
For being confirmed as the pixel of doubtful contour pixel, if the gradient magnitude of pixel is more than or equal to the threshold value of setting,The pixel is confirmed as real contour pixel.In this way, being looked for first according to the gradient magnitude of the First-order Gradient of image in this methodDoubtful contour pixel out further filters out real contour pixel using the threshold value of setting, can go the interference on removal of impurities side,Improve accuracy.
It is further preferred that the present embodiment method further includes step S13: in the infrared light image, will be determinedFor real contour pixel it is adjacent, around each pixel placement of the contour pixel be contour pixel.For example, if being determinedReal contour pixel is in inside image, then by it is adjacent with the pixel, around 8 pixels of the pixel be again set at profilePixel will be adjacent with the pixel, 5 around the pixel if the real contour pixel being determined is in image borderPixel is also set to contour pixel.This step expands contour pixel, keeps object profile more obvious.
S12: according to the location of pixels for the expression object profile determined, by corresponding picture in the visible imagesElement highlights.
Infrared light image and each pixel of visible images correspond respectively, according to the table being determined in infrared light imageThe location of pixels for showing object profile highlights corresponding pixel in visible images, to realize in visible lightInfrared image object profile is shown in image.
In the specific implementation, corresponding pixel can be replaced with into high luminance pixels in visible images, so that visibleObject profile is highlighted out in light image.
The method provided in this embodiment that infrared image object profile is shown in visible images is realized infrared lightThe profile of the high fever object of image is display together with visible images, and it is manual with scene to eliminate the needs when identifying objectThe step of switching visible mode and infrared mode.Correspondence shows object profile in visible images, enhances visibleThe target lock-on ability of light image.The advantage of the double light of double light picture pick-up devices is concentrated in one picture in this way and is highlighted, bothEnergy lock onto target, and it is observed that scene detailed information.
Correspondingly, referring to FIG. 3, the embodiment of the present invention also provides one kind shows infrared image target in visible imagesThe device of object profile, comprising:
Module 20 is obtained, for obtaining the infrared light image and visible images that shoot in synchronization to Same Scene,The infrared light image and each pixel of the visible images correspond respectively;
Determining module 21 calculates First-order Gradient for each pixel to the infrared light image, according to the infrared lightThe First-order Gradient calculated result of each pixel of image determines the pixel for indicating object profile in the infrared light image;
Display module 22, for the location of pixels according to the expression object profile determined, in the visible imagesIt is middle to highlight corresponding pixel.
The device provided in this embodiment that infrared image object profile is shown in visible images is obtained same firstThen the infrared light image and visible images that one moment shot Same Scene calculate one to each pixel of infrared light imageLadder degree is determined to indicate object in infrared light image according to the First-order Gradient calculated result of each pixel of infrared light imageThe pixel of profile will be corresponding in visible images further according to the location of pixels for the expression object profile determinedPixel highlights, and infrared image object profile is shown in visible images to realize.
Further specifically, the present embodiment is shown in visible images in the device of infrared image object profile, instituteStating determining module 21 includes:
Comparing unit, for the gradient magnitude of the pixel of the infrared light image to be preset other pixels in field with itGradient magnitude compare, if the gradient magnitude of the pixel is maximum, which is determined as doubtful contour pixel;
Judging unit, for judge the gradient magnitude for being confirmed as doubtful contour pixel whether in the first preset range,If so, the doubtful contour pixel is determined as real contour pixel.
Further, the present embodiment shows the device of infrared image object profile in visible images, further includes opening upOpen up module, in the infrared light image, by it is adjacent with real contour pixel is confirmed as, surround the contour pixelEach pixel placement be contour pixel.
In addition it should be noted that, the present embodiment is shown in visible images in the device of infrared image object profile,Obtaining module, determining module and each module of display module can refer to above with respect to visible the specific processing method of dataThe detailed description that the embodiment of the method for infrared image object profile is shown in light image, repeats no more in this part.
The embodiment of the present invention also provides a kind of equipment that infrared image object profile is shown in visible images, packetIt includes:
Memory, for storing computer program;
Processor is realized when for executing the computer program and shows infrared image in visible images as described aboveThe step of method of object profile.
The equipment provided in this embodiment that infrared image object profile is shown in visible images, can be realized firstThe infrared light image and visible images shot in synchronization to Same Scene is obtained, then to each picture of infrared light imageElement calculates First-order Gradient and determines table in infrared light image according to the First-order Gradient calculated result of each pixel of infrared light imageShow the pixel of object profile, further according to the location of pixels for the expression object profile determined, in visible imagesCorresponding pixel is highlighted, shows infrared image object profile in visible images to realize.
The embodiment of the present invention also provides a kind of computer readable storage medium, stores on the computer readable storage mediumThere is computer program, is realized when the computer program is executed by processor and show infrared figure in visible images as described aboveAs object profile method the step of.
Computer readable storage medium provided in this embodiment, the computer program stored thereon are performed, Neng GoushiThe infrared light image and visible images shot in synchronization to Same Scene is now obtained first, then to infrared light imageEach pixel calculates First-order Gradient, according to the First-order Gradient calculated result of each pixel of infrared light image, in infrared light image reallyThe pixel for indicating object profile is made, further according to the location of pixels for the expression object profile determined, in visible lightCorresponding pixel is highlighted in image, shows infrared image object profile in visible images to realize.
Show the method and correlation of infrared image object profile in visible images to provided by the present invention aboveEquipment is described in detail.It is used herein that a specific example illustrates the principle and implementation of the invention, withThe explanation of upper embodiment is merely used to help understand method and its core concept of the invention.It should be pointed out that being led for this technologyFor the those of ordinary skill in domain, without departing from the principle of the present invention, can also to the present invention carry out it is several improvement andModification, these improvements and modifications also fall within the scope of protection of the claims of the present invention.