Multi-image cutting low-memory processing method based on thought of biological marker recapture method

The idea of ​​biological marker recapture method is used to achieve independent cropping and low-memory processing of multiple pictures in the iOS system, which solves the problem of memory occupation and state preservation when cropping multiple pictures in mobile software, and improves the user experience and system stability.

CN118570338APending Publication Date: 2024-08-30ZHENGZHOU JUNYING NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410639014.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-22
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

It is difficult for existing mobile software to crop multiple images simultaneously and maintain low memory usage in the iOS system, and it cannot be effectively saved or uploaded after the cropping operation is completed, affecting user experience and system stability.

Method used

Adopting the idea based on the biological marker recapture method, by generating a unique image display position and attribute identifier, binding the image and recording the cropping status, disabling the reuse mechanism of UICollectionView, only rendering the image in the visible area, and only processing it when uploading The cropping area of ​​the visible area, unselected pictures are immediately written to the file or left blank.

Benefits of technology

It realizes independent cropping of multiple pictures, reduces memory consumption, ensures the reliability and efficiency of cropping, and ensures the stable operation of the iOS system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570338A
    Figure CN118570338A
Patent Text Reader

Abstract

The invention discloses a multi-image cutting low-memory processing method based on a biological marker recapture method thought, and relates to the technical field of mobile phone software. The multi-picture clipping low-memory processing method based on the idea of the biological marker recapture method comprises the following steps: step 1, according to the characteristic that attribute identifiers displayed by an iOS picture library are unique, generating picture display positions with the same number as pictures; step 2, binding each picture display position with a correspondingly displayed picture through an attribute identifier, so that the picture display positions and the correspondingly displayed picture meet a one-to-one correspondence relationship; according to the method, the thought of a biological marker recapture method is used for reference, the picture display position of the picture to be cut is marked, and the picture state after cutting operation is recorded, so that the states of the cut pictures can be mutually independent and do not conflict with each other, and meanwhile, the unselected pictures are null after being written, so that the effectiveness of each cut picture is ensured, and the cutting efficiency is improved. And meanwhile, the reliability of multi-image cutting is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of mobile phone software, and in particular to a multi-image clipping and low-memory processing method based on the idea of ​​biological marker-recapture method. Background Art

[0002] With the popularization of mobile devices, based on the existence of Moore's Law, the performance of mobile devices will be greatly improved every year. Along with this, the application of mobile software is becoming more and more common and integrated into all aspects of people's lives. Naturally, user needs are becoming increasingly diversified.

[0003] As work and life efficiency are increasing, users' need for cropping when using mobile image processing software is constantly reminding us to pursue efficiency.

[0004] Then, meeting the user's efficiency requirements of cropping multiple pictures at the same time, maintaining low memory consumption after cropping, and uploading or saving without having to save, is an urgent problem that needs to be solved.

[0005] In the current market, image processing apps all crop single images, upload or save them after processing. If you want to keep memory low after cropping multiple images, and retain the status of the user's cropping operation to facilitate subsequent uploading or saving, this has become a major problem in mobile software, especially in iOS systems. Summary of the invention

[0006] The purpose of the present invention is to solve at least one of the technical problems existing in the prior art, and to provide a multi-image cropping low-memory processing method based on the idea of ​​biological marker recapture method, which can solve the problem of multi-image cropping in image cropping mobile software under iOS system.

[0007] To achieve the above object, the present invention provides the following technical solution: a multi-image cropping low-memory processing method based on the biological marker recapture method, including a multi-image cropping method based on the biological marker recapture method, the multi-image cropping method based on the biological marker recapture method includes the following steps:

[0008] Step 1: Based on the fact that the attribute identifiers displayed in the iOS gallery are all unique, generate the same number of image display positions as the number of images;

[0009] Step 2: Bind each image display position to the corresponding image through the attribute identifier so that the two satisfy a one-to-one correspondence;

[0010] Step 3: According to the user's click, traverse each image display position, take out the currently clicked image display position, and perform editing operations such as enlarging and rotating the image.

[0011] Preferably, when the picture needs to be edited based on step three, the following operation steps are also required:

[0012] Step 1: Image cropping, editing and selection require the use of UICollectionView for display and operation. Limited by the cell reuse mechanism of UICollectionView, each cell is selected with a non-repeating and unique identifier tag, thereby disabling the reuse mechanism;

