CN116668709B - Image transmission method, device, server device and storage medium - Google Patents

Image transmission method, device, server device and storage medium Download PDF

Info

Publication number
CN116668709B
CN116668709B CN202310935329.6A CN202310935329A CN116668709B CN 116668709 B CN116668709 B CN 116668709B CN 202310935329 A CN202310935329 A CN 202310935329A CN 116668709 B CN116668709 B CN 116668709B
Authority
CN
China
Prior art keywords
image block
image
current
previous
target
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.)
Active
Application number
CN202310935329.6A
Other languages
Chinese (zh)
Other versions
CN116668709A (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.)
Tianjin Zhuolang Kunlun Cloud Software Technology Co ltd
Original Assignee
Tianjin Zhuolang Kunlun Cloud Software 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 Tianjin Zhuolang Kunlun Cloud Software Technology Co ltd filed Critical Tianjin Zhuolang Kunlun Cloud Software Technology Co ltd
Priority to CN202310935329.6A priority Critical patent/CN116668709B/en
Publication of CN116668709A publication Critical patent/CN116668709A/en
Application granted granted Critical
Publication of CN116668709B publication Critical patent/CN116668709B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/08Protocols specially adapted for terminal emulation, e.g. Telnet
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Multimedia (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides an image transmission method, an image transmission device, a server device and a storage medium, wherein when image transmission is carried out, the corresponding offset of each target image block in a current image to be transmitted is determined according to a preset similarity algorithm based on an integral graph; then, based on the corresponding offset of each target image block, performing image block position offset on the current image, and performing similarity comparison on the image blocks at the same position on the offset image and the previous image to obtain a first target image block belonging to the same image block and a second target image block belonging to different image blocks; and further, according to the data position information corresponding to the first target image block and the second target image block, determining target transmission information corresponding to the current image, and transmitting the target transmission information to the client. Therefore, the times and time of invalid comparison between the current image and the cached image of the client can be effectively reduced, and the transmission efficiency is improved.

Description

Image transmission method, device, server device and storage medium
Technical Field
The present invention relates to the field of cloud desktop technologies, and in particular, to an image transmission method, an image transmission device, a server device, and a storage medium.
Background
Cloud desktop is also called "desktop virtualization", and is to uniformly configure and release all data spaces, management services and desktop application systems by a server at the back end, so that a traditional PC is upgraded to network operation. The cloud desktop image caching system is a technology for reducing processed data and traffic by reducing the repeated parts of an image to be sent currently and a cached image of a client.
However, in the existing cloud desktop image caching system, each image to be sent needs to be compared with the cached image of the client, and the time spent in the process is long, so that the transmission efficiency is low.
Disclosure of Invention
The invention aims to provide an image transmission method, an image transmission device, a server device and a storage medium, so that the number of times and time of invalid comparison are reduced, and the transmission efficiency is improved.
In a first aspect, an embodiment of the present invention provides an image transmission method, including:
determining the offset of each target image block in the current image to be transmitted relative to the transmitted previous image according to a preset similarity algorithm based on an integral graph; the target image block is the same image block between the current image and the previous image, and the image block is obtained based on fixed size division;
Performing image block position offset on the current image based on the offset corresponding to each target image block to obtain an offset image;
performing similarity comparison of image blocks at the same position on the offset image and the previous image to obtain a first target image block and a second target image block; the first target image block is the same image block between the offset image and the previous image, and the second target image block is a different image block between the offset image and the previous image;
determining target transmission information corresponding to the current image according to the data position information corresponding to the first target image block and the second target image block;
transmitting the target transmission information to a client so that the client obtains the current image based on the target transmission information and a preset cache table; and the cache table stores the corresponding relation between the cache position information and the data position information of the cached image block.
Further, before determining the offset of each target image block in the current image to be transmitted relative to the transmitted previous image according to the preset similarity algorithm based on the integral graph, the image transmission method further includes:
Performing similarity calculation on the current image and the previous image to obtain an overall similarity value;
and when the overall similarity value reaches a preset similarity threshold value, executing the step of determining the offset of each target image block in the current image to be transmitted relative to the previous image transmitted according to a preset similarity algorithm based on an integral graph.
Further, the determining, according to a preset similarity algorithm based on an integral graph, an offset of each target image block in the current image to be transmitted relative to the previous image transmitted includes:
performing integral graph calculation on the current image to obtain a current integral graph;
according to the similarity algorithm based on the integral graph, similarity calculation of image blocks is carried out on the current integral graph and the previous integral graph, and the offset of each target image block in the current image relative to the previous image is obtained; wherein the previous integral map is an integral map of the previous image.
Further, the calculating the similarity of the image blocks according to the similarity algorithm based on the integral graph to obtain the offset of each target image block in the current image relative to the previous image, including:
Traversing each image block of the current integral map;
when traversing to a current image block, judging whether the previous integral image has the same image block as the current image block or not through a sliding window mode and the similarity algorithm based on the integral image; if so, determining the current image block as the target image block, and determining the offset corresponding to the target image block based on the position of the current image block and the position of the corresponding image block in the previous integral graph; if not, continuing to traverse the next image block until the traversal is finished.
Further, the determining whether the previous integral map has the same image block as the current image block according to the sliding window mode and the similarity algorithm based on the integral map includes:
performing difference degree calculation on the current image block and the image block in the current window of the previous integral graph according to the similarity algorithm based on the integral graph to obtain a difference degree value;
when the difference value is 0, determining that the image block in the current window is the same image block as the current image block in the previous integral graph;
when the difference value is greater than 0, judging whether the current window is positioned at the last position of the previous integral graph;
When the current window is not positioned at the last position of the previous integral graph, sliding the current window to the next position of the previous integral graph, and re-executing the step of carrying out difference degree calculation on the current image block and the image block in the current window of the previous integral graph according to the similarity algorithm based on the integral graph to obtain a difference degree value;
and when the current window is positioned at the last position of the previous integral graph, determining that the image block which is the same as the current image block does not exist in the previous integral graph.
Further, the target transmission information comprises first transmission information corresponding to the first target image block and second transmission information corresponding to the second target image block; the determining the target transmission information corresponding to the current image according to the data position information corresponding to the first target image block and the second target image block includes:
determining data position information corresponding to the first target image block as the first transmission information;
determining the second target image block as the second transmission information; or, determining the second transmission information by searching a hash value of the second target image block in a preset hash table; and the hash table stores the corresponding relation between the hash value of the cached image block and the data position information.
Further, the determining the second transmission information by searching the hash value of the second target image block in a preset hash table includes:
calculating to obtain a hash value of the second target image block through an XXhash algorithm;
when the hash value of the second target image block is found in the hash table, corresponding data position information is determined to be the second transmission information;
when the hash value of the second target image block is not found in the hash table, updating the hash value of the second target image block into the hash table, and determining the second target image block and corresponding data position information as the second transmission information, so that the client side updates the cache table based on the cache position of the second target image block and corresponding data position information after caching the second target image block.
In a second aspect, an embodiment of the present invention further provides an image transmission apparatus, including:
the offset determining module is used for determining the offset of each target image block in the current image to be transmitted relative to the transmitted previous image according to a preset similarity algorithm based on an integral graph; the target image block is the same image block between the current image and the previous image, and the image block is obtained based on fixed size division;
The position offset module is used for carrying out image block position offset on the current image based on the offset corresponding to each target image block to obtain an offset image;
the similarity comparison module is used for comparing the similarity of the image blocks at the same position of the offset image and the previous image to obtain a first target image block and a second target image block; the first target image block is the same image block between the offset image and the previous image, and the second target image block is a different image block between the offset image and the previous image;
the information determining module is used for determining target transmission information corresponding to the current image according to the data position information corresponding to the first target image block and the second target image block;
the information transmission module is used for transmitting the target transmission information to a client so that the client obtains the current image based on the target transmission information and a preset cache table; and the cache table stores the corresponding relation between the cache position information and the data position information of the cached image block.
In a third aspect, an embodiment of the present invention further provides a server device, including a memory, and a processor, where the memory stores a computer program that can run on the processor, and the processor implements the image transmission method according to the first aspect when executing the computer program.
In a fourth aspect, an embodiment of the present invention further provides a storage medium, where a computer program is stored, where the computer program is executed by a processor to perform the image transmission method according to the first aspect.
When the image transmission method, the device, the server device and the storage medium are used for image transmission, the offset of each target image block in the current image to be transmitted relative to the transmitted previous image is determined according to a preset similarity algorithm based on an integral graph; the target image block is the same image block between the current image and the previous image, and the image block is obtained based on fixed size division; then, based on the corresponding offset of each target image block, performing image block position offset on the current image to obtain an offset image; then, similarity comparison of image blocks at the same position is carried out on the offset image and the previous image, and a first target image block and a second target image block are obtained; the first target image block is the same image block between the offset image and the previous image, and the second target image block is a different image block between the offset image and the previous image; further, according to the data position information corresponding to the first target image block and the second target image block, determining target transmission information corresponding to the current image; finally, transmitting target transmission information to the client so that the client obtains a current image based on the target transmission information and a preset cache table; the corresponding relation between the buffer position information and the data position information of the buffered image blocks is stored in the buffer table. Therefore, the same image block with position offset between the current image and the previous image can be quickly found according to the similarity algorithm based on the integral graph, and the times and time of invalid comparison between the current image and the cached image of the client are effectively reduced, so that the transmission efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of an image transmission method according to an embodiment of the present invention;
fig. 2 is a flowchart of another image transmission method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an image transmission device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a server device according to an embodiment of the present invention.
Detailed Description
The technical solutions of the present invention will be clearly and completely described in connection with the embodiments, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The cloud desktop image caching system can reduce the processed data and flow by reducing the repeated parts of the picture to be sent currently and the previous picture. The unique weight of the data can be calculated by using a Hash algorithm (i.e. a Hash algorithm), the unique weight is used for comparing whether two blocks of data are identical or not, the existing data is searched in the forward star structure by using the weight, and if the data and the previous image data are found to be repeated. The chained forward star is a static chained list storage, and all adjacent points of a vertex can be accessed quickly by combining an edge set array and an adjacent table.
The cloud desktop image caching system stores the cached data for the chain type forward star structure, is fast for updating the existing caching table, but has the time complexity of O1 when the cache is compared and searched (namely, the time required by the cache is longer). Based on the above, the image transmission method, the device, the server device and the storage medium provided by the embodiment of the invention can reduce the times and time of invalid comparison, thereby improving the transmission efficiency.
The embodiment of the invention can be applied to cloud desktop image transmission scenes, some scene images are refreshed frequently, but most of two adjacent images are the same, only the positions are changed or are unchanged, the parts can be quickly found, and the transmitted data is reduced. The identity of each piece of data (each image block) may be calculated by means of, for example, an XXhash algorithm, which is used to compare a look-up to see if there is cached data, and if there is cached data, only control information (i.e. data location information) may be sent, reducing the sending of data.
In the prior art, only the image block moving matching on the same axis can be realized, and the image blocks on two axes can not be realized by moving up and down or horizontally, namely the image block moving matching with both up and down movement and horizontal movement can not be realized; the prior art also fails to perform the motion matching of a single pixel and requires a long time. The embodiment of the invention can realize the movement matching of single pixels on two axes and reduce the times and time of invalid comparison.
For the sake of understanding the present embodiment, first, an image transmission method disclosed in the embodiment of the present invention will be described in detail.
In the use process of the cloud desktop, the sent images are generally associated with each other greatly, and the sent images have a plurality of identical parts, so that the flow generated during the use period of the cloud desktop can be reduced by reducing the sending of the identical parts, and the smoothness of using the cloud desktop in the public network is improved; the method reduces the transmission of the same data and the processing time of subsequent data compression and the like, so that the smoothness of the cloud desktop and the use experience and the like are improved in a plurality of scenes with the same frames.
The embodiment of the invention provides an image transmission method which can be executed by a server device. Referring to a schematic flow chart of an image transmission method shown in fig. 1, the method mainly includes the following steps S102 to S110:
Step S102, determining the offset of each target image block in the current image to be transmitted relative to the transmitted previous image according to a preset similarity algorithm based on an integral graph; the target image block is the same image block between the current image and the previous image, and the image block is obtained based on fixed size division.
The image block dividing method may refer to related prior art, and will not be described herein; the size of the image block may be set according to actual requirements, and is not limited herein. The current image and the previous image may be two adjacent frames of images.
In some possible embodiments, the current image may be first subjected to an integral map calculation to obtain a current integral map; then, according to a similarity algorithm based on the integral graph, similarity calculation of image blocks is carried out on the current integral graph and the previous integral graph, and offset of each target image block in the current image relative to the previous image is obtained; wherein the previous integral map is the integral map of the previous image.
The integral map is defined as follows: the size of the bitmap is the same as that of the two-dimensional image, and the sum of all pixels in a rectangular area formed by the upper left corner of the image and any point on the image is the value of the same position in the bitmap, namely the integral map of the original image. Therefore, the following integral map calculation formula can be used to obtain the integral map of the current image:
Wherein, the liquid crystal display device comprises a liquid crystal display device,I(x,y) To integrate the pixel coordinate position in the graphx,y) An integrated value at which,x'、y' the pixel coordinate positions in the original image,i(x',y' is the position of pixel coordinates in the original imagex',y') pixel values (RGB values),xyis the pixel coordinate position in the integral map (i.e., the lower right corner coordinates of the rectangular region in the original image).
Further, the step of calculating the similarity of the image blocks according to the similarity algorithm based on the integral map and the current integral map and the previous integral map to obtain the offset of each target image block in the current image relative to the previous image can be realized by the following steps:
traversing each image block of the current integral map; when traversing to the current image block, judging whether the image block which is the same as the current image block exists in the previous integral diagram or not through a sliding window mode and a similarity algorithm based on the integral diagram; if so, determining the current image block as a target image block, and determining the offset corresponding to the target image block based on the position of the current image block and the position of the corresponding image block in the previous integral graph; if not, continuing to traverse the next image block until the traversal is finished.
Further, the step of determining whether the same image block exists in the previous integral map as the current image block may be implemented by the following process: performing difference degree calculation on the current image block and the image block in the current window of the previous integral graph according to a similarity algorithm based on the integral graph to obtain a difference degree value; when the difference value is 0, determining that the image block in the current window is the same image block as the current image block in the previous integral graph; when the difference value is greater than 0, judging whether the current window is positioned at the last position of the previous integral graph; when the current window is not positioned at the last position of the previous integrating diagram, sliding the current window to the next position of the previous integrating diagram, and re-executing the step of calculating the difference degree between the current image block and the image block in the current window of the previous integrating diagram according to the similarity algorithm based on the integrating diagram to obtain a difference degree value; when the current window is positioned at the last position of the previous integral graph, determining that the image block which is the same as the current image block does not exist in the previous integral graph.
Optionally, the difference degree calculation formula corresponding to the similarity algorithm based on the integral graph is as follows:
where D represents the degree of difference, the degree of similarity s=1-D, n, m is the width and height of the image block, I, j is the pixel coordinate position, I (I, j) is the integral value at the pixel coordinate position (I, j) of the image block in the current integral map, and K (I, j) is the integral value at the pixel coordinate position (I, j) of the image block in the previous integral map.
Step S104, based on the corresponding offset of each target image block, the image block position of the current image is offset, and an offset image is obtained.
Step S106, performing similarity comparison of image blocks at the same position on the offset image and the previous image to obtain a first target image block and a second target image block; the first target image block is the same image block between the offset image and the previous image, and the second target image block is a different image block between the offset image and the previous image.
Step S108, determining target transmission information corresponding to the current image according to the data position information corresponding to the first target image block and the second target image block.
The target transmission information may include first transmission information corresponding to the first target image block and second transmission information corresponding to the second target image block. Based on this, the data position information corresponding to the first target image block may be determined as the first transmission information; determining a second target image block as second transmission information; or, searching a hash value of the second target image block in a preset hash table to determine second transmission information, namely, determining the second transmission information corresponding to the second target image block by adopting a table look-up comparison mode based on the hash table; the hash table stores the corresponding relation between the hash value of the cached image block and the data position information.
Further, the step of determining the second transmission information by searching the hash value of the second target image block in the preset hash table may be implemented by the following steps: calculating to obtain a hash value of the second target image block through an XXhash algorithm; when the hash value of the second target image block is found in the hash table, corresponding data position information is determined to be second transmission information; when the hash value of the second target image block is not found in the hash table, updating the hash value of the second target image block into the hash table, and determining the second target image block and the corresponding data position information as second transmission information, so that the client side updates the cache table based on the cache position of the second target image block and the corresponding data position information after caching the second target image block. The XXhash algorithm has the advantages of high speed and low collision rate.
Step S110, transmitting target transmission information to a client so that the client obtains a current image based on the target transmission information and a preset cache table; the corresponding relation between the buffer position information and the data position information of the buffered image blocks is stored in the buffer table.
According to the image transmission method provided by the embodiment of the invention, the same image block with position offset between the current image and the previous image can be quickly found according to the similarity algorithm based on the integral graph, so that the times and time of invalid comparison between the current image and the cached image of the client are effectively reduced, and the transmission efficiency is improved. The offset comparison mode based on the integral graph does not limit the moving mode of the image block, and has lower calculation complexity, so that the moving matching of single pixels on two axes can be realized.
In order to further improve the transmission efficiency, it may be determined whether the integral graph-based offset comparison method is necessary before the integral graph-based offset comparison method is adopted. Based on this, referring to a flow chart of another image transmission method shown in fig. 2, the method includes the following steps:
step S202, similarity calculation is carried out on the current image and the previous image, and an overall similarity value is obtained.
In the similarity calculation, a conventional similarity algorithm may be adopted, or a similarity algorithm based on an integral graph may be adopted, which is not limited herein.
Step S204, judging whether the overall similarity value reaches a preset similarity threshold.
The similarity threshold may be set according to actual requirements, and is not limited herein, for example, the similarity threshold is 60%. When the judgment result is yes, that is, the overall similarity value reaches the similarity threshold value, step S206 is executed; when the determination result is no, that is, the overall similarity value does not reach the similarity threshold, step S208 is performed.
Step S206, transmitting the current image by adopting an offset comparison mode based on an integral graph.
The offset comparison manner based on the integral graph, that is, the manner corresponding to the step S102 to the step S110, is not described herein again.
Step S208, adopting a table look-up comparison mode based on a hash table to transmit the current image.
The table lookup comparison mode based on the hash table may refer to the foregoing step of determining the corresponding content of the step of second transmission information by looking up the hash value of the second target image block in the preset hash table, which is not described herein.
For easy understanding, a cloud desktop image caching system adopting the image transmission method is described below. The cloud desktop image caching system mainly comprises a server side and a client side.
The server side:
1) The table look-up comparison mode based on the hash table is as follows:
for the picture data to be calculated and buffered, the picture data is divided into a plurality of small segments (namely, an image is divided into a plurality of image blocks, each small segment corresponds to one image block), then the data of the small segments are sampled and extracted (one pixel takes one byte and stores RGB values thereof), the XXHash value of the data of the small segments is calculated according to the sampled data, and the hash value is used as the unique identification of the small segments.
The server side stores a hash table for recording the cached data hash value, and the hash table is of a chain type forward star structure.
If the segment of the hash value exists, the segment of the data client is indicated to be cached, and the segment of the data client can be transmitted to the client without transmitting the segment of the data, and only the position (namely the data position information) of the data in the hash table is recorded and is transmitted to the client as control information.
If the data is not cached, the hash table is updated. At this time, the cache table of the client needs to be updated synchronously, so that the record control information needs to be sent to the client together with the data. Wherein the update policy is to replace the previous hash value, preferably replace the oldest and unused for a long time. Alternatively, according to the last use time (last use time) and the number of times of use, the heat value of different hash values in the hash table can be obtained by calculation, and the hash value with the lowest heat value is determined to be the replaced hash value.
2) The pattern of offset comparison based on the integral map is as follows:
for two adjacent frames of images with unchanged content and changed positions, calculating an integral graph of the two frames of images, then calculating the similarity of the images according to the integral graph, further obtaining the offset of the image blocks between the two images according to a similarity algorithm, searching and comparing after the images are offset according to the offset, and effectively reducing the times and time of ineffective comparison.
Client side:
the client searches the cache table according to the control information given by the server and updates the cache table. And copying the cached data from the cache table into an image space, and displaying on a screen.
In the embodiment of the invention, for the image with the position change, the image integral graph is calculated first, then the similarity is calculated according to the integral graph, the offset of the image block between the two images is searched according to the similarity, and the image is calculated and compared after being offset according to the offset, so that the times and time of ineffective comparison can be effectively reduced.
Corresponding to the image transmission method, the embodiment of the invention also provides an image transmission device. Referring to a schematic structural view of an image transmission apparatus shown in fig. 3, the apparatus includes:
the offset determining module 301 is configured to determine an offset of each target image block in the current image to be transmitted relative to the previous image that has been transmitted according to a preset similarity algorithm based on an integral graph; the target image block is the same image block between the current image and the previous image, and the image block is obtained based on fixed size division;
the position offset module 302 is configured to perform an image block position offset on the current image based on an offset corresponding to each target image block, to obtain an offset image;
a similarity comparing module 303, configured to compare the similarity of the image blocks at the same position between the offset image and the previous image, so as to obtain a first target image block and a second target image block; the first target image block is the same image block between the offset image and the previous image, and the second target image block is a different image block between the offset image and the previous image;
The information determining module 304 is configured to determine target transmission information corresponding to the current image according to the data location information corresponding to the first target image block and the second target image block;
the information transmission module 305 is configured to transmit target transmission information to the client, so that the client obtains a current image based on the target transmission information and a preset cache table; the corresponding relation between the buffer position information and the data position information of the buffered image blocks is stored in the buffer table.
Further, the apparatus further includes:
the similarity calculation module is used for calculating the similarity between the current image and the previous image to obtain an overall similarity value;
the offset determining module 301 is further configured to: and when the overall similarity value reaches a preset similarity threshold value, executing the step of determining the offset of each target image block in the current image to be transmitted relative to the transmitted previous image according to a preset similarity algorithm based on an integral graph.
Further, the offset determining module 301 is specifically configured to: performing integral graph calculation on the current image to obtain a current integral graph; according to a similarity algorithm based on the integral graph, performing similarity calculation on image blocks of the current integral graph and the previous integral graph to obtain offset of each target image block in the current image relative to the previous image; wherein the previous integral map is the integral map of the previous image.
Further, the offset determining module 301 is further configured to: traversing each image block of the current integral map; when traversing to the current image block, judging whether the image block which is the same as the current image block exists in the previous integral diagram or not through a sliding window mode and a similarity algorithm based on the integral diagram; if so, determining the current image block as a target image block, and determining the offset corresponding to the target image block based on the position of the current image block and the position of the corresponding image block in the previous integral graph; if not, continuing to traverse the next image block until the traversal is finished.
Further, the offset determining module 301 is further configured to: performing difference degree calculation on the current image block and the image block in the current window of the previous integral graph according to a similarity algorithm based on the integral graph to obtain a difference degree value; when the difference value is 0, determining that the image block in the current window is the same image block as the current image block in the previous integral graph; when the difference value is greater than 0, judging whether the current window is positioned at the last position of the previous integral graph; when the current window is not positioned at the last position of the previous integral graph, sliding the current window to the next position of the previous integral graph, and re-executing the step of calculating the difference degree between the current image block and the image block in the current window of the previous integral graph according to the similarity algorithm based on the integral graph to obtain a difference degree value; when the current window is positioned at the last position of the previous integral graph, determining that the image block which is the same as the current image block does not exist in the previous integral graph.
Further, the target transmission information includes first transmission information corresponding to the first target image block and second transmission information corresponding to the second target image block; based on this, the above information determination module 304 specifically functions to: determining data position information corresponding to a first target image block as first transmission information; determining a second target image block as second transmission information; or, determining second transmission information by searching a hash value of a second target image block in a preset hash table; the hash table stores the corresponding relation between the hash value of the cached image block and the data position information.
Further, the information determining module 304 is further configured to: calculating to obtain a hash value of the second target image block through an XXhash algorithm; when the hash value of the second target image block is found in the hash table, corresponding data position information is determined to be second transmission information; when the hash value of the second target image block is not found in the hash table, updating the hash value of the second target image block into the hash table, and determining the second target image block and the corresponding data position information as second transmission information, so that the client side updates the cache table based on the cache position of the second target image block and the corresponding data position information after caching the second target image block.
The image transmission device provided in this embodiment has the same implementation principle and technical effects as those of the foregoing image transmission method embodiment, and for brevity, reference may be made to corresponding contents in the foregoing image transmission method embodiment where the embodiment portion of the image transmission device is not mentioned.
As shown in fig. 4, a server device 400 provided in an embodiment of the present invention includes: the image transmission method comprises a processor 401, a memory 402 and a bus, wherein the memory 402 stores a computer program capable of running on the processor 401, and when the server device 400 runs, the processor 401 and the memory 402 communicate through the bus, and the processor 401 executes the computer program to realize the image transmission method.
Specifically, the memory 402 and the processor 401 described above can be general-purpose memories and processors, and are not particularly limited herein.
The embodiment of the invention also provides a storage medium, on which a computer program is stored, which when being executed by a processor performs the image transmission method described in the previous method embodiment. The storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a RAM, a magnetic disk, or an optical disk, etc., which can store program codes.
Any particular values in all examples shown and described herein are to be construed as merely illustrative and not a limitation, and thus other examples of exemplary embodiments may have different values.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the invention.

