Image processing method, image processor, human-machine interface and relay protection device

By segmenting an image into a background layer, a primitive layer, and a foreground layer, and converting its color metrics into a bitstream for transmission, the problem of excessively long image transmission time under low-speed serial ports is solved, and fast transmission is achieved.

CN117197447BActive Publication Date: 2026-05-05SCHNEIDER ELECTRIC (CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SCHNEIDER ELECTRIC (CHINA) CO LTD
Filing Date
2022-05-30
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

In relay protection devices, the time required to transmit images through low-speed serial ports is too long, which cannot meet the requirements of high real-time performance.

Method used

The image is segmented into a background layer, a primitive layer, and a foreground layer. The color metric of each layer is converted into a matrix. The image is then transmitted using background layer bitstream, primitive layer bitstream, and foreground layer bitstream, reducing the number of bits required for transmission.

Benefits of technology

It significantly reduces image transmission time and enables fast image transmission under low-speed serial port communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117197447B_ABST
    Figure CN117197447B_ABST
Patent Text Reader

Abstract

An image processing method for a relay protection device is provided, comprising: acquiring an image including at least one preset primitive from a primitive library; segmenting the image into multiple sub-images having preset sizes and segmenting each sub-image into a background layer, a primitive layer, and a foreground layer; identifying the color metric of the background layer of each sub-image to form a background layer color matrix; identifying the primitive index value of the preset primitive in the primitive layer of each sub-image in the primitive library to form a primitive layer matrix; identifying the color metric of the foreground layer of each sub-image to form a foreground layer color matrix; and converting the background layer color matrix, the primitive layer matrix, and the foreground layer color matrix into corresponding background layer bitstream, primitive layer bitstream, and foreground layer bitstream.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This field relates to an image processing method, an image processor, a human-machine interface for a relay protection device, and a relay protection device including the image processor and the human-machine interface. Background Technology

[0002] Serial port communication is widely used in relay protection devices due to its low cost and high reliability. The processor and human-machine interface within the relay protection device transmit images via serial port communication. However, with low-speed serial ports, the time required to transmit images is relatively long. For example, transmitting a 320*240 pixel image via serial port communication at a baud rate of 115200 b / s takes approximately 20 seconds to complete. Summary of the Invention

[0003] Therefore, the purpose of this disclosure is to provide an image processing method for a relay protection device, which reduces the transmission time by reducing the total number of bits required to transmit the image, so that the image can be transmitted quickly even via low-speed serial port communication.

[0004] One aspect of this disclosure provides an image processing method. The method includes: acquiring an image, the image including at least one preset primitive from a primitive library, the primitive library including multiple preset primitives, each preset primitive having a preset size and a unique primitive index value; segmenting the image into multiple sub-images having the preset size, and segmenting each sub-image into a background layer, a primitive layer, and a foreground layer; identifying a color metric of the background layer of each sub-image and using the identified color metric as a matrix element to form a background layer color matrix; identifying the primitive index value of the preset primitive in the primitive layer of each sub-image in the primitive library and using the identified primitive index value as a matrix element to form a primitive layer matrix; identifying a color metric of the foreground layer of each sub-image and using the identified color metric as a matrix element to form a foreground layer color matrix; and converting the background layer color matrix, the primitive layer matrix, and the foreground layer color matrix into corresponding background layer bitstream, primitive layer bitstream, and foreground layer bitstream.

[0005] Optionally, the color metric for identifying the background layer of each sub-image includes identifying the RGB or HSL values ​​of the background layer; and the color metric for identifying the foreground layer of each sub-image includes identifying the RGB or HSL values ​​of the foreground layer.

[0006] Optionally, the color metric for identifying the background layer of each sub-image includes identifying the color index value of the background layer in a color library, and the color metric for identifying the foreground layer of each sub-image includes identifying the color index value of the foreground layer in a color library, wherein the color library includes multiple colors and each color has a unique color index value.

[0007] Optionally, the method further includes detecting whether each of the background layer color matrix, the primitive layer matrix, and the foreground layer color matrix has more than a predetermined number of consecutive identical matrix elements; and if more than a predetermined number of consecutive identical matrix elements exist, converting the background layer color matrix, the primitive layer matrix, and the foreground layer color matrix into corresponding background layer bitstream, primitive layer bitstream, and foreground layer bitstream includes: converting the more than predetermined number of consecutive identical matrix elements into bits representing the matrix elements and the number of consecutive identical matrix elements.

[0008] Optionally, the method further includes transmitting the background layer bit stream, primitive layer bit stream, and foreground layer bit stream via a serial port.

[0009] Another aspect of this disclosure provides an image processor for a relay protection device. The processor includes: an acquisition unit configured to acquire an image including at least one preset primitive from a primitive library, the primitive library including multiple preset primitives, each preset primitive having a preset size and a unique primitive index value; a segmentation unit configured to segment the image into multiple sub-images having preset sizes, and to segment each sub-image into a background layer, a primitive layer, and a foreground layer; a digitization unit configured to: identify a color metric of the background layer of each sub-image and use the identified color metric as a matrix element to form a background layer color matrix; identify primitive index values ​​of preset primitives in the primitive layer of each sub-image in the primitive library and use the identified primitive index values ​​as matrix elements to form a primitive layer matrix; and identify a color metric of the foreground layer of each sub-image and use the identified color metric as a matrix element to form a foreground layer color matrix; and an encoding unit configured to convert the background layer color matrix, the primitive layer matrix, and the foreground layer color matrix into corresponding background layer bitstreams, primitive layer bitstreams, and foreground layer bitstreams.

[0010] Optionally, the digitization unit is further configured to: identify the RGB or HSL value of the background layer color of each sub-image as the color metric of the background layer; and identify the RGB or HSL value of the foreground layer color of each sub-image as the color metric of the foreground layer.

[0011] Optionally, the digitization unit is further configured to: identify the color index value of the background layer of each sub-image in a color library as the color metric of the background layer, and identify the color index value of the foreground layer of each sub-image in a color library as the color metric of the foreground layer, wherein the color library includes a variety of colors and each color has a unique color index value.

[0012] Optionally, the image processor further includes a redundancy detection unit configured to detect whether each of the background layer color matrix, the primitive layer matrix, and the foreground layer color matrix has more than a predetermined number of consecutive identical matrix elements; and if more than a predetermined number of consecutive identical matrix elements exist, the encoding unit is further configured to: convert the more than predetermined number of consecutive identical matrix elements into bits representing the number of matrix elements and the number of consecutive identical matrix elements during the conversion of the background layer color matrix, the primitive layer matrix, and the foreground layer color matrix into corresponding background layer bitstream, primitive layer bitstream, and foreground layer bitstream.

[0013] Optionally, the image processing further includes a transceiver unit configured to transmit the background layer bit stream, primitive layer bit stream, and foreground layer bit stream via a serial port.

[0014] According to another aspect of this disclosure, a human-machine interface (HMI) for a relay protection device is provided. The HMI includes: a transceiver unit configured to receive, via a serial port, the background layer bitstream, the primitive layer bitstream, and the foreground layer bitstream generated by the image processor as described above; a decoding unit configured to decode the background layer bitstream, the primitive layer bitstream, and the foreground layer bitstream into a background layer color matrix, a primitive layer matrix, and a foreground layer color matrix; a restoration unit configured to restore the background layer color matrix, the primitive layer matrix, and the foreground layer color matrix into the background layer, primitive layer, and foreground layer of the plurality of sub-images by identifying the colors indicated by each matrix element in the background layer color matrix, the preset primitives indicated by each matrix element in the primitive layer matrix, and the colors indicated by each matrix element in the foreground layer color matrix; and a merging unit configured to merge the background layer, primitive layer, and foreground layer of the plurality of sub-images into the plurality of sub-images respectively, and to stitch the plurality of sub-images together into the image.

[0015] Another aspect of this disclosure provides a relay protection device. The relay protection device includes: an image processor as described above; a human-machine interface as described above, which communicates with the image processor via a serial port; a memory configured to store the primitive library; and an image generator that generates the image by selecting at least one preset primitive from the primitive library.

[0016] The image processing method, image processor, human-machine interface, and relay protection device including the image processor and human-machine interface according to embodiments of the present disclosure can reduce the time required to transmit images. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the description of the embodiments are briefly introduced below. Obviously, the drawings described below are merely some exemplary embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0018] Figure 1 This is a schematic structural block diagram of a relay protection device according to an embodiment of the present disclosure;