[0013] Step 2: Generate a corresponding number of cells as image display locations based on the number of images selected by the user, and use the localIdentify property of PHAsset as the unique identifier of the cell for initialization.

[0014] Preferably, the third step: using a Dictionary dictionary structure to bind the model and the cell together, and binding the model and the cell together whenever the UICollectionVIew loads the cell;

[0015] Step 4: During the cropping process, image rendering will cause memory usage issues. Consider reducing the number of images rendered so that the image is rendered only on the cell in the current visible area, that is, only the selected image is rendered.

[0016] Preferably, the fifth step: when uploading and saving, only the visible area and the cropped area of ​​the cell being cropped or uploaded are used for image rendering and display processing. When the image cropping operation of the cropped area of ​​the invisible area is completed, that is, when it is switched from selected to unselected, the file is immediately written or directly uploaded, and then the image used for image display in the invisible area is immediately assigned to nil.

[0017] Preferably, the step four: using the identifier as a unique mark, recording the state of each picture when editing stops, and caching the edited pictures.

[0018] Preferably, the step five is: traversing each picture, performing a write operation on the non-selected and edited pictures, and assigning the non-selected pictures to be empty.

[0019] Compared with the prior art, the present invention has the following beneficial effects:

[0020] (1) This multi-image cropping low-memory processing method based on the idea of ​​biological marker-recapture method draws on the idea of ​​biological marker-recapture method, marks the image display position of the image to be cropped, and uses this to record the image status after the cropping operation, so that after each image is cropped, the status can be independent of each other and will not conflict with each other. At the same time, the writing of unselected images is cleared, thereby ensuring the validity of each cropped image and the reliability of multi-image cropping.

[0021] (2) The multi-image cropping low-memory processing method based on the idea of ​​biological marker recapture method can reduce the space occupied by memory processing during the multi-image cropping process through the operations in the first step to the fifth step in step three. When uploading and saving, only the visible area and the cropped area of ​​the cell being cropped or uploaded are used for image rendering and display processing, which helps to reduce memory consumption and ensure the stable operation of the iOS system. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The present invention is further described below in conjunction with the accompanying drawings and embodiments:

[0023] Figure 1 It is a schematic diagram of a process flow of a multi-image clipping and low-memory processing method based on the idea of ​​biological marker-recapture method of the present invention;

[0024] Figure 2 The present invention is a schematic diagram of a certain cropping page layout composition of a multi-image cropping low-memory processing method based on the idea of ​​biological marker recapture method. DETAILED DESCRIPTION

[0025] This section will describe in detail the specific embodiments of the present invention. The preferred embodiments of the present invention are shown in the accompanying drawings. The purpose of the accompanying drawings is to supplement the description of the text part of the specification with graphics, so that people can intuitively and vividly understand each technical feature and the overall technical solution of the present invention, but it cannot be understood as a limitation on the scope of protection of the present invention.

[0026] In the description of the present invention, it should be understood that descriptions involving orientations, such as up, down, front, back, left, right, etc., and orientations or positional relationships indicated are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.

[0027] In the description of the present invention, "greater than", "less than", "exceed" etc. are understood as not including the number itself, and "above", "below", "within" etc. are understood as including the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.

[0028] In the description of the present invention, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention based on the specific content of the technical solution.

[0029] See also Figure 1-2 The present invention provides a technical solution: a multi-image cropping low-memory processing method based on the idea of ​​biological marker recapture method, including a multi-image cropping method based on the idea of ​​biological marker recapture method. The technical solution of the multi-image cropping method based on the idea of ​​biological marker recapture method is implemented as follows:

[0030] First, the method for cropping multiple images based on the biological marker-recapture method includes the following steps:

[0031] Step 1: Based on the fact that the attribute identifiers displayed in the iOS gallery are all unique, generate the same number of image display positions as the number of images;

[0032] Step 2: Bind each image display position to the corresponding image through the attribute identifier so that the two satisfy a one-to-one correspondence;

[0033] Step 3: According to the user's click, traverse each image display position, take out the currently clicked image display position, and perform editing operations such as enlarging and rotating the image;

[0034] Step 4: Use the identifier as a unique tag to record the state of each image when editing stops, and cache the edited images;

[0035] Step 5: Traverse each picture, write the unselected and edited pictures into the file, and assign the unselected pictures to null.

