CN110213457A - A kind of image transfer method and device - Google Patents

A kind of image transfer method and device Download PDF

Info

Publication number
CN110213457A
CN110213457A CN201910483949.4A CN201910483949A CN110213457A CN 110213457 A CN110213457 A CN 110213457A CN 201910483949 A CN201910483949 A CN 201910483949A CN 110213457 A CN110213457 A CN 110213457A
Authority
CN
China
Prior art keywords
image
character string
value
difference
pixel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910483949.4A
Other languages
Chinese (zh)
Other versions
CN110213457B (en
Inventor
张会杰
胡仁伟
陈效友
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Knownsec Information Technology Co Ltd
Original Assignee
Beijing Knownsec Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Knownsec Information Technology Co Ltd filed Critical Beijing Knownsec Information Technology Co Ltd
Priority to CN201910483949.4A priority Critical patent/CN110213457B/en
Publication of CN110213457A publication Critical patent/CN110213457A/en
Application granted granted Critical
Publication of CN110213457B publication Critical patent/CN110213457B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4007Scaling of whole images or parts thereof, e.g. expanding or contracting based on interpolation, e.g. bilinear interpolation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/32Circuits or arrangements for control or supervision between transmitter and receiver or between image input and image output device, e.g. between a still-image camera and its memory or between a still-image camera and a printer device

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Studio Devices (AREA)

Abstract

The application provides a kind of image transfer method and device, and this method is for improving existing image transmitting mechanism, this method comprises: calculating the character string of the first image of acquisition, obtains the first character string;The difference for comparing the first character string Yu multiple second character strings obtains multiple difference values, and multiple second character strings are the character string for calculating multiple second images and obtaining, and multiple second images are the multiple images acquired before the acquisition time of the first image;If multiple difference values are respectively less than preset threshold, and the difference of the transmission time of the acquisition time of the first image and the last image is greater than or equal to preset time period, then by the first image transmitting to server.During above-mentioned realization, determine to change image transmitting by two dimensions of the difference value and time between picture, the case where effectively long-term image is not sent.

Description

A kind of image transfer method and device
Technical field
This application involves the technical fields of image analysis, in particular to a kind of image transfer method and device.
Background technique
Currently, the image of fixed thermal infrared imager acquisition needs returned data center to process, traditional method is, Gu Fixed pattern thermal infrared imager acquires in real time and stores image, then compares to the adjacent two field pictures in storage, if adjacent two The difference value of frame image is greater than threshold value, then transmits the image acquired in real time;Conversely, if the difference value of adjacent two field pictures No more than threshold value, then the image acquired in real time is not transmitted.
Summary of the invention
The embodiment of the present application is designed to provide a kind of image transfer method and device, passes for improving existing image Defeated mechanism.
The embodiment of the present application provides a kind of image transfer method, comprising: the character string for calculating the first image of acquisition obtains Obtain the first character string;The difference for comparing first character string Yu the multiple second character string obtains multiple difference values, described Multiple second character strings are the character string for calculating multiple second images and obtaining, and the multiple second image is in the first image Acquisition time before acquire multiple images;If the multiple difference value is respectively less than preset threshold, and the first image The difference of the transmission time of acquisition time and the last image is greater than or equal to preset time period, then passes the first image Transport to server.During above-mentioned realization, determine to change plan by two dimensions of the difference value and time between picture As transmission, the case where long-term image is not sent is efficiently avoided.
Optionally, in the embodiment of the present application, in first character string and the multiple second character string Difference, after obtaining multiple difference values, further includes: if the multiple difference value is respectively less than preset threshold, and first figure The difference of the transmission time of the acquisition time of picture and the last image is less than preset time period, then stops the first image Transmission.During above-mentioned realization, stop the transmission of image by two dimensions of the difference value and time between picture, To prevent unnecessary image transmitting, network bandwidth is wasted during effectively improving thermal infrared imager transmission image The problem of resource.
Optionally, in the embodiment of the present application, in first character string and the multiple second character string Difference, after obtaining multiple difference values, further includes: if any difference value in the multiple difference value be greater than or equal to it is described The first image is then transmitted to server by preset threshold.During above-mentioned realization, pass through the difference value between picture It determines to change image transmitting, ensure that the efficiency that discrepant image just transmits.
Optionally, in the embodiment of the present application, the character string of first image for calculating acquisition, comprising: by described the One image zooms in and out and gray proces, obtains the first grayscale image, first grayscale image includes the corresponding ash of multiple pixels Angle value;The average value of the corresponding gray value of the multiple pixel is calculated, the first average value is obtained;By first average value with The corresponding gray value of each pixel in the multiple pixel compares, and obtains character string.During above-mentioned realization, lead to The character string for calculating picture is crossed, which is used to obtain the difference value of picture, effectively improves and picture is compared and is obtained The efficiency for obtaining difference value, to ensure that the efficiency that discrepant image just transmits.
Optionally, in the embodiment of the present application, described to zoom in and out the first image and gray proces, obtain first Grayscale image, comprising: the first image is zoomed in and out to pre-set dimension, the second image is obtained;Using maximum value process or averagely Second image is carried out gray proces by value method, obtains the first grayscale image.During above-mentioned realization, carried out by picture Scaling and gray proces, effectively improve the treatment effeciency to picture, to ensure that the effect that discrepant image just transmits Rate.
Optionally, in the embodiment of the present application, the average value for calculating the corresponding gray value of the multiple pixel, is obtained Obtain the first average value, comprising: according toThe average value of the corresponding gray value of the multiple pixel is calculated, is obtained First average value;Wherein,For first average value, i is the ith pixel point in the multiple pixel, xiIt is described more The corresponding gray value of ith pixel point in a pixel, n are the number of the multiple pixel.In above-mentioned realization process In, gray proces are carried out by picture, effectively improve the treatment effeciency to picture, to ensure that discrepant image The efficiency of transmission.
Optionally, in the embodiment of the present application, described by each of first average value and the multiple pixel The corresponding gray value of pixel compares, and obtains character string, comprising: if first average value is less than or equal to the multiple pixel The corresponding gray value of each pixel in point, then be denoted as one for comparison result;If first average value is greater than the multiple The corresponding gray value of each pixel in pixel, then be denoted as zero for the comparison result;The comparison result is successively connected The character string obtained is determined as character string.During above-mentioned realization, by calculating the character string of picture, by the character string For obtaining the difference value of picture, the efficiency for comparing picture and obtaining difference value is effectively improved, to ensure that difference The efficiency that different image just transmits.
Optionally, in the embodiment of the present application, first character string and the multiple second character string Difference obtains multiple difference values, comprising: by the second character string of each of the multiple second character string and first character String does XOR operation, obtains multiple third character strings;By the numerical value in third character string each in the multiple third character string It is cumulative, obtain multiple difference values.During above-mentioned realization, by calculating the character string of picture, which is used to obtain The difference value for obtaining picture, effectively improves the efficiency for comparing picture and obtaining difference value, to ensure that discrepant figure As the efficiency of just transmission.
The embodiment of the present application also provides a kind of image transmissions, comprising: first obtains module, for calculating acquisition The character string of first image obtains the first character string;First comparison module is used for first character string and multiple second The difference of character string obtains multiple difference values, and the multiple second character string is the character string for calculating multiple second images and obtaining, The multiple second image is the multiple images acquired before the acquisition time of the first image;First transmission module is used If being respectively less than preset threshold, and the transmission of the acquisition time of the first image and the last image in the multiple difference value The difference of time is greater than or equal to preset time period, then the first image is transmitted to server.
Optionally, in the embodiment of the present application, further includes: first stops module, if small for the multiple difference value It is less than preset time in the difference of preset threshold, and the transmission time of the acquisition time of the first image and the last image Section, then stop the transmission of the first image.
Optionally, in the embodiment of the present application, further includes: the second transmission module, if in the multiple difference value Any difference value is greater than or equal to the preset threshold, then the first image is transmitted to server.
Optionally, in the embodiment of the present application, the first acquisition module includes: the second acquisition module, and being used for will be described First image zooms in and out and gray proces, obtains the first grayscale image, first grayscale image includes that multiple pixels are corresponding Gray value;Third obtains module, and for calculating the average value of the corresponding gray value of the multiple pixel, it is average to obtain first Value;4th obtains module, for by first average value gray scale corresponding with each pixel in the multiple pixel Value compares, and obtains character string.
Optionally, in the embodiment of the present application, the second acquisition module includes: image scaling module, and being used for will be described First image is zoomed in and out to pre-set dimension, obtains the second image;Gradation processing module, for using maximum value process or average value Second image is carried out gray proces by method, obtains the first grayscale image.
Optionally, in the embodiment of the present application, it includes: that average value obtains module that the third, which obtains module, is used for basisThe average value of the corresponding gray value of the multiple pixel is calculated, the first average value is obtained;Wherein,It is described First average value, i are the ith pixel point in the multiple pixel, xiFor the ith pixel point in the multiple pixel Corresponding gray value, n are the number of the multiple pixel.
Optionally, in the embodiment of the present application, the 4th acquisition module includes: the first object module, if for described First average value is less than or equal to the corresponding gray value of each pixel in the multiple pixel, then is denoted as comparison result One;Second object module, if being greater than the corresponding ash of each pixel in the multiple pixel for first average value The comparison result is then denoted as zero by angle value;Connection result module, for the comparison result to be sequentially connected to the character of acquisition String is determined as character string.
Optionally, in the embodiment of the present application, first comparison module includes: the 5th acquisition module, and being used for will be described The second character string of each of multiple second character strings and first character string do XOR operation, obtain multiple third characters String;6th obtains module, for the numerical value in third character string each in the multiple third character string to add up, obtains multiple Difference value.
The embodiment of the present application also provides a kind of electronic equipment, comprising: processor and memory, the memory are stored with The processor executable machine readable instructions execute as described above when the machine readable instructions are executed by the processor Method.
The embodiment of the present application also provides a kind of storage medium, it is stored with computer program on the storage medium, the calculating Machine program executes method as described above when being run by processor.
Detailed description of the invention
Technical solution in ord to more clearly illustrate embodiments of the present application will make below to required in the embodiment of the present application Attached drawing is briefly described, it should be understood that the following drawings illustrates only some embodiments of the application, therefore should not be seen Work is the restriction to range, for those of ordinary skill in the art, without creative efforts, can be with Other relevant attached drawings are obtained according to these attached drawings.
Fig. 1 shows the structural schematic diagram of electronic equipment provided by the embodiments of the present application;
Fig. 2 shows image transfer method flow diagrams provided by the embodiments of the present application;
Fig. 3 shows Hash value calculating method flow diagram provided by the embodiments of the present application;
Fig. 4 shows image transmission structural schematic diagram provided by the embodiments of the present application.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete Whole description.
Referring to Figure 1, Fig. 1 shows the structural schematic diagram of electronic equipment provided by the embodiments of the present application.The application is implemented The a kind of electronic equipment 101 that example provides, comprising: processor 102 and memory 103, memory 103 is stored with processor 102 can The machine readable instructions of execution, machine readable instructions execute following method when being executed by processor 102.
Referring to Figure 1, the embodiment of the present application also provides a kind of storage medium 104, meter is stored on the storage medium 104 Calculation machine program, the computer program execute following method when being run by processor 102.
Wherein, storage medium 104 can be by any kind of volatibility or non-volatile memory device or their group It closes and realizes, such as static random access memory (Static Random Access Memory, abbreviation SRAM), electric erasable can Program read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), Erasable Programmable Read Only Memory EPROM (Erasable Programmable Read Only Memory, abbreviation EPROM), programmable read only memory (Programmable Red-Only Memory, abbreviation PROM), read-only memory (Read-Only Memory, abbreviation ROM), magnetic memory, flash memory, disk or CD.
In existing fixed thermal infrared imager, it can acquire in real time and store image, then to adjacent two in storage Frame image compares, if the difference value of adjacent two field pictures is greater than threshold value, the image acquired in real time is transmitted;Instead It does not transmit the image acquired in real time if the difference value of adjacent two field pictures is not more than threshold value.Certainly in a practical situation, Here the difference value of adjacent two field pictures, it is also possible to the difference value of adjacent multiple image.
For one in detail example be illustrated, it is understood that there may be a kind of situation for example: if the number of multiple difference values is 4, the difference value of three adjacent images is respectively less than preset threshold, specifically, for ease of description, below carries out image successively Number, one shares the image of 10 numbers, and the respective number of the image of this 10 numbers is respectively from 1 to 10;Difference value is small In preset threshold number for example, 1,2 and 3,2,3 and 4, and so on, 8,9 and 10 difference value again smaller than preset threshold, but It is that the image that number is 1 and the image difference value that number is 10 have been over preset threshold.If being only to be from image difference value The no condition greater than preset threshold judges whether the image transmits, then the image that number is 1 to 10 will not be sent, at this time The case where not sent there have been long-term image.
First embodiment
Fig. 2 shows image transfer method flow diagram provided by the embodiments of the present application, this method can be adopted by image Acquisition means execute, the image collecting device for example: thermal infrared imager, monitor camera, camera or terminal with camera etc., Terminal with camera is for example: mobile phone, tablet computer or notebook etc..This method can also be in image collecting device by acquisition Image transmitting is given with after the terminal (claiming device end below) for executing computer program functional, is executed here by device end Method, device end for example: PC, the network switch, network router or host desktop etc..Certainly, specific real During applying, image collecting device can be with device end and be connected by high-speed transfer route, high-speed transfer route here Image data can be quickly transmitted, high-speed transfer route here includes but is not limited to: optical fiber, serial ports, parallel bus or logical With universal serial bus etc..
The application scenarios of the image transfer method include but is not limited to high-frequency acquisition image, and need to send an image to The scene that server is handled, these scenes for example: common Video security monitoring and high resolution image data acquisition etc. Deng.
It is above-mentioned Fig. 2 shows image transfer method may include steps of:
Step S100: calculating the character string of the first image of acquisition, obtains the first character string.
Wherein, the acquisition of the first image and processing method can have several situations, the first situation, the first image can be It is handled by above-mentioned image acquisition device, and by the image collecting device;Second situation, the first image are by image Acquisition device acquisition, then the first image is sent to above-mentioned device end by the image collecting device, then by equipment end End handles the first image.
It is understood that the first image here can refer to infrared figure made of the intensity for obtaining object infrared light Picture is also possible to obtain the multichannel image or single channel image of the intensity of object visible light;First image for example can be The image that resolution ratio by infrared thermoviewer acquisition is 640*480.
The character string of image can refer to that the cryptographic Hash that processing acquisition is carried out to image, cryptographic Hash here are understood that For the fingerprint or mark of the image, cryptographic Hash here is used to obtain the difference value or similarity of multiple images, will pass through figure The difference value or similarity of picture judges whether image sends, the specific method for calculating the first character string, can be using average Hash value algorithms (also known as mean value hash algorithm) or perceptual hash value-based algorithm, specific calculating process will carry out in detail below Ground description.
In some embodiments in the embodiment of the present application, step S100 may include:
Step S110: the first image is zoomed in and out and gray proces, the first grayscale image of acquisition, the first grayscale image include more The corresponding gray value of a pixel.
Processing is zoomed in and out to image, part details will be removed to retain the structure of image by referring to, so that image Size becomes unified size, and size here refers to the height and width of image;Remove the mode of part details for example: removal is in length and breadth The difference of ratio, or zoomed in and out using interpolation value method according to aspect ratio etc., specific interpolation value method for example: bicubic is inserted The methods of value, arest neighbors interpolation and bilinear interpolation.
Gray proces refer to the process of and convert gray level image for color image;For example, working as R=G=in RGB model When B, then colour indicates a kind of greyscale color, and wherein the value of R=G=B is gray value, and therefore, each pixel of gray level image only needs One byte stores gray value (also known as intensity value, brightness value), tonal range 0-255.It in the specific implementation process, can be with Gray processing is carried out to color image using four kinds of methods such as component method, maximum value process, mean value method and weighted mean method, in order to just In understanding, will be illustrated in following example with maximum value process and mean value method.
In some embodiments in the embodiment of the present application, step S110 may include:
Step S111: the first image is zoomed in and out to pre-set dimension, the second image is obtained.
Wherein, pre-set dimension here can refer to a height of preset height of image, and the width of image is preset width, example Such as, the size of image is 32*24, wherein 32 pixels are the width of image, and 24 pixels are the height of image.By the first figure Can be as zooming in and out to one of embodiment of pre-set dimension, by the picture size of the first image scaling to 32*24, Using the image of 32*24 size as the second image.
Step S112: the second image is subjected to gray proces using maximum value process or mean value method, obtains the first grayscale image.
In some embodiments of the embodiment of the present application, indicated using the formula of maximum value process are as follows: Gray (i, j)=max Second image is carried out gray proces by { R (i, j), G (i, j), B (i, j) }, obtains the first grayscale image;Or use mean value method Formula be expressed asSecond image is subjected to gray proces, obtains the first gray scale Figure;
Wherein, Gray (i, j) is the gray value of the i-th row jth column of the first grayscale image, and R (i, j) is the i-th of the second image The first passage value of row jth column, G (i, j) are the second channel value that the i-th row jth of the second image arranges, and B (i, j) is the second image The i-th row jth column third channel value, max indicates to obtain maximum value.
Step S120: calculating the average value of the corresponding gray value of multiple pixels, obtains the first average value.
It in a particular embodiment, can basisCalculate the flat of the corresponding gray value of multiple pixels Mean value obtains the first average value;
Wherein,For the first average value, i is the ith pixel point in multiple pixels, xiFor i-th in multiple pixels The corresponding gray value of a pixel, n are the number of multiple pixels.
Step S130: it by the first average value compared with the corresponding gray value of each pixel in multiple pixels, obtains Character string.
As described above, character string here can refer to the cryptographic Hash that processing acquisition is carried out to image, Kazakhstan here Uncommon value can be understood as the fingerprint or mark of the image, and cryptographic Hash here is used to obtain the difference value or similar of multiple images Degree, judges whether image sends will pass through difference value or the similarity of image, the specific preparation method of character string here It is described as follows.
Fig. 3 is referred to, Fig. 3 shows Hash value calculating method flow diagram provided by the embodiments of the present application.Wherein, exist In some embodiments in the embodiment of the present application, step S130 can (also known as mean value Hash be calculated using average hash value algorithms Method) or perceptual hash value-based algorithm realize that be here described by taking average hash value algorithms as an example, this method includes following step It is rapid:
Step S131: if the first average value is less than or equal to the corresponding gray value of each pixel in multiple pixels, Comparison result is then denoted as one.
Wherein, the specific implementation of the above method is for example: the first average value is 200, first pixel pair therein The gray value answered is 100, then the postscript that compares is 1;The corresponding gray value of third pixel therein is 100, then compares Postscript is 1;The 4th corresponding gray value of pixel therein is 100, then the postscript that compares is 1.
Step S132: if the first average value is greater than the corresponding gray value of each pixel in multiple pixels, will compare Relatively result is denoted as zero.
Wherein, the specific implementation of the above method is for example: the first average value is 200, second pixel point pair therein The gray value answered is 300, then the postscript that compares is 0;The 5th corresponding gray value of pixel therein is 300, then compares Postscript is 0;The 6th corresponding gray value of pixel therein is 300, then the postscript that compares is 0.
Step S133: the character string that comparison result is sequentially connected acquisition is determined as character string.
Continuation is illustrated with above example, and the character string that comparison result is sequentially connected acquisition is determined as character string then Be 101100, then 101100 be exactly the first image character string or cryptographic Hash.
In some embodiments in the embodiment of the present application, this method be may is that the gray value of each pixel, with One average value is compared.If the gray value of the pixel is greater than or equal to average value, it is denoted as 1;If the gray value of the pixel Less than average value, it is denoted as 0.It by above-mentioned comparison result, combines, just constitutes one 768 and be made of numerical value 0 or 1 Character string, here it is the character string of this picture or cryptographic Hash.
Step S200: compare the difference of the first character string Yu multiple second character strings, obtain multiple difference values.
Wherein, multiple second character strings are the character string for calculating multiple second images and obtaining, and multiple second images are the The multiple images acquired before the acquisition time of one image.It is understood that the first above-mentioned image is after acquisition, by image Acquisition device or device end storage just obtain here when storing the first image of multiple and different time point acquisitions Multiple images.Here multiple images can refer to what above-mentioned image collecting device acquired before the acquisition time of the first image Multiple images may also mean that the multiple images that above equipment terminal accesses before accessing the first image.Certainly specific In implementation process, the first above-mentioned image and multiple images can be numbered, can be numbered sequentially in time, it can also be with It is numbered using timestamp, such as: each frame image of acquisition is numbered, and includes date and serial number;The form of number It can be " chronological order number ", such as: 201905081234567.
It is to be understood that calculating the concrete modes of multiple second character strings and above-mentioned here according to multiple second images The mode for calculating the first character string according to the first image is identical, and therefore, the acquisition process of multiple second character strings may refer to here Above-mentioned step S110 is to step S130, and details are not described herein.Here compare the difference of the first character string Yu multiple second character strings Different concrete mode will be specifically described below:
In one of embodiment in the embodiment of the present application, the first character string of comparison in step S200 with it is multiple The differences method of second character string may include steps of:
Step S210: the second character string of each of multiple second character strings and the first character string are done into XOR operation, obtained Obtain multiple third character strings.
Wherein, the second character string of each of multiple second character strings and the first character string are done to the specific side of XOR operation Formula can be, and second character string and first character string be done XOR operation, all pixels position in the above results that add up For 1 number, this numerical value, also referred to as Hamming distance are exported.
Step S220: the numerical value in third character string each in multiple third character strings is added up, multiple difference values are obtained.
As above, the number that all pixels position is 1 in the above results that add up exports this numerical value, also referred to as Hamming distance. Numerical value in third character string each in multiple third character strings is added up, multiple difference values can be obtained.
Step S300: if multiple difference values are respectively less than preset threshold, and the acquisition time of the first image and the last figure The difference of the transmission time of picture is greater than or equal to preset time period, then by the first image transmitting to server.
Wherein, it is above-mentioned judge image whether one of embodiment of transmission method can be with are as follows: if multiple difference values Number is 4, and the number of the first image is 201905081234571, and the number that previous frame sends picture is 201905081234567, then difference is 4, and the difference of the number of the first image and the transmission number of the last image is equal to pre- If the value of period, therefore, by the first image transmitting to server.It certainly, in the specific implementation process, can be according to two kinds Condition judges together, such as: the number of the first image and the difference of the transmission number of the last image are equal to preset time period Value, and in the case where multiple difference values are respectively less than preset threshold, by the first image transmitting to server.
It gives one example, is judged together for example according to two kinds of conditions again: if the number of multiple difference values is 4, it is assumed that is pre- If the period is the processing time of 4 images, one shares the image of 10 numbers, the respective number point of the image of this 10 numbers Wei not be from 1 to 10, and three adjacent images are similar, i.e., the difference value of three adjacent images is respectively less than preset threshold;If The condition for only meeting " multiple difference values are respectively less than preset threshold " is then sent, then this 10 images can not sent;If full " multiple difference values are respectively less than preset threshold, and the difference of the transmission time of the acquisition time of the first image and the last image to foot Value be greater than or equal to preset time period " condition then send, then meet " multiple difference values are respectively less than preset threshold " condition, But it is unsatisfactory for that " difference of the transmission time of the acquisition time of the first image and the last image is greater than or equal to preset time The condition of section ", therefore, every 4 images will be sent once, it is possible to understand that, it will it is 1,5 and 9 transmissions, or will be 2, 6 and 10 send, or are 3 and 7 transmissions, or are 4 and 8 transmissions.Benefit using this method of the embodiment of the present application exists In when server is not received by image for a long time, it can be determined that go out the transmission network between server and image sender It has failed, rather than meet image caused by the condition of " multiple difference values are respectively less than preset threshold " and do not transmit.
Continue to illustrate with above example, it is understood that there may be a kind of situation for example: if the number of multiple difference values is 4, The difference value of three adjacent images is respectively less than preset threshold, specifically, difference value be respectively less than the number of preset threshold for example, 1, 2 and 3,2,3 and 4, and so on, 8,9 and 10 difference value is again smaller than preset threshold, and still, the image that number is 1 is with number 10 image difference value has been over preset threshold.If being sentenced from whether image difference value is greater than the condition of preset threshold Whether the image that breaks transmits, then the image that number is 1 to 10 will not be sent, there have been long-term images not to send at this time The case where.Therefore, the benefit that method provided by the embodiments of the present application uses two kinds of conditions of image difference value and time to judge together It is, is effectively prevented from the case where image of above-mentioned number 1 to number 10 is not sent, that is, efficiently avoids long-term image The case where not sending.
Step S400: if multiple difference values are respectively less than preset threshold, and the acquisition time of the first image and the last figure The difference of the transmission time of picture is less than preset time period, then stops the transmission of the first image.
Wherein, preset threshold can be a specific value, such as 100 or 120, be also possible to be generated by a function Value, such as: the function of setting may is that f (x)=50 × (1-e-x)/(1+ex), wherein e is naturally normal for one in mathematics A several and nonterminating and non-recurring decimal, x are the difference of number picture number compared with of this frame picture.When here default Between section be also possible to a specific period, such as: 5 seconds or 10 seconds periods or a picture number with it is another Picture number difference as preset time period, such as: preset time period 4, such as: the number of the first image is 201905081234571, the number that previous frame sends picture is 201905081234567, then difference is 4, the volume of the first image Number it is less than the value of preset time period with the difference of the transmission number of the last image, therefore, the first image should not transmit.
It, can be by image before the difference of the transmission time of the acquisition time and the last image that calculate the first image It is numbered, can number sequentially in time, can also be numbered using timestamp, such as: the picture number of this frame is 201905081234571, the picture number of previous frame is 201905081234567 etc..The acquisition time of first image with most The specific calculation of the difference of the transmission time of a nearly image can subtract previous frame for this frame picture number and send picture Number, data instance in face herein above, then the transmission time of the acquisition time of the first image and the last image Difference is 4.
During above-mentioned realization, stop the biography of image by two dimensions of the difference value and time between picture It is defeated, to prevent unnecessary image transmitting, effectively improve image during thermal infrared imager transmission image it is long when Between the case where not sending the problem of.
In the embodiment of the present application, after step S300, can also include:
Step S500: if any difference value in multiple difference values is greater than or equal to preset threshold, the first image is passed Transport to server.
Wherein, it is above-mentioned judge image whether one of embodiment of transmission method can be with are as follows: successively comparing number is 201905081234570, the character of 201905081234569,201905081234568,201905081234567 picture String, that is, the cryptographic Hash of image.If any difference value in multiple difference values is greater than or equal to preset threshold, here default Threshold value is, for example, 100, then by the first image transmitting to server.During above-mentioned realization, pass through the difference between picture Value determines to change image transmitting, ensure that the efficiency that discrepant image just transmits.
Second embodiment
Fig. 4 is referred to, Fig. 4 shows image transmission structural schematic diagram provided by the embodiments of the present application.The application is real It applies example and provides a kind of image transmission 100, which includes:
First obtains module 110, and the character string of the first image for calculating acquisition obtains the first character string.
First comparison module 120 obtains multiple differences for comparing the difference of the first character string Yu multiple second character strings Value, multiple second character strings are the character string for calculating multiple second images and obtaining, and multiple second images are adopting in the first image Collect the multiple images acquired before the time.
First transmission module 130, if be respectively less than preset threshold for multiple difference values, and the acquisition time of the first image with The difference of the transmission time of the last image is greater than or equal to preset time period, then by the first image transmitting to server.
During realization described above, determine to change plan by two dimensions of the difference value and time between picture As transmission, the case where long-term image is not sent is efficiently avoided.
Optionally, in the embodiment of the present application, the device further include:
First stops module, if be respectively less than preset threshold for multiple difference values, and the acquisition time of the first image with most The difference of the transmission time of a nearly image is less than preset time period, then stops the transmission of the first image.
Optionally, in the embodiment of the present application, which can also include:
Second transmission module, if being greater than or equal to preset threshold for any difference value in multiple difference values, by the One image transmitting is to server.
Optionally, in the embodiment of the present application, the first acquisition module includes:
Second obtains module, for zooming in and out and gray proces the first image, obtains the first grayscale image, the first gray scale Figure includes the corresponding gray value of multiple pixels.
Third obtains module, for calculating the average value of the corresponding gray value of multiple pixels, obtains the first average value.
4th obtains module, for by the first average value gray value ratio corresponding with each pixel in multiple pixels Compared with acquisition character string.
Optionally, in the embodiment of the present application, the second acquisition module includes:
Image scaling module obtains the second image for zooming in and out the first image to pre-set dimension.
Gradation processing module obtains for the second image to be carried out gray proces using maximum value process or mean value method One grayscale image.
Optionally, in the embodiment of the present application, third acquisition module includes:
Average value obtains module, is used for basisThe average value of the corresponding gray value of multiple pixels is calculated, Obtain the first average value;Wherein,For the first average value, i is the ith pixel point in multiple pixels, xiFor multiple pixels The corresponding gray value of ith pixel point in point, n are the number of multiple pixels.
Optionally, in the embodiment of the present application, the 4th acquisition module includes:
First object module, if it is corresponding to be less than or equal to each pixel in multiple pixels for the first average value Comparison result is then denoted as one by gray value.
Second object module, if being greater than the corresponding gray scale of each pixel in multiple pixels for the first average value Value, then be denoted as zero for comparison result.
Connection result module, the character string for comparison result to be sequentially connected acquisition are determined as character string.
Optionally, in the embodiment of the present application, the first comparison module includes:
5th obtains module, for the second character string of each of multiple second character strings and the first character string to be done exclusive or Operation obtains multiple third character strings.
6th obtains module, for the numerical value in third character string each in multiple third character strings to add up, obtains more A difference value.
In several embodiments provided by the embodiments of the present application, it should be understood that disclosed device and method can also lead to Other modes are crossed to realize.Installation practice described above is only illustrative, for example, flow chart and block diagram in attached drawing Show the device of multiple embodiments according to the embodiment of the present application, the system in the cards of method and computer program product Framework, function and operation.In this regard, each box in flowchart or block diagram can represent a module, program segment or generation A part of code, a part of module, section or code include it is one or more it is for implementing the specified logical function can It executes instruction.It should also be noted that some as replacement implementations in, function marked in the box can also and attached drawing Middle marked order of occurrence is different.For example, two continuous boxes can actually be basically executed in parallel, they are sometimes It can execute in the opposite order, this is depending on related function.It is also noted that in block diagram and or flow chart The combination of box in each box and block diagram and or flow chart can execute the dedicated base of defined function or movement It realizes, or can realize using a combination of dedicated hardware and computer instructions in the system of hardware.
In addition, each functional module in each embodiment of the embodiment of the present application can integrate one independence of formation together Part, be also possible to modules individualism, an independent portion can also be integrated to form with two or more modules Point.
If function is realized and when sold or used as an independent product in the form of software function module, can store In computer-readable storage medium.Based on this understanding, the technical solution of the embodiment of the present application is substantially right in other words The part of part or the technical solution that the prior art contributes is expressed in the form of software products, and the computer is soft Part product is stored in a storage medium, including some instructions with so that computer equipment execute it is each in the embodiment of the present application The all or part of the steps of embodiment method.Computer equipment above-mentioned includes: personal computer, server, mobile device, intelligence Energy wearable device, the network equipment, virtual unit etc. are various to have the equipment for executing program code ability, storage medium packet above-mentioned Include: USB flash disk, mobile hard disk, read-only memory, random access memory, magnetic disk, tape or CD etc. are various to can store program The medium of code.
Above description, the only optional embodiment of the embodiment of the present application, but the protection scope of the embodiment of the present application is simultaneously Not limited to this, anyone skilled in the art, can be easily in the technical scope that the embodiment of the present application discloses Expect change or replacement, should all cover within the protection scope of the embodiment of the present application.