[0019] Figure 2A It is a schematic diagram library according to embodiments of this disclosure;

[0020] Figure 2B These are schematic images based on embodiments of the present disclosure;

[0021] Figure 3 This is a schematic flowchart of an image processing method according to an embodiment of the present disclosure;

[0022] Figure 4 This is a schematic diagram showing a sub-image being segmented into a background layer, a primitive layer, and a foreground layer according to an embodiment of the present disclosure.

[0023] Figure 5 This is an illustrative color library according to embodiments of the present disclosure;

[0024] Figure 6 This is a schematic structural block diagram of an image processor according to embodiments of the present disclosure; and

[0025] Figure 7 This is a schematic structural block diagram of a human-machine interface according to an embodiment of the present disclosure. Detailed Implementation

[0026] The present disclosure will now be described in detail with reference to exemplary embodiments thereof. However, the present disclosure is not limited to the embodiments described herein, which may be implemented in many different forms. The described embodiments are provided only to make the present disclosure thorough and complete, and to fully convey the concept of the present disclosure to those skilled in the art. Features of the various embodiments described may be combined with or substituted for each other, unless expressly excluded or should be excluded according to the context. Unless otherwise defined, the technical or scientific terms used in this disclosure should be understood in their ordinary sense by one of ordinary skill in the art to which this disclosure pertains.

[0027] As mentioned earlier, in relay protection devices, images are transmitted from the processor to the human-machine interface (HMI) via a serial port. The current transmission method involves converting the color metric values ​​(e.g., RGB, HSL, HSB, YUV, or YCbCr values) of each pixel in the image into a bitstream before transmitting it to the HMI. Using this method, for a 320*240 pixel image, if RGB values ​​are used as its color metric, each pixel requires 24 bits to represent, resulting in a total of 1,843,200 bits needed to transmit the image. At a baud rate of 115200 b / s, this transmission takes approximately 20 seconds. This transmission time is undesirable for the high real-time requirements of relay protection.

