Search

CN-117197447-B - Image processing method, image processor, human-computer interface and relay protection device

CN117197447BCN 117197447 BCN117197447 BCN 117197447BCN-117197447-B

Abstract

An image processing method for a relay protection device is provided, and comprises the steps of obtaining an image, dividing the image into a plurality of sub-images with preset sizes and dividing each sub-image into a background layer, a primitive layer and a foreground layer, identifying the color measurement 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 to form a primitive layer matrix, identifying the color measurement 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 a corresponding background layer bit stream, a primitive layer bit stream and a foreground layer bit stream.

Inventors

  • XU CHENLIANG
  • ZHOU XIANG

Assignees

  • 施耐德电气(中国)有限公司

Dates

Publication Date
20260505
Application Date
20220530

Claims (12)

  1. 1. An image processing method for a relay protection device, comprising: Acquiring an image, wherein the image comprises at least one preset primitive from a primitive database, the primitive database comprises a plurality of preset primitives, and each preset primitive has a preset size and a unique primitive index value; dividing the image into a plurality of sub-images with the preset size, and dividing each sub-image into a background layer, a primitive layer and a foreground layer; identifying a color metric for a background layer of each sub-image and forming a background layer color matrix using the identified color metric as a matrix element; Identifying a primitive index value of a preset primitive in the primitive layer of each sub-image in the primitive library, and taking the identified primitive index value as a matrix element to form a primitive layer matrix; identifying a color metric for the foreground layer of each sub-image and forming a foreground layer color matrix using the identified color metric as a matrix element, and And converting the background layer color matrix, the primitive layer matrix and the foreground layer color matrix into corresponding background layer bit streams, primitive layer bit streams and foreground layer bit streams.
  2. 2. The image processing method according to claim 1, wherein The color metric identifying the background layer of each sub-image includes an RGB value or an HSL value identifying the color of the background layer, and The color metric identifying the foreground layer of each sub-image includes an RGB value or an HSL value identifying the color of the foreground layer.
  3. 3. The image processing method according to claim 1, wherein The color metric identifying the background layer of each sub-image includes identifying a color index value of the color of the background layer in a color library, and The identifying a color metric for a foreground layer of each sub-image includes identifying a color index value for a color of each foreground layer in a color library, wherein The color library includes a plurality of colors and each color has a unique color index value.
  4. 4. The image processing method according to claim 3, further comprising: 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 Converting the background layer color matrix, the primitive layer matrix, and the foreground layer color matrix into corresponding background layer bit streams, primitive layer bit streams, and foreground layer bit streams in the presence of more than a predetermined number of consecutive identical matrix elements includes converting the more than a predetermined number of consecutive identical matrix elements into bits representing the number of matrix elements and consecutive identical matrix elements.
  5. 5. The image processing method according to any one of claims 1 to 4, further comprising: the background layer bitstream, the primitive layer bitstream, and the foreground layer bitstream are transmitted via a serial port.
  6. 6. An image processor for a relay protection device, comprising: An acquisition unit configured to acquire an image including at least one preset primitive from a primitive repository, the primitive repository including a plurality of preset primitives each having a preset size and a unique primitive index value; a segmentation unit configured to segment the image into a plurality of sub-images having a preset size, and segment each sub-image into a background layer, a primitive layer, and a foreground layer; A digitizing unit configured to: identifying a color metric for a background layer of each sub-image and forming a background layer color matrix using the identified color metric as a matrix element; identifying a primitive index value of a 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, and Identifying a color metric for the foreground layer of each sub-image and forming a foreground layer color matrix using the identified color metrics as matrix elements, and And the coding unit is configured to convert the background layer color matrix, the primitive layer matrix and the foreground layer color matrix into corresponding background layer bit streams, primitive layer bit streams and foreground layer bit streams.
  7. 7. The image processor of claim 6, wherein the digitizing unit is further configured to: identifying RGB or HSL values of the color of the background layer of each sub-image as a color measure of the background layer, and The RGB values or HSL values of the colors of the foreground layer of each sub-image are identified as a color metric for the foreground layer.
  8. 8. The image processor of claim 6, the digitizing unit further configured to: identifying a color index value of a color of a background layer of each sub-image in a color library as a color measure of the background layer, and Identifying a color index value of a color of a foreground layer of each sub-image in a color library as a color metric of the foreground layer, wherein The color library includes a plurality of colors and each color has a unique color index value.
  9. 9. The image processor of claim 8, further comprising: 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 In case there is more than a predetermined number of consecutive identical matrix elements, the encoding unit is further configured to convert the more than a predetermined number of consecutive identical matrix elements into bits representing the number of matrix elements and consecutive identical matrix elements during converting the background layer color matrix, the primitive layer matrix and the foreground layer color matrix into corresponding background layer bit streams, primitive layer bit streams and foreground layer bit streams.
  10. 10. The image processor of any of claims 6 to 9, further comprising: And a transceiving unit configured to transmit the background layer bit stream, the primitive layer bit stream and the foreground layer bit stream via a serial port.
  11. 11. A human-machine interface for a relay protection device, comprising: a transceiving unit configured to receive the background layer bit stream, the primitive layer bit stream and the foreground layer bit stream generated by the image processor according to any of claims 6-10 via a serial port; a decoding unit configured to decode the background layer bit stream, the primitive layer bit stream, and the foreground layer bit stream into the background layer color matrix, the primitive layer matrix, and the 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 to a background layer, a primitive layer, and a foreground layer of the plurality of sub-images by identifying colors indicated by respective matrix elements in the background layer color matrix, the preset primitives indicated by respective matrix elements in the primitive layer matrix, the colors indicated by respective matrix elements of the foreground layer color matrix, and And a merging unit configured to merge the background layer, the primitive layer, and the foreground layer of the plurality of sub-images into the plurality of sub-images, respectively, and to splice the plurality of sub-images into the image.
  12. 12. A relay protection device, comprising: An image processor according to any one of claims 6 to 10; a human-machine interface according to claim 11, in communication with the image processor via a serial port; A memory configured to store the primitive library, and And the image generator is used for generating the image by selecting at least one preset primitive from the primitive library.

