An industrial visual inspection result visualization method based on canvas multi-layer superposition

By using a five-layer canvas rendering pipeline and radial gradient heatmap technology, the problem of layered display of visual elements in industrial visual inspection is solved, and clear and intuitive visualization of inspection results is achieved.

CN123181684APending Publication Date: 2026-11-27SHANGHAI LINGSUO ROBOT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611563358.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-10
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In industrial vision inspection systems, existing visualization solutions cannot effectively display scene background, heatmap, inspection box and label in layers, resulting in occlusion and hierarchical confusion. Heatmaps cover the inspection box, making the box line unrecognizable, and heatmaps cannot intuitively express the spatial distribution of inspection confidence.

Method used

A five-layer canvas rendering pipeline is used, namely the simulated scene image layer, the heat map overlay layer, the detection bounding box layer, the recognition label layer, and the overlay information layer. Each layer is rendered independently. A radial gradient function is used to generate a heat map and right-angled corner markers are drawn at the four corners of the detection box to ensure that each element is displayed in layers.

Benefits of technology

It achieves clear layered display of various visual elements, with the heatmap positioned above the scene and below the detection box. The right-angled corner markers at the four corners of the detection box improve recognizability, and the confidence distribution trend of the heatmap is intuitively visible, solving the problems of occlusion and color interference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123181684A_ABST
    Figure CN123181684A_ABST
Patent Text Reader

Abstract

The application discloses a kind of industrial visual inspection result visualization methods based on canvas multi-layer superposition, belong to computer vision visualization and industrial display field.Method includes: in the surface of the canvas of browser, construct four-layer rendering pipeline, from bottom to top, it is analog scene picture layer, heat map superposition layer, detection bounding box layer and identification label layer in turn;In analog scene picture layer, the background element of industrial operation scene is drawn, including ground, equipment contour and lock pin position mark;In heat map superposition layer, with the center coordinates of detection frame as origin, radial gradient color scale heat map is drawn;In detection bounding box layer, high-light rectangular frame is drawn around the detected target, and corner mark is drawn in the four corners of rectangular frame;In identification label layer, the text label of target type and confidence value is drawn in the upper region of detection frame.The top layer draws superposition cover layer, including frame rate counter and real-time state indicator.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer vision visualization and industrial display, and specifically relates to a method for visualizing industrial visual inspection results based on multi-layer canvas overlay. Background Technology

[0002] In industrial vision inspection systems, images captured by cameras are processed by target detection algorithms, and the results need to be presented to operators in a visual manner. However, with only one large screen available, when heatmaps cover the bounding boxes, operators have to get very close to the screen to see which device is being selected. Existing visualization solutions typically draw the scene, bounding boxes, and labels sequentially on a single-layer canvas, which presents the following problems: different visual elements (scene background, heatmap, bounding boxes, labels, and operational information) may occlude and become disorganized when drawn on a single layer; heatmaps may cover the bounding boxes, causing the bounding boxes to become indistinguishable due to heatmap color interference; heatmaps typically use rectangular filled blocks, which cannot intuitively represent the spatial distribution of detection confidence; and bounding boxes are drawn with simple rectangular lines, which are insufficiently recognizable in complex industrial environments.

[0003] What's truly needed on-site is a visualization method for detection results based on multi-layered canvas overlay: allowing each type of visual element to be displayed as a separate layer with controllable rendering order, so that the results can be presented to the operator clearly and intuitively. Summary of the Invention

[0004] The technical problem that this invention aims to solve is actually very specific: when drawing the test results in an industrial setting, how can the scene background, heat map, test frame, labels, and operation information be drawn in layers so that they do not interfere with each other and each layer is clearly visible? To address the aforementioned issues, this invention presents a method for visualizing industrial visual inspection results based on multi-layer canvas overlay. The entire process runs within the browser's canvas rendering context, constructing a five-layer rendering pipeline from bottom to top: a simulated scene layer, a heatmap overlay layer, a detection bounding box layer, a recognition label layer, and an overlay information layer. The simulated scene layer uses basic graphics drawing commands to create background elements in the industrial operation scene; the heatmap overlay layer uses the center coordinates of the detection box as the gradient origin and a radial gradient function to generate a four-level circular gradient that spreads outward from the center; the detection bounding box layer draws a highlighted rectangle around the detected target and right-angled corner markers at the four corners; the recognition label layer draws the target type name and confidence value above the detection box; and the overlay information layer draws a frame rate counter and real-time detection status indicators. The beneficial effects of this invention are as follows: the rendering pipeline with five independent canvas layers manages different visual elements in layers, and the heat map is always located above the scene and below the detection frame, thus eliminating the problems of occlusion and color interference in single-layer rendering; the radially gradient four-level color heat map makes the distribution trend of detection confidence decreasing from the center to the outside in space intuitively visible; right-angled corner markers are drawn at the four corners of the detection frame, making the target easier to recognize even in complex industrial scene backgrounds. Attached Figure Description

