Information processing apparatus, method of controlling information processing apparatus, and storage medium
An information processing apparatus includes: a reception unit configured to receive an instruction to change an aspect ratio of a document including an image arrangement region; an adjustment unit configured to change the aspect ratio of the document and also adjust an aspect ratio of the image arrangement region, based on the instruction received by the reception unit; a control unit configured to perform control to perform trimming of an image arranged in the image arrangement region based on the aspect ratio of the image arrangement region adjusted by the adjustment unit; and a display control unit configured to perform control to display the document in which the aspect ratio is changed based on the instruction and in which the image trimmed by the control unit is arranged in the adjusted image arrangement region, on a display unit.
1 . An information processing apparatus, comprising:
(A) at least one memory and at least one processor and/or (B) at least one circuit, which function as:
(1) a reception unit configured to receive an instruction to change an aspect ratio of a document including an image arrangement region;
(2) an adjustment unit configured to change the aspect ratio of the document and also adjust an aspect ratio of the image arrangement region, based on the instruction received by the reception unit;
(3) a control unit configured to perform control to perform trimming of an image arranged in the image arrangement region based on the aspect ratio of the image arrangement region adjusted by the adjustment unit; and
(4) a display control unit configured to perform control to display, on a display unit, the document in which the aspect ratio is changed based on the instruction and in which the image trimmed by the control unit is arranged in the adjusted image arrangement region,
wherein, in a case where the number of objects detected from the image arranged in the image arrangement region is two or greater and smaller than a first predetermined number, the control unit performs control to perform trimming in a trimming range determined based on different conditions depending on an area of the object and a score calculated by using a concordance rate of object detection.
2 . The information processing apparatus according to claim 1 , wherein the display control unit performs control to display, on the display unit, a plurality of the documents in which the aspect ratio is changed based on the instruction and in which a plurality of trimmed images trimmed in different trimming ranges in the images by the control unit are arranged in the adjusted image arrangement region.
3 . The information processing apparatus according to claim 2 , further comprising:
a selection unit configured to select either one of the plurality of the documents in which the aspect ratio is changed based on the instruction, based on a user operation.
4 . The information processing apparatus according to claim 3 , wherein
the control unit changes a trimming range of an image arranged in the document selected by the selection unit, based on a user operation.
5 . The information processing apparatus according to claim 2 , wherein the display control unit performs control to display, on the display unit, the plurality of the documents in which the trimmed image is arranged in the adjusted image arrangement region, and nothing is arranged in another region.
6 . The information processing apparatus according to claim 1 , wherein the display control unit performs control to display, on the display unit, a plurality of trimmed images trimmed by the control unit in different trimming ranges in the image, and to display, on the display unit, the document in which the aspect ratio is changed based on the instruction and in which the trimmed image selected from the plurality of the trimmed images by a user operation is arranged in the adjusted image arrangement region.
7 . The information processing apparatus according to claim 1 , further comprising:
an output unit configured to output the changed document displayed by the display control unit in a printable state.
8 . The information processing apparatus according to claim 1 , wherein in a case where the object with the highest score occupies equal to or greater than a second predetermined proportion of the image, the control unit performs control to perform trimming in a trimming range in which the object is arranged at a center, trimming ranges using rule of thirds, and a trimming range in which at least one of a vertical range and a horizontal range of entirety of the image fits within the image arrangement region.
9 . A method of controlling an information processing apparatus, the method comprising:
receiving an instruction to change an aspect ratio of a document including an image arrangement region;
changing the aspect ratio of the document and also adjusting an aspect ratio of the image arrangement region, based on the instruction received in the receiving;
trimming an image arranged in the image arrangement region based on the aspect ratio of the image arrangement region adjusted in the adjusting; and
displaying, on a display unit, the document in which the aspect ratio is changed based on the instruction and in which the image trimmed in the controlling is arranged in the adjusted image arrangement region,
wherein, in a case where the number of objects detected from the image arranged in the image arrangement region is two or greater and smaller than a first predetermined number, in the trimming, trimming is performed in a trimming range determined based on different conditions depending on an area of the object and a score calculated by using a concordance rate of object detection.
10 . A non-transitory computer-readable storage medium storing a program for causing a computer to perform a method of controlling an information processing apparatus, the method comprising:
receiving an instruction to change an aspect ratio of a document including an image arrangement region;
changing the aspect ratio of the document and also adjusting an aspect ratio of the image arrangement region, based on the instruction received in the receiving;
trimming an image arranged in the image arrangement region based on the aspect ratio of the image arrangement region adjusted in the adjusting; and
displaying, on a display unit, the document in which the aspect ratio is changed based on the instruction and in which the image trimmed in the controlling is arranged in the adjusted image arrangement region,
wherein, in a case where the number of objects detected from the image arranged in the image arrangement region is two or greater and smaller than a first predetermined number, in the trimming, trimming is performed in a trimming range determined based on different conditions depending on an area of the object and a score calculated by using a concordance rate of object detection.