OSD image content detection method and device and computer storage medium

By using the OSD template image preset in local memory to compare with the pixel value of the image source in OSD image content detection, the real-time and reliability problems of OSD image content detection are solved, and effective monitoring of OSD image content is realized and Replacement improves the stability and reliability of the system.

CN119399103APending Publication Date: 2025-02-07ARKMICRO TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411271986.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

The prior art is difficult to effectively detect and ensure the realistic and reliable content of OSD image content, resulting in the displayed content that may be unreal or abnormal.

Method used

By determining the rectangular area for displaying the OSD image content in the image source, the preset OSD template image in local memory is compared with the pixel values ​​of the pixel points corresponding to the determined rectangular area, the abnormal pixel points are determined and the abnormal image is replaced.

Benefits of technology

Real-time monitoring and abnormal detection of OSD image content is realized, fault response speed and system stability are improved, and the reliability and authenticity of OSD image content is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119399103A_ABST
    Figure CN119399103A_ABST
Patent Text Reader

Abstract

The invention provides an OSD image content detection method and device and a computer storage medium, and the method comprises the steps: determining a rectangular region for OSD image content display in an image source; comparing a preset OSD template image in a local memory with a pixel value of a pixel point corresponding to the determined rectangular area; when a comparison difference value is greater than a preset threshold value, determining that the pixel point is an abnormal pixel point; when the number of the abnormal pixel points exceeds a preset number, determining that the OSD image in the current image source is displayed abnormally; and when the display of the OSD image is abnormal, replacing the corresponding rectangular region in the image source with a preset OSD template image in the local memory. The method can ensure that the image displayed by the OSD display system is vivid, and the displayed content is reliable, real and effective.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of image and video processing, and in particular relates to an OSD image content detection method, device and computer storage medium. Background Art

[0002] OSD (On-Screen Display) usually refers to screen display technology, which is a function of superimposing text, graphics or other information on the video image screen. It is commonly found in digital instruments, surveillance cameras, TV monitors and other devices to display indicator lights, alarm lights, time, channel information, menu settings and other content.

[0003] OSD image content detection mainly refers to the technology of detecting abnormalities in OSD information such as text and graphics superimposed on the video screen. OSD image display content information is very important. How to ensure that the images displayed by the OSD display system are realistic and the displayed content is reliable, true and effective is a problem that needs to be solved urgently. Summary of the invention

[0004] In view of this, the present invention provides an OSD image content detection method, device and computer storage medium to solve the deficiencies of the prior art.

[0005] In order to achieve the above object, the present invention adopts the following technical scheme:

[0006] An embodiment of the present invention provides an OSD image content detection method, comprising:

[0007] Determine the rectangular area in the image source where the OSD image content is displayed;

[0008] Compare the pixel values ​​of the pixels corresponding to the OSD template image preset in the local memory and the determined rectangular area;

[0009] When the difference between the comparisons is greater than a preset threshold, it is determined to be an abnormal pixel; when the number of abnormal pixels exceeds a preset number, it is determined that the OSD image display in the current image source is abnormal;

[0010] When the OSD image is displayed abnormally, the OSD template image preset in the local memory is used to replace the corresponding rectangular area in the image source.

[0011] Furthermore, before comparing the pixel values ​​of the pixels corresponding to the determined rectangular area with the preset OSD template image in the local memory, the following steps are also included:

[0012] Comparing the accuracy of pixel values ​​of the preset OSD template image in the local memory and the pixel points corresponding to the determined rectangular area;

[0013] According to the result of the color accuracy comparison, the pixel values ​​of the preset OSD template image in the local memory and the pixel points corresponding to the determined rectangular area are compared as follows:

[0014] When the color accuracy of the OSD template image matches the determined rectangular area, first determine the non-background color pixels in the rectangular area through the background color in the OSD template image preset in the local memory, and perform a point-by-point pixel value difference operation and comparison on the non-background color pixels in the rectangular area and the OSD template image pixels preset in the local memory at the corresponding positions;