Claims (8)

1. An image transmission method, comprising:
determining the offset of each target image block in the current image to be transmitted relative to the transmitted previous image according to a preset similarity algorithm based on an integral graph; the target image block is the same image block between the current image and the previous image, and the image block is obtained based on fixed size division;
performing image block position offset on the current image based on the offset corresponding to each target image block to obtain an offset image;
performing similarity comparison of image blocks at the same position on the offset image and the previous image to obtain a first target image block and a second target image block; the first target image block is the same image block between the offset image and the previous image, and the second target image block is a different image block between the offset image and the previous image;
Determining target transmission information corresponding to the current image according to the data position information corresponding to the first target image block and the second target image block;
transmitting the target transmission information to a client so that the client obtains the current image based on the target transmission information and a preset cache table; wherein, the buffer table stores the corresponding relation between the buffer position information and the data position information of the buffered image block;
the determining, according to a preset similarity algorithm based on an integral graph, an offset of each target image block in a current image to be transmitted relative to a previous image transmitted includes:
performing integral graph calculation on the current image to obtain a current integral graph;
according to the similarity algorithm based on the integral graph, similarity calculation of image blocks is carried out on the current integral graph and the previous integral graph, and the offset of each target image block in the current image relative to the previous image is obtained; wherein the previous integral map is an integral map of the previous image;
the step of calculating the similarity of the image blocks of the current integral graph and the previous integral graph according to the similarity algorithm based on the integral graph to obtain the offset of each target image block in the current image relative to the previous image, comprising the following steps:
Traversing each image block of the current integral map;
when traversing to a current image block, judging whether the previous integral image has the same image block as the current image block or not through a sliding window mode and the similarity algorithm based on the integral image; if so, determining the current image block as the target image block, and determining the offset corresponding to the target image block based on the position of the current image block and the position of the corresponding image block in the previous integral graph; if not, continuing to traverse the next image block until the traversal is finished.
2. The image transmission method according to claim 1, wherein before determining an offset of each target image block in the current image to be transmitted with respect to the previous image that has been transmitted according to the preset integrogram-based similarity algorithm, the image transmission method further comprises:
performing similarity calculation on the current image and the previous image to obtain an overall similarity value;
and when the overall similarity value reaches a preset similarity threshold value, executing the step of determining the offset of each target image block in the current image to be transmitted relative to the previous image transmitted according to a preset similarity algorithm based on an integral graph.
3. The image transmission method according to claim 1, wherein the determining whether the previous integral map has the same image block as the current image block by the sliding window method and the integral map-based similarity algorithm includes:
performing difference degree calculation on the current image block and the image block in the current window of the previous integral graph according to the similarity algorithm based on the integral graph to obtain a difference degree value;
when the difference value is 0, determining that the image block in the current window is the same image block as the current image block in the previous integral graph;
when the difference value is greater than 0, judging whether the current window is positioned at the last position of the previous integral graph;
when the current window is not positioned at the last position of the previous integral graph, sliding the current window to the next position of the previous integral graph, and re-executing the step of carrying out difference degree calculation on the current image block and the image block in the current window of the previous integral graph according to the similarity algorithm based on the integral graph to obtain a difference degree value;
and when the current window is positioned at the last position of the previous integral graph, determining that the image block which is the same as the current image block does not exist in the previous integral graph.
4. The image transmission method according to claim 1, wherein the target transmission information includes first transmission information corresponding to the first target image block and second transmission information corresponding to the second target image block; the determining the target transmission information corresponding to the current image according to the data position information corresponding to the first target image block and the second target image block includes:
determining data position information corresponding to the first target image block as the first transmission information;
determining the second target image block as the second transmission information; or, determining the second transmission information by searching a hash value of the second target image block in a preset hash table; and the hash table stores the corresponding relation between the hash value of the cached image block and the data position information.
5. The image transmission method according to claim 4, wherein the determining the second transmission information by searching a hash value of the second target image block in a preset hash table includes:
calculating to obtain a hash value of the second target image block through an XXhash algorithm;
When the hash value of the second target image block is found in the hash table, corresponding data position information is determined to be the second transmission information;
when the hash value of the second target image block is not found in the hash table, updating the hash value of the second target image block into the hash table, and determining the second target image block and corresponding data position information as the second transmission information, so that the client side updates the cache table based on the cache position of the second target image block and corresponding data position information after caching the second target image block.
6. An image transmission apparatus, comprising:
the offset determining module is used for determining the offset of each target image block in the current image to be transmitted relative to the transmitted previous image according to a preset similarity algorithm based on an integral graph; the target image block is the same image block between the current image and the previous image, and the image block is obtained based on fixed size division;
the position offset module is used for carrying out image block position offset on the current image based on the offset corresponding to each target image block to obtain an offset image;
The similarity comparison module is used for comparing the similarity of the image blocks at the same position of the offset image and the previous image to obtain a first target image block and a second target image block; the first target image block is the same image block between the offset image and the previous image, and the second target image block is a different image block between the offset image and the previous image;
the information determining module is used for determining target transmission information corresponding to the current image according to the data position information corresponding to the first target image block and the second target image block;
the information transmission module is used for transmitting the target transmission information to a client so that the client obtains the current image based on the target transmission information and a preset cache table; wherein, the buffer table stores the corresponding relation between the buffer position information and the data position information of the buffered image block;
the offset determining module is specifically configured to: performing integral graph calculation on the current image to obtain a current integral graph; according to the similarity algorithm based on the integral graph, similarity calculation of image blocks is carried out on the current integral graph and the previous integral graph, and the offset of each target image block in the current image relative to the previous image is obtained; wherein the previous integral map is an integral map of the previous image;
The offset determination module is further configured to: traversing each image block of the current integral map; when traversing to a current image block, judging whether the previous integral image has the same image block as the current image block or not through a sliding window mode and the similarity algorithm based on the integral image; if so, determining the current image block as the target image block, and determining the offset corresponding to the target image block based on the position of the current image block and the position of the corresponding image block in the previous integral graph; if not, continuing to traverse the next image block until the traversal is finished.
7. A server device comprising a memory, a processor, the memory having stored thereon a computer program executable on the processor, wherein the processor, when executing the computer program, implements the image transmission method of any of claims 1-5.
8. A storage medium having a computer program stored thereon, which when executed by a processor performs the image transmission method of any of claims 1-5.
CN202310935329.6A 2023-07-28 2023-07-28 Image transmission method, device, server device and storage medium Active CN116668709B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310935329.6A CN116668709B (en) 2023-07-28 2023-07-28 Image transmission method, device, server device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310935329.6A CN116668709B (en) 2023-07-28 2023-07-28 Image transmission method, device, server device and storage medium

