A method for processing a picture library
Through the RGB information feature comparison and symmetry verification of the photos in the gallery, the ID photo label is generated, which solves the problem of quickly and accurately screening ID photo in a large number of photos, and realizes efficient and convenient ID photo search and management.
Patent Information
- Application Number
- CN202310631933.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-30
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2043-05-30
AI Technical Summary
Quickly and accurately find and filter out ID photos in a large number of photo galleries. The existing technology methods are inefficient and easily lead to erroneous operations.
By comparing the RGB information characteristics of all photos in the gallery, identify the ID photo features, form an outline trajectory and verify symmetry, generate ID photo tags, realize multiple verifications to improve the accuracy, and directly retrieve the tag collection during the next search.
The screening process of ID photos is simplified and the search efficiency and accuracy are improved. Users can quickly and conveniently select the required ID photos from a large number of photos.
Smart Images

Figure CN116662590B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing methods, and particularly to a method for processing a picture library. Background Art
[0002] In the era of the rapid development of mobile devices, taking pictures has become a daily habit of many mobile electronic users. Pictures can instantly capture a certain scene or a certain person, freezing the people and events at that time. In today's era of rapid informatization development, we have entered an era of reading pictures, and pictures can record an event more intuitively. However, this also brings a problem. Users who like to take pictures are bound to store a large number of photos. Sometimes, if they want to find a specific photo, they may have to look from the first one all the way down, which is really inconvenient when facing a relatively large picture library. Moreover, this kind of up-and-down sliding search may easily overlook the photo they want to find and is prone to misoperation. Therefore, it is very important to obtain a method for processing a picture library that is convenient for retrieving ID photos. Summary of the Invention
[0003] To solve at least one of the above technical problems, the present invention provides a method for processing a picture library, including the following steps:
[0004] S1. Start the picture library;
[0005] S2. Obtain an instruction to search for an ID photo;
[0006] S3. Compare all the photo information data in the picture library with the characteristics of the ID photo. If they match, a list of pictures that meet the requirements is retrieved;
[0007] S4. The user makes a selection from this list of pictures.
[0008] The user deletes the photos according to the photos in the photo list.
[0009] The photo information data includes: the RGB information of all pixel grids in the photo, and the recording method is: (X, Y, Ra1, Ga2, Ba3), where X is the X-axis coordinate of the pixel coordinate, Y is the Y-axis coordinate of the pixel coordinate, Ra1 is the color value of the red channel, Ga2 is the color value of the green channel, and Ba3 is the color value of the blue channel.
[0010] Judge whether the RGB information on the pixel row with the Y-axis coordinate of y on the coordinate axis is consistent. If it is consistent, judge whether the RGB information on the pixel row of y - 1 is consistent until the RGB information on the pixel row of y - y1 is inconsistent. Then judge whether the RGB on the X-axis coordinates of x1 and x - x1 + 1 on the pixel points of this pixel row is consistent. If it is consistent, judge whether the RGB information on x1 + 1 and x - x1 is consistent until it is inconsistent, and then replace the RGB information on this pixel point with black.
[0011] Through the above technical solution, replacing the RGB at this pixel point with black can distinguish the background color and the contour of the person, forming a contour track.
[0012] Judge whether the RGB information on the eight surrounding pixel points of the pixel point where the RGB information is replaced with black is black. If so, and at least one adjacent pixel point on this pixel point is the background color, it means that the contour is continuous and conforms to the characteristics of a composite ID photo.
[0013] Through the above technical solution, the replaced black can be other colors, such as white or transparent, etc. If the track is continuous, it conforms to the characteristics of the contour of the ID photo, realizing multiple and various methods of verification and increasing the accuracy rate.
[0014] The characteristics of the ID photo include that the background color is solid color and the contour on the background color is continuous. The characteristics of the ID photo also include symmetry characteristics.
[0015] Define the axis of symmetry of the photo, obtain the symmetric pixels on both sides of the axis of symmetry, judge whether the RGB values of the symmetric pixel points are the same, obtain the same rate, define the same rate as B%, if it is greater than B%, it means that it conforms to symmetry.
[0016] If the above same rate is less than B%, the axis of symmetry can be translated one pixel unit, or two, or N, etc., and then the above judgment is made. If they are all less than B%, it does not conform to symmetry and is excluded.
[0017] N in the above N pixel units is less than y / 4. It can also be defined as N less than y / 5, or y / 3, that is, it is selected according to the proportion of the person in the ID photo.
[0018] Through the above technical solution, the present invention further increases the verification of the symmetry characteristics that conform to the characteristics of the ID photo, and can increase the accuracy rate of screening out ID photos.
[0019] The pictures in the picture list retrieved in step S4 are all marked with the "ID photo" label.
[0020] When retrieving next time, the photos under this label can be directly retrieved.
[0021] Each label forms a photo set, so that when the photo library runs next time and the "ID photo" instruction is input, the photos in this photo set can be directly retrieved.
[0022] When entering photos into this photo library, it can be directly judged according to the photo information data of the photo, which is convenient for entering it into the "ID photo" label or not.
[0023] Compared with the prior art, the advantages of the present invention are as follows: The method of the present invention is simple. It can select a set of ID photos from numerous photos, and users can select the required ID photos from this set for use, which is convenient and fast. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a diagram of the processing method of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0025] In order to enable those skilled in the art to better understand the present invention and thus more clearly define the scope of protection required by the present invention, the present invention will be described in detail below with reference to certain specific embodiments of the present invention. It should be noted that the following are only some specific embodiments of the concept of the present invention, which are only a part of the embodiments of the present invention. The specific and direct descriptions of the relevant structures are only for the convenience of understanding the present invention, and each specific feature does not of course and directly limit the scope of implementation of the present invention.
[0026] Referring to the attached drawings, the present invention adopts the following technical solutions. A method for processing a picture library includes the following steps:
[0027] S1. Start the picture library;
[0028] S2. Obtain an instruction to search for ID photos;
[0029] S3. Compare all the photo information data in the picture library with the characteristics of ID photos. If they match, a list of pictures that meet the requirements is retrieved;
[0030] S4. The user makes a selection from this list of pictures.
[0031] The user deletes the photos according to the photos in the photo list.
[0032] The photo information data includes: the RGB information of all pixel grids in the photo, and the recording method is: (X, Y, Ra1, Ga2, Ba3), where X is the X-axis coordinate of the pixel coordinate, Y is the Y-axis coordinate of the pixel coordinate, Ra1 is the color value of the red channel, Ga2 is the color value of the green channel, and Ba3 is the color value of the blue channel.
[0033] Judge whether the RGB information on the pixel row with the Y-axis coordinate of y on the coordinate axis is consistent. If it is consistent, judge whether the RGB information on the pixel row of y-1 is consistent until the RGB information on the pixel row of y-y1 is inconsistent. Then judge whether the RGB on the X-axis coordinates of x1 and x-x1+1 of the pixel points on this pixel row is consistent. If it is consistent, judge whether the RGB information on x1+1 and x-x1 is consistent until it is inconsistent, and then replace the RGB information on this pixel point with black.
[0034] By the above technical solution, replacing the RGB at this pixel point with black can distinguish the background color and the contour of the person, forming a contour track.
[0035] Judge whether the RGB information on the eight surrounding pixel points of the pixel point where the RGB information is replaced with black is black. If so, and at least one adjacent pixel point on this pixel point is the background color, it means that the contour is coherent, which conforms to the characteristics of a composite ID photo.
[0036] By the above technical solution, the replaced black can be other colors, such as white or transparent, etc. If the track is coherent, it conforms to the characteristics of the contour of the ID photo, realizing multiple and various verification methods, increasing the accuracy rate.
[0037] The characteristics of the ID photo include that the background color is solid color and the contour on the background color is coherent. The characteristics of the ID photo also include symmetry characteristics.
[0038] Define the axis of symmetry of the photo, obtain the symmetric pixels on both sides of the axis of symmetry, judge whether the RGB values of the symmetric pixel points are the same, obtain the same rate, define the same rate as B%, if it is greater than B%, it means that it conforms to symmetry.
[0039] If the above same rate is less than B%, the axis of symmetry can be translated one pixel unit or two, or N, etc., and then the above judgment is carried out. If they are all less than B%, it does not conform to symmetry and is excluded.
[0040] N in the above N pixel units is less than y / 4. It can also be defined as N less than y / 5, or y / 3, that is, it is selected according to the proportion of the person in the ID photo.
[0041] By the above technical solution, the present invention further increases the verification of the symmetry characteristics that conform to the characteristics of the ID photo, and can increase the accuracy rate of screening out ID photos.
[0042] The pictures in the picture list retrieved in step S4 are all marked with the "ID photo" label.
[0043] When retrieving next time, the photos under this label can be directly retrieved.
[0044] Each label forms a photo set, so that when the photo library runs next time and the "ID photo" instruction is input, the photos in this photo set can be directly retrieved.
[0045] When entering photos into this photo library, it can be directly judged according to the photo information data of the photo, which is convenient for entering it into the "ID photo" label or not.
[0046] Compared with the prior art, the advantages of the present invention are as follows: The method of the present invention is simple. It can select a set of ID photos from numerous photos, and users can select the required ID photos from within this set for use, which is convenient and fast.
[0047] The term "comprising" or any other similar term is intended to cover non-exclusive inclusion, such that a process, article, or apparatus / device comprising a series of elements includes not only those elements but also other elements not expressly listed, or also elements inherent to these process, article, or apparatus / device.
[0048] In the description of the present invention, the terms indicating directions or positional relationships such as "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. are based on the directions or positional relationships shown in the drawings. This is only for the convenience of description and does not indicate or imply that the device or element must have a specific orientation, be constructed and operated in a specific orientation, and thus cannot be construed as a limitation on the present invention. In addition, the terms "first", "second", "third" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance.
[0049] So far, the technical solution of the present invention has been described in conjunction with the preferred embodiments shown in the drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.
Claims
1. A method for processing a picture library, characterized in that: It includes the following steps: S1. Start the photo gallery; S2. Obtain the instruction to search for ID photos; S3. Compare the feature of all photo information data in the photo gallery with that of the ID photo. If they match, call out the list of pictures that meet the requirements; S4. The user selects from this list of pictures; The photo information data includes: the RGB information of all pixel grids in the photo, and the recording method is: (X, Y, Ra1, Ga2, Ba3), where X is the X-axis coordinate of the pixel coordinate, Y is the Y-axis coordinate of the pixel coordinate, Ra1 is the color value of the red channel, Ga2 is the color value of the green channel, and Ba3 is the color value of the blue channel; Judge whether the RGB information on the pixel row with the Y-axis coordinate of y on the coordinate axis is the same. If it is the same, then judge whether the RGB information on the pixel row of y-1 is the same, until the RGB information on the pixel row of y-y1 is different. Then judge whether the RGB of the pixel points with the X-axis coordinates of x1 and x-x1+1 on this pixel row is the same. If it is the same, then judge whether the RGB information of x1+1 and x-x1 is the same, until it is different, and then replace the RGB information of this pixel point with black; Judge whether the RGB information of the eight surrounding pixel points of the pixel point whose RGB information is replaced with black is black. If so, and at least one adjacent pixel point of this pixel point is the background color, it means that the outline is continuous and meets the characteristics of the ID photo; The pictures in the list of pictures called out in step S4 are all marked with the "ID photo" label; when calling again next time, the photos under this label can be directly called; The characteristics of the ID photo also include symmetry characteristics; define the axis of symmetry of the photo, obtain the symmetric pixels on both sides of the axis of symmetry, judge whether the RGB values of the symmetric pixel points are the same, obtain the same rate, define the same rate B%, if it is greater than B%, it means that it meets the symmetry; N in N pixel units is less than y / 4.
2. The gallery processing method according to claim 1, wherein: The characteristics of the ID photo include that the background color is solid color and the outline on the background color is continuous.
3. The gallery processing method according to claim 1, characterized in that: Each label forms a photo set, so that when the photo gallery runs next time and the "ID photo" instruction is input, the photos in this photo set can be directly called.
4. The gallery processing method according to claim 1, wherein: After step S4, there is also a screening step, and the user deletes according to the photos in the photo list.
Citation Information
Patent Citations
Certificate photo background changing method and device
CN110060267A
Portable digital photographing equipment system and photo screening method
CN111159113A