Image transmission method and apparatus, and electronic device
By meshing the image and comparing the grid difference values, determining whether to transmit grid data is solved, the existing image transmission methods have high requirements for bandwidth and computing resources, and the transmission efficiency of image data is improved.
Patent Information
- Application Number
- CN202311315111.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-11
- Publication Date
- 2025-04-11
AI Technical Summary
The existing image transmission methods have high requirements for bandwidth and computing resources, resulting in inefficiency.
By meshing the image, the grid difference values of adjacent transmitted images are compared, and the preset differential determination coefficient determines whether to transmit grid data, thereby reducing the transmission of invalid data.
It effectively reduces the transmission of invalid data in image transmission and improves the transmission efficiency of image data.
Smart Images

Figure CN119814941A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image transmission, and in particular, to a method and device for transmitting an image, an electronic device, and a non-transitory computer-readable storage medium. Background Art
[0002] In the prior art, two methods are usually used to transmit images.
[0003] One is to directly transmit the entire image. In this method, all the information of the image is transmitted. Therefore, there is a lot of repeated transmission data in the transmission data, and the bandwidth resource requirements are high.
[0004] The other is to compress the image before transmitting it. This method still transmits all the image data, and the sending end and the receiving end need to encode and decode the image data respectively. Therefore, it takes up more computing resources. Summary of the invention
[0005] The present application aims to propose a method and device for transmitting images, an electronic device, and a non-transitory computer-readable storage medium to solve the problem of high bandwidth requirements and high computing resource requirements for existing image transmission.
[0006] According to one aspect of the present application, a method for transmitting an image is proposed, comprising, in response to an image transmission instruction, gridding the image according to a preset number of gridding partitions; comparing difference values between the image and corresponding grids of a previous transmitted image of the image; and determining whether to transmit corresponding grid data of the image according to the difference values and a preset differentiation determination coefficient.
[0007] According to some embodiments, comparing the difference values of the image and the corresponding grid of the last transmitted image of the image includes: comparing the difference values of the pixels of the image and the corresponding grid of the last transmitted image of the image.
[0008] According to some embodiments, comparing the difference values of pixels of a corresponding grid of the image and a previous transmitted image of the image includes comparing the difference values of pixels of a corresponding grid of the image and a previous transmitted image of the image by using a weighted fitting comparison method.
[0009] According to some embodiments, a weighted fitting comparison method is used to compare the difference values of pixels of the image and the corresponding grid of the previous transmitted image of the image, including a data storage method in the memory according to the RGB565 color mode, and a weighted fitting comparison method is used to compare the difference values of pixels of the image and the corresponding grid of the previous transmitted image of the image.
[0010] According to some embodiments, in the weight fitting comparison method, the weight value of the high-order byte corresponding to the data storage in the memory of the RGB565 color mode is higher than the weight value of the low-order byte corresponding to the data storage in the memory of the RGB565 color mode.
[0011] According to some embodiments, comparing the difference values of pixels of a corresponding grid between the image and the previous transmitted image of the image includes comparing the difference values of pixels of a corresponding grid between the image and the previous transmitted image of the image by using mean comparison or pixel voting to calculate the ratio.
[0012] According to some embodiments, determining whether to transmit the corresponding grid data of the image based on the difference value and a preset differentiation determination coefficient includes transmitting the corresponding grid data of the image if the difference value of the corresponding grid of the image and the previous transmitted image of the image is greater than the differentiation determination coefficient.
[0013] According to one aspect of the present application, a device for transmitting an image is proposed, comprising an image gridding unit for gridding the image according to a preset number of gridding partitions in response to an image transmission instruction; a grid difference value comparison unit for comparing the difference values of the corresponding grids of the image and the previous transmitted image of the image; and a data transmission judgment unit for determining whether to transmit the corresponding grid data of the image according to a preset difference judgment coefficient.
[0014] According to one aspect of the present application, an electronic device is provided, comprising a processor; and
[0015] A memory stores a computer program, and when the computer program is executed by the processor, the processor executes the method described in any of the previous embodiments.
[0016] According to one aspect of the present application, a non-transitory computer-readable storage medium is provided, on which computer-readable instructions are stored. When the instructions are executed by a processor, the processor executes the method described in any of the previous embodiments.
[0017] According to an embodiment of the present application, the image to be transmitted is first gridded, and the difference values of the corresponding grids of adjacent transmitted images are compared. Based on the calculated difference value and the preset difference determination coefficient, it is determined whether to transmit the corresponding grid data, thereby greatly reducing the transmission of invalid data and improving the transmission efficiency of image data.
[0018] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments. By describing the exemplary embodiments in detail with reference to the drawings, the above and other objectives, features and advantages of the present application will become more apparent.
[0020] Figure 1 A flow chart of a method for transmitting an image according to an exemplary embodiment of the present application is shown.
[0021] Figure 2 A flow chart of another method for transmitting an image according to an embodiment of the present application is shown.
[0022] Figure 3 A schematic diagram of a RGB565 data storage method is shown.
[0023] Figure 4 A block diagram of a device for transmitting an image according to an exemplary embodiment of the present application is shown.
[0024] Figure 5 An electronic device according to an exemplary embodiment of the present application is shown. DETAILED DESCRIPTION
[0025] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this application will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. In the figures, the same figures show the same or similar parts, and thus their repeated description will be omitted.
[0026] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0027] The described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of these specific details, or other modes, components, materials, devices or operations may be adopted. In these cases, known structures, methods, devices, implementations, materials or operations will not be shown or described in detail.
[0028] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0029] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0030] As mentioned above, the existing image transmission method adopts the method of transmitting all image data, which requires more bandwidth resources on the one hand and more computing resources on the other hand. To solve these problems, according to the embodiment of the present application, the image to be transmitted is first gridded, and the difference values of the corresponding grids of adjacent transmitted images are compared. According to the calculated difference value and the preset difference determination coefficient, it is determined whether to transmit the corresponding grid data, thereby greatly reducing the transmission of invalid data and improving the transmission efficiency of image data.
[0031] The specific embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0032] Figure 1 A flow chart of a method for transmitting an image according to an exemplary embodiment of the present application is shown below. Figure 1 Taking as an example, a method for transmitting an image according to an exemplary embodiment of the present application is described in detail.
[0033] like Figure 1 As shown, in step S101, in response to an image transmission instruction, the image is gridded according to a preset number of gridded partitions.
[0034] It should be noted that, in step S101, the image to be transmitted may be gridded by dividing the image into equal parts evenly or unequally according to the image size, and there is no limitation here.
[0035] For example, the preset number of gridded partitions is 35. In step S101, the image to be transmitted is gridded according to the preset number of gridded partitions to obtain the following: Figure 2 Gridded image shown.
[0036] In step S103, the difference values of the corresponding grids of the image and the last transmitted image of the image are compared.
[0037] According to an embodiment of the present application, what is compared in step S103 is the difference values of pixels of corresponding grids of the image and the last transmitted image of the image.
[0038] In some embodiments, a weighted fitting comparison method is used to compare the difference values of pixels of the corresponding grids of the image and the previous transmitted image of the image.
[0039] Specifically, in step S103, according to the data storage method of the RGB565 color mode in the memory, a weighted fitting comparison method is adopted to compare the difference values of the pixels of the corresponding grid of the image and the previous transmitted image of the image. Wherein, in the weighted fitting comparison method, the weight value of the high-order byte corresponding to the data storage of the RGB565 color mode in the memory is higher than the weight value of the low-order byte corresponding to the data storage of the RGB565 color mode in the memory.
[0040] It should be noted here that in step S103, there is no limitation on the method of calculating the difference values of corresponding grids of adjacent transmitted images. The method of using weighted fitting comparison is only an example. Other methods can also be used to calculate the difference values of corresponding grids, for example, pixel voting calculation ratio or mean comparison method.
[0041] It should also be noted that the last transmitted image of the image refers to the last transmitted image adjacent to the image.
[0042] In step S105, it is determined whether to transmit the corresponding grid data of the image according to the difference value and a preset differentiation determination coefficient.
[0043] For example, if the difference value between the corresponding grid of the image and the last transmitted image of the image is greater than the differential determination coefficient, the corresponding grid data of the image is transmitted. Otherwise, the corresponding grid data of the image is not transmitted.
[0044] according to Figure 1 In the embodiment shown, by comparing the difference values of the corresponding grids of adjacent transmitted images, only the part that is different from the last time is transmitted each time, thereby reducing the transmission of invalid data during image transmission. By ignoring some slightly changed data, the image transmission efficiency can be greatly improved for scenes where the image changes infrequently.
[0045] Figure 2 A flow chart of another method for transmitting an image according to an embodiment of the present application is shown as follows: Figure 2In the above, step S201 is executed to configure the number of grid partitions and the grid differentiation determination coefficient, wherein the number of grid partitions is the number of grid partitions of the image, and the differentiation determination coefficient is the determination threshold for determining whether the grid data is transmitted.
[0046] In step S203, the gridded data of the transmission image is recorded.
[0047] In step S205 , difference values of adjacent images are calculated.
[0048] In step S207, it is determined whether the calculated differentiation value is greater than the grid differentiation determination coefficient.
[0049] If the difference value is greater than the difference determination coefficient, then step S209 is executed to transmit the grid data whose difference value is greater than the difference determination coefficient. Otherwise, step S205 is executed.
[0050] In step S209, the grid data is transmitted, and the grid data of the image recorded in step S205 is updated to facilitate the next analysis and comparison. Step S205 is then executed to calculate the difference value of the corresponding grid between the next image to be transmitted and its adjacent image.
[0051] It should be noted that the grid data with a coefficient greater than the grid differentiation determination coefficient can be transmitted together, or the grid data can be transmitted after each grid determination is completed, and there is no limitation here.
[0052] Figure 3 A schematic diagram of a RGB565 data storage method is shown below. Figure 3 As an example, the calculation process of comparing the difference values of pixels of corresponding grids of adjacent transmitted images by using weighted fitting comparison according to an embodiment of the present application is described in detail.
[0053] According to the embodiment of the present application, the weight of each component R, G, and B at a high position has a greater impact, and the weight of each component R, G, and B at a low position has a smaller impact. In a specific embodiment, "delta_" is used to represent the absolute value of the difference between two values of each component R, G, and B at a certain position. Taking delta_R4 as an example, delta_R4 = |R4-R4'|. R4 and R4' are the values of the R4 position this time and last time, respectively, and |R4-R4'| is the absolute value of the difference between two values of the R4 position.
[0054] For example, when R4=0 and R4′=1, R4−R4′=−1, and delta_R4=|R4−R4′|=1.
[0055] For another example, when R4=0, R4′=0, R4−R4′=0, and delta_R4=|R4−R4′|=0.
[0056] For another example, when R4=1 and R4′=0, R4−R4′=1, and delta_R4=|R4−R4′|=1.
[0057] For another example, when R4=1, R4′=1, R4−R4′=0, and delta_R4=|R4−R4′|=0.
[0058] In a specific embodiment, the weighted difference calculation method of R data is:
[0059] delta_R
[0060] =delta_R4*16+delta_R3*8+delta_R2*4+delta_R1*2+delta_R0.
[0061] The weighted difference calculation method of G data is:
[0062] delta_G
[0063] =delta_G5*32+delta_G4*16+delta_G3*8+delta_G2*4+delta_G1*2+delta_G0.
[0064] The weighted difference calculation method of B data is:
[0065] delta_B
[0066] =delta_B4*16+delta_B3*8+delta_B2*4+delta_B1*2+delta_B0.
[0067] Taking R data as an example, assuming that the differentiation coefficient is set to 4,
[0068] When delta_R4=delta_R3=delta_R2=0, delta_R1=delta_R0=1, delta_R=3<threshold 4, it is determined that the R data of the grid is the same as the last comparison, and the R data of the grid is not transmitted this time;
[0069] When delta_R3=delta_R2=delta_R1=delta_R0=0, delta_R4=1, delta_R=16>4, it is determined that the R data of the grid is different from the last comparison, and the R data of the grid needs to be transmitted this time.
[0070] The above mainly introduces the embodiments of the present application from the perspective of the method. Those skilled in the art should easily appreciate that, in combination with the operations or steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Those skilled in the art can use different ways to implement the described functions for each specific operation or method, and such implementation should not be considered to be beyond the scope of the present application.
[0071] The following describes the device embodiments of the present application. For details not described in the device embodiments of the present application, reference can be made to the method embodiments of the present application.
[0072] Figure 4 A block diagram of a device for transmitting an image according to an exemplary embodiment of the present application is shown. Figure 4 The device shown includes an image gridding unit 401, a grid difference value comparison unit 403, and a data transmission judgment unit 405. The image gridding unit 401 is used to respond to an image transmission instruction and grid the image according to a preset number of gridding partitions; the grid difference value comparison unit 403 is used to compare the difference value of the corresponding grid of the image and the previous transmitted image of the image; the data transmission judgment unit 405 is used to determine whether to transmit the corresponding grid data of the image according to a preset difference determination coefficient.
[0073] Figure 5 An electronic device according to an exemplary embodiment of the present application is shown. Figure 5 The electronic device 200 according to this embodiment of the present application is described. Figure 5 The electronic device 200 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0074] like Figure 5 As shown, the electronic device 200 is in the form of a general computing device. The components of the electronic device 200 may include, but are not limited to: at least one processing unit 210, at least one storage unit 220, a bus 230 connecting different system components (including the storage unit 220 and the processing unit 210), a display unit 240, etc.
[0075] The storage unit stores program codes, which can be executed by the processing unit 210, so that the processing unit 210 executes the methods described in this specification according to various exemplary embodiments of the present application. For example, the processing unit 210 can execute the following: Figure 1 The method shown in .
[0076] The storage unit 220 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 2201 and / or a cache memory unit 2202 , and may further include a read-only memory unit (ROM) 2203 .
[0077] The storage unit 220 may also include a program / utility 2204 having a set (at least one) of program modules 2205, such program modules 2205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0078] Bus 230 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0079] The electronic device 200 may also communicate with one or more external devices 300 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 200, and / or communicate with any device that enables the electronic device 200 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 250. Furthermore, the electronic device 200 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 260. The network adapter 260 may communicate with other modules of the electronic device 200 via the bus 230. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0080] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. The technical solution according to the implementation method of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above method according to the implementation method of the present application.
[0081] The software product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0082] Computer readable storage media may include data signals propagated in baseband or as part of a carrier wave, wherein readable program codes are carried. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program codes contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.
[0083] Program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0084] The computer-readable medium carries one or more programs. When the one or more programs are executed by a device, the computer-readable medium implements the aforementioned functions.
[0085] Those skilled in the art will appreciate that the above modules can be distributed in the device according to the description of the embodiment, or can be changed accordingly and only used in one or more devices different from the embodiment. The modules of the above embodiments can be combined into one module, or further divided into multiple sub-modules.
[0086] According to an embodiment of the present application, a computer program is provided, including a computer program or an instruction. When the computer program or the instruction is executed by a processor, the method described above can be executed.
[0087] The embodiments of the present application are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. At the same time, changes or deformations made by those skilled in the art based on the ideas of the present application, the specific implementation methods and the scope of application of the present application, all belong to the scope of protection of the present application. In summary, the content of this specification should not be construed as a limitation on the present application.
Claims
1. A method for transmitting an image, characterized in that: include: In response to an image transmission instruction, gridding the image according to a preset number of gridding partitions; comparing the difference values of the corresponding grids of the image and the last transmitted image of the image; According to the difference value and a preset differentiation determination coefficient, it is determined whether to transmit the corresponding grid data of the image.
2. The method according to claim 1, characterized in that: Comparing the difference values of the corresponding grids of the image and the last transmitted image of the image, comprising: The difference values of pixels of the corresponding grid of the image and the last transmitted image of the image are compared.
3. The method according to claim 2, characterized in that Comparing the difference values of pixels of the corresponding grids of the image and the last transmitted image of the image comprises: The weighted fitting comparison method is adopted to compare the difference values of the pixels of the corresponding grids of the image and the previous transmitted image of the image.
4. The method according to claim 3, characterized in that The weighted fitting comparison method is used to compare the difference values of pixels of the corresponding grid of the image and the previous transmitted image of the image, including: According to the data storage method of the RGB565 color mode in the memory, a weighted fitting comparison method is adopted to compare the difference values of the pixels of the corresponding grid of the image and the previous transmitted image of the image.
5. The method according to claim 4, characterized in that In the weight fitting comparison method, the weight value of the high-order byte corresponding to the data storage in the memory of the RGB565 color mode is higher than the weight value of the low-order byte corresponding to the data storage in the memory of the RGB565 color mode.
6. The method according to claim 2, characterized in that Comparing the difference values of pixels of the corresponding grids of the image and the last transmitted image of the image comprises: The difference values of pixels of the corresponding grids of the image and the previous transmitted image of the image are compared by using mean comparison or pixel voting to calculate the ratio.
7. The method according to claim 1, characterized in that Determining whether to transmit the corresponding grid data of the image according to the difference value and a preset differentiation determination coefficient includes: If the difference value between the corresponding grid of the image and the last transmitted image of the image is greater than the difference determination coefficient, the corresponding grid data of the image is transmitted.
8. A device for transmitting an image, characterized in that: include: An image gridding unit, configured to grid the image according to a preset number of gridding partitions in response to an image transmission instruction; A grid difference value comparison unit, used for comparing the difference values of the corresponding grids of the image and the last transmitted image of the image; The data transmission determination unit is used to determine whether to transmit the corresponding grid data of the image according to a preset differentiation determination coefficient.
9. An electronic device, comprising: processor; as well as A memory storing a computer program, which, when executed by the processor, enables the processor to perform the method according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having computer-readable instructions stored thereon, which, when executed by a processor, causes the processor to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Online education method, system and device and storage medium
CN113115037A
Video data transmission method and related device
CN115802047A
Method and device for transmitting electronic image information
EP1035736A1
Image data transmission from GPU to system memory
US20100207962A1
Systems and Methods for Selective Transmission of Media Content
US20210058616A1