Publications (2)

Publication Number Publication Date
CN116668709A CN116668709A (en) 2023-08-29
CN116668709B true CN116668709B (en) 2023-10-17

Family

ID=87720937

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310935329.6A Active CN116668709B (en) 2023-07-28 2023-07-28 Image transmission method, device, server device and storage medium

Country Status (1)

Country Link
CN (1) CN116668709B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10327401A (en) * 1997-05-22 1998-12-08 Hitachi Ltd Motion vector detection method and encoding method and device for picture signal using the same
WO2000033581A1 (en) * 1998-11-30 2000-06-08 Microsoft Corporation Efficient motion vector coding for video compression
CN111161204A (en) * 2019-12-31 2020-05-15 展讯通信(上海)有限公司 Image processing method and device, electronic equipment and readable storage medium
JP2020127233A (en) * 2016-09-30 2020-08-20 華為技術有限公司Huawei Technologies Co.,Ltd. Method and apparatus for image coding and decoding via inter prediction
CN112114760A (en) * 2020-08-13 2020-12-22 西安万像电子科技有限公司 Image processing method and device
CN112505701A (en) * 2020-12-14 2021-03-16 大连海事大学 Method for inhibiting non-local mean coherent speckle of nearly half-decreasing polarimetric SAR (synthetic aperture radar) image of integral image
CN114586059A (en) * 2019-11-13 2022-06-03 Oppo广东移动通信有限公司 Image registration method, terminal and computer storage medium
CN115019038A (en) * 2022-05-23 2022-09-06 杭州缦图摄影有限公司 Similar image pixel-level semantic matching method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8041147B2 (en) * 2007-07-18 2011-10-18 3DHISTECH Kft; Method for realistic stitching image blocks of an electronically recorded multipart image

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10327401A (en) * 1997-05-22 1998-12-08 Hitachi Ltd Motion vector detection method and encoding method and device for picture signal using the same
WO2000033581A1 (en) * 1998-11-30 2000-06-08 Microsoft Corporation Efficient motion vector coding for video compression
JP2020127233A (en) * 2016-09-30 2020-08-20 華為技術有限公司Huawei Technologies Co.,Ltd. Method and apparatus for image coding and decoding via inter prediction
CN114586059A (en) * 2019-11-13 2022-06-03 Oppo广东移动通信有限公司 Image registration method, terminal and computer storage medium
CN111161204A (en) * 2019-12-31 2020-05-15 展讯通信(上海)有限公司 Image processing method and device, electronic equipment and readable storage medium
CN112114760A (en) * 2020-08-13 2020-12-22 西安万像电子科技有限公司 Image processing method and device
CN112505701A (en) * 2020-12-14 2021-03-16 大连海事大学 Method for inhibiting non-local mean coherent speckle of nearly half-decreasing polarimetric SAR (synthetic aperture radar) image of integral image
CN115019038A (en) * 2022-05-23 2022-09-06 杭州缦图摄影有限公司 Similar image pixel-level semantic matching method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
图像块动态调整的自适应差值补偿矢量量化;潘梅森;颜君彪;;计算机工程与应用(第07期);全文 *