[0015] When the color accuracy of the OSD template image does not match that of the determined rectangular area, first determine the pixel points of the main color in the OSD template image preset in the local memory, and perform point-by-point pixel value difference calculation and comparison on the pixel points of the main color in the OSD template image preset in the local memory and the pixel points in the rectangular area at the corresponding position.

[0016] Furthermore, the step of first determining the pixels of the main color in the OSD template image preset in the local memory specifically includes: counting the colors of all pixels in the image except the background color, wherein the color of the pixel with the highest frequency of occurrence is the main color.

[0017] Furthermore, when the compared difference is greater than a preset threshold, the pixel is determined to be an abnormal pixel by comparing the compared difference of each pixel with the preset threshold. As long as the compared difference of any one of the R, G, and B components in a pixel is greater than the preset threshold, it is determined to be an abnormal pixel.

[0018] Furthermore, it also includes: judging whether the background display of the OSD image is abnormal through histogram statistics; if it is abnormal, a full replacement method is adopted when replacing the rectangular area corresponding to the data source with the OSD template image preset in the local memory; otherwise, a method of only replacing the OSD image but not the background color is adopted when replacing the rectangular area corresponding to the data source with the OSD template image preset in the local memory.

[0019] Furthermore, the full replacement method specifically replaces all pixels in the rectangular area, wherein the OSD icon is replaced with the OSD template image preset in the local memory, and the background part except the OSD icon is replaced with the preset background image; the method of only replacing the OSD image without replacing the background color specifically refers to superimposing the OSD template image preset in the local memory on the original OSD image, and the background part except the OSD icon still maintains the original image in the image source and is not replaced.

[0020] The embodiment of the present invention further provides an OSD image content detection device, comprising:

[0021] An OSD area determination module, used to determine a rectangular area in an image source where the OSD image content is displayed;

[0022] A pixel comparison module is used to compare the pixel values ​​of the OSD template image preset in the local memory with the pixel values ​​of the pixel points corresponding to the determined rectangular area;

[0023] A determination module, used to determine that a pixel is abnormal when the difference value of the comparison is greater than a preset threshold; when the number of abnormal pixels exceeds a preset number, it is determined that the OSD image display in the current image source is abnormal;

[0024] The replacement processing module is used to replace the corresponding rectangular area in the image source with the preset OSD template image in the local memory when the OSD image is displayed abnormally.

[0025] Furthermore, the pixel comparison module performs the following comparison:

[0026] When the color accuracy of the OSD template image matches the determined rectangular area, first determine the non-background color pixels in the rectangular area through the background color in the OSD template image preset in the local memory, and perform a point-by-point pixel value difference operation and comparison on the non-background color pixels in the rectangular area and the OSD template image pixels preset in the local memory at the corresponding positions;

[0027] When the color accuracy of the OSD template image does not match that of the determined rectangular area, first determine the pixel points of the main color in the OSD template image preset in the local memory, and perform point-by-point pixel value difference calculation and comparison on the pixel points of the main color in the OSD template image preset in the local memory and the pixel points in the rectangular area at the corresponding position.

[0028] Furthermore, it also includes: a background detection module, which is used to determine whether the background display of the OSD image is abnormal. If it is abnormal, the replacement processing module adopts a full replacement method when using the preset OSD template image in the local memory to replace the rectangular area corresponding to the data source; otherwise, the replacement processing module adopts a method of only replacing the OSD image without replacing the background color when using the preset OSD template image in the local memory to replace the rectangular area corresponding to the data source.

[0029] Furthermore, the full replacement method specifically replaces all pixels in the rectangular area, wherein the OSD icon is replaced with the OSD template image preset in the local memory, and the background part except the OSD icon is replaced with the preset background image; the method of only replacing the OSD image without replacing the background color specifically refers to superimposing the OSD template image preset in the local memory on the original OSD image, and the background part except the OSD icon still maintains the original image in the image source and is not replaced.

[0030] An embodiment of the present invention further provides a computer storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned OSD image content detection method is implemented.

[0031] An embodiment of the present invention further provides a computer program product, including a computer program, and when the computer program / instructions are executed by a processor, the above-mentioned OSD image content detection method is implemented.