[0005] Figure 1 This is a schematic diagram of the five-layer canvas rendering pipeline in an embodiment of the present invention.

[0006] Figure 2 This is a schematic diagram of the generation of a radially gradient thermogram in an embodiment of the present invention.

[0007] Figure 3 This is a schematic diagram of the corner markers of the detection frame in an embodiment of the present invention.

[0008] The meanings of the markings in the diagram are as follows: 100 - Canvas rendering pipeline begins; 101 - Simulated scene image layer (bottom layer); 102 - Draw ground lines, device outlines, and lock pin marks; 103 - Heatmap overlay layer; 104 - Generate a four-level circular gradient using radial gradient; 105 - Detect bounding box layer; 106 - Draw a highlighted rectangle and right-angled corner markers; 107 - Identify label layer; 108 - Draw target type text and confidence value; 109 - Overlay information layer (top layer); 110 - Draw a frame rate counter and real-time status indicator; 111 - Rendering of this frame complete. 201 - Red level (center), 202 - Orange level, 203 - Yellow level, 204 - Completely transparent level (edge), 205 - Gradient origin (center of detection box), 206 - Starting radius (one-eighth of the box width), 207 - Ending radius (one-half of the box width), 208 - Detection box area; 301 - Top left right-angled corner mark, 302 - Top right right-angled corner mark, 303 - Bottom right right-angled corner mark, 304 - Bottom left right-angled corner mark, 305 - Shadow glow effect, 306 - Target type text label, 307 - Confidence percentage value, 310 - Detected target rectangle. Detailed Implementation The visualization method initiates a five-layer rendering pipeline within the browser's canvas rendering context. From bottom to top, the pipeline consists of a simulated scene layer, a heatmap overlay layer, a bounding box detection layer, a label recognition layer, and an overlay information layer. Each layer maintains its own data version number and a dirty flag (e.g., ...). Figure 1 (As shown by the mark 100 in the middle).

[0009] When actually starting up, the data version number and dirty flag must be initialized first; otherwise, the first frame will redraw all layers as dirty layers. The simulated scene layer is located at the bottom layer of the pipeline (e.g.) Figure 1 As shown in marks 101 and 102, basic graphics drawing commands are used to draw the background elements of the industrial operation scene. Ground lines, equipment outlines, and lock pin position markers are all placed on this layer. Lock pin position markers are marked with solid orange dots with white outer rings. Their drawing priority is lower than that of the detection frame, and the frame covering them does not affect the rendering of the upper layer. This layer is redrawn at fixed intervals, simulating a camera refresh rate of thirty frames per second.

[0010] Static elements like ground lines don't need to be redrawn every frame; they can be refreshed at fixed intervals, saving the overhead for the heatmap layer. The heatmap overlay is located above the scene image layer. For each detected target, a radial gradient function is called with the center coordinates of the detection bounding box as the gradient origin to generate a four-level circular gradient that spreads outward from the center. The color levels correspond to red, orange, yellow, and complete transparency from the inside out. The heatmap is displayed above the scene image layer but below the detection bounding box (e.g., ...). Figure 1 (As shown in markings 103 and 104).