Also Published As

Publication number Publication date
CN116668709A (en) 2023-08-29

Similar Documents

Publication Publication Date Title
US9196021B2 (en) Video enhancement using related content
US8331696B2 (en) Update region detection device
US20140267439A1 (en) Image Delivery Architecture
EP3275184B1 (en) Efficient encoding of composited display frames
US8629936B2 (en) Moving region detection device
KR20050029117A (en) Method and apparatus for fast block motion matching
US9083975B2 (en) Moving image coding device
KR102598459B1 (en) Lost foot recovery of human objects from image sequences based on horizon detection.
CN110998660A (en) Method, system and apparatus for optimizing pipeline execution
US10708571B2 (en) Video frame processing
CN112509003B (en) Method and system for solving target tracking frame drift
WO2020057062A1 (en) Method and apparatus for implementing bilateral image filtering in fpga, and fpga
CN109831659B (en) VR video caching method and system
US11908051B2 (en) Image processing system and method for generating image content
CN111723713B (en) Video key frame extraction method and system based on optical flow method
CN109377552B (en) Image occlusion calculating method, device, calculating equipment and storage medium
CN116668709B (en) Image transmission method, device, server device and storage medium
CN108961196B (en) Significance fusion method for 3D fixation point prediction based on graph
JP6210953B2 (en) Image processing apparatus and image processing method
WO2022021287A1 (en) Data enhancement method and training method for instance segmentation model, and related apparatus
CN111309430B (en) Method and related device for automatically caching user interaction interface nodes
US8953843B1 (en) Selecting objects in a sequence of images
US11501406B2 (en) Disparity cache
CN108520259B (en) Foreground target extraction method, device, equipment and storage medium
CN114422807B (en) Transmission optimization method based on Spice protocol

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