[0028] Figure 1 This is a schematic structural block diagram of a relay protection device according to an embodiment of the present disclosure.

[0029] refer to Figure 1 According to embodiments of this disclosure, the relay protection device 100 is associated with an electrical system to protect the safety of circuits and electrical equipment within the electrical system. Electrical measurement data in the electrical system, such as voltage, current, and switch status, are acquired by a data acquisition device and transmitted to the relay protection device 100. The data acquisition device includes voltage sensors, current sensors, and other devices capable of sensing electrical measurement data in the electrical system. The data acquisition device may also be located inside the relay protection device 100 or as part of it. As shown, the relay protection device 100 includes a memory 110, an image generator 120, an image processor 130, and a human-machine interface 140.

[0030] The memory 110 stores a primitive library, which includes multiple preset primitives, each of which has a preset size and a unique primitive index value.

[0031] Image generator 120 receives electrical measurement data from the data acquisition device and generates an image characterizing the real-time electrical characteristics of the electrical system by selecting at least one preset graphic element from a graphic element library. Image generator 120 also assigns different colors to some of the at least one preset graphic element to highlight them for easier viewing by the user. Image generator 120 can select colors based on the default color model in relay protection device 100. The default color model can be RGB, HSL, YUV, or YCbCr, etc.

[0032] The following is combined Figure 2A and Figure 2B This will illustrate the process by which image generator 120 generates images.

[0033] Figure 2A It is a schematic diagram library according to an embodiment of this disclosure. Figure 2BThis is a schematic image based on an embodiment of the present disclosure.

[0034] refer to Figure 2A The primitive library 200 includes multiple preset primitives. For example, there are preset primitives IE0 (presented as blank), IE1-IE10 (presented as numbers 0-9), IE11-IE36 (presented as uppercase letters A-Z), IE37-IE62 (presented as lowercase letters a-z), IE63 (presented as a centered vertical line), IE64 (presented as a centered horizontal line), and so on. Each of these preset primitives has a preset size, such as 6*8 pixels. Each of these preset primitives has a unique primitive index value in the primitive library, such as 0-100.

[0035] refer to Figure 2B Image generator 120 generates image 210 by selecting at least one preset primitive from primitive library 200. As an example only, as shown in the figure, image generator 120 selects preset primitives IE81, IE64, IE12, IE2-IE4, IE85, IE100, IE65, IE63, IE82, IE84, and IE80 from primitive library 200 and places these preset primitives on a canvas of a certain size (e.g., 320*240), the size of which depends on the display size of human-machine interface 140. Image 210 presents three switch elements, including two switches in an open state presented by a combination of IE100 and IE65, and one switch in a closed state presented by a combination of IE100 and IE63. To highlight, image generator 120 assigns yellow to the two switches in the open state, red to the switch in the closed state (as indicated by the arrow in the figure), and blue to the letter "B" and the numbers "1", "2", and "3" (as indicated by the brackets in the figure). In addition, image generator 120 also assigns white to the background of image 210.

[0036] It should be noted that, Figure 2A The primitive library 200 shown in the figure and Figure 2B The image 210 shown is for illustrative purposes only. The shape and number of preset primitives in the primitive library 200 are not limited to this, nor are the specific contents of the image 210. Furthermore, the size of the preset primitives in the image 210 is not shown to scale with the overall size of the image 210.

[0037] Back Figure 1 The image processor 130 acquires the image 210 from the image generator 120 and implements the image processing method according to an embodiment of the present disclosure to reduce the time required to transmit the image to the human-machine interface.

[0038] Figure 3This is a schematic flowchart of an image processing method according to an embodiment of the present disclosure.

[0039] refer to Figure 3 The image processing method 300 according to an embodiment of the present disclosure includes steps S310 to S360. In step S310, an image is acquired, the image including at least one preset primitive from a primitive library, the primitive library including multiple preset primitives, each preset primitive having a preset size and a unique primitive index value. In step S320, the image is segmented into multiple sub-images having preset sizes, and each sub-image is segmented into a background layer, a primitive layer, and a foreground layer. In step S330, the color metric of the background layer of each sub-image is identified, and the identified color metric is used as a matrix element to form a background layer color matrix. In step S340, the primitive index value of the preset primitive in the primitive layer of each sub-image is identified in the primitive library, and the identified primitive index value is used as a matrix element to form a primitive layer matrix. In step S350, the color metric of the foreground layer of each sub-image is identified, and the identified color metric is used as a matrix element to form a foreground layer color matrix. In step S360, the background layer color matrix, primitive layer matrix, and foreground layer color matrix are converted into corresponding background layer bitstream, primitive layer bitstream, and foreground layer bitstream.

[0040] Steps S310 to S360 are described below with an example.