[0036] By drawing on the idea of ​​biological mark-recapture method, the image display position of the image to be cropped is marked and used to record the image status after the cropping operation. This ensures that the status of each image after cropping is independent of each other and will not conflict with each other. At the same time, the writing of unselected images is set to empty, thereby ensuring the validity of each cropped image and the reliability of multi-image cropping.

[0037] Furthermore, if you need to edit the image based on step 3, you also need the following steps:

[0038] Step 1: Image cropping, editing and selection require the use of UICollectionView for display and operation. Limited by the cell reuse mechanism of UICollectionView, each cell is selected with a non-repeating and unique identifier tag, thereby disabling the reuse mechanism;

[0039] Step 2: Generate a corresponding number of cells as image display positions according to the number of images selected by the user, and use the localIdentify attribute of PHAsset as the unique identifier of the cell for initialization;

[0040] Step 3: Use the Dictionary structure to bind the model and cell together whenever the UICollectionVIew loads the cell;

[0041] Step 4: During the cropping process, image rendering will cause memory usage to increase. Consider reducing the number of images rendered so that only the image is rendered on the cell in the current visible area, that is, only the selected image is rendered.

[0042] Step 5: When uploading or saving, only the visible area and the cropped area of ​​the cell being cropped or uploaded are used for image rendering and display. When the image cropping operation of the cropped area of ​​the invisible area is completed, that is, when it is switched from selected to unselected, it is immediately written to the file or uploaded directly, and then the image used for image display in the invisible area is immediately assigned to nil.

[0043] Through the operations from the first step to the fifth step in step three, the space occupied by memory processing can be reduced during the multi-image cropping process. When uploading and saving, only the visible area and the cropped area of ​​the cell being cropped or uploaded are used for image rendering and display processing, which helps to reduce memory consumption and ensure the stable operation of the iOS system.

[0044] The embodiments of the present invention are described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Various changes can be made within the knowledge scope of ordinary technicians in the technical field without departing from the purpose of the present invention.

Claims

1. A multi-image clipping low-memory processing method based on the idea of ​​biological marker-recapture method, characterized by: A method for cropping multiple images based on the idea of ​​biological marker recapture method is provided, wherein the method for cropping multiple images based on the idea of ​​biological marker recapture method comprises the following steps: Step 1: Based on the fact that the attribute identifiers displayed in the iOS gallery are all unique, generate the same number of image display positions as the number of images; Step 2: Bind each image display position to the corresponding image through the attribute identifier so that the two satisfy a one-to-one correspondence; Step 3: According to the user's click, traverse each image display position, take out the currently clicked image display position, and perform editing operations such as enlarging and rotating the image.

2. The multi-image clipping low-memory processing method based on the biological marker-recapture method according to claim 1, characterized in that: When the picture needs to be edited based on step three, the following steps are required: Step 1: Image cropping, editing and selection require the use of UICollectionView for display and operation. Limited by the cell reuse mechanism of UICollectionView, each cell is selected with a non-repeating and unique identifier tag, thereby disabling the reuse mechanism; Step 2: Generate a corresponding number of cells as image display locations based on the number of images selected by the user, and use the localIdentify property of PHAsset as the unique identifier of the cell for initialization.

3. The multi-image clipping low-memory processing method based on the biological marker-recapture method according to claim 2, characterized in that: The third step: use the Dictionary dictionary structure to bind the model and the cell together, and bind the model and the cell together whenever the UICollectionVIew loads the cell; Step 4: During the cropping process, image rendering will cause memory usage issues. Consider reducing the number of images rendered so that the image is rendered only on the cell in the current visible area, that is, only the selected image is rendered.

4. The multi-image clipping low-memory processing method based on the biological marker-recapture method according to claim 3, characterized in that: The fifth step: when uploading and saving, only the visible area and the cropped area of ​​the cell being cropped or uploaded are used for image rendering and display processing. When the image cropping operation of the cropped area of ​​the invisible area is completed, that is, when it is switched from the selected state to the unselected state, it is immediately written to the file or directly uploaded, and then the image used for image display in the invisible area is immediately assigned to nil.

5. The multi-image clipping low-memory processing method based on the biological marker-recapture method according to claim 1, characterized in that: The fourth step: using the identifier as a unique mark, recording the state of each picture when editing stops, and caching the edited pictures.

6. The multi-image clipping low-memory processing method based on the biological marker-recapture method according to claim 1, characterized in that: The step five is: traversing each picture, and for the non-selected and edited pictures, writing the file operation, and assigning the non-selected pictures to be empty.