A self-service printer ink cartridge remaining detection and reminder system and method based on visual recognition
Through visual recognition technology, the video stream of ink cartridges is analyzed using cameras and image processing, and the accuracy of traditional detection methods under different lighting and ink cartridge designs is solved, and high-accurate ink cartridge margin detection and early warning is achieved, reducing costs and improving User experience and work efficiency.
Patent Information
- Application Number
- CN202411284999.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-09-13
AI Technical Summary
The ink cartridge margin detection method in existing printers is not reliable enough, especially under different lighting conditions and diverse ink cartridge designs, traditional sensor detection methods are difficult to ensure accuracy, and increase equipment costs, so it is impossible to achieve accuracy without changing the hardware structure. Test.
Using a visual recognition-based method, the ink cartridge video stream is captured by a camera, and the ink amount in the ink cartridge is analyzed using image processing technology, including image positioning, color space conversion, threshold segmentation and ink amount estimation, to determine the remaining ink amount of ink cartridge and trigger an early warning.
It realizes high-accuracy ink cartridge margin detection under different environments and ink cartridge designs, reduces costs, avoids printing interruptions caused by insufficient ink, and improves user experience and work efficiency.
Smart Images

Figure CN118799789B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of printers, and in particular relates to a self-service printer ink cartridge remaining amount detection and reminder system and method based on visual recognition. Background Art
[0002] With the advancement of office automation technology, self-service printers have become one of the indispensable devices in enterprises and homes. However, in actual use, due to the lack of effective means to detect the remaining ink level in the ink cartridges, printing jobs are often interrupted due to insufficient ink. Traditional methods of detecting the remaining ink level in ink cartridges mainly rely on pressure sensors or conductivity sensors installed inside the printer to estimate the remaining ink level, but these methods have certain limitations. For example, the sensors are easily affected by environmental factors, resulting in inaccurate measurements, and increase the cost of the printer. For older printers that are not equipped with sensors or cost-sensitive application scenarios, how to achieve accurate ink cartridge level detection without changing the original hardware structure has become an urgent problem to be solved.
[0003] The current technical solutions are difficult to ensure the accuracy of ink cartridge remaining detection under various environmental conditions, especially in situations where the light changes greatly or the ink cartridge appearance design is diverse, the traditional sensor detection method is often not reliable enough. Therefore, it is necessary to develop a new method that can maintain high detection accuracy under different lighting conditions and multiple ink cartridge types. Summary of the invention
[0004] The purpose of the present invention is to provide a self-service printer ink cartridge remaining detection and reminder system and method based on visual recognition, which uses a camera device to capture the video stream of the ink cartridge and analyzes the ink level in the ink cartridge through image processing technology to solve the problems raised in the above background technology.
[0005] To achieve the above object, the present invention provides a self-service printer ink cartridge remaining detection and reminder method based on visual recognition, comprising the following steps:
[0006] Step 1: Capture a video stream containing an image of an ink cartridge, wherein the video stream contains at least a portion of the visible area of the ink cartridge; Step 2: Extract a single-frame image from the video stream as an analysis object, wherein the image clearly displays a specific portion of the ink cartridge; Step 3: Locate the ink cartridge in the extracted image, and determine the ink cartridge contour boundary through a preset template matching; Step 4: Apply color space conversion technology to process the determined internal pixels of the ink cartridge contour, and separate the color information representing the amount of ink; Step 5: Perform threshold segmentation on the separated color information to distinguish between the ink and background areas; Step 6: Count the number of pixels representing the ink area in the segmented image to estimate the proportion of the remaining ink in the ink cartridge; Step 7: Compare the estimated proportion with the preset warning line to determine whether it is lower than a predetermined threshold; Step 8: When the judgment result is yes, trigger the warning signal preparation, and send a notification message of insufficient ink to the user to end the entire process.
[0007] Preferably, after step 1, the following sub-process steps are also included:
[0008] Locate the first frame of the video stream and mark the position coordinates (x, y) and size (w, h) of the ink cartridge in the frame;
[0009] Calculate the average brightness value of the ink cartridge area in the first frame , through the formula Obtain, where I(i+x,j+y) represents the pixel brightness value at the coordinate (i+x,j+y);
[0010] Using the obtained , set the brightness threshold , to distinguish the ink area and non-ink area in the ink cartridge, where ΔL is a pre-defined tolerance value.
[0011] Preferably, after step 2, the following sub-process steps are also included:
[0012] Convert the extracted single frame image into a grayscale image G;
[0013] Apply the edge detection method to identify the ink box contour in the grayscale image G and obtain the edge map E, where the edge map E is obtained by calculating the gradient intensity of each pixel in the grayscale image G. The formula is: ,in and Respectively represent the gradient values of the pixel along the x-axis and y-axis at position (i, j);
[0014] The obtained edge map E is used to determine the bounding box of the ink cartridge, and the specific position of the ink cartridge is defined by finding the continuous maximum circumscribed rectangle in the edge map E.
[0015] Preferably, after step 3, the following sub-process steps are also included:
[0016] A preset template T is applied to the extracted image for matching, where the template T is a sample image of a known ink cartridge shape;
[0017] Calculate the similarity S(x,y) between each possible position in the image and the template T, using the formula Get, where m and n are the height and width of template T, respectively, I(i+x,j+y) is the pixel value at the corresponding position in the image, and are the modulus of the image and template respectively;
[0018] The position with the largest similarity S(x,y) is selected as the best matching position of the ink cartridge, and the contour boundary of the ink cartridge is drawn with this position as the center.
[0019] Preferably, after step 4, the following sub-process steps are also included:
[0020] Convert the determined inner pixels of the ink cartridge outline from the RGB color space to the HSV color space so as to separate the color information representing the ink amount;
[0021] Applying Thresholds , , The hue H, saturation S, and brightness V values in the HSV color space are screened to identify the color area representing the ink amount;
[0022] Calculate the average brightness value for the filtered color area , through the formula Get, where N is the number of pixels filtered out, is the brightness value of the i-th pixel;
[0023] Use what you get To assess the amount of ink remaining in the cartridge, Lower values indicate less ink.
[0024] Preferably, after step 5, the following sub-process steps are also included:
[0025] Set the threshold range [Hmin, Hmax], [Smin, Smax], [Vmin, Vmax] in the HSV color space to distinguish the ink area from the background area;
[0026] Apply the above threshold range to filter the image data in the HSV color space to generate a binary image B, where the ink area is the foreground: the value is 1; the background area is the background: the value is 0;
[0027] Analyze the connected domain in the generated binary image B and count the area of the ink region , through the formula Calculate, where B(i,j) is the pixel value at position (i,j) in the image;
[0028] Based on the statistical ink area , evaluate the status of the remaining ink level in the ink cartridge.
[0029] Preferably, after step 6, the following sub-process steps are also included:
[0030] In the binary image, the pixel point with a pixel value of 1 is defined to represent the ink area;
[0031] Traverse the entire binary image and accumulate the total number of pixels representing the ink area ;
[0032] Using the formula Calculate the remaining ink ratio ,in is the total number of pixels in the image.
[0033] Preferably, after step 7, the following sub-process steps are also included:
[0034] Get the calculated remaining ink volume ratio ;
[0035] Set a warning threshold T as a reference for determining whether the ink level is sufficient. Compared with T, if If it is less than T, it is considered that the ink level is insufficient. When it is confirmed that the ink level is insufficient, the warning notification process is started to prompt the user of the ink level status;
[0036] like If it is greater than or equal to T, then record the current value and continue monitoring until the next detection cycle.
[0037] Preferably, when the judgment result in step eight is positive, the following sub-process steps are also included:
[0038] Activate the warning signal preparation module and configure the content of the ink level warning message according to the activation status;
[0039] Send the configured warning message to the user's receiving terminal;
[0040] Record the sending status of the alert message and check whether it has been successfully delivered. If it indicates that the message has not been successfully delivered, repeat it until it is confirmed to be delivered.
[0041] On the other hand, the present invention provides a self-service printer ink cartridge remaining detection and reminder system based on visual recognition, comprising:
[0042] A video stream acquisition module, used for acquiring a video stream containing an ink cartridge image, wherein the video stream contains at least a portion of a visible area of the ink cartridge;
[0043] An image extraction module, used to extract a single frame image from the video stream as an analysis object, the image clearly showing a specific part of the ink cartridge;
[0044] The ink cartridge position determination module is used to locate the ink cartridge position in the extracted image and determine the ink cartridge contour boundary by matching a preset template;
[0045] The ink volume color acquisition module is used to process the determined internal pixels of the ink cartridge outline by applying the color space conversion technology to separate the color information representing the ink volume;
[0046] The color segmentation module is used to perform threshold segmentation on the separated color information to distinguish the ink from the background area;
[0047] The remaining ink volume estimation module is used to estimate the remaining ink volume ratio in the ink cartridge by counting the number of pixels representing the ink area in the segmented image;
[0048] The remaining ink volume confirmation module is used to compare the estimated ratio with the preset warning line to determine whether it is lower than a predetermined threshold;
[0049] The reminder module is used to trigger the early warning signal preparation when the judgment result is yes, and send a notification message of insufficient ink to the user to end the whole process.
[0050] Technical effects and advantages of the present invention: Compared with the prior art, the present invention provides a self-service printer ink cartridge remaining detection and reminder system and method based on visual recognition, which has the following advantages:
[0051] The present invention uses a camera device to capture a video stream of an ink cartridge and analyzes the amount of ink in the ink cartridge through image processing technology. This method is not affected by changes in ambient light and can adapt to different ink cartridge designs, with strong versatility and robustness. Through intelligent analysis of the ink cartridge image, the amount of ink remaining in the ink cartridge can be accurately estimated, and an early warning can be issued to the user in a timely manner when the ink amount approaches a critical value, thereby avoiding interruptions to printing tasks due to insufficient ink and improving user experience and work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 It is a flow chart of the self-service printer ink cartridge remaining detection and reminder method based on visual recognition of the present invention;
[0053] Figure 2 The present invention is a block diagram of a self-service printer ink cartridge remaining detection and reminder system based on visual recognition. DETAILED DESCRIPTION
[0054] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. The specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0055] The present invention provides a self-service printer ink cartridge remaining detection and reminder method based on visual recognition, which mainly uses a camera device to shoot a video stream of the ink cartridge and analyzes the ink volume in the ink cartridge through image processing technology. This method is not affected by changes in ambient light and can accurately estimate the remaining ink volume in the ink cartridge. The details are as follows:
[0056] like Figure 1 As shown, in this embodiment, the self-service printer ink cartridge remaining detection and reminder method based on visual recognition includes the following steps:
[0057] Step 1: Acquire a video stream containing an ink cartridge image, where the video stream contains at least a portion of a visible area of the ink cartridge; specifically, the following sub-process steps are included:
[0058] Locate the first frame of the video stream and mark the position coordinates (x, y) and size (w, h) of the ink cartridge in the frame;
[0059] Calculate the average brightness value of the ink cartridge area in the first frame , through the formula Obtain, where I(i+x,j+y) represents the pixel brightness value at the coordinate (i+x,j+y);
[0060] Using the obtained , set the brightness threshold , to distinguish the ink area and non-ink area in the ink cartridge, where ΔL is a pre-defined tolerance value.
[0061] Through the above sub-process steps, it is possible to achieve:
[0062] Precise positioning and initialization: By accurately locating the position and size of the ink cartridge in the first frame of the video stream, a benchmark is provided for subsequent image processing, ensuring the accuracy of the ink cartridge area analysis.
[0063] Automatically distinguish between ink and non-ink areas: Calculate the average brightness value of the ink cartridge area and set the brightness threshold accordingly. This can effectively distinguish between the ink area and non-ink area in the ink cartridge, and maintain high detection accuracy even under different ambient light conditions.
[0064] Improve robustness: By setting a tolerance value ΔL, the system can adapt to brightness changes under different conditions, thereby enhancing the robustness and adaptability of the system.
[0065] Step 2: extracting a single frame image from the video stream as an analysis object, the image clearly showing a specific part of the ink cartridge; specifically comprising the following sub-process steps:
[0066] Convert the extracted single frame image into a grayscale image G;
[0067] Apply the edge detection method to identify the ink box contour in the grayscale image G and obtain the edge map E, where the edge map E is obtained by calculating the gradient intensity of each pixel in the grayscale image G. The formula is: ,in and Respectively represent the gradient values of the pixel along the x-axis and y-axis at position (i, j);
[0068] The obtained edge map E is used to determine the bounding box of the ink cartridge, and the specific position of the ink cartridge is defined by finding the continuous maximum circumscribed rectangle in the edge map E.
[0069] By converting color images into grayscale images, the dimension of image data is reduced, the subsequent processing steps are simplified, and the basic features of the image are retained, which helps to improve the effect of edge detection. The application of edge detection technology can highlight the boundaries of objects in the image, especially the outline of the ink cartridge, which is crucial for the subsequent identification of the ink cartridge position. The edge map E provides a clear boundary information, which helps the system to identify the position of the ink cartridge more accurately.
[0070] By finding the continuous maximum enclosing rectangle in the edge map, the actual position of the ink cartridge can be accurately defined. This method not only improves the accuracy of ink cartridge detection, but also can cope with the changes in the angles and sizes of the ink cartridge in the image, enhancing the flexibility of the system. The combination of edge detection and maximum enclosing rectangle reduces the possibility of false detection due to background interference or the edges of other objects, ensuring that only the true ink cartridge outline is identified and tracked.
[0071] Through the methods of image grayscale, edge detection and edge map analysis, the precise identification of the ink cartridge position is achieved, the accuracy and stability of the system are improved, the ink cartridge can be reliably detected under different environmental conditions, and a solid foundation is laid for further ink quantity analysis.
[0072] Step 3: Locate the ink cartridge position in the extracted image and determine the ink cartridge contour boundary through preset template matching; specifically, the following sub-process steps are included:
[0073] A preset template T is applied to the extracted image for matching, where the template T is a sample image of a known ink cartridge shape;
[0074] Calculate the similarity S(x,y) between each possible position in the image and the template T, using the formula Get, where m and n are the height and width of template T, respectively, I(i+x,j+y) is the pixel value at the corresponding position in the image, and are the modulus of the image and template respectively;
[0075] The position with the largest similarity S(x,y) is selected as the best matching position of the ink cartridge, and the contour boundary of the ink cartridge is drawn with this position as the center.
[0076] Using sample images of known ink cartridge shapes as templates for matching can effectively identify the ink cartridge position in the image. Template matching is a content-based image retrieval method that uses known patterns (i.e., templates) to search for similar areas in unknown images to achieve the purpose of positioning.
[0077] Since the template T is created based on the known ink box shape, it can maintain high matching accuracy even in the case of poor image quality or the presence of certain noise. This makes the method robust and can work effectively under different lighting conditions and background complexity.
[0078] Template matching algorithms usually have a fast processing speed, especially with the support of hardware acceleration, which can achieve real-time image processing. This means that a large number of image analysis tasks can be completed in a short time, which is suitable for application scenarios that require fast response. By calculating the similarity and selecting the highest value as the best matching position, the occurrence of false matches can be significantly reduced. This not only accurately finds the position of the ink cartridge, but also avoids mistaking non-ink cartridge areas for target areas.
[0079] Template matching is a classic image processing technology. Its algorithm is relatively simple and easy to understand, and is easy to program and debug. In addition, many modern computer vision libraries provide ready-made functions for template matching, which can be easily integrated into existing software systems.
[0080] In summary, the positioning of the ink cartridge by template matching technology can achieve high-precision and high-speed image recognition, ensure the correct extraction of the ink cartridge contour boundary, and provide a reliable basis for subsequent further analysis.
[0081] Step 4: Apply color space conversion technology to process the determined internal pixels of the ink cartridge outline to separate the color information representing the ink volume; specifically, the following sub-process steps are included:
[0082] Convert the determined inner pixels of the ink cartridge outline from the RGB color space to the HSV color space so as to separate the color information representing the ink amount;
[0083] Applying Thresholds , , The hue H, saturation S, and brightness V values in the HSV color space are screened to identify the color area representing the ink amount;
[0084] Calculate the average brightness value for the filtered color area , through the formula Get, where N is the number of pixels filtered out, is the brightness value of the i-th pixel;
[0085] Use what you get To assess the amount of ink remaining in the cartridge, Lower values indicate less ink.
[0086] By converting the RGB color space to the HSV color space, it is easier to separate the color information related to the ink volume. The HSV color space divides the color into three independent components: hue, saturation, and value, making color analysis more intuitive and effective.
[0087] Using the brightness (V) value in the HSV color space, the ink area can be identified by setting a suitable threshold. The ink area usually has a lower brightness value, while the blank area has a higher brightness value. Therefore, by calculating the average brightness value within the ink box outline , which can effectively evaluate the remaining amount of ink in the ink cartridge.
[0088] The HSV color space is more robust to changes in lighting. Even under different lighting conditions, the changes in hue and saturation are often much smaller than those in the RGB color space, which allows for better detection results under a variety of lighting conditions.
[0089] By adjusting the threshold , , , the algorithm can be flexibly adjusted according to the actual cartridge color and environmental conditions to adapt to different types of cartridges and different application scenarios.
[0090] By calculating the average brightness , which can more accurately reflect the amount of ink in the ink cartridge. This method not only reduces the sensitivity to changes in the overall brightness of the image, but also improves the detection accuracy of local ink areas. Compared with directly processing images in the RGB space, the threshold screening process in the HSV color space is simpler, reducing unnecessary calculations and improving the execution efficiency of the algorithm.
[0091] In summary, by processing the internal pixels of the ink cartridge contour determined by color space conversion technology and calculating the average brightness value to evaluate the ink volume, efficient and accurate ink volume detection can be achieved, which is suitable for various ink cartridge types and different usage environments.
[0092] Step 5: Perform threshold segmentation on the separated color information to distinguish the ink and background areas; specifically, the following sub-process steps are included:
[0093] Set the threshold range [Hmin, Hmax], [Smin, Smax], [Vmin, Vmax] in the HSV color space to distinguish the ink area from the background area;
[0094] Apply the above threshold range to filter the image data in the HSV color space to generate a binary image B, where the ink area is the foreground: the value is 1; the background area is the background: the value is 0;
[0095] Analyze the connected domain in the generated binary image B and count the area of the ink region , through the formula Calculate, where B(i,j) is the pixel value at position (i,j) in the image;
[0096] Based on the statistical ink area , evaluate the status of the remaining ink level in the ink cartridge.
[0097] By setting the threshold range in the HSV color space, the ink area can be accurately distinguished from the background area. Since the color characteristics of the ink area usually have a certain distribution pattern in the HSV space, the ink area can be effectively distinguished from the background by setting a reasonable threshold. The binary image generated by filtering the image using the HSV threshold can clearly show the location of the ink area. This image is very beneficial for subsequent processing because it eliminates the complexity of color and only retains the information of the area of interest.
[0098] By analyzing the connected domains in the generated binary image, the area of the ink region can be accurately counted. Connected domain analysis is a common image processing technique that helps us understand how the various parts of an image are connected together, which is particularly useful for identifying ink regions.
[0099] By calculating the area A of the ink region, the amount of remaining ink in the ink cartridge can be quantitatively evaluated. This method provides objective data support, making the ink volume evaluation more accurate and reliable. The HSV threshold segmentation method has good adaptability to different lighting conditions and ink colors, because the HSV color space can better reflect the essential attributes of color, thereby reducing the impact of external factors on ink volume evaluation.
[0100] As a basic step in image processing, threshold segmentation can be easily combined with other image processing techniques, such as morphological operations and edge detection, to further improve the accuracy and reliability of ink volume assessment. In short, by setting the HSV threshold and performing binarization, and then counting the area of the connected domain, the remaining ink volume in the ink cartridge can be effectively assessed, providing an accurate and reliable means of ink volume monitoring.
[0101] Step 6: Count the number of pixels representing the ink area in the segmented image to estimate the remaining ink volume in the ink cartridge; specifically, the following sub-process steps are included:
[0102] In the binary image, the pixel point with a pixel value of 1 is defined to represent the ink area;
[0103] Traverse the entire binary image and accumulate the total number of pixels representing the ink area ;
[0104] Using the formula Calculate the remaining ink ratio ,in is the total number of pixels in the image.
[0105] By traversing the binary image, the total number of pixels P representing the ink area can be accurately counted. This process ensures that the coverage of the ink area is accurately quantified. By calculating the remaining ink ratio R, a value between 0 and 1 can be obtained, which intuitively reflects the ratio of the remaining ink in the ink cartridge to the full ink state. This helps users understand the current status of the ink cartridge and decide whether to replace or refill the ink. This method can be embedded in an automated system to continuously monitor the status of the ink cartridge, reducing the need for manual inspection and improving efficiency.
[0106] If the system can acquire images and process them in real time, it can provide near real-time feedback on the remaining ink level, which is particularly important for applications that require continuous printing. Compared with other monitoring methods that may require dedicated hardware, image processing-based technologies can use existing cameras or other imaging devices, reducing the cost of implementation. This method can adjust threshold settings and algorithm parameters according to different application scenarios to make it suitable for different types of ink and background environments.
[0107] In summary, the method of estimating the proportion of remaining ink in the ink cartridge by counting the number of pixels representing the ink area in the segmented image not only provides an accurate means of ink level monitoring, but also has the advantages of simple implementation, high cost-effectiveness and flexibility to adapt to various situations.
[0108] Step 7: Compare the estimated ratio with the preset warning line to determine whether it is below the predetermined threshold; specifically, the following sub-process steps are included:
[0109] Get the calculated remaining ink volume ratio ;
[0110] Set a warning threshold T as a reference for determining whether the ink level is sufficient. Compared with T, if If it is less than T, it is considered that the ink level is insufficient. When it is confirmed that the ink level is insufficient, the warning notification process is started to prompt the user of the ink level status;
[0111] like If it is greater than or equal to T, then record the current value and continue monitoring until the next detection cycle.
[0112] By setting the warning threshold T, it is possible to promptly detect when the remaining ink level in the ink cartridge is lower than the safe level, and immediately send a warning notification to the user. This helps users prepare in advance to prevent interruptions to printing tasks due to insufficient ink. When the system detects that the remaining ink level ratio R is lower than the preset warning threshold T, it can immediately start the warning notification process, prompting the user to take appropriate preventive measures, such as replacing the ink cartridge or replenishing ink, thereby avoiding potential service interruptions. When the remaining ink level ratio R is greater than or equal to the threshold T, the system will continue to monitor the status of the ink cartridge and update the record in each detection cycle to ensure that the latest ink level information is always available.
[0113] Through the automated early warning mechanism, users do not need to pay attention to the status of the ink cartridges at all times. The system will actively remind users when necessary, which improves the user experience and reduces the user's operating burden. By regularly checking and comparing the remaining ink ratio with the preset threshold, it can ensure that the problem of insufficient ink can be discovered in time under any circumstances, enhancing the reliability and stability of the system. The warning line threshold T can be adjusted according to actual conditions, so that the method can adapt to the needs of different users and different usage scenarios, improving the flexibility and adaptability of the system.
[0114] In summary, by comparing the estimated remaining ink volume ratio with the preset warning line threshold, the method can effectively monitor the ink cartridge status and provide timely warning notification when necessary, thereby ensuring the continuity and efficiency of printing work.
[0115] Step 8: When the judgment result is yes, the warning signal preparation is triggered, and the notification message of insufficient ink is sent to the user to end the whole process. In the case of positive judgment result, the following sub-process steps are also included: activating the warning signal preparation module, and configuring the content of the ink warning message according to the activation status; sending the configured warning message to the user's receiving terminal; recording the sending status of the warning message and checking whether it has been successfully delivered. If it indicates that the message has not been successfully delivered, it will be repeated until it is confirmed to be delivered.
[0116] On the other hand, this embodiment proposes a self-service printer ink cartridge remaining detection and reminder system based on visual recognition, such as Figure 2 As shown, including:
[0117] The video stream acquisition module is used to acquire a video stream containing an ink cartridge image, wherein the video stream contains at least a portion of a visible area of the ink cartridge;
[0118] The image extraction module is used to extract a single frame image from the video stream as an analysis object, and the image clearly shows a specific part of the ink cartridge;
[0119] The ink cartridge position determination module is used to locate the ink cartridge position in the extracted image and determine the ink cartridge contour boundary through preset template matching;
[0120] The ink volume color acquisition module is used to process the determined internal pixels of the ink cartridge outline by applying the color space conversion technology, and separate the color information representing the ink volume;
[0121] The color segmentation module is used to perform threshold segmentation on the separated color information to distinguish the ink from the background area;
[0122] The remaining ink volume estimation module is used to estimate the remaining ink volume ratio in the ink cartridge by counting the number of pixels representing the ink area in the segmented image;
[0123] The remaining ink volume confirmation module is used to compare the estimated ratio with the preset warning line to determine whether it is lower than a predetermined threshold;
[0124] The reminder module is used to trigger the early warning signal preparation when the judgment result is yes, and send a notification message of insufficient ink to the user to end the whole process.
[0125] In addition, the above-mentioned video stream acquisition module, image extraction module, ink cartridge position determination module, ink color acquisition module, color segmentation module, remaining ink estimation module, remaining ink confirmation module, and reminder module are also used to implement other steps of the above-mentioned self-service printer ink cartridge remaining detection and reminder method based on visual recognition when executed.
[0126] In summary, the present invention uses a camera device to capture a video stream of an ink cartridge and analyzes the amount of ink in the ink cartridge through image processing technology. This method is not affected by changes in ambient light and can adapt to different ink cartridge designs, with strong versatility and robustness. Through intelligent analysis of the ink cartridge image, the amount of ink remaining in the ink cartridge can be accurately estimated, and an early warning can be issued to the user in a timely manner when the ink amount approaches a critical value, thereby avoiding interruptions to printing tasks due to insufficient ink and improving user experience and work efficiency.
[0127] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A self-service printer ink cartridge remaining detection and reminder method based on visual recognition, characterized in that: The following steps are involved: Step 1: acquiring a video stream containing an ink cartridge image, wherein the video stream contains at least a portion of a visible area of the ink cartridge; Step 2: extracting a single frame image from the video stream as an analysis object; Step 3: Locate the ink cartridge position in the extracted image and determine the ink cartridge contour boundary through preset template matching; Step 4: Apply color space conversion technology to process the determined internal pixels of the ink cartridge outline to separate the color information representing the ink volume; Step 5: Perform threshold segmentation on the separated color information to distinguish the ink and background areas; Step 6: Count the number of pixels representing the ink area in the segmented image to estimate the remaining ink volume in the ink cartridge; Step 7: Compare the estimated ratio with the preset warning line to determine whether it is below the predetermined threshold; Step 8: When the judgment result is yes, the warning signal is triggered and a notification message of insufficient ink is sent to the user to end the whole process.
2. According to the method of claim 1, the self-service printer ink cartridge remaining detection and reminder method based on visual recognition is characterized in that: Step 1 specifically includes the following sub-process steps: Locate the first frame of the video stream and mark the position coordinates (x, y) and size (w, h) of the ink cartridge in the frame; Calculate the average brightness value of the ink cartridge area in the first frame , through the formula Obtain, where I(i+x,j+y) represents the pixel brightness value at the coordinate (i+x,j+y); Using the obtained , set the brightness threshold , to distinguish the ink area and non-ink area in the ink cartridge, where ΔL is a pre-defined tolerance value.
3. The method for detecting and reminding the ink cartridge remaining amount of a self-service printer based on visual recognition according to claim 2, characterized in that: Step 2 specifically includes the following sub-process steps: Convert the extracted single frame image into a grayscale image G; Apply the edge detection method to identify the ink box contour in the grayscale image G and obtain the edge map E, where the edge map E is obtained by calculating the gradient intensity of each pixel in the grayscale image G. The formula is: ,in and Respectively represent the gradient values of the pixel along the x-axis and y-axis at position (i, j); The obtained edge map E is used to determine the bounding box of the ink cartridge, and the specific position of the ink cartridge is defined by finding the continuous maximum circumscribed rectangle in the edge map E.
4. The method for detecting and reminding the ink cartridge remaining amount of a self-service printer based on visual recognition according to claim 3, characterized in that: Step three specifically includes the following sub-process steps: A preset template T is applied to the extracted image for matching, where the template T is a sample image of a known ink cartridge shape; Calculate the similarity S(x,y) between each possible position in the image and the template T, using the formula We get: where m and n are the height and width of the template T, respectively; I(i+x,j+y) represents the pixel brightness value at the coordinate (i+x,j+y). and are the modulus of the image and template respectively; The position with the largest similarity S(x,y) is selected as the best matching position of the ink cartridge, and the contour boundary of the ink cartridge is drawn with this position as the center.
5. The method for detecting and reminding the ink cartridge remaining amount of a self-service printer based on visual recognition according to claim 4, characterized in that: Step 4 specifically includes the following sub-process steps: Convert the determined inner pixels of the ink cartridge outline from the RGB color space to the HSV color space so as to separate the color information representing the ink amount; Applying Thresholds , , The hue H, saturation S, and brightness V values in the HSV color space are screened to identify the color area representing the ink amount; Calculate the average brightness value for the filtered color area , through the formula Get, where N is the number of pixels filtered out, is the brightness value of the i-th pixel; Use what you get To assess the amount of ink remaining in the cartridge, Lower values indicate less ink.
6. The method for detecting and reminding the ink cartridge remaining amount of a self-service printer based on visual recognition according to claim 5, characterized in that: Step 5 specifically includes the following sub-process steps: Set the threshold range [Hmin, Hmax], [Smin, Smax], [Vmin, Vmax] in the HSV color space to distinguish the ink area from the background area; Apply the above threshold range to filter the image data in the HSV color space to generate a binary image B, where the ink area is the foreground: the value is 1; the background area is the background: the value is 0; Analyze the connected domain in the generated binary image B and count the area of the ink region , through the formula Calculate, where B(i,j) is the pixel value at position (i,j) in the image; Based on the statistical ink area , evaluate the status of the remaining ink level in the ink cartridge.
7. The method for detecting and reminding the ink cartridge remaining amount of a self-service printer based on visual recognition according to claim 6, characterized in that: Step 6 specifically includes the following sub-process steps: In the binarized image, the pixel point with a pixel value of 1 is defined to represent the ink area; Traverse the entire binary image and accumulate the total number of pixels representing the ink area ; Using the formula Calculate the remaining ink ratio ,in is the total number of pixels in the image.
8. The method for detecting and reminding the ink cartridge remaining amount of a self-service printer based on visual recognition according to claim 7, characterized in that: Step seven specifically includes the following sub-process steps: Get the calculated remaining ink volume ratio ; Set a warning threshold T as a reference for determining whether the ink level is sufficient. Compared with T, if If it is less than T, it is considered that the ink level is insufficient. When it is confirmed that the ink level is insufficient, the warning notification process is started to prompt the user of the ink level status; like If it is greater than or equal to T, then record the current value and continue monitoring until the next detection cycle.
9. The method for detecting and reminding the ink cartridge remaining amount of a self-service printer based on visual recognition according to claim 8, characterized in that: If the result of step eight is positive, the following sub-process steps are also included: Activate the warning signal preparation module and configure the content of the ink level warning message according to the activation status; Send the configured warning message to the user's receiving terminal; Record the sending status of the alert message and check whether it has been successfully delivered. If it indicates that the message has not been successfully delivered, repeat it until it is confirmed to be delivered.
10. A self-service printer ink cartridge remaining detection and reminder system based on visual recognition, characterized in that: include: A video stream acquisition module, used for acquiring a video stream containing an ink cartridge image, wherein the video stream contains at least a portion of a visible area of the ink cartridge; An image extraction module, used for extracting a single frame image from the video stream as an analysis object; The ink cartridge position determination module is used to locate the ink cartridge position in the extracted image and determine the ink cartridge contour boundary by matching a preset template; The ink volume color acquisition module is used to process the determined internal pixels of the ink cartridge outline by applying the color space conversion technology to separate the color information representing the ink volume; The color segmentation module is used to perform threshold segmentation on the separated color information to distinguish the ink from the background area; The remaining ink volume estimation module is used to estimate the remaining ink volume ratio in the ink cartridge by counting the number of pixels representing the ink area in the segmented image; The remaining ink volume confirmation module is used to compare the estimated ratio with the preset warning line to determine whether it is lower than a predetermined threshold; The reminder module is used to trigger the early warning signal preparation when the judgment result is yes, and send a notification message of insufficient ink to the user to end the whole process.