[0041] In this example, in step S310, the image processor 130 obtains image 210 as shown in FIG. 2B from the image generator 120. Image 210 has a size of 320*240 pixels. Image 210 includes preset primitives IE81, IE64, IE12, IE2, IE3, IE4, IE85, IE100, IE65, IE63, IE82, IE84, and IE80 from the primitive library 200. Each preset primitive has a size of 6*8 pixels and has a unique primitive index value of 81, 64, 12, 2, 3, 4, 85, 100, 65, 63, 82, 84, and 80 in the primitive library.

[0042] In this example, in step S320, the image processor 130 divides the image 210 into 40*40 sub-images of size 6*8 pixels. Each sub-image is then divided into a background layer, a primitive layer, and a foreground layer, thereby dividing the image 210 into 40*40 background layers, 40*40 primitive layers, and 40*40 foreground layers of size 6*8 pixels.

[0043] Figure 4 This is a schematic diagram illustrating how a sub-image is segmented into a background layer, a primitive layer, and a foreground layer according to an embodiment of the present disclosure. (See reference) Figure 4For example, subimage 410 is divided into a white background layer 411, a primitive layer presenting the capital letter "B", and a blue (as indicated by the arrow in the figure) foreground layer 413.

[0044] In this example, in step S330, the image processor 130 first identifies the color of each of the 40*40 background layers, each with a size of 6*8 pixels, and obtains the RGB value of that color as its color metric based on the RGB color model. For example, the image processor 130 identifies the color of the background layer 411 of sub-image 410 as white, and obtains its RGB value as (0,0,0) according to the RGB model. Similarly, the image processor 130 obtains RGB values ​​of (0,0,0) for all 40*40 background layers. Then, the image processor 130 arranges these 40*40 RGB values ​​(0,0,0) according to the position of the corresponding sub-image in image 210 to form the following background layer color matrix M. BG Background layer color matrix M BG Each element of the matrix is ​​(0,0,0).

[0045]

[0046] In this example, in step S340, the image processor 130 first identifies the preset primitives of each of the 40*40 primitive layers with a size of 6*8 pixels. Specifically, for blank sub-images without any preset primitives (such as...), Figure 2B As shown, the sub-image 211 located in the upper left corner of image 210 is identified by image processor 130 as a blank preset primitive IE0 in primitive library 200. Then, image processor 130 retrieves the primitive index value of this preset primitive in primitive library 200. For example, image processor 130 finds that the primitive index value of sub-image 412 in primitive library 200 is 12. Similarly, image processor 130 retrieves the primitive index values ​​of each of the 40*40 primitive layers. Then, image processor 130 arranges these 40*40 primitive index values ​​according to the position of the corresponding sub-image in image 210 to form the following primitive layer matrix M. IE .

[0047]

[0048] In this example, in step S350, the image processor 130 first identifies the color of each background layer in the 40*40 foreground layers, each with a size of 6*8 pixels, and obtains the RGB value of that color as its color metric according to the RGB color model. For example, the image processor 130 identifies the color of the foreground layer 413 of sub-image 410 as blue, and obtains the RGB value corresponding to blue as (0,0,255) according to the RGB color model. Similarly, the image processor 130 obtains the RGB values ​​of each of the 40*40 background layers. Then, these 40*40 RGB values ​​are arranged according to the position of the corresponding sub-image in image 210 to form the following foreground layer color matrix M. FG It should be noted that, for simplicity, matrix M is used here. FG The image only lists the RGB values ​​of the foreground layer of the rendering switch element and the sub-image of the letter "B" in image 210.

[0049]

[0050] In step S360, the background layer color matrix M BG primitive layer matrix M IE and the foreground layer color matrix M FG These are converted into corresponding background layer bitstream, primitive layer bitstream, and foreground layer bitstream, respectively.

[0051] Background layer color matrix M BG It has 40*40 matrix elements, each indicating an RGB value requiring 24 bits to represent, and the background layer bitstream has 38400 bits. Primitive layer matrix M IE It has 40*40 matrix elements, each indicating a primitive index value. Since image 210 is used to characterize the electrical characteristics of an electrical system, the preset primitives are used to draw common electrical symbols, numbers, and letters, so the number of preset primitives is limited. In practice, 200 preset primitives are sufficient to depict images such as image 210, so 8 bits are sufficient to represent all primitive index values; therefore, the primitive layer bitstream has 12800 bits. Foreground layer color matrix M FG It has 40*40 matrix elements, each matrix element indicating an RGB value and requiring 24 bits to represent, so the foreground layer bitstream has 38,400 bits. Therefore, the total number of bits in the background layer bitstream, primitive layer bitstream, and foreground layer bitstream is 89,600 bits.

[0052] Following step S360, the image processing method 300 may further include step S370 of transmitting the background layer bitstream, primitive layer bitstream, and foreground layer bitstream via a serial port. For example, the image processor 130 transmits a background layer bitstream, primitive layer bitstream, and foreground layer bitstream with a total bit count of 89,600 to the human-machine interface 140. At a baud rate of 115,200 b / s, the transmission time is approximately 0.972 seconds. This significantly reduces the transmission time compared to the 20-second transmission time achievable with current technology.

[0053] Thus, the image processing method 300 according to the embodiments of this disclosure achieves a significant reduction in image transmission time by reducing the total number of bits required to transmit the image.