[0011] This layer is drawn on an off-screen canvas first and then pasted on. Only dirty areas are redrawn. If the entire layer is not dirty, the previous bitmap can be reused directly, which has low overhead. The detection bounding box layer draws a highlighted rectangle around the detected target, and draws right-angled markers at the four right angles of the rectangle; a shadow glow effect is superimposed outside the bounding box line, with the shadow glow color matching the bounding box line color, and the blur radius being larger than the line width, so that the detection bounding box can still be recognized even in complex industrial backgrounds (e.g., Figure 1 (As shown in markings 105 and 106).

[0012] Don't set the blur radius of the shadow glow too small, otherwise it will blend into the outline and reduce the recognizability instead of increasing it. The label recognition layer draws text labels of the target type and their corresponding confidence scores (e.g., ...) in the area above the detection box. Figure 1 As shown in markings 107 and 108, the text labels and confidence scores are updated synchronously with the detection results.

[0013] Labels should be placed away from areas with dense borders to avoid overlapping with corner marks and making them difficult to read. The overlay layer is at the top of the pipeline, containing the frame rate counter and real-time detection status indicator; once all layers for a frame have been processed, the rendering of that frame is considered complete, and the loop begins for the next frame (e.g., ...). Figure 1 (As shown in the middle markings 109 to 111).

[0014] The status indicator light uses different colors for lagging and normal conditions, allowing operators to easily determine whether the data is recent or not. like Figure 2 As shown in the middle 201 to 204, the radial gradient heatmap has four color levels from the inside to the outside: the red color level at the center, the orange color level, the yellow color level, and the completely transparent color level at the edge. The four color levels make the confidence level show a distribution trend of decreasing from the center to the outside in space.

[0015] The four levels of color depth were chosen after careful consideration; too few levels would result in an unclear transition, while too many would make the color appear muddy. Four levels are just right. The gradient origin is taken from the center coordinates of the detection box. The starting radius is one-eighth of the detection box width, and the ending radius is half of the detection box width. The annular area between the two covers the entire detection box. A continuous color transition replaces the rectangular fill blocks, and the thermal boundary no longer abruptly blocks scene information (e.g., ...). Figure 2 (As shown in markings 205 to 208).

[0016] The radius ratio is set to a fixed proportion based on the frame width to make the visual weight of heatmaps for targets of different sizes similar, so that large frames don't become blurred and small frames are not clearly visible. Draw right-angled corner markers at the four right-angled positions of the detection frame, namely the upper left, upper right, lower right, and lower left corners, respectively. The corner markers should be drawn as part of the rectangle's outline (e.g., ...). Figure 3 (As shown in markings 301 to 304).

[0017] The corner markers are made with right angles instead of rounded corners to maintain consistency with the frame style and prevent them from looking like two different things on-site. A shadow and glow effect are overlaid on the outer edge of the rectangular frame to enhance its visibility. Target type text labels and confidence percentage values ​​(e.g., [missing information]) are drawn near the detection box. Figure 3 (As shown in markings 305 to 307), the labels and values ​​are located in the area above the detection box.

[0018] Don't make the transparency of the shadow glow layer full; semi-transparent is fine. If it's too solid, it will cover the frame lines. The aforementioned badges, shadow glow effects, text labels, and confidence scores are all organized around the target detection rectangle, with transparency within the rectangle to allow the underlying scene and heatmap to show through (e.g., ...). Figure 3 (As shown in the middle mark 310).

[0019] The transparency within the frame is essential; otherwise, it will block the heatmap, rendering the first few layers blank. On the rendering scheduler side, upon receiving the detection result data frame, the affected layers are identified based on changes in target coordinates, size, confidence level, or type. Corresponding dirty flags are then placed on these layers, and only the dirty areas of the marked layers are redrawn. Layers without marked flags reuse the previously cached bitmaps. The actual frame rate per unit time is also monitored. If the frame rate drops below a threshold, the redraw frequency is reduced, and the dirty areas of adjacent data frames are merged and redrawn uniformly. The actual frame rate is used to reduce the rendering load, ensuring smooth operation even on low-performance terminals in the production environment.

[0020] There is a prerequisite for merging dirty regions: the targets in adjacent frames must actually be next to each other. If they are too far apart, hard merging will only draw more images, which is counterproductive.

Claims

1. A method for visualizing industrial visual inspection results based on multi-layer canvas overlay, characterized in that, include: In the browser's canvas rendering context, the simulated scene image layer, heatmap overlay layer, detection bounding box layer, recognition label layer and overlay information layer are constructed in order from bottom to top, and a data version number and a dirty flag are maintained for each layer. Receive the detection result data frame output by the industrial vision inspection module. The detection result data frame includes the center coordinates of each detected target, the width and height of the detection box, the target type, the confidence value, and the detection data timestamp. Based on the detection result data frame, determine the affected rendering layer: when the coordinates or size of the detected target change, set the dirty markers of the heatmap overlay layer and the detection bounding box layer, and calculate the dirty region containing the old and new detection box regions; When the confidence level or target type changes, the dirty mark of the identification label layer and the heat map overlay layer is set; Write the data version number to which the timestamp of the detected data in this frame belongs to the set layer, and verify the lower layer data version number that each upper layer depends on. If the version numbers are inconsistent, cascade the upper layer dirty flag. During rendering, only rendering layers with the dirty flag set are redrawn, and each layer only redraws its dirty region: unset layers directly reuse the cached bitmap from the previous rendering. The redrawn layer has been re-marked with dirty tags. In the heatmap overlay, a radial gradient heatmap is drawn for each detection target with the center coordinates of the detection frame as the gradient origin. The starting radius, ending radius, and transparency of the inner layer color level of the radial gradient are all calculated by the confidence value of the detection target through a preset piecewise mapping function, so that a definite data mapping relationship is formed between the spatial parameters of the heatmap and the confidence value. In the overlay information layer, the time difference between the timestamp of the detection data and the current rendering time is calculated: when the time difference exceeds a preset freshness threshold, the detection data is determined to be lagging, the overall rendering transparency of the heatmap overlay layer is reduced according to the proportion of the time difference exceeding the threshold, and a data lag indicator is drawn in the overlay information layer; when the time difference does not exceed the preset freshness threshold, the heatmap overlay layer is rendered with normal transparency. The measured rendering frame rate per unit time is statistically analyzed. When the measured rendering frame rate is lower than the preset frame rate threshold, the redraw frequency of the rendering loop is reduced and the dirty regions of adjacent detection data frames are merged and redrawn uniformly. The rendering load is adjusted in reverse by the measured frame rate.

2. The method according to claim 1, characterized in that, The radial gradient function is implemented using the browser's canvas radial gradient interface. The starting radius of the gradient is one-eighth of the detection box width, and the ending radius is one-half of the detection box width.

3. The method according to claim 1, characterized in that, The detection boundary box layer has a shadow glow effect superimposed on the rectangular frame lines. The color of the shadow glow is the same as the color of the rectangular frame lines, and the blur radius is greater than the width of the rectangular frame lines.

4. The method according to claim 1, characterized in that, The locking pin position marker is an orange solid dot with a white outer border. The position marker is drawn with a lower priority than the detection bounding box, and the detection box covers the position marker.

5. The method according to claim 1, characterized in that, The simulated scene image layer is redrawn at fixed intervals, and the periodic refresh rate of the simulated camera image is thirty frames per second.

6. A visualization system for industrial visual inspection results based on multi-layer canvas overlay, characterized in that, include: The five-layer rendering pipeline manager is used to build scene rendering layers, heatmap overlay layers, detection bounding box layers, recognition label layers, and overlay information layers, and maintains the data version number and dirty flag for each layer; The dirty region calculation module is used to determine the affected layer based on the detection result data frame, calculate the dirty region, write the data version number, and cascade the dirty regions according to the inter-layer dependencies. The incremental rendering module is used to redraw only the dirty regions of the set layers and reuse the cached bitmaps of the unset layers; The confidence mapping module is used to convert the confidence value of the detected target into the starting radius, ending radius, and inner layer color level transparency of the radial gradient heatmap of the target through a piecewise mapping function; The data freshness monitoring module is used to compare the time difference between the data timestamp and the rendering time. When the threshold is exceeded, the transparency of the heat map is reduced proportionally and a hysteresis indicator is output. The frame rate closed-loop adjustment module is used to statistically analyze the actual rendering frame rate and reduce the redraw frequency and merge dirty areas when it is lower than the preset threshold. Heatmaps are cached off-screen and only dirty areas are redrawn; When the lag continues to exceed the threshold, the heat map layer is further hidden, leaving only the bounding box layer, to prevent expired data from misleading operators.

7. The system according to claim 6, characterized in that, The canvas rendering pipeline manager triggers redrawing at a frequency of thirty frames per second. During each frame redraw, the redrawing is performed sequentially in the order of scene image layer, heat map layer, bounding box layer, label layer, and overlay information layer.

8. The system according to claim 6, characterized in that, The heatmap generator uses radial gradient instead of rectangular fill, and the number of color levels and the color values ​​of each color level in the heatmap can be adjusted by configuration parameters to adapt to different application scenarios.

9. A computer-readable storage medium comprising executable instructions that, when executed by a processor, implement the method of any one of claims 1 to 5.