[0032] The OSD image content detection method provided by the present invention has the following characteristics: (1) High timeliness: The technical solution of the present application can monitor the superposition state of OSD information in real time. Once an abnormality occurs, it can be quickly discovered and reported, thereby improving the fault response speed. (2) High accuracy and reliability: When the color of the OSD template image matches that of the image source, the part of the detection area except the background is compared point by point, and abnormalities in the value of a single pixel point can be detected. In addition, the background of the OSD image is not compared, thereby avoiding misjudgment caused by background changes. (3) Strong compatibility: When the color of the OSD template image does not match that of the image source, only the main color of the OSD image in the detection area is compared, which has strong adaptability to scenes with unclear boundaries and many gradient colors. It is not limited by the OSD color format. For example, if the video signal source OSD uses true color and the local preset OSD template uses 256 colors, detection can also be performed. (4) Strong anti-interference ability: The present application is provided with a detection threshold, and a suitable threshold can be configured according to the application scenario. (5) Improving system stability and reliability: The technical solution of the present application can be used in a video image display system to help determine whether the system's software and hardware functions are operating normally by detecting the status of the OSD image, and can overwrite and replace the original abnormal image after detecting an abnormality, thereby improving the stability and reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0034] Figure 1 A flowchart of an OSD image content detection method provided by an embodiment of the present invention;

[0035] Figure 2 A schematic diagram of the structure of an OSD image content detection device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0036] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0037] Figure 1 The present invention provides an OSD image content detection method according to an embodiment of the present invention, comprising:

[0038] S1. Determine a rectangular area in an image source where OSD image content is displayed.

[0039] Determine the starting coordinates (X, Y) and size A*B of the OSD image window to be detected in the image source, that is, the detection area is a rectangular area starting from (X, Y) coordinates and ending at (X+A, Y+B). This rectangular area is used to display OSD image content.

[0040] S2. Compare the pixel values ​​of the pixels corresponding to the OSD template image preset in the local memory and the determined rectangular area.

[0041] Before comparing pixel values, the color accuracy of the OSD template image and the determined rectangular area can be compared, and different pixel value comparison strategies can be selected according to whether the color accuracy comparison matches, so as to achieve the best detection effect. The details are as follows:

[0042] When the color accuracy of the rectangular area of ​​the OSD template image matches that of the image source, the non-background color pixels in the rectangular area are first determined by the background color in the OSD template image preset in the local memory, and the non-background color pixel value P in the rectangular area is compared with the OSD template image pixel value p preset in the local memory at the corresponding position by point-by-point difference calculation. The pixel value difference comparison is performed point by point except for the background color, and any abnormal single pixel value can be detected. Since the background of the OSD image is not compared, misjudgment caused by background changes is avoided.

[0043] When the color accuracy of the OSD template image does not match that of the rectangular area of ​​the image source, first determine the main color in the preset OSD template image in the local memory. The main color can be determined by counting the colors of all pixels in the image except the background color to see which color appears most frequently, thereby determining it as the main color. Compare the pixel value p containing the main color in the preset OSD template image in the local memory with the pixel value P in the rectangular area at the corresponding position point by point. When the color of the OSD template image does not match that of the image source, only compare the main color of the OSD image in the detection area, which has strong adaptability to scenes with unclear boundaries and many gradient colors. It is not limited by the OSD color format. For example, if the video signal source OSD uses 24-bit true color and the local preset OSD template uses 8-bit 256-color image, detection can also be performed.

[0044] S3. When the compared difference is greater than a preset threshold, it is determined to be an abnormal pixel; when the number of abnormal pixels exceeds a preset number, it is determined that the OSD image display in the current image source is abnormal.

[0045] The difference of comparison is the comparison of the difference of each pixel with the preset threshold. As long as the difference of a pixel is greater than the preset threshold, it is judged as an abnormal pixel. For the scenes with matching and mismatching color numbers, the thresholds set are also different.