Claims (10)

1. a kind of image transfer method characterized by comprising
The character string of the first image of acquisition is calculated, the first character string is obtained;
The difference for comparing first character string Yu multiple second character strings obtains multiple difference values, the multiple second character String to calculate the character string that multiple second images obtain, the multiple second image be the first image acquisition time it The multiple images of preceding acquisition;
If the multiple difference value is respectively less than preset threshold, and the biography of the acquisition time of the first image and the last image The difference of defeated time is greater than or equal to preset time period, then the first image is transmitted to server.
2. the method according to claim 1, wherein in first character string and the multiple the The difference of two character strings, after obtaining multiple difference values, further includes:
If the multiple difference value is respectively less than preset threshold, and the biography of the acquisition time of the first image and the last image The difference of defeated time is less than preset time period, then stops the transmission of the first image.
3. the method according to claim 1, wherein in first character string and the multiple the The difference of two character strings, after obtaining multiple difference values, further includes:
If any difference value in the multiple difference value is greater than or equal to the preset threshold, the first image is transmitted To server.
4. the method according to claim 1, wherein the character string of first image for calculating acquisition, comprising:
The first image is zoomed in and out and gray proces, obtains the first grayscale image, first grayscale image includes multiple pictures The corresponding gray value of vegetarian refreshments;
The average value of the corresponding gray value of the multiple pixel is calculated, the first average value is obtained;
By first average value compared with the corresponding gray value of each pixel in the multiple pixel, character is obtained String.
5. according to the method described in claim 4, it is characterized in that, it is described by the first image zoom in and out at gray scale Reason obtains the first grayscale image, comprising:
The first image is zoomed in and out to pre-set dimension, the second image is obtained;
Second image is subjected to gray proces using maximum value process or mean value method, obtains the first grayscale image.
6. according to the method described in claim 4, it is characterized in that, the multiple pixel corresponding gray value of calculating Average value obtains the first average value, comprising:
According toThe average value of the corresponding gray value of the multiple pixel is calculated, the first average value is obtained;Wherein,For first average value, i is the ith pixel point in the multiple pixel, xiFor i-th in the multiple pixel The corresponding gray value of a pixel, n are the number of the multiple pixel.
7. according to the method described in claim 4, it is characterized in that, described by first average value and the multiple pixel In the corresponding gray value of each pixel compare, obtain character string, comprising:
If first average value is less than or equal to the corresponding gray value of each pixel in the multiple pixel, will compare Relatively result is denoted as one;
If first average value is greater than the corresponding gray value of each pixel in the multiple pixel, by the comparison As a result it is denoted as zero;
The character string that the comparison result is sequentially connected acquisition is determined as character string.
8. the method according to claim 1, wherein first character string and the multiple second The difference of character string obtains multiple difference values, comprising:
The second character string of each of the multiple second character string and first character string are done into XOR operation, obtained multiple Third character string;
Numerical value in third character string each in the multiple third character string is added up, multiple difference values are obtained.
9. a kind of image transmission characterized by comprising
First obtains module, and the character string of the first image for calculating acquisition obtains the first character string;
First comparison module obtains multiple difference values for the difference of first character string and multiple second character strings, The multiple second character string is the character string for calculating multiple second images and obtaining, and the multiple second image is described first The multiple images acquired before the acquisition time of image;
First transmission module, if being respectively less than preset threshold, and the acquisition time of the first image for the multiple difference value It is greater than or equal to preset time period with the difference of the transmission time of the last image, then the first image is transmitted to service Device.
10. device according to claim 9, which is characterized in that further include:
First stops module, if being respectively less than preset threshold, and the acquisition time of the first image for the multiple difference value It is less than preset time period with the difference of the transmission time of the last image, then stops the transmission of the first image.
CN201910483949.4A 2019-06-04 2019-06-04 Image transmission method and device Active CN110213457B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910483949.4A CN110213457B (en) 2019-06-04 2019-06-04 Image transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910483949.4A CN110213457B (en) 2019-06-04 2019-06-04 Image transmission method and device