[0054] The preceding description describes how image processor 130 assigns different colors to elements in image 210, such as switch elements, the letter "B," and the numbers "1," "2," and "3," based on color models like RGB and HSL, to highlight them for easier viewing by the user. However, in practice, only a few colors are used when drawing images like image 210; about a dozen are sufficient. Therefore, 8 bits are enough to represent all colors, reducing the number of bits compared to using 24 bits to represent each color. Considering this, an alternative embodiment of image processing method 300 is proposed.

[0055] In this alternative embodiment, the memory 110 of the relay protection device 100 also stores a color library, which includes a variety of colors, each with a unique color index value. By using the color index values ​​in the color library as color metrics, the total number of bits required to transmit the image can be further reduced, thereby reducing the image transmission time.

[0056] Figure 5 This is an illustrative color library according to embodiments of this disclosure. (See also...) Figure 5 The color library 500 stores 20 colors, including transparent (C0), yellow (C1), red (C9), white (C10), blue (C11), and black (C19). Each color has a unique color index value, ranging from 0 to 19.

[0057] In this alternative embodiment, the image generator 120 selects a color from a color library 500 when assigning a color to some preset primitives in the image 210.

[0058] In this alternative embodiment, when implementing step S330 of the image processing method 300, the image processor 130 identifies the color metric of the background layer of each sub-image, which includes identifying the color index value of the background layer in the color library 500.

[0059] Referring back to the previous example, image processor 130 first identifies the color of each of the 40*40 background layers, each with a size of 6*8 pixels, and retrieves the color index value of that color from the color library 500. For example, image processor 130 identifies that all 40*40 background layers are white and retrieves the color index value of white as 10. Then, image processor 130 arranges these 40*40 color index values ​​of 10 according to the position of the sub-images in image 210 to form the following background layer color matrix M′. BG Background layer color matrix M′ BG Each element of the matrix is ​​10.

[0060]

[0061] In this alternative embodiment, when the image processor performs step S350 of the image processing method 300, identifying the color metric of the foreground layer of each sub-image includes identifying the color index value of the foreground layer in the color library 500.

[0062] Continuing with the previous example, the image processor 130 first identifies the color of each of the 40*40 foreground layers, each with a size of 6*8 pixels, and retrieves the index value of that color from the color library 500. For example, the image processor 130 identifies the color of the foreground layer 413 of sub-image 410 as blue and retrieves its color index value as 11 from the color library. For sub-images without predefined primitive blanks (e.g., sub-image 211 located in the upper left corner of image 210), the image processor 130 identifies its foreground layer color as transparent, with a corresponding color index value of 0. Then, the image processor 130 arranges the 40*40 color index values ​​according to the position of the corresponding sub-image in image 210 to form the following foreground layer color matrix M′. FG .

[0063]

[0064] In this alternative embodiment, due to the background layer color matrix M′ BG and the foreground layer color matrix M′ FG Each matrix element in the image processor indicates a color index value and requires only 8 bits to represent. The number of bits in the background layer bitstream obtained by image processor 130 in step S360 is reduced to 12800 bits, and the number of bits in the foreground layer bitstream is also reduced to 12800 bits. Therefore, the total number of bits in the background layer bitstream, primitive layer bitstream, and foreground layer bitstream transmitted by image processor 130 via the serial port in step S370 is reduced to 38400 bits. At a baud rate of 115200 b / s, the image transmission time is further reduced to approximately 0.417 seconds.

[0065] Thus, image processing method 300 achieves a further reduction in image transmission time by using color index values ​​from a color library instead of RGB values ​​as color measures for the background and foreground layers.

[0066] Based on the previous example, the background layer color matrix, primitive layer matrix, and foreground layer color matrix may have a large number of consecutive identical matrix elements. For example, in the previous example, the background layer matrix M... BG All matrix elements are 0 or the background layer matrix M′ BG The matrix elements are all 10, and the primitive layer matrix M IE Most of the matrix elements in the matrix are blank preset primitives with primitive index value 0 (IE0). The foreground color matrix M′... FG Most of the matrix elements in the image processing method 300 also represent the color metric value 0, which represents transparency. With this in mind, an alternative embodiment of the image processing method 300 is proposed.

[0067] In this alternative embodiment, after steps S330, S340, and S350, the image processing method 300 may further include step S350', which detects whether each of the background layer color matrix, the primitive layer matrix, and the foreground layer color matrix contains more than a predetermined number of consecutive identical matrix elements. Furthermore, if the presence of more than a predetermined number of consecutive identical matrix elements is detected, in step S360, converting the background layer color matrix, the primitive layer matrix, and the foreground layer color matrix into corresponding bitstreams includes converting the more than predetermined number of consecutive identical matrix elements into bits representing the matrix element and the number of consecutive identical matrix elements. Here, the predetermined number relates to the number of bits reduced by converting the more than predetermined number of consecutive identical matrix elements into bits representing the matrix element and the number of consecutive identical matrix elements.