[0046] The comparison threshold of OSD image detection takes RGB components as an example, and each component sets a comparison threshold Rth, Gth, and Bth respectively. The point-by-point comparison method takes RGB components as an example, and the absolute value of Pr-pr is compared with Rth, the absolute value of Pg-pg is compared with Gth, and the absolute value of Pb-pb is compared with Bth. If the absolute value of any component of a pixel is greater than the set threshold, it is judged as an abnormal pixel. When the number of abnormal pixels exceeds the preset number, it is judged that the OSD image display in the current image source is abnormal. Otherwise, the OSD image is normal. Users can adjust the set threshold and preset number according to the actual test results.

[0047] S4. When the OSD image is displayed abnormally, the OSD template image preset in the local memory is used to replace the corresponding rectangular area in the image source.

[0048] The replacement method can be selected in two ways: a method of replacing all pixels in the window or a method of replacing only the OSD image without replacing the background color. The specific replacement method can be selected by detecting whether the background display of the OSD image is distorted. In a certain embodiment, histogram statistics are used to assist in judging whether the background display of the OSD image is abnormal. If abnormal, a full replacement method is used when replacing the rectangular area corresponding to the data source with the preset OSD template image in the local memory. Otherwise, a method of replacing only the OSD image without replacing the background color is used when replacing the rectangular area corresponding to the data source with the preset OSD template image in the local memory.

[0049] The abnormal OSD image corresponding to the data source is replaced by the preset OSD template image in the local memory. All pixels in the rectangular area are replaced, where the OSD icon is replaced by the preset OSD template image in the local memory, and the background part except the OSD icon is replaced by the preset background image. The preset background image can be a solid color background image or a gradient background image.

[0050] The abnormal OSD image corresponding to the data source is replaced by the preset OSD template image in the local memory in a manner of replacing only the OSD image but not the background color. Specifically, the preset OSD template image in the local memory is superimposed on the original OSD image, and the background part except the OSD icon still maintains the original image in the image source and is not replaced.

[0051] Figure 2 As shown, an embodiment of the present invention provides an OSD image content detection device, including: an OSD area determination module, a pixel comparison module, a judgment module and a replacement processing module; the OSD area determination module is used to determine the rectangular area where the OSD image content is displayed in the image source; the pixel comparison module is used to compare the pixel values ​​of the pixel points corresponding to the OSD template image preset in the local memory with the determined rectangular area; the judgment module is used to determine the pixel point as an abnormal pixel when the comparison difference is greater than a preset threshold; when the number of abnormal pixel points exceeds the preset number, it is determined that the OSD image display in the current image source is abnormal; the replacement processing module is used to replace the corresponding rectangular area in the image source with the OSD template image preset in the local memory when the OSD image display is abnormal.

[0052] It should be noted that: the OSD image content detection device provided in the above embodiment only uses the division of the above program modules as an example when performing image content detection. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the OSD image content detection device provided in the above embodiment and the OSD image content detection method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment. The beneficial effects are the same as the method embodiment and will not be repeated here.

[0053] The embodiment of the present invention also provides a computer storage medium, which is a computer-readable storage medium, on which a computer program is stored, and the above-mentioned computer program can be executed by a processor of an OSD image content detection device to complete the steps of the above-mentioned OSD image content detection method. The computer-readable storage medium can be a magnetic random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM) and other memories.

[0054] In the several embodiments provided by the present invention, it should be understood that the disclosed methods and intelligent devices can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0055] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for detecting OSD image content, characterized in that: include: Determine the rectangular area in the image source where the OSD image content is displayed; Compare the pixel values ​​of the pixels corresponding to the OSD template image preset in the local memory and the determined rectangular area; When the difference between the comparisons is greater than a preset threshold, it is determined to be an abnormal pixel; when the number of abnormal pixels exceeds a preset number, it is determined that the OSD image display in the current image source is abnormal; When the OSD image is displayed abnormally, the OSD template image preset in the local memory is used to replace the corresponding rectangular area in the image source.

