An intelligent filtering of mixed color method, device, storage medium and electronic equipment
By using an intelligent noise filtering algorithm, interference points and the original color of the sample are recorded, and a filtering range is set, the error problem caused by interference in smartphone colorimetric analysis is solved, thus improving the accuracy and stability of the analysis results.
Patent Information
- Application Number
- CN202211080777.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-05
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2042-09-05
AI Technical Summary
In colorimetric analysis of smartphones, the image of the sample after imaging is often affected by interference such as shadows, reflections, white spots, and exposure points, resulting in large errors in the analysis results. Existing methods are difficult to effectively filter out these interferences, affecting the accuracy of the analysis results.
An intelligent noise filtering algorithm based on color difference filtering domain is adopted. By listening to and recording the colors of interference points and the original color of the sample through image click events, the filtering domain is set, and the sample area is globally scanned to filter interference points, and the sample color data after removing interference is output.
It enables rapid and accurate filtering of interference in sample images, reduces analytical errors, and improves the accuracy and stability of colorimetric analysis.
Smart Images

Figure CN115601252B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to an intelligent method for filtering out unwanted colors, belonging to the field of sample analysis technology. Background Technology
[0002] Java is an object-oriented programming language characterized by simplicity, object-oriented programming, distributed nature, robustness, security, platform independence and portability, multithreading, and dynamism. It incorporates various advantages of the C++ language. In recent years, Java has been widely used to develop desktop applications, web applications, Android mobile applications, and embedded system applications.
[0003] Smartphones offer advantages such as portability, low cost, reliability, and flexibility. Over the past few decades, smartphones have been widely used in fields such as biology, chemistry, medicine, and clinical practice. Due to their excellent imaging capabilities and powerful computing functions, smartphones are a popular and inexpensive analytical platform for researchers. Smartphones evolved from Pocket PCs. Early Pocket PCs did not have phone call capabilities, but as users' reliance on their information processing functions grew, smartphones have developed to their current state.
[0004] However, due to the ever-changing analytical environment, the image of the sample after imaging often faces interference such as shadows, reflections, white spots, and exposure points. If these interference points are also taken into account when performing colorimetric analysis, it will bring a large error that deviates from the true value of the sample. In order to ensure the accuracy of the analysis results and reduce the error caused by various interference colors, it is of great significance to develop an intelligent color filtering method for colorimetric analysis of smartphones. Summary of the Invention
[0005] Technical solution: In order to overcome the shortcomings of the current method, this invention proposes an intelligent noise filtering method, which uses an intelligent noise filtering algorithm based on color difference filtering domain to accurately filter color interference caused by noise such as shadows, reflections, white spots, and exposure points.
[0006] To achieve the above objectives, the present invention adopts the following technical solution:
[0007] A method for intelligently filtering noise includes the following steps:
[0008] S1. Acquire sample image data;
[0009] S2. Record the color of interference points. Specifically, listen for image click events and start recording mode. Wait for user interaction. When the user clicks on a noise-filled area, automatically record and display the color value of the current clicked area.
[0010] S3. Record the original color of the sample: Re-enter the listening state, and the user clicks on the normal color area of the sample to obtain the original color value of the sample;
[0011] S4. Set the filter range: Set the filter range based on the difference between the interference points and the original color of the sample;
[0012] S5. Filter and output results: Globally scan the sample area, treat pixels whose color values are within the filtering range as interference points and filter them, and finally calculate and output the sample color data results after removing interference.
[0013] In one embodiment, the sample image data obtained in step S1 includes: sample image data acquired by a device with photographic or video recording capabilities, or sample image data transmitted via a medium and loaded into a local database.
[0014] In one embodiment, setting the filtering range in step S4 includes: using a manual interactive control to manually set the filtering range based on the interference point color data displayed in step S2.
[0015] In one embodiment, in step S4, the filter domain is calculated as follows:
[0016] if Color i Color o
[0017]
[0018] if Color i <Color o
[0019]
[0020] Among them, Color i Color represents the color value of the interference point. o Table of original color values for the sample, [y, 255], [0, y]
[0021] They represent Color respectively i Color o and Color i <Color o The filtering domains for the two cases are as follows: Color is selected based on the color channel value with the greatest difference among the three RGB channels, and k and b represent adjustment coefficients, respectively.
[0022] Furthermore, k and b should be adjusted according to the actual situation, where k∈[1,2] and b∈[0,1].
[0023] In one embodiment, filtering is performed by selecting the color channel with the largest difference among the RGB three channels.
[0024] In one embodiment, the interference point is a shadow, reflection, white spot, or exposure point in the image.
[0025] This application also provides an intelligent noise filtering device, comprising:
[0026] The data acquisition module is configured to: acquire sample image data;
[0027] The color recording module is configured to: listen for and record the color data of interference points and the original color data at the location recorded during human-computer interaction;
[0028] The filter domain setting module is configured to: set the filter domain based on the difference between the interference point and the original color of the sample;
[0029] The filter output module is configured to: globally scan the sample area, treat pixels whose color values are within the filter domain as interference points and filter them, and finally complete the calculation in the background and output the sample color data result after removing the interference.
[0030] This application also provides a computer-readable storage medium, characterized in that the storage medium stores a computer program, wherein the computer program is configured to execute the method described at runtime.
[0031] This application also provides an electronic device, including a memory and a processor, characterized in that the memory stores a computer program, and the processor is configured to run the computer program to perform the method described.
[0032] Beneficial effects
[0033] The beneficial effects of this invention are as follows: This lightweight noise filtering algorithm allows for automatic noise filtering in the background with simple interaction, offering fast operation, low memory usage, accurate filtering, and good versatility. Given the ever-changing environment, imaged samples often face interference from shadows, reflections, white spots, and exposure points. The intelligent noise filtering algorithm accurately filters out color interference caused by shadows, reflections, white spots, and exposure points, effectively solving problems such as the inaccurate differentiation between interference and color areas in traditional methods, leading to significant errors. This improves analytical accuracy and minimizes interference errors caused by noise. Attached Figure Description
[0034] Figure 1 Method flowchart.
[0035] Figure 2The first row of the sample image shows standard sample solutions with concentrations from left to right: 5 μg / mL, 10 μg / mL, 25 μg / mL, 50 μg / mL, 100 μg / mL, and 0 μg / mL. S1, S2, and S3 are parallel actual samples with different concentrations.
[0036] Figure 3 The standard curve before using the algorithm; the vertical axis is the ratio of G (green) value to V (brightness) value, and the horizontal axis is the concentration of standard samples, resulting in the standard curve shown below. Figure 3 As shown, where R 2 =0.9405.
[0037] Figure 4 The standard curve obtained after applying the algorithm; the vertical axis represents the ratio of G (green) value to V (brightness) value, and the horizontal axis represents the concentration of standard samples, resulting in the standard curve shown below. Figure 5 As shown, where R 2 =0.9833.
[0038] Figure 5 Application scenario of one embodiment of this application. Detailed Implementation
[0039] The present invention will be further illustrated below with reference to specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and not to limit the scope of the present invention. After reading the present invention, any modifications of the present invention in various equivalent forms by those skilled in the art will fall within the scope defined by the appended claims.
[0040] like Figure 1 As shown in the figure, this application provides an intelligent method for filtering noise, including:
[0041] S1. Obtain sample images;
[0042] S2. Record the color of interference points: The program activates the image click event listener in the background and starts the recording mode. It waits for user interaction. When the user clicks on the noise location with their finger, the program will automatically record and display the color value of the current click location.
[0043] S3. Record the original color of the sample: The program enters the listening state again, and the user clicks on the normal color area of the sample to obtain the original color value of the sample.
[0044] S4. Set the filter domain: The program sets the filter domain based on the difference between the interference points and the original color of the sample.
[0045] S5. Filter and output results: The sample area is scanned globally, and pixels with color values within the filtering range are regarded as interference points and filtered out. Finally, the calculation is completed in the background and the sample color data results after removing interference are output.
[0046] It should be noted that those skilled in the art will understand that electronic devices can also be smartphones (such as Android phones, iOS phones, etc.), tablets, PDAs, and other terminal devices such as mobile internet devices (MIDs) and tablets.
[0047] In one embodiment, the programming language used to implement the program and algorithm is Java / Android.
[0048] In one embodiment, using the method of this application, a single filtering process can be completed within 30 seconds.
[0049] In one embodiment, the processes of filtering out unwanted colors, calculating, and outputting are all performed automatically in the background.
[0050] In one embodiment, the setting of the filtering domain in this application supports manual setting. This includes, in addition to the program automatically setting the filtering domain based on the calculation results, manually setting the filtering domain. Specifically, a manual interactive control is provided, allowing the user to set the filtering range according to the interference point color data displayed in step S2.
[0051] In one embodiment, the filter domain is calculated as follows:
[0052] if Color i Color o
[0053]
[0054] if Color i <Color o
[0055]
[0056] Where [y,255] and [0,y] represent Color respectively. i Color o and Color i <Color o Filtering domain in two cases, Color i Color represents the color value of the interference point. oThe original color value of the sample is represented by k (Color is selected based on the color channel value with the greatest difference among the three RGB channels), and k and b represent adjustment coefficients respectively. k and b should be adjusted according to the actual situation. Specifically, k∈[1,2], b∈[0,1], a larger k value results in a smaller filtering range. To ensure a larger filtering range, the k value should be as close to 1 as possible. Similarly, a smaller b value results in a smaller filtering range. To ensure a larger filtering range, the k value should be as close to 1 as possible.
[0057] Hue (H), Saturation (S), and Value (V). The R, G, B color space is based on three primary colors: R (Red), G (Green), and B (Blue). Different levels of layering are used to produce a rich and wide range of colors, hence it is commonly known as the three-primary-color model.
[0058] The intelligent noise filtering method provided in this application can be applied to, for example... Figure 5 In the application environment shown, terminal 102 communicates with server 104 via a network. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices, and server 104 can be a standalone server or a server cluster consisting of multiple servers.
[0059] In one embodiment, a method for intelligently filtering out unwanted colors is provided. It should be noted that this method is illustrated using an example of its application in colorimetric analysis on a smartphone. Specific application scenarios are as follows:
[0060] This embodiment provides an image equalization color extraction method for colorimetric analysis in smartphones. The flowchart of the method is shown below. Figure 1 It should be noted that the sample used in this embodiment is emodin (see...). Figure 2 ), Figure 2 The first row of drops contains standard substances (STDs), with concentrations from left to right of 5 μg / mL, 10 μg / mL, 25 μg / mL, 50 μg / mL, 100 μg / mL, and 0 μg / mL. The second row contains two parallel drops of samples S1, S2, and S3. In this example, k is set to 1.1 and b to 0.9.
[0061] Taking a standard with a concentration of 100 μg / mL as an example ( Figure 2The fifth well in the first row (in the image) clearly shows interference from other colors in the sample area. First, the image is loaded into the program interface. Touch monitoring is enabled. Then, in recording mode, a finger is tapped on the interference area, recording the color value of the interference point as (R:227, G:77, B:108). Then, the original color value of the sample area is obtained by tapping on it as (R:235, G:15, B:75). The average color value obtained with interference is (R:235, G:52, B:92). A direct calculation shows that the average color value deviates significantly from the original color value. After recording, the filtering domain is calculated. Since G is the color parameter with the best gradient within the linear range of emodin, G is selected for the filtering domain calculation. The calculation formula is as follows:
[0062] if Color i Color o
[0063]
[0064] if Color i <Color o
[0065]
[0066] Large-interval filtering is selected here, with k = 1.1, b = 0.9, and Color... i Color represents the color value of the interference point. o This represents the original color value of the sample.
[0067] First, the color channel with the largest difference is calculated based on the RGB three-channel color values. From the sample data, it is known that the G channel has the largest color value difference; therefore, the G value is selected for filtering. Since the G value of the interfering points is greater than the G value of the original sample color, according to the algorithm, the G value should be selected here. According to the sample, Color o Value is 77, Color i The value is 15. Substituting this into the formula, we get y = (77 + 15) / 2 * 1.1 = 50.6. Therefore, the calculated filtering range is [50.6, 255]. The machine then performs a global scan of the sample area, filtering out interference points whose G values fall within the filtering range and outputting the final calculated true color value of the sample.
[0068] result:
[0069] This embodiment tested the color extraction results before and after filtering out noise. The results showed that the standard curve fitting results were worse in the presence of interference compared to after filtering out noise. Figure 3 R 2 =0.9405, Figure 4 R2 =0.9833), the quantitative results showed large fluctuations (Table 1) and deviated significantly from the standard value.
[0070] Table 1. Quantitative results of the program before using the algorithm.
[0071]
[0072] When the algorithm proposed in this invention is used to filter out unwanted colors, the above situation is greatly improved (Table 2), and the standard reference values are from the ultraviolet spectrophotometer (Table 3).
[0073] Table 2. Quantitative Results of the Program After Using the Algorithm
[0074]
[0075] Table 3 shows the actual measurement results of the program after applying the algorithm.
[0076]
[0077] Finally, we used Photoshop to extract the standard color values of the sample area, and then extracted the sample color results before and after filtering out noise. We took three samples for each case. The results showed that when there was interference, the average color value of the sample deviated significantly from the standard value. After applying this noise filtering algorithm, the extracted color values were close to the standard values, and the results remained stable (Table 4).
[0078] Table 4. Results of sample determination using a UV-Vis spectrophotometer
[0079]
[0080] For those skilled in the art, various corresponding changes and modifications can be made based on the above technical solutions and concepts, and all such changes and modifications should be included within the protection scope of the claims of this invention.
[0081] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0082] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0083] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method of intelligently filtering mixed color, characterized by, The method comprises the following steps: S1, acquiring sample image data; S2, recording the color of the interference point, specifically: performing image click event monitoring and starting the recording mode, waiting for user interaction, and when the user clicks the position of the interference point, automatically recording and displaying the color value of the current user click position; S3, recording the original color of the sample: entering the monitoring state again, and obtaining the original color value of the sample by the user clicking the normal color area of the sample; S4, setting the filtering domain: setting the filtering domain according to the difference between the interference point and the original color of the sample; S5, filtering and outputting the result: globally scanning the sample area, regarding the pixel points with color values within the filtering domain as interference points and filtering them, and finally obtaining the sample color data result after removing the interference by calculation and output; In step S4, the filtering domain calculation method is: if Color i >Color o if Color i <Color o Among them, Color i Color represents the color value of the interference point. o The original color values of the sample are shown in the table, where [y, 255] and [0, y] represent Color respectively. i Color o and Color i <Color o The filtering domains in the two cases are as follows: Color is selected according to the color channel value with the greatest difference among the three RGB channels, k and b represent adjustment coefficients respectively; and k and d should be adjusted according to the actual situation, k∈[1,2], b∈[0,1].
2. The intelligent filtering of multicolour method as claimed in claim 1, wherein, The sample image data obtained in step S1 includes: sample image data obtained by a device with a photographing function, or sample image data loaded from a local database through a medium.
3. The intelligent filtering of multicolour method as claimed in claim 1, wherein, The filtering domain setting in step S4 includes: manually setting the filtering range according to the interference point color data displayed in step S2 by using a manual interaction control.
4. The intelligent filtering of multicolour method as claimed in claim 1, wherein, The filtering is completed by selecting the color channel value with the maximum difference in the RGB three channels.
5. The intelligent filtering of multicolour method as claimed in claim 1, wherein, The interference point is a shadow, a highlight, a white point or an exposure point in the image.
6. An intelligent color sorter, characterized in that, It comprises: A data acquisition module configured to acquire sample image data; A color recording module configured to monitor and record the interference point color data and the original color data of the recorded position during human-computer interaction; A filtering domain setting module configured to set the filtering domain according to the difference between the interference point and the original color of the sample; A filtering output module configured to globally scan the sample area, regard the pixel points with color values within the filtering domain as interference points and filter them, and finally complete the calculation and output to obtain the sample color data result after removing the interference in the background; The filtering domain calculation method of the filtering domain setting module is: if Color i >Color o if Color i <Color o Among them, Color i Color represents the color value of the interference point. o The original color values of the sample are shown in the table, where [y, 255] and [0, y] represent Color respectively. i Color o and Color i <Color o The filtering domains are defined in two cases. Color is selected based on the color channel values with the greatest difference among the three RGB channels, and k and b represent adjustment coefficients respectively. Furthermore, k and b should be adjusted according to the actual situation, where k∈[1,2] and b∈[0,1].
7. A computer readable storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is set to execute the method described in any one of claims 1 to 5 when running.
8. An electronic device comprising a memory and a processor, characterized in that The storage medium stores a computer program, wherein the computer program is set to execute the method described in any one of claims 1 to 5 when running.
Citation Information
Patent Citations
Mobile colorimetric assay device
US11181482B1