[0068] Using the previous example, let's set the predetermined number to 40. For the background layer matrix M′ BG The image processor 130 can detect that it contains 1600 consecutive identical matrix elements 10. Then the image processor 130 can determine the background layer matrix M′. BG This is converted into bits representing "10, quantity 1600". For example, this conversion can be achieved using a sparse matrix compression algorithm. The number of bits required to represent "10, quantity 1600" is greater than the number of bits required to represent the background layer matrix M′. BG Each matrix element in this matrix requires fewer bits. Similarly, for the primitive layer matrix M... IE The image processor 130 can detect, for example, that its first to sixth rows contain 640 consecutive identical matrix elements of 0, and its second to fourth rows also contain 640 consecutive identical matrix elements of 0. Then the image processor 130 can classify the primitive layer matrix M... IERows 1-16 and 25-40 are converted into bits representing "0, quantity 640", while rows 17-24 are still converted into bits representing the elements of the original matrix. The total number of bits in the resulting primitive layer bitstream is greater than that of the primitive layer matrix M. IE Each matrix element in this matrix requires fewer bits. Similarly, for the foreground layer color matrix M′, the number of bits required is also less. FG The image processor 130 can detect that rows 1 to 16 and rows 25 to 40 each contain 640 consecutive identical matrix elements of 0. Therefore, the image processor 130 can determine the foreground layer color matrix M′. FG Lines 1-16 and 25-40 are converted to bits representing "0, quantity 640", while lines 17-24 are still converted to bits representing their original matrix elements. The ratio of the number of bits in the resulting foreground layer bitstream to the number of bits in the foreground layer color matrix M′ represents the foreground layer color matrix. FG Each matrix element requires fewer bits.

[0069] Thus, in this alternative embodiment, more than a predetermined number of consecutive identical matrix elements are converted into bits representing the matrix element and the number of consecutive identical matrix elements, thereby further reducing the total number of bits in the background layer bitstream, primitive layer bitstream, and foreground layer bitstream.

[0070] The image processing method 300 has been described above. The image processor 130 and the human-machine interface 140 are described below.

[0071] Figure 6 This is a schematic structural block diagram of an image processor according to an embodiment of the present disclosure.

[0072] The image processor 130 according to an embodiment of the present disclosure includes an acquisition unit 610, a segmentation unit 620, a digitization unit 630, and an encoding unit 640.

[0073] The acquisition unit 610 is configured to acquire an image. The image includes at least one preset primitive from a primitive library. The primitive library includes multiple preset primitives, each with a preset size and a unique primitive index value. For example, the acquisition unit 610 acquires an image such as... Figure 2B The image 210 shown. Image 210 includes preset primitives IE81, IE64, IE12, IE2 to IE4, IE85, IE100, IE65, IE63, IE82, IE84 and IE80 from, for example, primitive library 200.

[0074] The segmentation unit 620 is configured to segment an image into multiple sub-images of preset sizes, and to segment each sub-image into a background layer, a primitive layer, and a foreground layer. For example, the segmentation unit 620 segments an image 210 with a size of 320*240 into 40*40 sub-images with a size of 6*8. Furthermore, the segmentation unit 620 segments each sub-image into a background layer, a primitive layer, and a foreground layer, such as... Figure 4 The sub-image 410 shown is divided into a background layer 411, a primitive layer 412, and a foreground layer 413.

[0075] The digitization unit 630 is configured to identify the color metric of the background layer of each sub-image and use the identified color metric as a matrix element to form a background layer color matrix; identify the primitive index value of a preset primitive in the primitive layer of each sub-image in the primitive library and use the identified primitive index value as a matrix element to form a primitive layer matrix; and identify the color metric of the foreground layer of each sub-image and use the identified color metric as a matrix element to form a foreground layer color matrix.

[0076] In one embodiment, the digitization unit 630 identifies the RGB values ​​of the background layer color of each sub-image as the background layer color metric and the RGB values ​​of the foreground layer color of each sub-image as the foreground layer color metric. For example, the digitization unit 630 identifies the RGB value of the background layer 411 of sub-image 410 as (0,0,0), identifies the primitive index value of the preset primitive of primitive layer 412 of sub-image 410 in primitive library 200 as 12, and identifies the RGB value of the foreground layer 413 of sub-image 410 as (0,0,255). In this way, the aforementioned background layer color matrix M is obtained. BG primitive layer matrix M IE and the foreground layer color matrix M FG .

[0077] In another embodiment, the digitization unit 630 identifies the color index value of the background layer color of each sub-image in the color library 500 as the color metric of the background layer, and identifies the color index value of the foreground layer color of each sub-image in the color library 500 as the color metric of the foreground layer. For example, the digitization unit identifies that the background layer 411 of sub-image 410 is white, with a color index value of 10 in the color library 500, identifies that the preset primitive of the primitive layer 412 of sub-image 410 has a primitive index value of 12 in the primitive library 200, and identifies... Figure 4 The foreground layer 413 is blue, with a color index of 11 in the color library 500. The background layer color matrix M′ is obtained in this way. BG primitive layer matrix M IE and the foreground layer color matrix M′ FG .

[0078] Encoding unit 640 is configured to input the background layer color matrix M BG or M′ BG primitive layer matrix M IE and the foreground layer color matrix M FG or M′ FG Converted into corresponding background layer bitstream, primitive layer bitstream, and foreground layer bitstream.