2. The method according to claim 1, characterized in that Before comparing the pixel values ​​of the pixels corresponding to the OSD template image preset in the local memory and the determined rectangular area, the following steps are also included: Compare the color accuracy of the OSD template image preset in the local memory with the color accuracy corresponding to the determined rectangular area; According to the result of the color accuracy comparison, the pixel values ​​of the preset OSD template image in the local memory and the pixel points corresponding to the determined rectangular area are compared as follows: When the color accuracy of the OSD template image matches the determined rectangular area, first determine the non-background color pixels in the rectangular area through the background color in the OSD template image preset in the local memory, and perform a point-by-point pixel value difference operation and comparison on the non-background color pixels in the rectangular area and the OSD template image pixels preset in the local memory at the corresponding positions; When the color accuracy of the OSD template image does not match that of the determined rectangular area, first determine the pixel points of the main color in the OSD template image preset in the local memory, and perform point-by-point pixel value difference calculation and comparison on the pixel points of the main color in the OSD template image preset in the local memory and the pixel points in the rectangular area at the corresponding position.

3. The method according to claim 2, characterized in that The step of first determining the pixels of the main color in the OSD template image preset in the local memory specifically includes: counting the colors of all pixels in the image except the background color, wherein the color of the pixel with the highest frequency of occurrence is the main color.

4. The method according to claim 1, characterized in that: When the comparison difference is greater than a preset threshold, the pixel is determined to be an abnormal pixel. Specifically, the comparison difference of each pixel is compared with the preset threshold. As long as the comparison difference of any one of the R, G, and B components in a pixel is greater than the preset threshold, it is determined to be an abnormal pixel.

5. The method according to claim 1, characterized in that Also includes: Determine whether the background display of the OSD image is abnormal. If so, a full replacement method is adopted when using the preset OSD template image in the local memory to replace the rectangular area corresponding to the data source. Otherwise, a method of only replacing the OSD image but not the background color is adopted when using the preset OSD template image in the local memory to replace the rectangular area corresponding to the data source.

6. The method according to claim 5, characterized in that The full replacement method specifically refers to replacing all pixels in the rectangular area, wherein the OSD icon is replaced with an OSD template image preset in the local memory, and the background part except the OSD icon is replaced with a preset background image; the method of only replacing the OSD image without replacing the background color specifically refers to superimposing the OSD template image preset in the local memory on the original OSD image, and the background part except the OSD icon still maintains the original image in the image source and is not replaced.

7. An OSD image content detection device, characterized in that: An OSD area determination module, used to determine a rectangular area in an image source where the OSD image content is displayed; A pixel comparison module is used to compare the pixel values ​​of the OSD template image preset in the local memory with the pixel values ​​of the pixel points corresponding to the determined rectangular area; A determination module, used to determine that a pixel is abnormal when the difference value of the comparison is greater than a preset threshold; when the number of abnormal pixels exceeds a preset number, it is determined that the OSD image display in the current image source is abnormal; The replacement processing module is used to replace the corresponding rectangular area in the image source with the preset OSD template image in the local memory when the OSD image is displayed abnormally.

8. The device according to claim 7, characterized in that The pixel comparison module performs the following comparison: When the color accuracy of the OSD template image matches the determined rectangular area, first determine the non-background color pixels in the rectangular area through the background color in the OSD template image preset in the local memory, and perform a point-by-point pixel value difference operation and comparison on the non-background color pixels in the rectangular area and the OSD template image pixels preset in the local memory at the corresponding positions; When the color accuracy of the OSD template image does not match that of the determined rectangular area, first determine the pixel points of the main color in the OSD template image preset in the local memory, and perform point-by-point pixel value difference calculation and comparison on the pixel points of the main color in the OSD template image preset in the local memory and the pixel points in the rectangular area at the corresponding position.

9. The device according to claim 7, characterized in that Also includes: The background detection module is used to determine whether the background display of the OSD image is abnormal. If it is abnormal, the replacement processing module adopts a full replacement method when using the preset OSD template image in the local memory to replace the rectangular area corresponding to the data source; otherwise, the replacement processing module adopts a method of only replacing the OSD image without replacing the background color when using the preset OSD template image in the local memory to replace the rectangular area corresponding to the data source.

10. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the OSD image content detection method according to any one of claims 1 to 6 is implemented.