Description

Image processing method, image processor, human-computer interface and relay protection device Technical Field The field relates to an image processing method for a relay protection device, an image processor, a man-machine interface and the relay protection device comprising the image processor and the man-machine interface. Background Serial port communication is widely used in relay protection devices due to its low cost and high reliability. The relay protection device comprises a processor and a man-machine interface which are communicated through a serial port to transmit images. In the case of a low-speed serial port, however, the time required to transmit an image is long. For example, transmitting an image of 320 x 240 pixels in size via serial port communication requires about 20 seconds to complete at a baud rate of 115200 b/s. Disclosure of Invention In view of the above, an object of an embodiment of the present disclosure is to provide an image processing method for a relay protection device, which reduces a transmission time period by reducing the total number of bits required to transmit an image, so that transmission of an image can be completed rapidly also via low-speed serial port communication. An aspect of the present disclosure provides an image processing method. The method includes obtaining an image, the image including at least one preset primitive from a primitive library, the primitive library including a plurality of preset primitives each having a preset size and a unique primitive index value, segmenting the image into a plurality of sub-images having the preset size and 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 a primitive index value of a preset primitive in the primitive layer of each sub-image 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 a corresponding primitive bit stream, a background layer bit stream and a foreground layer bit stream. Optionally, the identifying the color metric of the background layer of each sub-image comprises identifying an RGB value or an HSL value of the color of the background layer, and the identifying the color metric of the foreground layer of each sub-image comprises identifying an RGB value or an HSL value of the color of the foreground layer. Optionally, the identifying the color metric for the background layer of each sub-image includes identifying a color index value for the color of the background layer in a color library, and the identifying the color metric for the foreground layer of each sub-image includes identifying a color index value for the color of each foreground layer in a color library, wherein the color library includes a plurality of colors and each color has a unique color index value. Optionally, the method further comprises 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, in the event that 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 bit streams, primitive layer bit streams, and foreground layer bit streams comprises converting the more than a predetermined number of consecutive identical matrix elements into bits representing the number of matrix elements and consecutive identical matrix elements. Optionally, the method further comprises transmitting the background layer bitstream, the primitive layer bitstream, and the foreground layer bitstream via a serial port. Another aspect of the present disclosure provides an image processor for a relay protection device. The processor comprises an acquisition unit configured to acquire an image, the image comprising at least one preset primitive from a primitive library, the primitive library comprising a plurality of preset primitives, each preset primitive having a preset size and a unique primitive index value, a segmentation unit configured to segment the image into a plurality of sub-images having preset sizes and to segment each sub-image into a background layer, a primitive layer and a foreground layer, a digitizing unit configured to identify a color metric of the background layer of each sub-image and to form a background layer color matrix with the identified color metr