[0079] The image processor 130 also includes a transceiver unit 650 configured to transmit background layer bitstream, primitive layer bitstream and foreground layer bitstream to the human interface 140 via a serial port.

[0080] Additionally, the image processor 130 may also include a redundancy detection unit 660, which is configured to detect the background layer color matrix M. BG or M′ BG primitive layer matrix M IE and the foreground layer color matrix M FG or M′ FG Does each of the matrices contain more than a predetermined number of consecutive identical matrix elements? And, if there are more than a predetermined number of consecutive identical matrix elements, the encoding unit 640, during the conversion of these matrices into a bit stream, converts the more than predetermined number of consecutive identical matrix elements into bits representing the matrix element and the number of consecutive identical matrix elements.

[0081] Thus, the total number of bits required for the image processor 130 to send the image 210 to the human-machine interface 140 via the serial port is significantly reduced compared to the total number of bits required to send the RGB value of each pixel of the image 210, and the transmission time is also significantly reduced.

[0082] Figure 7 This is a schematic structural block diagram of the human-machine interface 140 according to an embodiment of the present disclosure.

[0083] According to an embodiment of the present disclosure, the human-machine interface 140 includes a transceiver unit 710, a decoding unit 720, a restoration unit 730, and a merging unit 740.

[0084] The transceiver unit 710 is configured to receive, via a serial port, the background layer bitstream, the primitive layer bitstream, and the foreground layer bitstream generated by the aforementioned image processor 130.

[0085] The decoding unit 720 is configured to decode the background layer bitstream, primitive layer bitstream, and foreground layer bitstream into a background layer color matrix, a primitive layer matrix, and a foreground layer color matrix. For example, the decoding unit 720 obtains the background layer color matrix M by performing an action that is the inverse of the action performed by the encoding unit 640 in the image processor 130.BG or M′ BG primitive layer matrix M IE and the foreground layer color matrix M FG or M′ FG .

[0086] The restoration unit 730 is configured to restore the background layer color matrix, primitive layer matrix, and foreground layer color matrix into background, primitive, and foreground layers of multiple sub-images by recognizing the colors indicated by each matrix element in the background layer color matrix, the preset primitives indicated by each matrix element in the primitive layer matrix, and the colors indicated by each matrix element in the foreground layer color matrix. The restoration unit 730 restores the background, primitive, and foreground layers of the multiple sub-images by performing an action that is the inverse of the action performed by the digitization unit 630 in the image processor 130.

[0087] The merging unit 740 is configured to merge the background layer, primitive layer, and foreground layer of the multiple sub-images into multiple sub-images respectively, and to stitch the multiple sub-images together to form an image. The merging unit 740 derives the multiple sub-images by performing an action that is the inverse of the action performed by the segmentation unit 620 in the image processor 130, for example, by... Figure 4 The background layer 411, primitive layer 412, and foreground layer 413 shown are exported as sub-images 410. The sub-images are then combined into image 210 for user viewing.

[0088] The above is only based on Figure 6 and Figure 7 Parts of the image processor 130 and human-machine interface 140 according to embodiments of the present disclosure have been described, and the image processor 130 and human-machine interface 140 may be referenced and cited in connection with the foregoing image processing method 300 and its additional aspects, as well as the accompanying drawings. For example, one or more steps in the foregoing image processing method 300 may be modified to implement the image processor 130 and human-machine interface 140 and their additional aspects. To avoid repetition, further details are omitted here.

[0089] According to the image processing method 300 of the present disclosure, an image processor 130 and a human-machine interface 140, and a relay protection device 100 including the image processor 130 and the human-machine interface 140 and communicating between the two via a serial port, reduce the time required to transmit the image by reducing the total number of bits required to transmit the image, thereby improving the real-time performance of conveying the evolution of electrical system characteristics.

[0090] Those skilled in the art should understand that the specific embodiments described above are merely examples and not limitations. Various modifications, combinations, partial combinations, and substitutions can be made to the embodiments of this disclosure according to design requirements and other factors, as long as they are within the scope of the appended claims or their equivalents, and thus fall within the scope of the rights to be protected by this disclosure.

Claims

1. An image processing method for relay protection devices, comprising: Acquire an image, the image including at least one preset primitive from a primitive library, the primitive library including multiple preset primitives and each preset primitive having a preset size and a unique primitive index value; The image is segmented into multiple sub-images with the preset size, and each sub-image is segmented into a background layer, a primitive layer, and a foreground layer; Identify the color metric of the background layer for each sub-image and use the identified color metric as a matrix element to form the background layer color matrix; Identify the primitive index value of the preset primitive in the primitive layer of each sub-image in the primitive library and use the identified primitive index value as a matrix element to form a primitive layer matrix; Identify the color metric of the foreground layer for each sub-image and use the identified color metric as a matrix element to form the foreground layer color matrix; as well as The background layer color matrix, the primitive layer matrix, and the foreground layer color matrix are converted into corresponding background layer bitstream, primitive layer bitstream, and foreground layer bitstream.