Publications (2)

Publication Number Publication Date
CN110213457A true CN110213457A (en) 2019-09-06
CN110213457B CN110213457B (en) 2021-04-13

Family

ID=67790775

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910483949.4A Active CN110213457B (en) 2019-06-04 2019-06-04 Image transmission method and device

Country Status (1)

Country Link
CN (1) CN110213457B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111192195A (en) * 2019-12-17 2020-05-22 中国平安财产保险股份有限公司 Picture processing method and device, computer equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080111883A1 (en) * 2006-11-13 2008-05-15 Samsung Electronics Co., Ltd. Portable terminal having video surveillance apparatus, video surveillance method using the portable terminal, and video surveillance system
CN105931269A (en) * 2016-04-22 2016-09-07 海信集团有限公司 Tracking method for target in video and tracking device thereof
CN106817410A (en) * 2016-12-28 2017-06-09 广州大气候农业科技有限公司 Image retransmission method, image storage method, the node and server of Internet of Things
CN107239518A (en) * 2017-05-24 2017-10-10 福建中金在线信息科技有限公司 A kind of image comparison method, contrast device, electronic equipment and storage medium
CN108876756A (en) * 2017-05-09 2018-11-23 普天信息技术有限公司 The measure and device of image similarity
CN109241897A (en) * 2018-08-29 2019-01-18 深圳华远云联数据科技有限公司 Processing method, device, gateway and the storage medium of monitoring image

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080111883A1 (en) * 2006-11-13 2008-05-15 Samsung Electronics Co., Ltd. Portable terminal having video surveillance apparatus, video surveillance method using the portable terminal, and video surveillance system
CN105931269A (en) * 2016-04-22 2016-09-07 海信集团有限公司 Tracking method for target in video and tracking device thereof
CN106817410A (en) * 2016-12-28 2017-06-09 广州大气候农业科技有限公司 Image retransmission method, image storage method, the node and server of Internet of Things
CN108876756A (en) * 2017-05-09 2018-11-23 普天信息技术有限公司 The measure and device of image similarity
CN107239518A (en) * 2017-05-24 2017-10-10 福建中金在线信息科技有限公司 A kind of image comparison method, contrast device, electronic equipment and storage medium
CN109241897A (en) * 2018-08-29 2019-01-18 深圳华远云联数据科技有限公司 Processing method, device, gateway and the storage medium of monitoring image

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111192195A (en) * 2019-12-17 2020-05-22 中国平安财产保险股份有限公司 Picture processing method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN110213457B (en) 2021-04-13

