Invention content
The purpose of the application is to provide a kind of image processing method, and this method can be realized pair under the premise of control cost
The accurate calibration of blind element;The another object of the application is to provide a kind of image processing apparatus, equipment, readable storage medium storing program for executing and one kind
Infrared imaging device has above-mentioned advantageous effect, and details are not described herein.
In order to solve the above technical problems, the application provides a kind of image processing method, including:
Obtain image one and image two that acquisition time interval is less than time threshold;Wherein, the acquisition of described image one
Time is earlier than described image two;
Calculate the interframe displacement of described image one and described image two;
Judge that the pixel in described image two corresponds to the picture of the pixel in described image one according to the interframe displacement
Whether element value error is more than error threshold;
If so, it is blind element that pixel value error, which is more than the pixel of error threshold, in judgement described image two.
Preferably, whether the pixel value error for judging pixel according to the positional information respectively in two field pictures
More than further including before error threshold:
Medium filtering is carried out to described image one.
Preferably, it calculates described image one and the interframe displacement of described image two includes:
Calculate separately row projection and the row projection of described image one and described image two;
The interframe displacement on line direction and column direction is calculated separately according to row projection and the row projection.
Preferably, the setting method of the error threshold includes:
It obtains and is located at into the pixel in the first range of pixel of row pixel value error judgment respectively in two field pictures
Pixel value error;
According to the pixel value error calculation error threshold of the neighborhood.
Preferably, the acquisition time interval that obtains includes less than the image one and image two of time threshold:
Obtain image one and image two adjacent in continuous acquisition image process;Wherein, the time interval of acquisition is less than
The time threshold.
Preferably, described image processing method further includes:
The pixel value of pixel in the second range of the blind element is weighted averagely, it is average to obtain pixel
Value;
The pixel average is assigned to the blind element.
The application discloses a kind of image processing apparatus, is applied to infrared imaging device, including:
Acquiring unit is less than the image one and image two of time threshold for obtaining acquisition time interval;Wherein, described
The acquisition time of image one is earlier than described image two;
Computing unit, the interframe displacement for calculating described image one and described image two;
Judging unit, for judging that the pixel in described image two is corresponded in described image one according to the interframe displacement
Whether the pixel value error of middle pixel is more than error threshold;
Judging unit judges pixel in described image two if being more than the error threshold for the pixel value error
It is blind element to be worth error and be more than the pixel of error threshold.
The application discloses a kind of image processing equipment, including:
Memory, for storing program;
Processor, when for executing described program the step of realization described image processing method.
The application discloses a kind of readable storage medium storing program for executing, has program stored therein on the readable storage medium storing program for executing, and described program is located
Manage the step of realizing described image processing method when device executes.
The application discloses a kind of infrared imaging device, including described image processing equipment.
Image processing method provided herein differs extremely short infrared image by obtaining acquisition time interval:Image
One and image two, since the temperature information of image will not mutate within the extremely short time, respective pixel in front and back two frame
The value of point will not mutate, and the pixel that same scene is obtained according to the interframe displacement being calculated is corresponded in two width frames respectively
Position in image, so as to compare two field pictures pixel point value situation of change, when the pixel value of pixel in image
When variable quantity in very short time is more than error threshold, illustrate that the pixel is blind element.Image processing method provided by the present application
Method does not need blackbody demarcation in carrying out blind element detection process, and cost of implementation is low, can be completed merely with two inter frame image information
The judgement of blind element, not only accuracy rate is high, but also method is simple and practicable, can be widely used in the actual use scene of infrared system
In.
Calculating interframe displacement being disclosed in one embodiment of the application, ranks projecting method may be used, the application is creative
Ground proposes to calculate interframe displacement using ranks projecting method, and the displacement information of this front and back frame is applied to blind element detection process
In, calculating error is small, and precision is high, and calculating process is simple, can reduce the cost of blind element processing, improves blind element detection efficiency.
Being disclosed in another embodiment of the application can also judge pixel respectively two according to the positional information
Before whether the pixel value error in frame image is more than error threshold, medium filtering is carried out to image one, can be filtered out in image one
Lofty point, lofty pair graph in image one can be effectively prevent to generate interference as two blind element judgement.
Being also disclosed in another embodiment of the application can also be according to the pixel being located at into row pixel value error judgment
The pixel value error of pixel in first range sets error threshold, using in the image of Same Scene same time as joining
According to it is possible to prevente effectively from the interference that scene information judges blind element.
It is also disclosed after detecting blind element in another embodiment of the application, it can be to the second model positioned at the blind element
The pixel value of pixel in enclosing is weighted averagely, obtains pixel average;And pixel average is assigned to blind element, pass through
Assignment is carried out to blind element therein using pixel value in neighborhood in the Same Scene same time, the standard to blind element in real time can be completed
It really replaces, improves the quality of infrared imaging.
Disclosed herein as well is a kind of image processing apparatus, equipment, readable storage medium storing program for executing and infrared imaging devices, have
Above-mentioned advantageous effect, details are not described herein.
Specific implementation mode
The core of the application is to provide a kind of image processing method, and this method can be realized pair under the premise of control cost
The accurate calibration of blind element;Another core of the application is to provide a kind of image processing apparatus, equipment, readable storage medium storing program for executing and one
Kind infrared imaging device, has above-mentioned advantageous effect.
To keep the purpose, technical scheme and advantage of the embodiment of the present application clearer, below in conjunction with the embodiment of the present application
In attached drawing, technical solutions in the embodiments of the present application is clearly and completely described, it is clear that described embodiment is
Some embodiments of the present application, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art
The every other embodiment obtained without making creative work, shall fall in the protection scope of this application.
Referring to FIG. 1, Fig. 1 is the flow chart of image processing method provided by the embodiments of the present application;This method may include:
Step s100, image one and image two that acquisition time interval is less than time threshold are obtained;Wherein, image one
Acquisition time is earlier than image two.
It needs to carry out analysis calculating using two field pictures in the application, after a frame image can be acquired, be read from frame buffer
The image of caching is taken, when the time interval of the picture frame that need to ensure the caching read and the picture frame currently acquired is less than preset
Between threshold value, to ensure that current image frame and the value of corresponding pixel points in cache image frame will not mutate.When no caching
When picture frame or the time interval of cache image frame and current image frame are more than time threshold, a frame image can acquired
Interval is less than in time threshold afterwards acquires a frame image again.
Time interval to ensure the image one of acquisition and the image two of acquisition is short as possible, to ensure to correspond in two field pictures
The variation of pixel is small as possible, to ensure judgement precision, it is preferable that can obtain figure adjacent in continuous acquisition image process
As one and image two, the time interval of gatherer process need to ensure to be less than time threshold.
Specific range of setting of time threshold is not limited at this, the shorter computational accuracy of time interval of two field pictures is more
It is high.
The image two of acquisition time rearward is denoted as Pnow, the forward image one of acquisition time is denoted as Pformer, when whole fortune
It, can be by P after the completion of calculationnowIt is put into caching, becomes new Pformer。
Step s101, the interframe displacement of image one and image two is calculated.
Method for calculating two field pictures interframe displacement is not limited at this, for example can be asked by Fourier transformation mode
, specially:Fourier transformation is carried out to two field pictures, then seeks the crosspower spectrum of two field pictures, it is anti-then to carry out Fourier
Transformation, finds the maximum of points after inverse transformation, and coordinate is the displacement of front and back frame.In addition, interframe displacement can also pass through
Gyroscope, accelerometer progress auxiliary judgment is added, passes through displacement between the common judgment frame of displacement information and algorithm of gyroscope.
Wherein it is preferred to calculate error to be reduced under the premise of not increasing other ancillary equipments as possible, it is multiple to reduce calculating
Polygamy, calculates image one and the method for the interframe displacement of image two is specifically as follows:
Step 1:Calculate separately row projection and the row projection of image one and image two;
Step 2:The interframe displacement on line direction and column direction is calculated separately according to row projection and row projection.
Wherein, row projection is the weighted sum of the row, and row projection is the weighted sum of the row, and wherein weight can be according to reality
Border situation is configured, and sets weight here as 1.
It is projected on line direction:
In formula, Width is detector array width.
Similarly, row projection can be calculated, is projected on column direction:
In formula, Height is detector array height.
Correlation is calculated, that is, finds out front and back two frame and is expert at the maximum correspondence of similarity on column direction.
Row correlation calculations:
Wherein m=0,1,2 ..., 2*MaxCol-1, MaxCol are the maximum displacement on picture frame row, can voluntarily be set
It is fixed, it generally can be set as the 10% of picture frame columns.
The calculating of row correlation:
Wherein n=0,1,2 ..., 2*MaxRow-1, MaxRow are the maximum displacement on image frame lines, with above-mentioned row maximum
Displacement is similar, can be with sets itself, for example can be set as the 10% of picture frame line number.
After the completion of row correlation calculations, the array of a correlation can be obtained, wherein minimum point is two field pictures
Displacement in a column direction.Likewise, can be in the hope of the displacement on line direction.
The application creatively proposes to calculate interframe displacement using ranks projecting method, and the displacement of this front and back frame is believed
Breath applies in blind element detection process, and calculating error is small, and precision is high, and calculating process is simple, can reduce the cost of blind element processing,
Improve blind element detection efficiency.
Step s102, judge that the pixel in image two corresponds to the pixel value of the pixel in image one according to interframe displacement
Whether error is more than error threshold.
According to obtained interframe displacement, pixel of the pixel (x, y) in image one in image two can be calculated and sat
It is designated as (x', y'), calculating pixel value error can allow image one and the pixel value of corresponding points in image two to subtract each other, and can also allow figure
As one is divided by with the pixel values of corresponding points in image two, error calculation method is not limited at this.Pixel value mistake is calculated
It is compared with preset error threshold after difference, if the pixel value error of certain point is more than error threshold, it may be said that the bright picture
Vegetarian refreshments may be blind spot;If the pixel value error of certain point is less than error threshold, it can be said that the bright pixel is normal display
Pixel, at this to pixel value error be less than error threshold the case where do not limit, can not make to locate as shown in step s104
Reason can also carry out further accurate judgement etc..
Wherein, the setting of the concrete numerical value of error threshold is not limited, the same time under similar scene can be counted
Pixel value error in interval is used as error threshold after being averaged;In the image one and image two that are obtained also according to statistics
Pixel value error carry out error threshold setting, it is preferable that the setting method of error threshold is specifically as follows:
Step 1:It obtains and is located at into the pixel in the first range of pixel of row pixel value error judgment respectively in two frames
Pixel value error in image;
Step 2:According to the pixel value error calculation error threshold of neighborhood.
Wherein, the specific dividing mode of the first range does not limit, for example the pixel to be judged can voluntarily be arranged
Centered on point, 5 pixels are the neighborhood of radius as the first range.According to positioned at the pixel into row pixel value error judgment
The pixel value error of pixel in first range sets error threshold, using in the image of Same Scene same time as joining
According to it is possible to prevente effectively from the interference that scene information judges blind element.
Specifically, by comparing the pixel value of pixel and surrounding neighbors pixel, the process of blind element judgement is carried out
It can be as follows:
Judge Pnow(x,y)-Pformer_m(x', y') > k*Aver (Pnow_neighbor-Pformer_m_neighbor)
In formula, Aver (Pnow_neighbor-Pformer_m_neighbor) it can indicate point in the neighborhoods of the surrounding 5*5 centered on (x, y)
The mean value of difference, k are coefficient, can generally take 3.
If the pixel value error that pixel step s103, in image two corresponds to the pixel in image one is more than error
Threshold value judges that the pixel that pixel value error is more than error threshold in image two is blind element.
To detecting that the processing mode after blind element does not limit, such as blind element quantity, distribution in needing to infrared image
Situations such as carry out theory analysis when, can only the data of needs are counted;When in actual application, for example it is applied to
During infrared movement and infrared complete machine field progress infrared image are shown, then need to carry out blind element recovery to the blind element detected
Process, to ensure the infrared image of high quality.
Image processing method provided herein differs extremely short infrared image by obtaining acquisition time interval:Image
One and image two, since the temperature information of image will not mutate within the extremely short time, respective pixel in front and back two frame
The value of point will not mutate, and the pixel that same scene is obtained according to the interframe displacement being calculated is corresponded in two width frames respectively
Position in image, so as to compare two field pictures pixel point value situation of change, when the pixel value of pixel in image
When variable quantity in very short time is more than error threshold, illustrate that the pixel is blind element.In carrying out blind element detection process not
Blackbody demarcation is needed, cost of implementation is low, and the judgement of blind element can be completed merely with two inter frame image information, and not only accuracy rate is high,
And method is simple and practicable, can be widely used in the actual use scene of infrared system.
Preferably, it is based on above-described embodiment, pixel of the pixel respectively in two field pictures is being judged according to location information
Value error whether be more than error threshold before can further include:Medium filtering is carried out to image one.Judging picture according to location information
Vegetarian refreshments carries out medium filtering before whether the pixel value error in two field pictures is more than error threshold respectively to image one, can be with
The lofty point in image one is filtered out, lofty pair graph in image one can be effectively prevent to generate interference as two blind element judgement.
Preferably, to ensure the output quality of infrared image, image processing method provided by the present application can further include blind
The replacement process of member, is specifically as follows:
Step 1:The pixel value of pixel in the second range of blind element is weighted averagely, it is average to obtain pixel
Value;
Step 2:Pixel average is assigned to blind element.
Fig. 2 show image schematic diagram before replacement, and Fig. 3 show effect diagram after progress blind element replacement.Pass through contraposition
It is weighted averagely in the pixel value of the pixel in the second range of blind element, obtains pixel average;And pixel average is assigned
It is worth to blind element, carrying out assignment to blind element therein by using pixel value in neighborhood in the Same Scene same time can be completed reality
When accurate replacement to blind element, improve the quality of infrared imaging.Wherein, above-mentioned second range refers in preset second image
Region, the second range delimit can according to the similarity with blind element point scene, voluntarily choose in image two with blind element field of points
The higher region of scape similarity so that the pixel value of pixel and blind element point in the second range is more closely, in order to pixel
The replacement of value.The setting of specific range does not limit herein, for example can choose in image two using blind element point as the center of circle arbitrary half
As the second range, the second range can also be identical as the first range above for the blind element peripheral region of diameter.
Understanding for intensification to image processing method provided by the present application, at this to image processing method provided by the present application
Completely illustrated.
Specifically, referring to FIG. 4, the stream for another image processing method that Fig. 4 is provided by the application specific implementation mode
Cheng Tu, including:
Step s200, a frame image data is acquired.
Step s201, the previous frame image of caching is read from frame buffer.
Step s202, the ranks projection of two field pictures is calculated.
Step s203, it is projected according to ranks and calculates correlation.
It calculates correlation and finds out front and back two frame and be expert at the maximum correspondence of similarity on column direction, ranks correlation meter
After the completion of calculation, the array of a correlation can be obtained.
Step s204, according to the interframe displacement on correlation calculations ranks direction.
Minimum point is the displacement between front and back two frames in a column direction in row correlation array.Likewise, can be in the hope of
Obtain the displacement on line direction.
Step s205, medium filtering is carried out to the previous frame image of caching.
Step s206, blind element is determined whether according to filtered previous frame image and the present image collected.
The interframe displacement being calculated according to step s204 can calculate in this frame pixel after the filtering in former frame
Pixel point coordinates, the pixel value of front and back two frames corresponding points subtracts each other, poor by comparing central point difference and surrounding neighbors pixel
Value, you can carry out blind element judgement.
If it is determined that step s207, blind element, then blind element replacement is carried out.
After blind element detects, the value of blind element surrounding neighbors point is weighted averagely, blind element point is then assigned to.
If it is determined that not being step s208, blind element, then any processing wouldn't be carried out.
Referring to FIG. 5, the structure diagram for the image processing apparatus that Fig. 5 is provided by the application specific implementation mode, the dress
Set including:
Acquiring unit 300 is less than the image one and image two of time threshold for obtaining acquisition time interval;Wherein,
The acquisition time of image one is earlier than image two;
Computing unit 301, the interframe displacement for calculating image one and image two;
Judging unit 302, for judging that the pixel in image two corresponds to the pixel in image one according to interframe displacement
Pixel value error whether be more than error threshold;
Judging unit 303 judges that pixel value error is more than in image two if being more than error threshold for pixel value error
The pixel of error threshold is blind element.
Image processing apparatus provided by the present application can realize the accurate calibration to blind element under the premise of control cost.
Wherein, acquiring unit 300 can be further used for:Obtain in continuous acquisition image process adjacent image one and
Image two;Wherein, the time interval of acquisition is less than time threshold.
Wherein, computing unit 301 may further include:
Ranks project computation subunit, the row projection for calculating separately image one and image two and row projection;
Interframe displacement computation subunit calculates separately line direction and column direction for projection to be projected and arranged according to row
Interframe displacement.
Wherein, image processing apparatus provided by the present application can further include:Median filter unit 304, for according to position
Before confidence breath judges whether pixel value error of the pixel respectively in two field pictures is more than error threshold, in being carried out to image one
Value filtering.Median filter unit 304 is connect with computing unit 301 and judging unit 302 respectively, as shown in Figure 6.
Wherein, image processing apparatus provided by the present application can further include:Blind element replacement unit 305, for blind to being located at
The pixel value of pixel in first second range is weighted averagely, obtains pixel average;Pixel average is assigned to blind
Member.Blind element replacement unit 305 is connect with judging unit 303, as shown in Figure 7.
It should be noted that each unit in image processing apparatus in the application specific implementation mode, worked
Journey please refers to the corresponding specific implementation mode of image processing method, and details are not described herein.
Image processing equipment provided by the present application is introduced below, specifically the introduction of image processing equipment can refer to
The step of above-mentioned image processing method, Fig. 8 are the structure diagram of image processing equipment provided by the embodiments of the present application;The equipment can
To include:
Memory 700, for storing program;
Processor 800, when for executing program the step of realization image processing method.
Referring to FIG. 9, the structural schematic diagram of image processing equipment provided by the embodiments of the present application, which can be because matching
It sets or performance is different and generate bigger difference, may include one or more processors (central
Processing units, CPU) 322 (for example, one or more processors) and memory 332, one or more
Store the storage medium 330 (such as one or more mass memory units) of application program 342 or data 344.Wherein, it deposits
Reservoir 332 and storage medium 330 can be of short duration storage or persistent storage.The program for being stored in storage medium 330 may include
One or more modules (diagram does not mark), each module may include to the series of instructions behaviour in data processing equipment
Make.Further, central processing unit 322 could be provided as communicating with storage medium 330, executes and deposits in processing system 301
Series of instructions operation in storage media 330.
Processing system 301 can also include one or more power supplys 326, one or more wired or wireless nets
Network interface 350, one or more input/output interfaces 358, and/or, one or more operating systems 341, such as
Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM etc..
Step in image processing method described in above figure 1 can be realized by the structure of image processing equipment.
Image processing equipment provided by the present application can be demarcated without the help of equipment such as black matrixes into blind element, in actual use
The detection and replacement for carrying out blind element in scene in real time, avoid infrared system returns factory's re-calibration, and can be to avoid complexity
The interference of scene, accuracy rate is high, and at low cost, use scope is wide.
Readable storage medium storing program for executing provided by the embodiments of the present application is introduced below, readable storage medium storing program for executing described below with
Above-described image processing method can correspond reference.
A kind of readable storage medium storing program for executing disclosed in the present application, is stored thereon with program, realization figure when program is executed by processor
As the step of processing method.
A kind of infrared imaging device, including image processing equipment is also disclosed in the application, and wherein image processing equipment can refer to
Above-mentioned introduction, details are not described herein.
It is apparent to those skilled in the art that for convenience and simplicity of description, the device of foregoing description,
The specific work process of equipment, storage medium and unit, can refer to corresponding processes in the foregoing method embodiment, herein no longer
It repeats.
In several embodiments provided herein, it should be understood that disclosed device, equipment, storage medium and
Method may be implemented in other ways.For example, apparatus embodiments described above are merely indicative, for example, single
Member division, only a kind of division of logic function, formula that in actual implementation, there may be another division manner, such as multiple units or
Component can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point is shown
The mutual coupling, direct-coupling or communication connection shown or discussed can be by some interfaces, between device or unit
Coupling or communication connection are connect, can be electrical, machinery or other forms.
The unit illustrated as separating component may or may not be physically separated, and be shown as unit
Component may or may not be physical unit, you can be located at a place, or may be distributed over multiple networks
On unit.Some or all of unit therein can be selected according to the actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the application can be integrated in a processing unit, it can also
It is that each unit physically exists alone, it can also be during two or more units be integrated in one unit.Above-mentioned integrated list
The form that hardware had both may be used in member is realized, can also be realized in the form of SFU software functional unit.
It, can if integrated unit is realized in the form of SFU software functional unit and when sold or used as an independent product
To store in a terminal.Based on this understanding, the technical solution of the application substantially in other words makes the prior art
The all or part of the part of contribution or the technical solution can be expressed in the form of software products, which is stored in
In one storage medium, including some instructions are used so that a station terminal (can be mobile phone or tablet computer etc.) executes sheet
Apply for all or part of step of each embodiment method.And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only storage
Device (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disc or light
The various media that can store program code such as disk.
Each embodiment is described by the way of progressive in specification, the highlights of each of the examples are with other realities
Apply the difference of example, just to refer each other for identical similar portion between each embodiment.For device disclosed in embodiment
Speech, since it is corresponded to the methods disclosed in the examples, so description is fairly simple, related place is referring to method part illustration
.
Professional further appreciates that, unit described in conjunction with the examples disclosed in the embodiments of the present disclosure
And algorithm steps, it can be realized with the combination of electronic hardware, terminal or the two, in order to clearly demonstrate hardware and software
Interchangeability generally describes each exemplary composition and step according to function in the above description.These functions are studied carefully
Unexpectedly it is implemented in hardware or software, depends on the specific application and design constraint of technical solution.Professional technique people
Member can use different methods to achieve the described function each specific application, but this realization is it is not considered that super
Go out scope of the present application.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can directly be held with hardware, processor
The combination of capable software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only deposit
Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology
In any other form of storage medium well known in field.
Above to image processing method provided herein, device, equipment, readable storage medium storing program for executing and a kind of infrared imaging
Device is described in detail.Specific examples are used herein to illustrate the principle and implementation manner of the present application, with
The explanation of upper embodiment is merely used to help understand the present processes and its core concept.It should be pointed out that being led for this technology
For the those of ordinary skill in domain, under the premise of not departing from the application principle, can also to the application carry out it is several improvement and
Modification, these improvement and modification are also fallen into the application scope of the claims.