2. The image processing method according to claim 1, wherein... The color metric for identifying the background layer of each sub-image includes identifying the RGB or HSL values ​​of the background layer's color; and The color metric for identifying the foreground layer of each sub-image includes identifying the RGB or HSL values ​​of the foreground layer's color.

3. The image processing method according to claim 1, wherein... The color metric for identifying the background layer of each sub-image includes identifying the color index value of the background layer in a color library, and The color metric for identifying the foreground layer of each sub-image includes identifying the color index value of each foreground layer in a color library, wherein... The color library includes multiple colors, and each color has a unique color index value.

4. The image processing method according to claim 3, further comprising: Detect whether there is more than a predetermined number of consecutive identical matrix elements in each of the background layer color matrix, the primitive layer matrix, and the foreground layer color matrix; and In the case where there is more than a predetermined number of consecutive identical matrix elements, converting the background layer color matrix, the primitive layer matrix, and the foreground layer color matrix into corresponding background layer bitstream, primitive layer bitstream, and foreground layer bitstream includes: converting the more than predetermined number of consecutive identical matrix elements into bits representing the matrix elements and the number of consecutive identical matrix elements.

5. The image processing method according to any one of claims 1 to 4, further comprising: The background layer bit stream, the primitive layer bit stream, and the foreground layer bit stream are transmitted via a serial port.

6. An image processor for a relay protection device, comprising: The acquisition unit is configured to acquire an image, the image including at least one preset primitive from a primitive library, the primitive library including multiple preset primitives and each preset primitive having a preset size and a unique primitive index value; The segmentation unit is configured to segment the image into multiple sub-images with a preset size, and to segment each sub-image into a background layer, a primitive layer, and a foreground layer; The digital unit is configured as follows: Identify the color metric of the background layer for each sub-image and use the identified color metric as a matrix element to form the background layer color matrix; Identify the primitive index value of the preset primitive in the primitive layer of each sub-image in the primitive library and use the identified primitive index value as a matrix element to form a primitive layer matrix; as well as Identify the color metric of the foreground layer for each sub-image and use the identified color metric as matrix elements to form the foreground layer color matrix; as well as The encoding unit is configured to convert the background layer color matrix, the primitive layer matrix, and the foreground layer color matrix into corresponding background layer bitstream, primitive layer bitstream, and foreground layer bitstream.

7. The image processor according to claim 6, wherein, The digitization unit is also configured to: Identify the RGB or HSL value of the background layer color for each sub-image as the color metric for the background layer; and Identify the RGB or HSL value of the foreground layer color for each sub-image as the color metric for the foreground layer.

8. The image processor according to claim 6, wherein the digitization unit is further configured to: The color index value of the background layer color in the color library is identified for each sub-image and used as the color metric for that background layer. The color index value of the foreground layer color in the color library is identified for each sub-image and used as the color metric for the foreground layer, where... The color library includes a variety of colors, and each color has a unique color index value.

9. The image processor according to claim 8, further comprising: The redundancy detection unit is configured to detect whether each of the background layer color matrix, the primitive layer matrix, and the foreground layer color matrix contains more than a predetermined number of consecutive identical matrix elements; and In the presence of more than a predetermined number of consecutive identical matrix elements, the encoding unit is further configured to: convert the more than predetermined number of consecutive identical matrix elements into bits representing the number of the matrix elements and the number of consecutive identical matrix elements during the conversion of the background layer color matrix, the primitive layer matrix, and the foreground layer color matrix into the corresponding background layer bitstream, primitive layer bitstream, and foreground layer bitstream.

10. The image processor according to any one of claims 6 to 9, further comprising: The transceiver unit is configured to transmit the background layer bit stream, the primitive layer bit stream, and the foreground layer bit stream via a serial port.

11. A human-machine interface for a relay protection device, comprising: The transceiver unit is configured to receive, via a serial port, the background layer bitstream, the primitive layer bitstream, and the foreground layer bitstream generated by the image processor according to any one of claims 6-10; The decoding unit is configured to decode the background layer bitstream, the primitive layer bitstream, and the foreground layer bitstream into the background layer color matrix, the primitive layer matrix, and the foreground layer color matrix; The restoration unit is configured to restore the background layer color matrix, the primitive layer matrix, and the foreground layer color matrix into the background layer, primitive layer, and foreground layer of the plurality of sub-images by recognizing the colors indicated by each matrix element in the background layer color matrix, the preset primitives indicated by each matrix element in the primitive layer matrix, and the colors indicated by each matrix element in the foreground layer color matrix. as well as The merging unit is configured to merge the background layer, primitive layer, and foreground layer of the plurality of sub-images into the plurality of sub-images respectively, and to stitch the plurality of sub-images into the image.

12. A relay protection device, comprising: Image processor according to any one of claims 6 to 10; The human-machine interface according to claim 11 communicates with the image processor via a serial port; The memory is configured to store the primitive library; as well as An image generator generates the image by selecting at least one preset primitive from the primitive library.

Citation Information

Patent Citations

  • Image coloring method and device and computer readable storage medium

    CN113763496A

  • A method and apparatuses for encoding and decoding an image

    WO2009022048A1