Similar Documents

Publication Publication Date Title
KR102629380B1 (en) Method for Distinguishing a Real Three-Dimensional Object from a Two-Dimensional Spoof of the Real Object
US20200380279A1 (en) Method and apparatus for liveness detection, electronic device, and storage medium
CN106682632B (en) Method and device for processing face image
TW201627917A (en) Method and device for face in-vivo detection
US20230045306A1 (en) Face liveness detection method, system, apparatus, computer device, and storage medium
US20210248468A1 (en) Classifying Time Series Image Data
CN110059666B (en) Attention detection method and device
CN112434546A (en) Face living body detection method and device, equipment and storage medium
CN110969060A (en) Neural network training method, neural network training device, neural network tracking method, neural network training device, visual line tracking device and electronic equipment
CN109683698B (en) Payment verification method and device, electronic equipment and computer-readable storage medium
CN113869219B (en) Face living body detection method, device, equipment and storage medium
CN115633193A (en) Monitoring video encryption method and system
CN115588052A (en) Sight direction data acquisition method, device, equipment and storage medium
CN112115811A (en) Image processing method and device based on privacy protection and electronic equipment
CN108712400A (en) Data transmission method, device, computer readable storage medium and electronic equipment
CN110213457A (en) A kind of image transfer method and device
CN107301373B (en) Data processing method, device and storage medium
CN111860498A (en) Method and device for generating antagonism sample of license plate and storage medium
CN111222446A (en) Face recognition method, face recognition device and mobile terminal
CN109121194B (en) Method and apparatus for state transition of electronic device
CN115357736A (en) Picture matching method, device, storage medium and equipment
CN113723310B (en) Image recognition method and related device based on neural network
JPWO2019188578A1 (en) Arithmetic logic unit, calculation method, program and discrimination system
WO2020253342A1 (en) Panoramic rendering method for 3d video, computer device, and readable storage medium
CN114627535B (en) Coordinate matching method, device, equipment and medium based on binocular camera

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant