System and method for automatically cropping digital images

By detecting salient areas of the image and generating a cropping candidate set, the automatic cropping system solves the problems of aesthetics and efficiency in the image cropping process, provides better aesthetic results and faster cropping time, and is especially suitable for large-scale image processing.

CN118735929APending Publication Date: 2024-10-01CANVA PTY LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410387294.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-03-31
Filing Date
2024-04-01
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

In the existing technology, the image cropping process is difficult for unskilled users to obtain aesthetically pleasing results and takes a long time. Especially when a large number of images need to be cropped, manual cropping becomes tedious and time-consuming.

Method used

The computer processing unit detects salient areas of the image, generates a cropping candidate set, calculates candidate scores, selects the best cropping candidates, and generates a cropped version of the image to achieve automatic cropping.

Benefits of technology

Automatic cropping can provide better aesthetic results than manual cropping, reduce the number of user operations during the trial and error process, significantly reduce cropping time, especially when processing a large number of images, simplify the process and reduce the processing cycle and power consumption of the device .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118735929A_ABST
    Figure CN118735929A_ABST
Patent Text Reader

Abstract

The invention relates to a system and a method for automatically cropping a digital image. A computer-implemented method for automatically generating a cropped version of an input image is described herein. The method includes processing an input image to detect salient regions of the input image and generating a set of cropping candidates based on the salient regions of the input image, each cropping candidate defining a different image cropping. A set of candidate scores is calculated, each candidate score corresponding to a clipping candidate, and a first clipping candidate is selected based on the set of scores. A cropped version of the input image is then generated based on the image cropped defined by the first cropped candidate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Aspects of the present disclosure relate to systems and methods for automatically cropping digital images. Background Art

[0002] Digital images are used in quite a variety of contexts: photo albums, websites, social media services, advertising / marketing, and so on.

[0003] Once an original digital image is captured, the user will often manipulate (or edit) the image through an image editing application. A common manipulation performed by such applications is cropping the original image. For example, this may be performed to improve (or at least change) the composition of the original image and / or to change the aspect ratio of the original image.

[0004] Manual image cropping is typically a straightforward process that can be performed in a variety of ways. However, for unskilled users, performing a crop that provides good aesthetic results can be challenging and time consuming. For example, inexperienced users may need to perform many cropping operations in a trial and error process before finding a crop that they are satisfied with.

[0005] Image cropping can be a tedious task even for experienced users — especially if the user has to crop a large number of images. Summary of the invention

[0006] The present invention describes a computer-implemented method for automatically generating a cropped version of an input image, the method comprising: processing the input image by a processing unit to detect a salient area of ​​the input image; generating a set of cropping candidates based on the salient area of ​​the input image, each cropping candidate defining a different image crop; calculating a set of candidate scores, each candidate score corresponding to a cropping candidate; selecting a first cropping candidate based on the set of cropping candidate scores; generating a cropped version of the input image based on the image crop defined by the first cropping candidate; and outputting the cropped version of the input image. BRIEF DESCRIPTION OF THE DRAWINGS

[0007] In the attached picture:

[0008] Figure 1 is a diagram depicting a system for performing the various features of the present disclosure.

[0009] Figure 2 is a block diagram of an example computer processing system.

[0010] Figure 3 Depicts an example user interface.

[0011] Figure 4 is a flow diagram depicting operations performed to automatically rotate one or more input images.

[0012] Figure 5 Depicts an example user interface.

[0013] Figure 6 Depicts an example user interface.

[0014] Fig. 7A and Figure 7B is a flow diagram depicting operations for generating a set of one or more cropping candidates for an input image.

[0015] Although the present description is susceptible to various modifications and alternative forms, specific embodiments are shown by way of example in the drawings and described in detail. However, it should be understood that the drawings and detailed description are not intended to limit the invention to the specific forms disclosed. It is intended to cover all modifications, equivalents and substitutes that fall within the scope of the invention defined by the appended claims. DETAILED DESCRIPTION

[0016] In the following description, numerous specific details are set forth to provide a thorough understanding of the present invention. However, it is apparent that the present invention can be practiced without these specific details. In some examples, well-known structures and devices are shown in block diagram form to avoid unnecessary ambiguity.

[0017] As mentioned above, image cropping is a common operation performed on digital images. The present disclosure relates to systems and methods for automatically cropping (or automatically suggesting cropping) digital images.

[0018] Automatic cropping offers many advantages.

[0019] In the case of an inexperienced user, automatic cropping can provide better results from an aesthetic (e.g., image composition) perspective than would be obtained by a user manually cropping the image (or, at least, can provide better results without the user having to perform multiple cropping operations in a trial-and-error process).

[0020] Furthermore, in situations where a user (experienced or otherwise) needs to crop a large number of images, automatic cropping can simplify this process and significantly reduce the time and user input required to perform the cropping operation. This in turn can reduce processing cycles and power consumption of the device (or set of devices) involved in performing the cropping operation, since each image can be automatically cropped without having to display the image separately and receive user input defining the desired cropping.

[0021] In order to crop an image in a meaningful way, the automatic cropping techniques described herein generate (in some instances) multiple cropping candidates based on the most interesting or salient parts of the image. Each cropping candidate is then scored to identify the best cropping candidate, which can then be used to actually crop the input image.

[0022] The techniques disclosed herein are computer-implemented techniques executed by one or more computer processing systems. Figure 1 An example computer processing system 100 is depicted. System 100 may be any suitable type of computer processing system, such as a desktop computer, a laptop computer, a tablet device, a smart phone device, a server computer, or an alternative computer processing system. System 100 may, for example, have the same (or similar) architecture as system 200 described below.

[0023] In this example, computer system 100 is configured to perform the functions described herein by executing a software application (or set of software applications) 102—i.e., computer-readable instructions stored in a storage device (such as non-volatile memory 210 described below) and executed by a processing unit of system 100 (such as processing unit 202 described below).

[0024] In this example, the application 102 displays a user interface that allows a user to trigger the automatic image cropping process and view the results of the process. In this example, the application 102 also includes various modules that interoperate to automatically crop an input image. These modules are discussed below, but include: a rotation module 104, a salient region detection module 106, a crop candidate generation module 108, and a scoring module 110.

[0025] In this example, system 100 is connected to communication network 120. Through network 120, system 100 can communicate with (eg, send data to and receive data from) other computer processing systems (not shown).

[0026] Go to Figure 2 , the block diagram of the computer processing system 200 can be configured to implement the embodiments and / or features described herein. For example, Figure 1 The system 100 may be such as Figure 2 The computer processing system shown in (although alternative architectures are possible).

[0027] System 200 is a general purpose computer processing system. It should be understood that Figure 2 Not all functional or physical components of a computer processing system are shown. For example, no power supply or power supply interface is depicted, although system 200 will carry a power supply or be configured for connection to a power supply (or both). It will also be understood that the particular type of computer processing system will determine the appropriate hardware and architecture, and that alternative computer processing systems suitable for implementing features of the present disclosure may have more, alternative, or fewer components than those depicted.

[0028] Computer processing system 200 includes at least one processing unit 202. Processing unit 202 may be a single computer processing device (e.g., a central processing unit, a graphics processing unit, or other computer-related device), or may include multiple computer processing devices. In some cases, where computer processing system 200 is described as performing an operation or function, all processing required to perform the operation or function will be performed by processing unit 202. In other cases, the processing required to perform the operation or function may also be performed by a remote processing device accessible and available (in a shared or dedicated manner) to system 200.

[0029] Through communication bus 204, processing unit 202 is in data communication with one or more machine-readable storage (memory) devices that store computer-readable instructions and / or data that are executed by processing unit 202 to control the operation of processing system 200. In this example, system 200 includes system memory 206 (e.g., BIOS), volatile memory 208 (e.g., random access memory such as one or more DRAM modules), and non-transitory memory 210 (e.g., one or more hard disks or solid-state drives).

[0030] The system 200 also includes one or more interfaces, generally indicated at 212, through which the system 200 interfaces with various devices and / or networks. In general, other devices may be integrated with the system 200, or may be separate. In the case where a device is separate from the system 200, the connection between the device and the system 200 may be through wired or wireless hardware and communication protocols, and may be a direct or indirect (e.g., networking) connection.

[0031] In general, and depending upon the particular system in question, system 200 includes one or more input devices to allow data to be input into / received by system 200 via connected devices, and one or more output devices to allow data to be output by system 200. Example devices are described below, however, it is understood that not all computer processing systems will include all of the devices mentioned and that devices in addition to and in place of those mentioned may well be used.

[0032] For example, the system 200 may include or be connected to one or more input devices through which information / data is input into (received by) the system 200. Such input devices may, for example, include a keyboard, a pointer device (such as a mouse or trackpad), a touch screen, and / or other input devices. The system 200 may also include or be connected to one or more output devices controlled by the system 200 to output information. Such output devices may, for example, include one or more display devices (such as LCDs, LEDs, touch screens, or other display devices) and / or other output devices. The system 200 may also include or be connected to devices that act as both input devices and output devices, such as a touch screen display (which may receive touch signals / inputs and display / output data) and a memory device (from which data may be read and to which data may be written).

[0033] For example, where system 200 is an end-user device (such as system 100), system 200 may include a display 218 (which may be a touch screen display), a camera 220 device, a microphone 222 device (which may be integrated with the camera device), a cursor control device 224 (e.g., a mouse, trackpad, or other cursor control device), a keyboard 226, and a speaker 228 device.

[0034] System 200 also includes a method for communicating with a network such as Figure 1 The system 200 may include one or more communication interfaces 216 for communicating with the network 120. Through the communication interfaces 216, the system 200 may transmit data to and receive data from networked systems and / or devices.

[0035] System 200 may be any suitable computer processing system, such as a server computer system, a desktop computer, a laptop computer, a netbook computer, a tablet computing device, a mobile / smart phone, a personal digital assistant, or an alternative computer processing system.

[0036] System 200 stores or accesses computer applications (which may also be referred to as computer software or computer programs). Generally, such applications include computer-readable instructions and data that, when executed by processing unit 202, configure system 200 to receive, process, and output data. The instructions and data may be stored on a non-transitory machine-readable medium, such as 210, accessible to system 200. The instructions and data may be transmitted to / received by system 200 via data signals in a transmission channel enabled, for example, by a wired or wireless network connection over an interface such as communication interface 216.

[0037] Typically, one application accessible to system 200 will be an operating system application. In addition, system 200 will store or have access to application programs that, when executed by processing unit 202, configure system 200 to perform the various computer-implemented processing operations described herein. For example, and with reference to the above Figure 1 , system 100 includes (and executes) application 102 .

[0038] In some cases, part or all of a given computer-implemented method will be performed by the system 200 itself, while in other cases the processing may be performed by other devices in data communication with the system 200 .

[0039] In the present disclosure, application 102 configures system 100 to provide a user interface (UI). Figure 3 A simplified and partial example of a UI 300 that the application 102 may display (eg, displayed on the display 218 ) is provided.

[0040] In this example, UI 300 is a graphical user interface (GUI) that includes a preview area 302 in which a selected digital image 304 is displayed. UI 300 also includes a zoom control 306 with which a user can interact to zoom in / out the currently displayed image 304.

[0041] In this example, UI 300 also includes a search UI 310, which generally provides a user with controls for searching or browsing digital images (which can then be selected for display and / or automatic cropping as described below). In this example, search UI 310 includes a search control 312, through which a user can submit search data (e.g., a string) to search for a specific image. Search UI 310 can also include a directory structure, etc. (generally represented at 314), which a user can use to browse accessible images. In this case, accessible images can be images stored on locally accessible storage (e.g., on non-transitory storage 210 and / or alternative disk drives) or remotely accessible images (e.g., stored on a networked storage device, cloud storage service, or other remote service, and can be accessed via network 120).

[0042] In this example, UI 300 also includes an automatic cropping control 320 (the operation of which will be described below) and an output image control 322. In general, a user can use the output image control to save or otherwise output an image. Application 102 can provide various options for outputting an image. For example, application 102 can provide the user with the option of outputting an image by one or more of the following: saving the image to a local memory (e.g., non-transitory memory 210 or an alternative drive); saving the image to a remote storage location (e.g., a networked storage device, a cloud storage service, or other remote storage service); printing the image to a printer (a local or networked printer); sending the image to another user (e.g., by attaching the image to an email, instant message, or other electronic communication); publishing the image to a social media platform or other service (e.g., by sending the image to a third-party server system using an appropriate API command to publish the image); and / or by other output means.

[0043] Alternatives to UI 400 are possible, and may include additional, fewer, or alternative controls and UI elements, as described above.

[0044] Go to Figure 4 , a method 400 for automatically cropping an input image will be described. The operations of the method 400 will be described as being performed by the application 102 (and various associated modules) running on the system 100. However, the operations may be performed by one or more alternative applications running on the system 100 or one or more alternative systems.

[0045] Application 102 may be configured to perform processing according to method 400 in response to detecting various triggering events. As one example, user activation of a user interface control (such as auto-crop control 320 of UI 300 described above) may be a triggering event.

[0046] At 402, the application 102 determines one or more input images to be automatically cropped. This can be done in a variety of ways.

[0047] As an example, where the event triggering method 400 is activation of a UI control (such as control 320) and an image is already opened / selected (and, for example, displayed in a preview area such as 302), application 102 can determine that the opened image is an input image.

[0048] Alternatively, in response to detecting activation of the auto-crop control 320, the application 102 can display (e.g., in the search UI 310 or an alternative UI or UI area) an image selection user interface that allows the user to search or browse images and select one or more images for auto-cropping.

[0049] At 404, the application 102 determines a target aspect ratio value for each input image. In this embodiment, three target aspect ratio values ​​are possible: a value indicating that the target aspect ratio is the same as the aspect ratio of the original image (e.g., a first value); a value indicating a specific target aspect ratio (e.g., a second value); or a value indicating that the target aspect ratio should be automatically determined (e.g., a third value).

[0050] The application 102 may determine a target aspect ratio for the input image based on user input. As one example, the application 102 may display an aspect ratio selection UI that allows the user to select between two or more of the following: an "automatic" target aspect ratio option (indicating that the application 102 should automatically determine the aspect ratio); an "original" target aspect ratio option (indicating that the original aspect ratio of the input image should be used); and a specific / user-defined target aspect ratio option (which allows the user to specify a specific aspect ratio).

[0051] The application 102 may provide any suitable UI (or set of UIs) as the aspect ratio selection UI. Figure 5 An example of UI 500 is depicted. UI 500 is similar to Figure 3 300, except that the search UI 310 has been replaced with an aspect ratio selection UI 502. In this example, the application 102 displays an aspect ratio selection area 504 (which includes controls for selecting a desired target aspect ratio option) and an image selection area 506 (which includes controls that allow a user to select one or more of the input images to which the desired aspect ratio is applied).

[0052] In this example, the application 102 provides three aspect ratio selector controls corresponding to the three target aspect ratio options described above: an automatic control 508, which, when selected, indicates that the application 102 is to automatically determine the target aspect ratio; an original control 510, which, when selected, indicates that the application 102 is to use the aspect ratio of the original image as the target aspect ratio; and a specified control 512, which allows the user to specify the target aspect ratio. The specified control can be a drop-down list that allows the user to select from a predefined set of common aspect ratios, and / or can provide text input boxes that allow the user to enter a width and height.

[0053] In this example, the image selection area 506 displays a thumbnail 514 of each image that has been selected (e.g., at 402) for automatic cropping. Each thumbnail includes a check box 516. If a target aspect ratio option has been selected for (and associated with) an image, its preview 514 also includes an indicator 518 indicating the selected option. In addition, an "all" control 520 (which allows the user to select all input images) and a "none" control 522 (which allows the user to deselect all input images) are displayed. To select a specific target aspect ratio option for a particular image (or set of images), the user can select one or more images (e.g., via the check box 516 or the "all" control 520), and then select the desired target aspect ratio option control. For example, to associate a specified aspect ratio of 16:9 with all input images, the user can activate the "all" control (to select all input images) and then activate the "specify" control 512 (and select or enter an aspect ratio of 16:9).

[0054] UI 500 also includes a continue control 524, which, when activated, indicates that the user has completed selecting target aspect ratio options for the input images. If a target aspect ratio option has not been set for any input image, application 102 may apply a default option (e.g., automatic, original, or a specific aspect ratio), or may notify the user that a target aspect ratio option has not been set for one or more input images.

[0055] Alternatives to UI 500 are possible, and may include additional, fewer, or alternative controls and UI elements, as described above.

[0056] In an alternative embodiment, the application 102 is configured to operate with a default target aspect ratio value—e.g., such that the target aspect ratio is always automatically determined (or, alternatively, always the original image aspect ratio or always a defined aspect ratio). In this case, no determination may be required at 404 (and no UI for specifying a target aspect ratio may need to be provided).

[0057] In the present embodiment, the application 102 is configured to allow selection of multiple input images (thereby providing batch automatic cropping). However, in alternative embodiments, the application 102 may instead limit input image selection to a single image at a time.

[0058] Furthermore, while the application 102 may be configured to provide a graphical user interface for a user to select an input image and an associated target aspect ratio option, this need not be the case. For example, the application 102 may provide (or be accessible via) a command line interface that allows a user to select an input image and an associated target aspect ratio option through an appropriate command, an argument specifying the location of an input image or set of input images, and (optionally) an argument specifying a desired target aspect ratio option for the or each input image.

[0059] As a further example, the application 102 may provide one or more user interfaces that allow a user to populate a table indicating the input images (e.g., by directory path, URL, or alternative identifier) ​​and an associated target aspect ratio option for each input image. Such a table may take a form such as the following:

[0060] Input Image Target aspect ratio options C:\images\1.jpg automatic C:\images\2.jpg 3:4 C:\images\3.jpg 16:9 C:\images\4.jpg original C:\images\4.jpg automatic

[0061] In this example, the image "4.jpg" is included twice: once associated with the "original" target aspect ratio option, and once associated with the "automatic" target aspect ratio option. In a case such as this, the application 102 will perform automatic cropping on the image "4.jpg" twice (and generate two separate output images / image versions): once using the original aspect ratio as input, and once by automatically determining the aspect ratio.

[0062] As yet another example, application 102 may provide one or more user interfaces that allow a user to upload a file (eg, in a csv or other suitable format) that defines a table such as above.

[0063] After 404, the application 102 has determined one or more input images to be automatically cropped and (in this embodiment) the associated target aspect ratio options for each input image. Each input image is then processed separately to generate a corresponding output (cropped) image. Where multiple input images are defined, they may be processed sequentially or in parallel in any order.

[0064] At 406, the application 102 processes the selected input image to determine a rotation correction value. In the present embodiment, the rotation module 104 (referred to as module 104) is used to determine the rotation correction value—for example, the module 104 determines the degree by which the image should be rotated to correct for what may be an unintentional misalignment of the original input image (e.g., a horizontal horizon, etc.).

[0065] Module 104 may be configured to process the selected image in various ways to determine such rotation correction values.Module 104 may implement any suitable rotation correction algorithm which, in general, takes as input an image and returns a value indicating a predicted rotation that should be performed.

[0066] As a specific example, module 104 may determine the rotation correction value by processing the selected input image according to a rotation correction process as described in Australian patent application AU 2023202005 (titled "Image rotation" and filed on March 31, 2023), the contents of which are incorporated herein by reference. As another example, the approach used in the RotNet Git Hub repository (https: / / github.com / d4nst / RotNet, as of March 16, 2023) and described in Daniel Saez's post "Correcting Image Orientation Using Convolutional Neural Networks: A hands-on introduction to deep learning applications" may be used.

[0067] At 408, the application 102 determines whether to rotate the selected input image. In the present embodiment, the application 102 determines this based on a threshold rotation range: if the rotation correction value determined at 406 falls within the threshold rotation range, the application 102 determines that the image should be rotated (and the process proceeds to 410). If not, the application determines that the input image should not be rotated (and the process proceeds to 412). In some embodiments, the threshold rotation range is -15 degrees to +15 degrees (although other ranges may be applied). The rationale for selecting this range is that if the rotation correction value is determined to be outside of this range, then it is likely that the original image was intentionally captured in its original form.

[0068] At 410, the application 102 rotates the selected input image according to the rotation correction value determined at 406. Processing then proceeds to 412.

[0069] At 412, the application 102 determines salient regions of the input image (rotated if applicable at 410). In the present embodiment, the salient region detection module 106 (module 106) is used to determine salient regions of the selected input image.

[0070] Module 106 may be configured to determine salient regions (or objects) of the selected input image in a variety of ways. As an example, module 106 may process the selected input image (rotated if applicable at 410) using a machine learning model that has been trained to determine salient regions (or salient objects) therein. For example, the trained machine learning model may be a machine learning model such as that described by Xuebin Qin, Zichen Zhang, Chenyang Huang, Masood Dehghan, Osmar R. Zaiane, and Martin Jagersand in the paper “ U2 Network: Deeply use nested U-shaped structure for salient object detection (U 2 -Net: GoingDeeper with Nested U-Structure for Salient Object Detection)"(arXiv:2005.09007v3) 2 Network model.

[0071] Alternative methods for determining salient regions of an input image may be used. For example, methods such as those described in the paper "A Simple Pooling-Based Design for Real-Time Salient Object Detection" by Jiang-Jiang Liu, Qibin Hou, Ming-Ming Cheng, Jiashi Feng, and Jianmin Jiang (arXiv:1904.09569v1) may be used. As a further example, methods such as those described in the paper “Boundary-Aware Segmentation Network for Mobile and Web Applications” by Xuebin Qin, Deng-Ping Fan, Chenyang Huang, Cyril Diagne, Zichen Zhang, Adria Cabeza Sant'Anna, Albert Suarez, Martin Jagersand, and Ling Shao (arXiv:2101.04704v2) can be used.

[0072] In this embodiment, module 106 returns the salient region data in the form of a mask. The mask includes a set of mask values, each mask value corresponding to a pixel of the selected input image (rotated if applicable at 410). The original value of the mask (which is a value between 0 and 1) is converted to a value of 1 (which indicates that the corresponding input image pixel is part of the salient region) or 0 (which indicates that the corresponding input pixel is not part of the salient region - for example, it is the background). This conversion can be performed by applying a threshold to the original mask value, such as a threshold of 0.15 (or an alternative threshold).

[0073] At 414, the application 102 generates a crop candidate set for the selected input image. Fig. 7A and Figure 7BDescribes the generation of crop candidates. Each crop candidate in the crop candidate set will define a different image crop. The crop candidates can define an image crop in a variety of ways, but will typically include data that allows the minimum x, maximum x, minimum y, and maximum y coordinates of the crop to be determined (e.g., crop coordinates). A given crop candidate may define these four values ​​explicitly, or may define other data from which they can be calculated (e.g., minimum x, minimum y, crop width, and crop height).

[0074] At 416, the application 102 calculates a set of candidate scores. Each candidate score calculated corresponds to a cropping candidate generated at 414. In this example, the candidate scores are calculated by the scoring module 110.

[0075] In general, the candidate score calculated by module 110 provides a measure of the aesthetic and / or composition quality of the crop candidate to which the score corresponds. Module 110 can calculate such a score for the selected crop candidate in various ways. As an example, module 110 can process the selected crop candidate (or, more specifically, a version of the selected input image, which is rotated at 410 if necessary and cropped according to the selected crop candidate) using a machine learning model that has been trained to return a score based on aesthetic and / or composition quality. The trained machine learning model can be, for example, a pre-trained ReLIC++ composition model, as generally described in the following paper, which can be used: Lin Zhao, Meimei Shang, Fei Gao, et al. Representation Learning of Image Composition for Aesthetic Prediction. Computer Vision and Image Understanding (CVIU), Vol. 199, No. 103024, October 2020.

[0076] Alternative methods for calculating image scores may be used. For example, approaches such as those described in the paper "Image Composition Assessment with Saliency-augmented Multi-patternPooling" by Bo Zhang, Li Niu, and Liqing Zhang (arXiv:2104.03133v2) may be used. As a further alternative example, approaches such as those described in the paper "Composition-Aware Image Aesthetics Assessment" (WACV 2020, Dong Liu, Rohit Puri, Nagendra Kamath, and Subhabrata Bhattacharya) may be used.

[0077] At 418, the application 102 selects a final crop candidate for the selected input image based on the candidate scores (e.g., the composition aesthetic score values ​​provided by the ReLIC++ model) calculated at 416. The application 102 will select the crop candidate with the most favorable candidate score (which may be the highest candidate score). If multiple crop candidates have the same score, the application 102 may select any one of the candidates with equal highest scores (or may select all candidates with equal highest scores as different crop options for output).

[0078] At 420, the application 102 generates a cropped version of the selected input image. The cropped version is based on the final crop candidate selected at 418. The application 102 can be configured to generate the cropped version of the selected input image in various ways. For example, the application 102 can be configured to generate the cropped version in a non-destructive manner: for example, by associating relevant cropping data with the selected input image so that when the image is displayed, the image is displayed according to the cropping data (but the user can undo the crop to return to the original image). Alternatively, the application 102 can be configured to generate the cropped version by creating a copy of the selected input image, cropping the copy according to the selected cropping candidate, and outputting the copy. Further alternatively, the application 102 can be configured to generate the cropped version in a destructive manner: for example, by cropping the original image (discarding the cropped data).

[0079] At 422, the application 102 outputs a cropped version of the input image. The application 102 may be configured to output the cropped version in various ways, and depending, for example, on whether the automatic cropping has been run in batch mode.

[0080] In this embodiment, the application 102 is configured to display a UI that allows the user to preview a cropped version of the input image and choose whether to keep or discard the cropped version. Figure 6 An example of such a UI 600 is depicted. The UI 600 is similar to Figure 3 300 , however the preview area 302 includes additional controls ( 602 - 612 ), and the search UI 310 has been replaced by a crop image UI 614 .

[0081] In this example, the preview area 302 of the UI 600 includes: a preview 602 of a particular cropped version of a particular input image; a "Show Original" control 604 (which, if selected, causes the application 102 to display the original image to which the preview 602 corresponds); a "Select" control 606 (which, if selected, causes the application 102 to save the cropped version of the preview 602 and display the preview 602 of the cropped version of the next input image (if any)); a "Discard" control 608 (which, if selected, causes the application 102 to discard the cropped version of the preview 602 and display the preview 602 of the cropped version of the next input image (if any)); a "Next Image" control 610 (which, if selected, causes the application 102 to display the preview 602 of the cropped version of the next input image (if any)); and a Previous Image control 612 (which, if selected, causes the application 102 to display the preview 602 of the cropped version of the previous input image (if any)).

[0082] By activating control 322 , the user may elect to output a cropped version of the input image corresponding to preview 602 in a different manner—eg, to communicate with another person, to post to a social media service or website, to print, or to otherwise output a version of the image.

[0083] In this example, the crop image UI 614 includes: an aspect ratio indicator 616 (which indicates the aspect ratio of the preview 602); a score indicator 618 (which indicates the candidate score calculated for the cropped version shown by the preview 602); one or more view alternative cropping controls 620 (through which the user can view a preview of the current input image cropped according to alternative cropping candidates (e.g., cropping candidates that resulted in less favorable candidate scores and were therefore not selected as the final cropping candidate selected at 418)); one or more view alternative design controls 622 (through which the user can select to view previews of cropped versions of other input images (similar to the next image control 610 and the previous image control 612 discussed above)).

[0084] Alternatives to UI 600 are possible, and may include additional, fewer, or alternative controls and UI elements, as described above.

[0085] In the case of a single input image or a relatively limited number of input images, a UI such as 600 above may be appropriate. In the case of a large number of input images, the application 102 can output cropped versions of those images in different ways. In this case, and as an example, the application 102 can output cropped versions by automatically saving them (without providing any preview or the ability to select / discard a given version to the user). In the case where each cropped version is a copy of the corresponding input image, the application 102 can save these copies to a default location (which can be the same location as the input image or a subdirectory of the location) using a defined file (e.g., "<original file name>-autocrop" (or any other file name)). In addition, the application 102 can display a progress indicator when generating the cropped version, and display a message indicating that the cropped version has been generated when the display is completed. Such a message can include an indication of the location where the cropped version has been saved and can be accessed (or a link in the case of a GUI message).

[0086] At 414, one or more cropping candidates are generated for the selected input image. Fig. 7A and Figure 7B , an example method 700 for generating cropping candidates for a selected image (referred to as an input image) will be described. In the present embodiment, the cropping candidates are generated by the cropping candidate generation module 108 (referred to as module 108).

[0087] In the present embodiment, module 108 is configured to perform different crop candidate generation operations based on the output of the salient region detection performed at 412. Thus, at 702, module 108 determines whether a viable salient region has been detected in the input image.

[0088] In this embodiment, module 108 determines that a feasible salient region is not detected in any of the following cases: the output of 412 is that the salient region (or object) cannot be detected in the input image; or the output of 412 is that the salient region (or object) in the input image exceeds a threshold size. Various threshold sizes can be applied, however, in some embodiments, module 108 is configured to apply a threshold size of 80%. That is, if the size of the detected salient region (or object) is greater than 80% of the size of the input image, module 108 will determine that a feasible salient region is not detected.

[0089] If no viable salient region is detected, the process proceeds to 704. In this case, module 108 will generate a single crop candidate according to the first candidate generation method (which includes operations 704 to 716 discussed below).

[0090] If a feasible salient region is detected, the process proceeds to 720. In this case, module 108 will generate a plurality of cropping candidates according to a second candidate generation method (which includes operations 720 to 730 discussed below).

[0091] At 704, no viable salient region is detected in the input image. In this case, module 108 determines whether a target aspect ratio has been defined for the input image. In this embodiment, and as described above, the target aspect ratio may be defined as the aspect ratio of the input image or an alternative aspect ratio (e.g., an aspect ratio that a user has manually entered / selected). If the user has selected an option indicating that a target aspect ratio should be automatically determined (or module 108 is configured to automatically determine a target aspect ratio by default), then no target aspect ratio is defined for the input image.

[0092] If a target aspect ratio has been defined for the input image at 704, processing proceeds to 706. At 706, module 108 computes a single crop candidate. The single crop candidate is a maximal center crop at the defined aspect ratio—i.e., a crop centered at the center of the input image (rotated if applicable at 408), having the defined target aspect ratio, and extending the width and / or height of the input image.

[0093] At 708 , module 108 returns the crop candidate (or data defining the crop candidate) computed at 706 .

[0094] If at 704, a target aspect ratio is not defined for the input image, processing proceeds to 710. At 710, module 108 calculates the aspect ratio of the input image.

[0095] At 712, module 108 determines a target aspect ratio for the crop candidate. In the present embodiment, module 108 determines the target aspect ratio by selecting an aspect ratio from a predefined list of aspect ratios. Specifically, module 108 selects the target aspect ratio as the aspect ratio in the predefined list that is closest to the input image aspect ratio (as calculated at 712). In the present embodiment, the predefined list of aspect ratios includes the following aspect ratios: [1:1, 2:3, 3:2, 4:5, 5:4, 9:16, 16:9]. However, the predefined list may include additional, fewer, and / or alternative aspect ratios.

[0096] At 714, module 108 computes a single crop candidate.

[0097] The single crop candidate is a maximum center crop at the aspect ratio determined at 712—i.e., a crop centered at the center of the input image (rotated at 408 if applicable), having the aspect ratio determined at 712, and extending the width and / or height of the input image.

[0098] Processing then proceeds to 716 where the crop candidate (or data defining the crop candidate) computed at 714 is returned.

[0099] At 720, a feasible salient region has been detected. In this case, module 108 determines whether a target aspect ratio has been defined for the input image (eg, as per 704 described above).

[0100] If a target aspect ratio has been defined for the input image at 720, processing proceeds to 722. At 722, module 108 computes a set of seed points (e.g., a list or other data structure). Each seed point is a point (e.g., defined by an (x, y) coordinate pair) on which a crop candidate set will be based.

[0101] In the present embodiment, module 108 calculates a set of seed points to include a center seed point (which is calculated as the center point of the detected salient area) and a plurality of offset seed points (each offset seed point defines a point offset from the center seed point). In the present embodiment, the offset seed points include: a left seed point (which is calculated as a point to the left of the center seed point); a right seed point (which is calculated as a point to the right of the center seed point); and a top seed point (which is calculated as a point above the center seed point). Module 108 can be configured to calculate the left seed point, the right seed point, and the top seed point based on the center seed point in various ways. For example, module 108 can adjust the relevant x-coordinate or y-coordinate of the center seed point by a predefined percentage. For example, if the center point has coordinates (x c ,y c ), the input image has a width w and a height h, and the predefined percentage is t, then module 108 can calculate: the left seed point has coordinates ((xc –W*t),y c ); the right and left seed points have coordinates ((x c +W*t),y c ); the top seed point has coordinates (x c ,y c + H*t). Any suitable value of t may be used, for example 5% (0.05) or an alternative value.

[0102] In other embodiments, additional or fewer seed points may be generated, and / or the seed points may be generated based on different methods. For example, a set of n seed points may be generated by generating a central seed point as described above and then applying a random perturbation to the x-coordinate and / or y-coordinate of the central seed point (the random perturbation being constrained to a range appropriate for the size of the input image).

[0103] At 724, module 108 iterates over each seed point generated at 722 and generates a crop candidate subset for each seed point. For the selected seed point, this involves the operations described at 726 and 728.

[0104] At 726, for the selected seed point, module 108 calculates a maximum crop bounding box for the selected seed point. The maximum crop bounding box is a bounding box centered at the selected seed point, has a defined target aspect ratio, and extends the width and / or height of the input image. The maximum crop bounding box may be calculated in the same (or similar) manner as described above with reference to 706, except that the crop is not centered on the center of the input image (rotated at 408 if applicable), but is centered on the selected seed point.

[0105] At 728, and for the selected seed point, module 108 generates a crop candidate subset (e.g., a list) of the selected seed point. The crop candidate subset generated at 728 may be referred to as a seed point subset. The crop candidate subset generated at 728 is based on the maximum crop bounding box determined at 726 for the selected seed point.

[0106] In the present embodiment, module 108 generates a subset of crop candidates at 728 with reference to the scaling value set. In particular, module 108 generates each crop candidate by applying a scaling value from the scaling value set to the maximum crop bounding box calculated at 726. In a specific example, the scaling value set includes (0.875, 0.9, 0.925, 0.95, 0.975, 1.0). The scaling value set may include additional, fewer, and / or alternative scaling values. By generating crop candidates in this manner, each crop candidate remains centered on the selected seed point, maintains a defined aspect ratio, and will retain a majority (or, for a scaling value of 1.0, retains all) of the salient area of ​​the input image.

[0107] At 730 , after processing each seed point at 724 , the module 108 returns a crop candidate set. The crop candidate set includes the crop candidates for each subset generated at 728 (or data defining each of those crop candidates).

[0108] To illustrate this particular embodiment, in the presence of a viable salient region (as determined at 702) and in the presence of a defined aspect ratio (determined at 720), module 108 generates 24 crop candidates. Specifically, for each of the four seed points (center, left, top, and right), module 108 generates a subset of six crop candidates (one candidate based on each zoom value (0.875, 0.9, 0.925, 0.95, 0.975, 1.0)).

[0109] If a target aspect ratio has not been defined for the input image at 720, processing proceeds to 732. At 732, module 108 determines the orientation of the input image as portrait (if the image height is greater than its width), landscape (if the image width is greater than its height), or square (if the image height is equal to its width).

[0110] At 734, module 108 determines an aspect ratio set based on the orientation of the input image determined at 730. In this embodiment, each possible input image orientation is associated with a predefined aspect ratio set, and each predefined set includes two or more aspect ratios. As a specific example, the predefined aspect ratio set may be as follows:

[0111] Directional Aspect Ratio Horizontal [1:1,3:2,4:3,5:4,16:9] Vertical [1:1,2:3,3:4,4:5,9:16] square [1:1,2:3,3:2,3:4,4:3,4:5,5:4]

[0112] In alternative embodiments, the set of predefined aspect ratios for a given orientation may include additional, fewer, or alternative aspect ratios. Providing multiple aspect ratios is advantageous because it results in crop candidates of varying aspect ratios, however in some embodiments, one or more of the orientations may be associated with a single aspect ratio (in which case the crop candidates vary based on the seed point and scaling values ​​described below).

[0113] At 736, module 108 iterates for each aspect ratio in the set of aspect ratios determined at 734. For each aspect ratio, module 108 generates a set of seed points and, for each seed point, generates a crop candidate subset. This is described below with reference to operations 738 to 744.

[0114] At 738, and for the selected aspect ratio, module 108 calculates a set of seed points. This operation is similar (or identical) to operation 722 described above, and will not be described again. In this embodiment, and as with operation 722 described above, module 108 calculates a set of seed points to include a center seed point, a left seed point, a right seed point, and a top seed point. In other embodiments, additional or fewer seed points may be calculated at 738, and / or seed points may be calculated based on different approaches.

[0115] At 740, and for the selected aspect ratio, module 108 iterates for each seed point calculated at 738 and generates a crop candidate subset (which may be referred to as a seed point subset) for each seed point. The operations performed at 740 are similar to the operations performed at 724 described above.

[0116] At 742, and for the selected seed point, module 108 calculates a maximum crop bounding box based on the selected seed point and the selected aspect ratio. This is similar to operation 726 described above. At 724, the maximum crop bounding box is a bounding box centered at the selected seed point, having the selected aspect ratio, and extending the width and / or height of the input image.

[0117] At 744, and for the selected seed point, module 108 generates a crop candidate subset (e.g., a list). The crop candidate subset is based on the maximum crop bounding box determined at 742, and in the present embodiment, is generated according to operation 728 described above (e.g., based on a set of scaling values). In the present embodiment, the set of scaling values ​​used to generate the crop candidate subset at 744 is (0.875, 0.9, 0.925, 0.95, 0.975, 1.0). Alternative scaling values ​​may be used.

[0118] Once all seed points for all aspect ratios have been processed, processing proceeds to 746. At 746, module 108 returns a crop candidate set. The crop candidate set includes crop candidates (or data defining those crop candidates) for each subset generated at 744 for each aspect ratio.

[0119] To illustrate this particular embodiment, in the presence of a viable salient region (as determined at 702), no defined aspect ratio (determined at 720), and the input image is a portrait image, module 108 generates 120 crop candidates. Specifically, for each of the five aspect ratios associated with the portrait orientation (1:1, 2:3, 3:4, 4:5, 9:16), module 108 generates four seed points (center, left, top, and right), and for each of those seed points, module 108 generates a subset of six crop candidates (one candidate based on each zoom value (0.875, 0.9, 0.925, 0.95, 0.975, 1.0)).

[0120] The flowcharts shown in the drawings and described above define operations in a particular order to explain various features. In some cases, the operations described and illustrated may be capable of being performed in an order different from that shown / described, one or more operations may be combined into a single operation, a single operation may be divided into multiple separate operations, and / or the functions implemented by one or more of the described / illustrated operations may be implemented by one or more alternative operations. In addition, the functions / processing of a given flowchart operation may potentially be performed by (or in conjunction with) different applications running on the same or different computer processing systems.

[0121] The present disclosure provides various user interface examples. It should be understood that alternative user interfaces are possible. Such alternative user interfaces may provide the same or similar user interface features as those described and / or illustrated in different ways, provide the same or similar user interface features as those described and / or illustrated, or omit certain user interface features that have been described and / or illustrated.

[0122] In the above described embodiment, automatic cropping of images is performed by a single application 102 running on a single computer processing system 100. However, alternatives are possible.

[0123] For example, one or more of modules 104, 106, 108, and / or 110 may be different applications (running on the same or separate computer processing systems) that interoperate with application 102 to perform the described techniques.

[0124] As another example, the functions performed by modules 104, 106, 108, and 110 may be combined together in an automatic cropping package that may be used to extend the set of functions provided by any suitable image editing application. In this case, the packaged automatic cropping may be installed locally on a given end-user system, such as as a plug-in or extension to an existing image editing application.

[0125] As another example, the functions performed by modules 104, 106, 108 and 110 can be combined in an automatic cropping service that can be accessed by any appropriate image editing application. For example, the function set of modules 104, 106, 108 and 110 can be provided by one or more server-side applications. In this case, application 102 can be configured to provide a front end to the user to select one or more images to be automatically cropped and (if necessary) display the resulting cropped image to the user. However, in order to perform cropping, application 102 transmits the image (or the identifier of the image) to the server environment (if necessary, together with the desired aspect ratio). Then, the server environment performs the relevant operations before returning the cropped image (or the data that application 102 can use to crop the image) to application 102.

[0126] Unless otherwise stated, the terms "include" and "comprise" (and variations such as "including", "includes", "comprising", "comprises", "comprised", etc.) are used inclusively and do not exclude other features, components, integers, steps or elements.

[0127] In some cases, the present disclosure uses the terms "first", "second", etc. to describe various elements. Unless otherwise stated, these terms are only used to distinguish elements from each other, not in an ordinal sense. For example, without departing from the scope of the described examples, a first user input may be referred to as a second user input, or vice versa. In addition, when the terms "first", "second", etc. are used to distinguish elements or features, the second user input may exist without the first user input. For example, the second user input may occur before the first user input (or when the first user input never occurs).

[0128] It will be understood that the embodiments disclosed and defined in this specification extend to alternative combinations of two or more of the individual features mentioned or evident from the text or drawings. All of these different combinations constitute alternative embodiments of the present disclosure.

[0129] This specification describes various embodiments with reference to numerous specific details, which may vary depending on the implementation. Limitations, elements, properties, features, advantages, or attributes expressly recited in the claims should not be considered essential or necessary features. Accordingly, the description and drawings are to be regarded as illustrative rather than restrictive.

Claims

1. A computer-implemented method for automatically generating a cropped version of an input image, the method comprising: Processing the input image by a processing unit to detect a salient area of ​​the input image; generating a set of cropping candidates based on the salient regions of the input image, each cropping candidate defining a different image crop; Calculate a set of candidate scores, each candidate score corresponds to a cropping candidate; selecting a first crop candidate based on the crop candidate score set; generating the cropped version of the input image based on the image crop defined by the first crop candidate; as well as The cropped version of the input image is output.

2. The computer-implemented method of claim 1 , wherein: Generating the cropping candidate set based on the salient area of ​​the input image includes: determining one or more target aspect ratios; and For a first target aspect ratio of the one or more target aspect ratios: generating a first set of seed points, wherein each seed point in the first set of seed points is generated based on the salient area of ​​the input image; generating a first subset of cropping candidates based on a first seed point in the first set of seed points, wherein each cropping candidate in the first subset of cropping candidates has an aspect ratio corresponding to the first target aspect ratio; and Each cropping candidate in the first subset of cropping candidates is included in the cropping candidate set.

3. The computer-implemented method of claim 2, wherein: Determining the one or more target aspect ratios includes determining a single defined target aspect ratio.

4. The computer-implemented method of claim 2, wherein: Determining the one or more target aspect ratios includes determining a plurality of predefined target aspect ratios.

5. The computer-implemented method of claim 4, wherein: Determining the plurality of predefined target aspect ratios comprises: determining an orientation of the input image; and The plurality of predefined target aspect ratios are determined based on the orientation of the input image.

6. The computer-implemented method of claim 2, wherein: Generating the first set of seed points includes generating a central seed point, the central seed point defining the center of the salient region of the input image.

7. The computer-implemented method of claim 2, wherein: Generating the first set of seed points includes generating offset seed points, the offset seed points defining points offset from a center of the salient region of the input image.

8. The computer-implemented method of claim 2, wherein: Generating the first subset of cropping candidates based on the first seed point includes generating a plurality of cropping candidates based on the first seed point, the first target aspect ratio, and a set of scaling values.

9. The computer-implemented method of claim 8, wherein: Generating the plurality of cropping candidates based on the first seed point, the first target aspect ratio, and the scaling value set comprises: calculating a maximum crop bounding box centered at the first seed point, having the first target aspect ratio and extending the width and / or height of the input image; and For each scaling value in the set of scaling values, a crop candidate is generated by applying a scaling based on the scaling value to the maximum crop bounding box.

10. The computer-implemented method of claim 1, wherein: Before processing the input image to detect the salient area of ​​the input image, the method further comprises: determining a rotation correction value for the input image; and The input image is rotated based on the rotation correction value.

11. The computer-implemented method of claim 1 , wherein: Processing the input image to detect the salient region of the input image includes processing the input image using a first trained machine learning model.

12. The computer-implemented method of claim 1, wherein: Calculating the first candidate score of the first crop candidate includes: generating a first cropped version of the input image based on the first cropping candidate; and The first candidate score is calculated by processing the first cropped version of the input image using a second trained machine learning model.

13. The computer-implemented method of claim 1, wherein: Outputting the cropped version of the input image comprises one or more of: displaying the cropped version of the input image; saving the cropped version of the input image; publishing the cropped version of the input image; printing the cropped version of the input image; attaching the cropped version of the input image to an electronic communication.

14. A computer processing system comprising: one or more computer processing units; as well as A non-transitory computer readable medium storing instructions which, when executed by the one or more computer processing units, cause the one or more computer processing units to perform a method comprising: processing an input image to detect salient regions of the input image; generating a set of cropping candidates based on the salient region of the input image, each cropping candidate defining a different image crop; Calculate a set of candidate scores, each candidate score corresponds to a cropping candidate; selecting a first crop candidate based on the crop candidate score set; generating a cropped version of the input image based on the image crop defined by the first crop candidate; as well as The cropped version of the input image is output.

15. The computer processing system of claim 14, wherein: Generating the cropping candidate set based on the salient area of ​​the input image includes: determining one or more target aspect ratios; and For a first target aspect ratio of the one or more target aspect ratios: generating a first set of seed points, wherein each seed point in the first set of seed points is generated based on the salient area of ​​the input image; generating a first subset of cropping candidates based on a first seed point in the first set of seed points, wherein each cropping candidate in the first subset of cropping candidates has an aspect ratio corresponding to the first target aspect ratio; and Each cropping candidate in the first subset of cropping candidates is included in the cropping candidate set.

16. The computer processing system implemented method of claim 15, wherein: Determining the one or more target aspect ratios comprises determining a plurality of predefined target aspect ratios, and wherein determining the plurality of predefined target aspect ratios comprises: determining an orientation of the input image; and The plurality of predefined target aspect ratios are determined based on the orientation of the input image.

17. The computer processing system of claim 15, wherein: Generating the first set of seed points includes: generating a central seed point, the central seed point defining the center of the salient region of the input image; and An offset seed point is generated, the offset seed point defining a point offset from a center of the salient region of the input image.

18. The computer processing system of claim 15, wherein: Generating the first subset of cropping candidates based on the first seed point includes generating a plurality of cropping candidates based on the first seed point, the first target aspect ratio, and a set of scaling values.

19. The computer processing system of claim 14, wherein: Before processing the input image to detect the salient area of ​​the input image, the method further comprises: determining a rotation correction value for the input image; and The input image is rotated based on the rotation correction value.

20. A non-transitory storage storing instructions executable by one or more computer processing units to cause the one or more computer processing units to perform a method comprising: processing an input image to detect salient regions of the input image; generating a set of cropping candidates based on the salient region of the input image, each cropping candidate defining a different image crop; Calculate a set of candidate scores, each candidate score corresponds to a cropping candidate; selecting a first crop candidate based on the crop candidate score set; generating a cropped version of the input image based on the image crop defined by the first crop candidate; as well as The cropped version of the input image is output.

Citation Information

Cited By

  • Video analysis system, video analysis method, and video analysis program

    JP7876039B1

  • Method and apparatus for image cropping, and device, medium and program product

    WO2026143598A1