Keyboard light control method based on game scene, control device and storage medium
By identifying technical means in the game through image frames and using a pre-trained ROI localization model to identify technical problems in the game during the battle phase, the technology solves the problem of visual interference caused by the inability of existing keyboard backlight control methods to distinguish between core game content and irrelevant screens. Synchronous lighting control during the game is achieved, improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN LINGDIANLINGYI TECH CO LTD
- Filing Date
- 2026-05-15
- Publication Date
- 2026-07-14
AI Technical Summary
Existing keyboard backlight control methods cannot distinguish between core game content and irrelevant visuals during gameplay, resulting in cluttered lighting changes that distract users and cause visual interference.
By acquiring image frames during game runtime, a pre-trained ROI localization model is used to identify regions of interest during the battle phase, calculate inter-frame difference values, determine regional interaction icons based on a pre-stored feature table, and control the keyboard illumination area to display target lighting effects after satisfying the validity detection of consecutive frames.
It achieves synchronization between keyboard lighting and changes in the game's battle situation, reduces invalid recognition interference, improves the game interaction experience, and reduces the computing power consumption of terminal devices.
Smart Images

Figure CN122205705B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of lighting control technology, and in particular to a keyboard lighting control method, control device and storage medium based on game scenarios. Background Technology
[0002] In the backlight control methods of related gaming keyboards, the real-time image of the display device is usually captured at a preset frequency. After basic image processing such as segmentation and scaling of the captured image, the pixel color data in the image is extracted, and then the corresponding light driving signal is generated to drive the keyboard backlight and the screen image to change synchronously, thereby realizing the basic linkage between the lighting effect and the displayed content.
[0003] However, current keyboard backlight control methods can only achieve surface color synchronization decoration. Regardless of whether the screen displays the core combat screen of the game, or irrelevant screens such as system pop-ups, advertisements, or office interfaces, it passively replicates the overall color changes of the screen screen. When users are playing games, the chaotic and jumping backlight changes distract their attention and may even cause unnecessary visual interference.
[0004] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention
[0005] The main purpose of this application is to provide a keyboard lighting control method based on game scenarios, which aims to solve the technical problem that lighting changes without actual interactive significance cause unnecessary visual interference to users.
[0006] To achieve the above objectives, this application proposes a keyboard lighting control method based on a game scene, the method comprising:
[0007] Obtain image frames from the display device during game runtime;
[0008] If the game stage in the image frame is determined to be a battle stage, at least one first ROI image corresponding to the battle stage is determined based on the pre-trained ROI localization model.
[0009] Obtain the second ROI image whose timestamp precedes that of the first ROI image;
[0010] Determine the inter-frame difference value between the first ROI image and the second ROI image;
[0011] If the inter-frame difference value is greater than a preset difference threshold, the region interaction icon in the first ROI image is determined based on the pre-stored feature table.
[0012] If the regional interaction icon satisfies the continuous frame validity detection, control at least one illuminated area on the keyboard to display the target lighting effect corresponding to the regional interaction icon.
[0013] In one embodiment, the step of controlling at least one illuminated area on the keyboard to display the target lighting effect corresponding to the regional interaction icon if the regional interaction icon satisfies the consecutive frame validity detection includes:
[0014] If the regional interaction icon satisfies the continuous frame validity detection, determine the event type and level corresponding to the regional interaction icon;
[0015] Obtain a lighting control strategy that matches the event type and level corresponding to the interactive icon of the area;
[0016] Based on the lighting control strategy, at least one illuminated area on the keyboard is controlled to display the target lighting effect corresponding to the area's interactive icon.
[0017] In one embodiment, there are multiple area interaction icons. After the step of obtaining a lighting control strategy that matches the event type and level corresponding to the area interaction icon, the keyboard lighting control method based on the game scene further includes:
[0018] Determine the light blending display strategy or display priority associated with multiple interactive icons in the aforementioned areas;
[0019] Based on the aforementioned light fusion display strategy, the light control strategies corresponding to multiple regional interactive icons are integrated; or
[0020] Based on the lighting control strategy corresponding to the highest priority area interaction icon, control at least one luminous area on the keyboard to display the target lighting effect corresponding to the area interaction icon.
[0021] In one embodiment, the event type corresponding to the area interaction icon includes event information and operation perspective, and the step of obtaining a lighting control strategy that matches the event type and level corresponding to the area interaction icon includes:
[0022] A first lighting control strategy is determined based on the event information, and a second lighting control strategy is determined based on the level of the area interaction icon.
[0023] A third lighting control strategy is determined based on the operating perspective, wherein the operating perspective type includes operator perspective and observer perspective.
[0024] By integrating the first lighting control strategy, the second lighting control strategy, and the third lighting control strategy, a target lighting control strategy for controlling the keyboard to adjust the target lighting effect is obtained.
[0025] In one embodiment, the step of determining the event type and level corresponding to the regional interaction icon if the regional interaction icon satisfies the consecutive frame validity detection includes:
[0026] If the regional interaction icon satisfies the continuous frame validity detection, obtain the semantic recognition result or contour recognition result of the regional interaction icon;
[0027] Based on the semantic recognition result or the contour recognition result, determine the event type and level corresponding to the regional interaction icon.
[0028] In one embodiment, the step of determining the region interaction icon in the first ROI image based on a pre-stored feature table if the inter-frame difference value is greater than a preset difference threshold includes:
[0029] If the inter-frame difference value is greater than a preset difference threshold, determine the effective region where the inter-frame difference value is greater than the preset difference threshold.
[0030] The matching degree between the effective region and the target icon in the pre-stored feature table is calculated based on a preset algorithm;
[0031] If the matching degree is greater than the preset matching degree, then the regional interaction icon is determined to be the target icon.
[0032] In one embodiment, when the target icon in the pre-stored feature table is a bomb icon, the step of calculating the matching degree between the effective region and the target icon in the pre-stored feature table based on a preset algorithm includes:
[0033] Based on the preset color associated with the bomb icon, the sub-image of the effective area is updated to a binary mask image, and the target icon is updated to a target mask image;
[0034] The step of determining the regional interactive icon as the target icon if the matching degree is greater than the preset matching degree includes:
[0035] If the matching confidence between the binary mask image and the target mask image is greater than the preset execution confidence, the regional interaction icon is determined to be the bomb icon.
[0036] In one embodiment, when the target icon in the pre-stored feature table is a character defeat icon, the step of calculating the matching degree between the effective area and the target icon in the pre-stored feature table based on a preset algorithm includes:
[0037] Convert the sub-image of the effective region into a grayscale image;
[0038] ORB features of the grayscale image are extracted based on the Oriented Fast Rotation Binary Feature Descriptor;
[0039] Based on the mapping rules between the pre-stored ORB features and the visual dictionary set, the bag-of-words vector of the ORB features is determined, and the similarity between the bag-of-words vector and the pre-stored bag-of-words vector is determined.
[0040] The step of determining the regional interactive icon as the target icon if the matching degree is greater than the preset matching degree includes:
[0041] If the similarity is greater than the preset similarity, then the area interaction icon is determined to be the character's defeat icon.
[0042] In addition, to achieve the above objectives, this application also proposes a keyboard lighting control device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the keyboard lighting control method based on a game scene as described above.
[0043] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the keyboard lighting control method based on the game scene described above.
[0044] One or more technical solutions proposed in this application have at least the following technical effects:
[0045] By acquiring image frames from the display device during game runtime, a pre-trained ROI localization model is used to detect these frames. Only when the game phase in an image frame is determined to be a combat phase is at least one first ROI image corresponding to that phase identified, rather than performing full-screen indiscriminate recognition on all image frames. Next, a second ROI image with a timestamp preceding the first ROI image is acquired. When the frame difference between the first and second ROI images exceeds a preset difference threshold, a region interaction icon in the first ROI image is determined based on a pre-stored feature table. This filters out invalid recognition scenarios due to ineffective battle changes, avoids invalid repetitive display of static lighting, and prevents recognition interference from screen changes without actual interactive significance. After the region interaction icon satisfies the consecutive frame validity detection, at least one illuminated area on the keyboard displays the target lighting effect corresponding to the region interaction icon. This eliminates the need for lighting adjustments based on invalid screen content, ensuring that the lighting effect triggering timing is synchronized with changes in the game's battle situation, thus improving the interactive experience during gameplay. Attached Figure Description
[0046] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0047] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0048] Figure 1 This is a flowchart illustrating the first embodiment of the keyboard lighting control method based on a game scenario in this application.
[0049] Figure 2 This is a schematic diagram of image frames for the keyboard lighting control method based on a game scene in this application;
[0050] Figure 3 This is a flowchart illustrating the second embodiment of the keyboard lighting control method based on a game scenario in this application.
[0051] Figure 4 This is a schematic diagram of the device structure of the hardware operating environment involved in the keyboard lighting control method based on a game scene in the embodiments of this application.
[0052] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0053] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0054] In the backlight control methods of related gaming keyboards, the real-time image of the display device is usually captured at a preset frequency. After basic image processing such as segmentation and scaling of the captured image, the pixel color data in the image is extracted, and then the corresponding light driving signal is generated to drive the keyboard backlight and the screen image to change synchronously, thereby realizing the basic linkage between the lighting effect and the displayed content.
[0055] However, current keyboard backlight control methods can only achieve surface color synchronization decoration. Regardless of whether the screen displays the core combat screen of the game, or irrelevant screens such as system pop-ups, advertisements, or office interfaces, it passively replicates the overall color changes of the screen screen. When users are playing games, the chaotic and jumping backlight changes distract their attention and may even cause unnecessary visual interference.
[0056] Meanwhile, after major peripheral manufacturers establish strategic partnerships with popular game developers, their peripheral products can obtain structured event data through game interfaces (SDK / API), and then control the output of corresponding lighting effects based on this structured event data. However, in actual use, players must correctly install the manufacturer's drivers, enable specific functions, and keep the versions synchronized; any error in any of these steps can lead to the failure of the linkage. Therefore, the cost of use is high.
[0057] Based on this, this application provides a solution that first acquires image frames, and only when the game stage in the image frame is determined to be a battle stage is at least one first ROI image corresponding to the battle stage determined, instead of performing full-screen indiscriminate recognition processing on all image frames. Then, by acquiring a second ROI image whose timestamp precedes the first ROI image, when the frame difference between the first and second ROI images exceeds a preset difference threshold, the region interaction icon in the first ROI image is determined based on a pre-stored feature table. This filters out invalid recognition scenarios due to invalid battle changes, avoids invalid repetitive display of static screen lighting, and prevents recognition interference caused by screen changes without actual interactive significance. After the region interaction icon satisfies the consecutive frame validity detection, at least one illuminated area on the keyboard is controlled to display the target lighting effect corresponding to the region interaction icon. This eliminates the need for lighting adjustments based on invalid screen content, allowing the lighting effect triggering timing to synchronize with game battle changes, improving the interactive experience during gameplay. Simultaneously, key event lighting displays can be completed solely through image recognition, improving the keyboard lighting display effect.
[0058] In this embodiment, the executing entity can be a keyboard lighting control device for a game scene, such as a computer host device, a keyboard body integrating a lighting control module, or an external control device independent of the host and keyboard. The following description uses a keyboard lighting control device as an example. Furthermore, the games described in this application refer to FPS (First-Person Shooter) games that typically use keyboard controls and run on computer devices.
[0059] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0060] This application provides a keyboard lighting control method based on a game scene, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the keyboard lighting control method based on a game scene according to this application.
[0061] In this embodiment, the keyboard lighting control method based on the game scene includes steps S10~S60:
[0062] Step S10: Obtain image frames from the display device during game runtime.
[0063] Display devices refer to terminal output devices used to output game visuals, including but not limited to computer monitors, external displays for game consoles, and portable game terminal screens. An image frame refers to a single static image unit that constitutes the dynamic visuals of a game, captured at fixed time intervals. Each image frame corresponds to a unique capture timestamp.
[0064] In this embodiment, after detecting that the game is running, image frames from the display device are acquired. Specifically, the start of the target game can be determined by using a preset process snapshot, such as by registering a process startup event callback through WMI (Windows Management Instrumentation) to detect the start and stop of the game process. Simultaneously, the desktop content of the display can be captured through a preset interface, such as the d3d11 interface. It is understood that the game process detection and image capture technologies mentioned in the preceding examples are both mature open-source technologies.
[0065] It is understandable that if the acquired image frame is empty, the processing of this frame will end.
[0066] Step S20: If the game stage in the image frame is determined to be the battle stage, at least one first ROI image corresponding to the battle stage is determined based on the pre-trained ROI localization model.
[0067] It's important to note that competitive games typically consist of an out-of-game preparation phase and an in-game battle phase. The battle phase refers to the events occurring during the game's execution; that is, after the game transitions from the out-of-game preparation phase to the in-game battle phase, the current game phase is determined to be the battle phase. After acquiring image frames, a preset algorithm can be used to identify pre-stored images associated with the battle phase. The current image frame is compared with the pre-stored images to determine whether the game phase of the image frame is the battle phase. Specifically, the open-source OpenCV's `matchtemplate` algorithm is used to compare the current image with the pre-stored images.
[0068] The pre-trained ROI localization model refers to an object detection model based on a deep learning framework that has been trained and optimized in advance using a large dataset of game battle scenes. This model can quickly identify the battle phase in the input image and locate the coordinates of the region of interest corresponding to the event. The model architecture can be YOLO, SSD, Faster R-CNN, etc., and this application does not limit it.
[0069] A Region of Interest (ROI) refers to a localized area within an image frame that is directly related to the combat phase and contains core interactive information. It distinguishes it from non-interactive game background or scene areas, such as areas corresponding to game events related to player actions and character status changes. These events include, but are not limited to, skill activation events, character being hit events, item acquisition events, character status change events, game phase change events, and game defeat events. This ROI is associated with a specific game type. The first ROI image refers to a localized image extracted from the currently processed image frame based on the coordinates of the located ROI. The first ROI image can be one or multiple images. If there is only one combat event in the current game, then there is only one first ROI image. However, if there are multiple combat events and these events are displayed in different areas, then multiple first ROI images will be collected.
[0070] In this embodiment, after acquiring an image frame, the system first presets a design resolution (width W0, height H0, such as 2560×1440). Then, based on the width and height of the actually captured image frame, it calculates the horizontal scaling ratio sx and the vertical scaling ratio sy. Subsequently, it selects a uniform scaling factor scalescale based on the relationship between the horizontal and vertical scaling ratios. When sx=1, it takes min(sx, sy); otherwise, it takes max(sx, sy), thus ensuring that the scaling reference of the subsequent region of interest is consistent. When sx≠sy, it calculates the horizontal and vertical offsets, thereby accurately mapping the rectangular ROI originally defined in the design coordinate system to the corresponding region in the actual image frame. This allows the ROI coordinates output by the pre-trained model to adapt to any resolution, avoiding positioning deviations caused by image stretching or compression, ensuring that the region analysis on which the lighting effect trigger depends always falls on the correct image position, and improving robustness across devices and resolutions.
[0071] Therefore, after determining that the game phase in the image frame is a combat phase, as an optional implementation, the image frame can be used as input to the ROI positioning model to obtain the game crosshair position. Then, the pre-trained ROI positioning model determines the screen scaling factor based on the game crosshair position and the ratio of the target game's current resolution to the baseline resolution. Finally, the pre-trained model determines the ROI image based on pre-stored event region information and the screen scaling factor. The device can then directly acquire the ROI image determined by the model. For example, if the default screen size is 2k, the area corresponding to a character being hit is an A×B area in the center or above the game crosshair, or a specific area around the game. If the currently acquired image frame is 1k, then the ROI image with a corresponding scaling ratio of (A×B) / K can be determined using the event region information bound to the game and the screen scaling factor. Here, the pre-stored event region information refers to the relative position of the game's combat event in the image frame, and K is the corresponding scaling ratio.
[0072] Therefore, when a single event occurs in the current game, the image frame is preprocessed, such as scaling and pixel normalization. Based on the preprocessed image frame, the pixel coordinates of the region of interest corresponding to that battle phase are output. The corresponding local scene is then cropped from the original image frame using these coordinates to generate the first ROI image with a timestamp.
[0073] As another optional implementation, when multiple events are in parallel, multiple regions of interest corresponding to multiple events can be located simultaneously, and multiple first ROI images can be extracted. The localization process of a single image is implemented in the same way, and this application will not elaborate on it.
[0074] This embodiment uses a pre-trained ROI localization model for preliminary judgment, filtering out invalid images without combat events, and then extracting the core ROI region. This reduces the processing scope from the entire screen to a local core area, significantly reducing computational overhead and improving real-time processing. Simultaneously, it identifies ROI images corresponding to single and multiple events, enabling coverage of single and multiple types of lighting effect triggering scenarios during lighting display.
[0075] Understandably, if the game phase in the image frame is not a battle phase, then the action of obtaining the image frame from the display device will be executed.
[0076] Step S30: Obtain the second ROI image whose timestamp precedes that of the first ROI image.
[0077] The second ROI image refers to a historical ROI image whose timestamp is earlier than the first ROI image, corresponds to the same region of interest coordinates, and belongs to the same event category as the first ROI image. The first and second ROI images can be images from adjacent frames or images from frames at fixed intervals. This embodiment preferably uses adjacent frame images.
[0078] Therefore, in this embodiment, the ROI image in the same region can be extracted as the second ROI image by using the previous adjacent image frame of the original image frame corresponding to the first ROI image as a reference. For example, if the original image frame corresponding to the first ROI image is determined to be the Nth frame, the previous adjacent frame in time, i.e., the (N-1)th frame, is determined as the reference frame of the second ROI image. Then, based on the region of interest coordinates and event category markers corresponding to the first ROI image, a local image with the same coordinate range is cropped from the original image frame of the (N-1)th frame, to obtain the second ROI image with the same size and format as the first ROI image.
[0079] This embodiment extracts ROI images of the same region of interest in adjacent frames, so as to analyze the data of adjacent frames and meet the event capture requirements of fast-paced FPS games.
[0080] Step S40: Determine the inter-frame difference value between the first ROI image and the second ROI image.
[0081] The inter-frame difference value refers to a standardized numerical value calculated using an image differencing algorithm, which quantifies the degree of difference between the first ROI image and the second ROI image. A larger value indicates a more significant difference between the two images.
[0082] In this embodiment, the structural similarity (SSIM) algorithm can be used to calculate the structural differences between two ROI images from three dimensions: brightness, contrast, and structure, generating standardized inter-frame difference values. The first and second ROI images are converted into RGB three-channel images, and each image is divided into multiple non-overlapping image sub-blocks. Gaussian filtering is applied to each sub-block to eliminate noise interference in the difference calculation. For each corresponding sub-block, parameters for brightness similarity, contrast similarity, and structural similarity are calculated. A weighted average is then used to obtain the structural similarity index for that sub-block, where the index ranges from 0 to 1, with values closer to 1 indicating greater structural similarity between the two sub-blocks. Finally, the average of the structural similarity indices for all sub-blocks is taken to obtain the global structural similarity index for the two ROI images. Subtracting the global structural similarity index from 1 yields the standardized inter-frame difference value, which also ranges from 0 to 1, with larger values indicating more significant structural differences between the two images.
[0083] Optionally, the sum of pixel-level differences between the two ROI images can be calculated using the Sum of Absolute Differences (SAD) algorithm to generate a standardized inter-frame difference value. Specifically, the first and second ROI images are converted into single-channel grayscale images, and the pixel value ranges of the two grayscale images are aligned. Then, the absolute difference of pixel values is calculated for corresponding pixels in the two grayscale images, generating a difference matrix with the same size as the original image. Each element in the matrix represents the absolute difference of the corresponding pixel, and elements with values greater than 0 in the difference matrix are the pixels that have changed. Finally, the sum of all elements in the difference matrix is calculated to obtain the sum of absolute differences. This sum of absolute differences is then divided by the total number of pixels in the two images to obtain the standardized average absolute difference per pixel. This average absolute difference is used as the final inter-frame difference value.
[0084] This embodiment calculates the differences between consecutive frames of the same region of interest to determine whether there is event information related to lighting changes in the current battle phase based on the difference value.
[0085] Step S50: If the inter-frame difference value is greater than the preset difference threshold, determine the region interaction icon in the first ROI image based on the pre-stored feature table.
[0086] The preset difference threshold refers to a pre-configured critical value used to determine whether the inter-frame difference value reaches the standard for valid change. Specifically, when the inter-frame difference value exceeds this threshold, a valid visual change with interactive significance is determined to have occurred within the ROI area; otherwise, it is determined to be an invalid scene without valid change. The pre-stored feature table refers to a database pre-built and stored locally, containing feature templates for various game interaction icons. Each feature template corresponds to a unique interaction icon type, icon feature description, etc. Regional interaction icons refer to visual interaction icons located within the ROI area in the game screen that are directly related to player operations and character status, including but not limited to skill icons, hit icons, item icons, and status icons.
[0087] In this embodiment, a large difference value indicates a change in the corresponding event in the current region. In this case, the region interaction icon can be determined based on the icon recognition method of template matching. When determining the region interaction icon in the first ROI image based on the pre-stored feature table, the entire region or a local region of the first ROI image is usually matched based on the template matching algorithm or feature point matching method, and then the region interaction icon is determined according to the matching result.
[0088] Specifically, step S50 may include steps S51 to S53:
[0089] Step S51: Determine the effective region where the inter-frame difference value is greater than the preset difference threshold, and then calculate the effective region based on the preset algorithm;
[0090] Step S52: Calculate the matching degree between the effective region and the target icon in the pre-stored feature table based on the preset algorithm;
[0091] Step S53: If the matching degree is greater than the preset matching degree, then the area interaction icon is determined to be the target icon.
[0092] As an optional implementation, the inter-frame difference value is compared with a preset difference threshold. If the inter-frame difference value is greater than the preset difference threshold, it is determined that there is a valid image change within the ROI region. Then, a pre-stored feature table is loaded from local storage. Based on the event category corresponding to the first ROI image, multiple candidate icons for the corresponding category are selected. According to a preset matching priority, the selected icon templates are sequentially matched with the preprocessed first ROI image. For each template match, the matching degree is calculated. If a template with a matching degree greater than the preset matching threshold exists, it is determined that the first ROI image contains an interactive icon corresponding to that template. The type of the interactive icon, its corresponding lighting effect configuration information, etc., are then recorded. This eliminates false recognition results with low matching degrees, ensuring that the recognized interactive icons have high reliability.
[0093] As an alternative implementation, the ORB feature point extraction and matching algorithm is used to extract feature points from the first ROI image and icons in a pre-stored feature table. Feature point matching is then used to identify interactive icons within the region. Specifically, the ORB algorithm is used to extract feature points and corresponding feature descriptors from the preprocessed first ROI image. Then, the pre-stored feature table is loaded, and the pre-stored feature points and feature descriptors of all icon templates in the table are extracted. Based on a brute-force matching algorithm, the feature descriptors of the first ROI image are matched pairwise with the feature descriptors of all icon templates, and successfully matched feature point pairs are selected. Finally, matching degree statistics and icon determination are performed. The number of successfully matched feature point pairs between each icon template and the first ROI image is counted, and the matching degree value is calculated. If the matching degree value is greater than a preset matching threshold, it is determined that the first ROI image contains an interactive icon corresponding to that template, and the type and corresponding lighting effect information of the interactive icon are recorded.
[0094] For example, for the first ROI image of the skill bar area in an FPS game, the inter-frame difference value is 0.15, which is greater than the preset difference threshold of 0.05. At this time, 256 feature points and corresponding descriptors of the first ROI image are extracted by the ORB algorithm. Then, the pre-stored feature descriptors of all item icon templates in the pre-stored feature table are loaded and matched in pairs. The skill 1 icon of character x is obtained. The skill 1 is empty and is in the used state.
[0095] For example, the current image frame is as follows Figure 2As shown, the image frame includes multiple Regions of Interest (ROI) images. Different ROI images correspond to different pre-stored template icons, and the recognition methods for different images also differ; for example, the icons may be solid colors, text, patterns, or outlines. Therefore, different underlying algorithms are used to determine the interactive icons for ROI images at different locations.
[0096] This embodiment filters valid regions, performing icon recognition only on ROI images with valid visual changes, reducing invalid matching operations and lowering computational consumption. Simultaneously, by using template matching and feature point matching, it can effectively target icons for both fixed UIs (user interfaces) and various UI types, ensuring successful icon recognition.
[0097] Understandably, if the inter-frame difference value is less than the preset difference threshold, it means that the current screen content has not changed much, and there is no need to perform subsequent icon recognition and lighting effect adjustment.
[0098] Step S60: If the area interaction icon satisfies the continuous frame validity detection, control at least one illuminated area on the keyboard to display the target lighting effect corresponding to the area interaction icon.
[0099] Consecutive frame validity detection verifies whether an interactive area icon represents a genuine and valid game interaction event, rather than a single-frame misidentification, by analyzing the recognition results of multiple consecutive frames. Typically, if the same interactive area icon appears in N consecutive frames (e.g., 3 consecutive frames), the icon is considered to have passed the consecutive frame validity detection. Keyboards usually have multiple different illuminated areas, each with independently configurable parameters such as color, brightness, blinking frequency, and dynamic effects. The target lighting effect is a pre-configured keyboard lighting effect that corresponds one-to-one with the type of interactive area icon, including parameters such as the illuminated area, color, brightness, blinking frequency, and dynamic mode.
[0100] In this embodiment, when the area interaction icons in multiple consecutive frames meet the conditions, the target lighting effect parameters corresponding to the area interaction icon can be retrieved from the pre-stored feature table, including the luminous area, color, brightness, flashing frequency, duration, etc. Then, the lighting effect control command is sent to the keyboard's lighting effect control chip through the keyboard's wired / wireless communication interface to control at least one corresponding luminous area on the keyboard to display the corresponding lighting effect according to the target lighting effect parameters.
[0101] For example, for the identified ultimate skill icon, the pre-configured number of consecutive frames N is 3. Taking the 60th frame where the icon is identified as the starting frame, the 61st and 62nd image frames are retrieved sequentially. After repeating the process, it is confirmed that the same ultimate skill icon is identified in both the 61st and 62nd frames, thus satisfying the consecutive frame validity detection. Next, the target lighting effect parameters corresponding to the ultimate skill event are retrieved from the pre-stored feature table: the Q key area of the keyboard (the control corresponding to the skill) is illuminated, red, brightness 100%, flashing at 10Hz, and duration 1 second. Finally, the lighting effect control command is sent to the keyboard's lighting effect control chip via the USB interface to control the Q key area of the keyboard to display the corresponding flashing lighting effect according to the parameters.
[0102] It is understandable that if the same type of regional interaction icon is identified in all N frames of images, the regional interaction icon is determined to satisfy the continuous frame validity detection; otherwise, it is determined to be an invalid recognition result and the lighting effect adjustment is not triggered.
[0103] This embodiment provides a keyboard lighting control method based on game scenarios. First, a pre-trained ROI localization model is used to extract key regions, reducing the image processing scope. Then, inter-frame difference calculations are used to calculate the effective region, eliminating invalid calculations caused by meaningless screen changes. Subsequently, a pre-stored feature table is used to accurately identify regional interactive icons. Finally, continuous frame validity detection completes the final verification before triggering the corresponding lighting effect. Based on this, precise linkage between keyboard lighting effects and game events can be achieved without connecting to the game's native SDK interface. Furthermore, lighting effects are adjusted only during game combat based on the actual battle content, rather than being captured in real-time. This effectively reduces the computational burden on the terminal device during image recognition and the interference of lighting on user attention, improving the user interaction experience.
[0104] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 3 Step S60 also includes steps S61 to S63:
[0105] Step S61: If the area interaction icon satisfies the continuous frame validity detection, determine the event type and level corresponding to the area interaction icon.
[0106] In this embodiment, to reduce computational complexity, when determining the lighting control strategy corresponding to an area interaction icon, it is also necessary to determine the event type and corresponding level of the icon. This allows for the filtering and matching of lighting control strategies based on the type and level. Event types include skill release events, character attack events, item use events, character defeat events, and scene transition events. Event level refers to a quantitative grading index of the urgency, importance, and trigger intensity of events of the same type. For example, in an item use event, if there are two available items, the level is 1 when using one item and 2 when using two items. Different levels correspond to different display effects of the same light, or different light display effects. For example, level 1 might display for 1 second, level 2 for 2 seconds, or level 1 might display a gradient light, while level 2 might display a flashing light, etc.
[0107] When determining the event type and level, the semantic recognition results or contour recognition results of the regional interactive icons can be obtained. Based on these results, the event type and level corresponding to the regional interactive icons can be determined. Specifically, the regional interactive icons can be submitted to an optical character recognition (OCR) module. This module analyzes the text and contours of the icons, recognizing the text semantics and the icon semantics based on the contours. For example, the icon sub-image can be input into a pre-trained icon classification CNN model. Based on contour recognition, the model outputs whether the icon is a hit warning icon, a bomb deployment icon, or a healing item icon, along with the corresponding confidence scores. Simultaneously, all valid text content within the icon will be extracted to determine the specific text semantics, such as defeat, victory, or triumph.
[0108] Step S62: Obtain the lighting control strategy that matches the event type and level corresponding to the area interaction icon.
[0109] In this embodiment, as an optional implementation of determining the lighting control strategy, different event types correspond to different lighting control strategies. The event type and event level can be used as index keys to perform precise retrieval and matching in the locally stored lighting strategy library to obtain the corresponding lighting control strategy.
[0110] As another optional implementation, a first lighting control strategy can be determined based on the event type, and a second lighting control strategy can be determined based on the level. The two control strategies are then merged to obtain the target lighting control strategy. For example, if the current event is a defeat event, the corresponding first lighting control strategy is "the K key will be in a breathing flashing state for the next 5 seconds." The consecutive defeat level corresponding to the defeat event is 3, and the corresponding second lighting control strategy is "blinking yellow." Merging the two control strategies results in "the K key will be in a yellow flashing state for the next 5 seconds." It is understood that when the displayed content does not conflict, merging the control strategies refers to overlaying the lighting effects. If the displayed content conflicts, merging is based on display priority. For example, if the first control strategy is to display the K key in red, and the second control strategy is to display it in yellow, and the second control strategy has a higher priority, then the merged control strategy will display the K key in yellow. Furthermore, the merging method can also be based on different colors; for example, after merging red and yellow, an orange light needs to be output.
[0111] As an alternative implementation, in addition to specific event information such as skill release events, character being hit events, item usage events, character defeat events, and scene switching events, the event type also includes the current operation perspective type, which includes the operator's perspective and the observer's perspective. When the current perspective is the observer's perspective, if the user's character is defeated in the current round and the displayed interface is that of another character, the lighting effects corresponding to this perspective will not affect the user's interactive experience. Therefore, in addition to determining event information through contours, the operation perspective can also be determined based on the ROI image corresponding to the observer's perspective. In the process of obtaining the lighting control strategy that matches the event type and level corresponding to the area interaction icon, a first lighting control strategy can be determined based on the event information, a second lighting control strategy can be determined based on the level of the area interaction icon, and a third lighting control strategy can be determined based on the operation perspective. Finally, the first, second, and third lighting control strategies are merged to obtain the target lighting control strategy for the keyboard-adjustable target lighting effects. For example, the first lighting control strategy is "the K key will be in a breathing flashing state for the next 5 seconds," the corresponding second lighting control strategy is "flashing yellow," and the third lighting control strategy is "flashing frequency increased by 100%." This results in lighting control strategies that differ from the operator's perspective. Based on this, the keyboard can display different lighting effects according to the current viewing angle, ensuring that the lighting effect strategy remains consistent with the actual interactive stage of the user, thus improving the accuracy and flexibility of the lighting response.
[0112] Furthermore, as another alternative implementation method, please continue to refer to... Figure 2When there are multiple interactive icons for a given region (ROI), meaning different interactive icons are extracted from multiple ROI images, a strategy conflict verification process is performed for the different lighting control strategies corresponding to each interactive icon. Specifically, based on the priority parameters in each strategy, strategies are sorted from highest to lowest priority. Lower-priority strategies are overlaid or temporarily disabled to resolve lighting effect display conflicts when multiple events are triggered simultaneously, ensuring that the lighting effects of high-priority core events are displayed first and completely. Meanwhile, content without conflicts can be displayed collaboratively.
[0113] Specifically, when there are multiple area interaction icons, the lighting fusion display strategy or display priority associated with each icon can be determined first. Lighting control strategies can then be fused based on the lighting fusion display strategy, or the highest-priority lighting control strategy can be displayed based on the display priority. Lighting fusion display is performed when the lighting content does not conflict, while priority adjustment is performed when there is a conflict. This avoids display chaos caused by multiple overlapping lighting effects, ensures the orderliness of lighting effect display, and guarantees that the final lighting command for each button is unique and executable. This prevents the flashing effect of specific keys in high-priority events from being completely overridden by global events, thus conveying multi-dimensional game status information without interfering with player operations.
[0114] For example, the area interaction icons are a bomb icon and a level 3 defeat icon, and the perspective is the operator's perspective. At this time, the lighting control strategy corresponding to the defeat icon is "the K key will be flashing yellow for the next 5 seconds." The lighting control strategy corresponding to the bomb icon is "all keys on the keyboard will be red for the next 10 seconds." After lighting fusion and priority display, the lighting control strategy is determined to be: "the K key will be flashing yellow for the next 5 seconds, and other keys will be solid red; from 5 to 10 seconds, all keys will be solid red."
[0115] It should be noted that the above lighting control strategy is for illustrative purposes only and is not intended to limit this application.
[0116] Step S63: Based on the lighting control strategy, control at least one illuminated area on the keyboard to display the target lighting effect corresponding to the interactive icon.
[0117] After obtaining the corresponding control strategy, the lights are displayed in the corresponding light-emitting areas.
[0118] This embodiment provides a keyboard lighting control method based on game scenarios. It binds the recognition results of regional interactive icons with lighting effect control strategies, achieving synchronized lighting effects after key events occur during game battles through visual recognition. Simultaneously, based on a lighting effect fusion strategy, when multiple events or different strategies exist during game battles, display effects are superimposed and / or overlaid, improving the lighting control effect after battle events are triggered.
[0119] Based on the first embodiment of this application, in the third embodiment of this application, the content that is the same as or similar to that in the first embodiment can be referred to the above description, and will not be repeated hereafter. In addition, step S50 further includes steps S51 to S53:
[0120] Step S51: If the inter-frame difference value is greater than the preset difference threshold, determine the effective region where the inter-frame difference value is greater than the preset difference threshold.
[0121] Step S52: Calculate the matching degree between the effective region and the target icon in the pre-stored feature table based on the preset algorithm;
[0122] Step S53: If the matching degree is greater than the preset matching degree, then the area interaction icon is determined as the target icon.
[0123] In this embodiment, different ROI regions correspond to different display icons. And different display icons correspond to different icon recognition methods.
[0124] As an optional implementation, when the target icon in the pre-stored feature table is a bomb icon, after determining the effective area, the sub-image of the effective area can be updated to a binary mask image based on the preset color associated with the bomb icon, and the target icon can be updated to a target mask image. If the matching confidence between the binary mask image and the target mask image is greater than the preset execution confidence, the interactive icon of the area is determined to be a bomb icon.
[0125] Specifically, for the ROI region corresponding to the bomb icon, effective regions with inter-frame differences exceeding a preset threshold undergo search rectangle scaling mapping and margin expansion processing. Then, based on set threshold rules for red, green, and blue components, a red binary mask image of the current frame sub-image and the corresponding bomb icon in the pre-stored feature table is generated pixel-by-pixel. The bomb icon undergoes the same processing. Finally, sliding matching is performed on the current frame mask image using the normalized correlation coefficient method. The global maximum response value is taken as the matching confidence. When the confidence exceeds a preset deployment threshold, the interactive icon in the region is determined to be the bomb icon.
[0126] For example, the first ROI image corresponds to the area where the bomb has been deployed in an FPS competitive game, and the icon in the pre-stored feature table is a highly saturated bright red icon. At this point, the effective area of the first ROI image is converted into an RGB three-channel image to eliminate the interference of format differences on subsequent processing. After performing the same processing on the bomb icon, a full-image sliding match is performed, calculating the matching response value at each sliding position, and taking the global maximum response value of 0.92 as the confidence score for this match. If this confidence score is greater than the preset deployment judgment threshold of 0.85, the interaction icon in the judgment area is the bomb icon, meaning that the current frame is in the bomb deployment completed state.
[0127] As an alternative implementation, when the target icon in the pre-stored feature table is a character defeat icon, the sub-image of the effective region can be converted into a grayscale image. ORB features of the grayscale image are extracted using the Oriented Fast Rotation Binary Feature Descriptor. Then, according to the mapping rules between the pre-stored ORB features and the visual dictionary set, the bag-of-words vector of the ORB features is determined. Finally, the similarity between the bag-of-words vector and the pre-stored bag-of-words vector is determined. If the similarity is greater than a preset similarity, the region interaction icon is determined to be the character defeat icon.
[0128] Specifically, after cropping a circular or square region defined by a preset center and radius (i.e., the effective region), the sub-image of this effective region is converted into a grayscale image. Then, a directional fast rotation binary feature descriptor is used to extract key points and descriptors. These descriptors are then mapped to bag-of-words vectors using a pre-trained visual vocabulary. Finally, the similarity between the current frame's bag-of-words vector and the pre-stored template bag-of-words vector is calculated. If the similarity is greater than a preset threshold, the region's interactive icon is determined to be a character defeat icon. During training, image samples from multiple different game scenes are first acquired, and the ORB features of these image samples are extracted to obtain an ORB feature set. Then, a preset bag-of-words model is used to cluster and train the ORB feature set to obtain a visual dictionary set. Finally, a mapping rule between the ORB features and the visual dictionary set is constructed so that the extracted ORB features can be converted into bag-of-words feature vectors based on this mapping rule.
[0129] Furthermore, when the target icon is a game scene switching icon, such as a character defeat icon, a two-level detection mechanism based on green mask gating pre-screening and optical character recognition (OCR) can be used to convert the effective area into the HSV color space. First, green pixels in the image are extracted through the first HSV interval. When the proportion of green pixels in the area is not less than a preset first proportion threshold (e.g., 0.7), high-brightness, low-saturation pixels in the area are extracted as text candidates through the second HSV interval. Only when the proportion of text candidate pixels in the area is greater than a preset second proportion threshold (e.g., 0.1) is the subsequent recognition process triggered by gating, thereby filtering out invalid frames in advance. After gating verification, based on the predefined second rectangular area covering the round win / loss text at the design resolution, it is mapped to the current frame, and the corresponding sub-image is extracted and converted to BGR format. This is then submitted to the optical character recognition module for text recognition. Subsequently, in the recognition result string output by the optical character recognition module, a match is found for the preset character codes representing victory and defeat. If the character code corresponding to victory is matched, the icon is determined to be a game scene switching icon; the same applies if the character code corresponding to defeat is matched. Finally, when the game scene changes, the state of the collected event data is reset to prepare for the relevant data statistics in the next round.
[0130] Furthermore, when the target icon is a character being hit, the search radius R and the ring thickness T can be used to determine the annular area of interest. Then, the rectangular sub-image containing this ring, i.e., the effective sub-image, is converted to a three-channel color space. Next, based on a fixed angle step size traversal, for each angle θ, the red excess at each sampling point is calculated, defined as the difference between the red component and the larger of the green and blue components. For the same θ, sampling is performed within a reference radius interval located inside the inner radius Rin and outside the outer radius Rout, and the average is calculated to obtain the annular average excess and the reference average excess. The difference between the two is recorded as the radial difference value for that angle, and a circular moving average smoothing is applied to the difference value and the average excess of the annular and reference bands. Subsequently, for each angle, an adaptive difference threshold is set based on the reference average excess, such as a base threshold + the product of the reference average excess and the positive part multiplied by a penalty coefficient. Only angle indices that simultaneously meet the following conditions are retained: the smoothed radial difference is greater than the adaptive threshold, the annular average excess is greater than the absolute red threshold, and the proportion of the radial difference to the annular average excess is greater than a proportional threshold. Finally, the retained angle indices are sorted by angle, and those with a gap greater than the gap threshold (e.g., 15°) are divided into different segments; if the first and last segments are adjacent on the circumference, they are merged; the segment with the most points is selected as the candidate arc segment, and its angle span and fill rate (the ratio of points to span) are calculated; if the span is less than the minimum arc length threshold, greater than the maximum arc length threshold, or the fill rate is too low, the icon is determined not to be a hit icon. Within the angle range corresponding to the candidate arc segment, the proportion of pixels with red excess exceeding the confirmation threshold in the ring and reference bands are counted respectively. If the proportion in the ring band is not lower than the first proportion and the proportion in the reference band is lower than the second proportion of the ring band proportion (e.g., less than half), then a hit icon is determined to exist.
[0131] Optionally, when the target image is character skill information, the effective area can be converted into a grayscale image, and then reverse binarized with a fixed threshold to obtain an icon binary image. The icon binary image is then matched with the pre-stored skill icon templates of multiple characters using normalized correlation coefficient template matching. The hero icon with the maximum response exceeding the matching threshold (e.g., 0.43) is taken as the character skill of a certain character.
[0132] It should be noted that the process of determining the interactive icons of the target region can be performed simultaneously, that is, the interactive icons of different ROI images can be detected based on the corresponding algorithm.
[0133] This embodiment provides a keyboard lighting control method based on a game scene. It first filters out effective regions with significant changes by using an inter-frame difference threshold, and then performs icon matching only on these regions, reducing the computational load of template matching and improving real-time processing efficiency. Simultaneously, by eliminating interference from static backgrounds or low-frequency noise through changing regions, it reduces the probability of false matching, thereby improving the accuracy of icon recognition and consequently enhancing the accuracy of subsequent lighting display.
[0134] This application provides a keyboard lighting control device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the game scene-based keyboard lighting control method in the first embodiment described above.
[0135] The following is for reference. Figure 4 It shows a structural schematic diagram of a keyboard lighting control device suitable for implementing embodiments of this application. Figure 4 The keyboard lighting control device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0136] like Figure 4 As shown, the keyboard lighting control device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the keyboard lighting control device. The processing unit 1001, the read-only memory 1002, and the RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the input / output interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the keyboard lighting control device to communicate wirelessly or wiredly with other devices to exchange data. Although keyboard lighting control devices with various systems are shown in the figures, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems may be implemented alternatively.
[0137] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0138] The keyboard lighting control device provided in this application employs the game-scene-based keyboard lighting control method described in the above embodiments, which solves the technical problem of unnecessary visual interference to users caused by lighting changes that have no actual interactive significance. Compared with the prior art, the beneficial effects of the keyboard lighting control device provided in this application are the same as those of the game-scene-based keyboard lighting control method provided in the above embodiments, and other technical features of this keyboard lighting control device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0139] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0140] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0141] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the keyboard lighting control method based on a game scene in the above embodiments.
[0142] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory (EPROM, or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, radio frequency (RF), etc., or any suitable combination thereof.
[0143] The aforementioned computer-readable storage medium may be included in the keyboard lighting control device; or it may exist independently and not assembled into the keyboard lighting control device.
[0144] The aforementioned computer-readable storage medium carries one or more programs that, when executed by the keyboard lighting control device, cause the keyboard lighting control device to:
[0145] Obtain image frames from the display device during game runtime;
[0146] If the game stage in the image frame is determined to be a battle stage, at least one first ROI image corresponding to the battle stage is determined based on the pre-trained ROI localization model.
[0147] Obtain the second ROI image whose timestamp precedes that of the first ROI image;
[0148] Determine the inter-frame difference value between the first ROI image and the second ROI image;
[0149] If the inter-frame difference value is greater than a preset difference threshold, the region interaction icon in the first ROI image is determined based on the pre-stored feature table.
[0150] If the regional interaction icon satisfies the continuous frame validity detection, control at least one illuminated area on the keyboard to display the target lighting effect corresponding to the regional interaction icon.
[0151] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0152] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0153] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0154] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described keyboard lighting control method based on a game scene. This solves the technical problem of unnecessary visual interference to users caused by lighting changes that have no actual interactive significance. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the keyboard lighting control method based on a game scene provided in the above embodiments, and will not be repeated here.
[0155] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A keyboard lighting control method based on a game scene, characterized in that, The keyboard lighting control method based on game scenarios includes: Obtain image frames from the display device during game runtime; If the game stage in the image frame is determined to be a battle stage, at least one first ROI image corresponding to the battle stage is determined based on the pre-trained ROI localization model. Obtain the second ROI image whose timestamp precedes that of the first ROI image; Determine the inter-frame difference value between the first ROI image and the second ROI image; If the inter-frame difference value is greater than a preset difference threshold, the region interaction icon in the first ROI image is determined based on the pre-stored feature table. The event type corresponding to the region interaction icon includes event information and operation perspective. If the area interaction icon satisfies the continuous frame validity detection, control at least one illuminated area on the keyboard to display the target lighting effect corresponding to the area interaction icon, including: if the area interaction icon satisfies the continuous frame validity detection, determine the event type and level corresponding to the area interaction icon; Obtaining a lighting control strategy that matches the event type and level corresponding to the area interaction icon includes: determining a first lighting control strategy based on the event information; determining a second lighting control strategy based on the level of the area interaction icon; determining a third lighting control strategy according to the operation perspective, wherein the operation perspective type includes operator perspective and observer perspective; and fusing the first lighting control strategy, the second lighting control strategy, and the third lighting control strategy to obtain a target lighting control strategy for controlling the keyboard to adjust the target lighting effect, wherein the fused lighting control strategy includes lighting effect overlay display and priority-based lighting effect display. Based on the lighting control strategy, at least one illuminated area on the keyboard is controlled to display the target lighting effect corresponding to the area's interactive icon.
2. The keyboard lighting control method based on a game scene as described in claim 1, characterized in that, The area interaction icons are multiple. After the step of obtaining a lighting control strategy that matches the event type and level corresponding to the area interaction icon, the keyboard lighting control method based on the game scene further includes: Determine the light blending display strategy or display priority associated with multiple interactive icons in the aforementioned areas; Based on the aforementioned light fusion display strategy, the light control strategies corresponding to multiple regional interactive icons are integrated; or Based on the lighting control strategy corresponding to the highest priority area interaction icon, at least one luminous area on the keyboard is controlled to display the target lighting effect corresponding to the area interaction icon.
3. The keyboard lighting control method based on a game scene as described in claim 1, characterized in that, If the regional interaction icon satisfies the consecutive frame validity detection, the step of determining the event type and level corresponding to the regional interaction icon includes: If the regional interaction icon satisfies the continuous frame validity detection, obtain the semantic recognition result or contour recognition result of the regional interaction icon; Based on the semantic recognition result or the contour recognition result, determine the event type and level corresponding to the regional interaction icon.
4. The keyboard lighting control method based on a game scene as described in claim 1, characterized in that, The step of determining the region interaction icon in the first ROI image based on a pre-stored feature table if the inter-frame difference value is greater than a preset difference threshold includes: If the inter-frame difference value is greater than a preset difference threshold, determine the effective region where the inter-frame difference value is greater than the preset difference threshold. The matching degree between the effective region and the target icon in the pre-stored feature table is calculated based on a preset algorithm; If the matching degree is greater than the preset matching degree, then the regional interaction icon is determined to be the target icon.
5. The keyboard lighting control method based on a game scene as described in claim 4, characterized in that, When the target icon in the pre-stored feature table is a bomb icon, the step of calculating the matching degree between the effective area and the target icon in the pre-stored feature table based on a preset algorithm includes: Based on the preset color associated with the bomb icon, the sub-image of the effective area is updated to a binary mask image, and the target icon is updated to a target mask image; The step of determining the regional interactive icon as the target icon if the matching degree is greater than the preset matching degree includes: If the matching confidence between the binary mask image and the target mask image is greater than the preset execution confidence, the regional interaction icon is determined to be the bomb icon.
6. The keyboard lighting control method based on a game scene as described in claim 5, characterized in that, When the target icon in the pre-stored feature table is a character defeat icon, the step of calculating the matching degree between the effective area and the target icon in the pre-stored feature table based on a preset algorithm includes: Convert the sub-image of the effective region into a grayscale image; ORB features of the grayscale image are extracted based on the Oriented Fast Rotation Binary Feature Descriptor; Based on the mapping rules between the pre-stored ORB features and the visual dictionary set, the bag-of-words vector of the ORB features is determined, and the similarity between the bag-of-words vector and the pre-stored bag-of-words vector is determined. The step of determining the regional interactive icon as the target icon if the matching degree is greater than the preset matching degree includes: If the similarity is greater than the preset similarity, then the area interaction icon is determined to be the character's defeat icon.
7. A keyboard lighting control device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the keyboard lighting control method based on a game scene as described in any one of claims 1 to 6.
8. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the keyboard lighting control method based on a game scene as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Peripheral feedback effect control method and system, storage medium and electronic equipment
CN121927278A
Projector and method for projecting image
US20090128716A1