Image Processing Apparatus, Image Processing Method, and Computer-Readable Medium

The processor of the image processing device calculates the position of the inserted object, considers the center of gravity, color difference and type of the foreground and background, and solves the problem of imbalance in the design of the insert object and realizes reasonable image configuration.

CN113409421BActive Publication Date: 2025-08-01FUJIFILM BUSINESS INNOVATION CORP
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202010927912.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-03-17
Filing Date
2020-09-07
Publication Date
2025-08-01
Estimated Expiration
2040-09-07

AI Technical Summary

Technical Problem

When inserting objects in images with foreground and background, it is difficult to maintain a balanced configuration on the design.

Method used

Through the processor of the image processing device, the features of the image and inserted object are accepted, and their positions are calculated to maintain design balance, including taking into account factors such as the center of gravity, color difference and type of the foreground and background, and adjusting the position of the inserted object to avoid exceeding or overlapping.

Benefits of technology

It realizes the balanced configuration on the design when inserting objects, ensuring that the inserted objects are properly distributed in the image and avoid overlapping or exceeding the image boundary.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113409421B_ABST
    Figure CN113409421B_ABST
Patent Text Reader

Abstract

Provided are an image processing apparatus, an image processing method, and a computer-readable medium. The image processing apparatus has a processor that performs the following processing: receiving an image having a foreground and a background, receiving an insertion object, calculating a position for configuring the insertion object based on the characteristics of the foreground, the background, and the insertion object respectively, and outputting the insertion object in such a manner that it is configured at the calculated position.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to an image processing apparatus, an image processing method, and a computer-readable medium. Background Art

[0002] Japanese Patent Publication No. 5302258 discloses a method for positioning a target object in an electronic document. The method includes the following steps: for the input electronic document, identifying a first target object and a second target object to be positioned within a page of the electronic document; detecting the saliency of the first target object, that is, generating a saliency map of the first target object; in the step of generating a first one-dimensional guide line contour for the first target object based on the detection of the saliency of the first target object, using the one-dimensional average value of the saliency in the saliency map as a feature for the guide line contour; generating a second one-dimensional guide line contour for the second target object based on the detection of the saliency of the second target object; positioning the first target object and the second target object based on the first guide line contour and the second guide line contour and generating a corrected document; and outputting the corrected document.

[0003] Japanese Patent Publication No. 6023058 discloses an image processing apparatus having: a segmentation unit that divides each of a plurality of images into a plurality of segments; a calculation unit that calculates the importance of each segment in the one image based on the relationship between different segments in the one image or the relationship between the segments of the one image and the segments of a specified other image; and a classification unit that classifies the segmented segments into any one of a target object, a foreground, and a background. The calculation unit calculates the importance of the segments using at least one of the attention degree of the segments, the co-occurrence degree of the segments, and the importance of the target object. Moreover, the calculation unit calculates in such a manner that the closer a segment is to the attention position presumed to be the position at which the photographer is concerned in the one image, the higher the attention degree of the segment, and calculates the importance of the foreground segment and the background segment based on the calculated attention degree of the segments. The calculation unit obtains the center of gravity of the target object segment in the one image and obtains the attention position as the position symmetric to the center of gravity point with the center point of the image as the center.

[0004] Japanese Patent Publication No. 6422228 discloses a program that is used to display a page configured with a target object on a display, enabling a computer to function as a reception unit and a display unit. The reception unit displays an input screen for text input according to a user's instruction for a display item displayed outside the page on the display, makes a text object representing the text input in the input screen become an object to be newly inserted into the page, and conducts reception. The display unit displays the page into which the text object received by the reception unit is inserted, and can display a plurality of target objects in an overlapping manner on the page. When the second text object has been configured at a predetermined position on the page when the reception unit receives the first text object, the display unit displays the following page, in which, based on the position where the second text object is configured, the first text object is inserted into a position that does not overlap with the second text object. SUMMARY OF THE INVENTION

[0005] However, there are times when it is necessary to insert an insertion object into the background of an image having a foreground and a background.

[0006] An object of the present invention is to provide an image processing apparatus, an image processing method, and a computer-readable medium that can configure an insertion object in a manner that maintains design balance when inserting the insertion object into the background of an image having a foreground and a background.

[0007] According to a first aspect of the present disclosure, there is provided an image processing apparatus including a processor that performs the following processing: receiving an image having a foreground and a background, receiving an insertion object, calculating a position for configuring the insertion object based on the characteristics of the foreground, the background, and the insertion object respectively, and outputting the insertion object in such a way that it is configured at the calculated position.

[0008] According to a second aspect of the present disclosure, the processor obtains the center-of-gravity position of the foreground and obtains the center-of-gravity position of the insertion object based on the center-of-gravity position of the foreground.

[0009] According to a third aspect of the present disclosure, the processor obtains the center-of-gravity position of the insertion object in such a way that the center-of-gravity position of the insertion object is symmetric with the center-of-gravity position of the foreground with the center of the image as the center.

[0010] According to a fourth aspect of the present disclosure, the processor obtains the center-of-gravity position of the foreground and calculates in such a way that the center-of-gravity position of the insertion object belongs to the background.

[0011] According to a fifth aspect of the present disclosure, the processor takes into account the color difference between the foreground and the background to obtain the center-of-gravity position of the foreground.

[0012] According to the sixth aspect of the present disclosure, the processor takes into account the color difference between the inserted object and the background to obtain the center-of-gravity position of the inserted object.

[0013] According to the seventh aspect of the present disclosure, the processor takes into account data related to the type of the foreground to calculate the position where the inserted object is to be arranged.

[0014] According to the eighth aspect of the present disclosure, the processor takes into account data related to the type of the inserted object to calculate the position where the inserted object is to be arranged.

[0015] According to the ninth aspect of the present disclosure, when the inserted object extends beyond the image, the processor moves the inserted object so that the inserted object is contained within the image.

[0016] According to the tenth aspect of the present disclosure, when the inserted object overlaps with the foreground, the processor moves the inserted object so that the inserted object is contained within the background.

[0017] According to the eleventh aspect of the present disclosure, the processor receives a first inserted object and a second inserted object, calculates the position where the first inserted object is to be arranged based on the characteristics of the foreground, the background, and the first inserted object, and adds the first inserted object as the foreground to calculate the position where the second inserted object is to be arranged.

[0018] According to the twelfth aspect of the present invention, there is provided a computer-readable medium storing a program for causing a computer to execute processing, the processing including the steps of: receiving an image having a foreground and a background; receiving an inserted object; calculating the position where the inserted object is to be arranged based on the characteristics of the foreground, the background, and the inserted object; and outputting the inserted object so that it is arranged at the calculated position.

[0019] According to the thirteenth aspect of the present disclosure, there is provided an image processing method including the steps of: receiving an image having a foreground and a background; receiving an inserted object; calculating the position where the inserted object is to be arranged based on the characteristics of the foreground, the background, and the inserted object; and outputting the inserted object so that it is arranged at the calculated position.

[0020] (Effect)

[0021] According to the first, twelfth, or thirteenth aspect, when an inserted object is inserted into the background of an image having a foreground and a background, the inserted object can be arranged while maintaining a design balance.

[0022] According to the second solution, the center-of-gravity position of the insertion object can be calculated based on the center-of-gravity of the foreground.

[0023] According to the third solution, the center-of-gravity of the insertion object can be arranged at a symmetric position of the center-of-gravity position of the foreground centered on the center of the image.

[0024] According to the fourth solution, the insertion object can be arranged in the background image.

[0025] According to the fifth solution, the center-of-gravity position of the foreground can be obtained on the condition of the color difference between the foreground and the background.

[0026] According to the sixth solution, the center-of-gravity position of the insertion object can be obtained on the condition of the color difference between the insertion object and the background.

[0027] According to the seventh solution, the insertion object can be arranged with the type of the foreground as a condition.

[0028] According to the eighth solution, the insertion object can be arranged with the type of the insertion object as a condition.

[0029] According to the ninth solution, based on the calculation result, even when the insertion object extends beyond the background, the insertion object can be corrected to be included in the background.

[0030] According to the tenth solution, based on the calculation result, even when the insertion object overlaps with the foreground, the insertion object can be corrected to be included in the background.

[0031] According to the eleventh solution, even when there are multiple insertion objects, the multiple insertion objects can be arranged in a way that maintains the design balance. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 is a block diagram showing the hardware of the image processing apparatus according to an embodiment of the present disclosure.

[0033] Figure 2 is a block diagram showing the software structure of the image processing apparatus according to an embodiment of the present disclosure.

[0034] Figure 3 is a flowchart showing the process flow for constructing a saliency map in the image processing apparatus according to an embodiment of the present disclosure.

[0035] Figure 4 is a change diagram showing the change of the image for constructing a saliency map in the image processing apparatus according to an embodiment of the present disclosure.

[0036] Figure 5 is a table showing the importance coefficients for image types in the image processing apparatus according to an embodiment of the present disclosure.

[0037] Figure 6 is a flowchart showing the operation process of the image processing apparatus according to an embodiment of the present disclosure.

[0038] Figure 7 is an explanatory diagram showing a method for cutting a foreground image and a background image in the image processing apparatus according to an embodiment of the present disclosure.

[0039] Figure 8 is an explanatory diagram showing a method for explaining how to search for a nearby configuration space in the image processing apparatus according to an embodiment of the present disclosure.

[0040] Figure 9 is an explanatory diagram for explaining the processing in Embodiment 1 of the present disclosure.

[0041] Figure 10 is an explanatory diagram for explaining a method for obtaining the centroid position of an insertion object in Embodiment 1 of the present disclosure.

[0042] Figure 11 is an explanatory diagram for explaining the processing in Embodiment 2 of the present disclosure.

[0043] Figure 12 is an explanatory diagram for explaining a method for obtaining the centroid position of an insertion object in Embodiment 2 of the present disclosure.

[0044] Figure 13 is an explanatory diagram for the processing in Embodiment 3 of the present disclosure.

[0045] Figure 14 is an explanatory diagram for explaining a method for obtaining the centroid position of an insertion object in Embodiment 3 of the present disclosure.

[0046] Figure 15 is an explanatory diagram for explaining the processing in Embodiment 4 of the present disclosure.

[0047] Figure 16 is an explanatory diagram for explaining a method for obtaining the centroid position of an illustration in Embodiment 4 of the present disclosure.

[0048] Figure 17 is an explanatory diagram for explaining a method for obtaining the centroid position of text in Embodiment 4 of the present disclosure.

[0049] Figure 18 is an explanatory diagram for explaining the screen change when changing the size and color of text in Embodiment 5 of the present disclosure, Figure 18 (a) shows the screen before the change, Figure 18 (b) shows the screen after the change. Detailed Description of the Invention

[0050] Next, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings.

[0051] Figure 1 The hardware configuration of the image processing apparatus 10 according to an embodiment of the present disclosure is shown.

[0052] The image processing apparatus 10 includes a processor 12, a memory 14, a storage device 16, an operation display device interface 18, a communication interface 20, and an input interface 22. The processor 12, the memory 14, the storage device 16, the operation display device interface 18, the communication interface 20, and the input interface 22 are connected via a bus 24.

[0053] The processor 12 executes predetermined processing based on a control program stored in the memory 14. The storage device 16 is constituted by, for example, a hard disk and stores necessary software and data. An operation display device 26 is connected to the operation display device interface 18. The operation display device 26 is provided with a touch panel 28 and a display 30, receives operation data from the touch panel 28, and sends display data to the display 30.

[0054] The communication interface 20 is connected to a terminal device or a server via a LAN (Local Area Network) 32, receives an image from the terminal device or the server, or sends an image to the terminal device or the server. Not limited to the LAN, it may also be connected to the terminal device or the server via the Internet.

[0055] The input interface 22 is connected to a mouse 34 and a keyboard 36, and inputs operation signals or operation data from the mouse 34 and the keyboard 36.

[0056] Figure 2 The software configuration for implementing the functions of the image processing apparatus 10 is shown.

[0057] The image processing apparatus 10 includes an object image to be inserted reception unit 38 and an insertion object reception unit 40.

[0058] The object image to be inserted reception unit 38 receives an image having a foreground and a background. The insertion object reception unit 40 receives an image to be an insertion object. The object image to be inserted reception unit 38 receives an image stored in the storage device 16 and an image sent from a terminal device and a server via the communication interface 20, etc. Similarly, the insertion object reception unit 40 receives, in addition to an image stored in the storage device 16 and an image sent from a terminal device and a server via the communication interface 20, an image formed as text. The received images include text, logos, illustrations, and images.

[0059] As described later, the foreground / background cutting unit 42 cuts the foreground and background of the image received by the object image to be inserted reception unit 38 based on the saliency map of the background image.

[0060] As described later, the foreground image centroid calculation unit 44 calculates the centroid position of the foreground using moments based on features such as the color difference between the foreground image and the background image, the color difference between the insertion object and the background image, and the visual importance related to the type of the foreground.

[0061] As described below, the insertion object centroid calculation unit 46 calculates the centroid position of the insertion object configuration space in a manner symmetric with respect to the centroid position of the foreground image and the image center.

[0062] As described later, the insertion object configuration determination unit 48 determines whether the insertion object calculated by the insertion object centroid calculation unit 46 is accommodated in the background image. For example, it determines whether the insertion object does not exceed the object image to be inserted or does not overlap with the foreground image.

[0063] As described below, when the insertion object configuration determination unit 48 determines that the insertion object is not accommodated in the background image, the insertion object configuration change unit 50 changes the configuration of the insertion object so that the insertion object is accommodated in the background image.

[0064] The result display control unit 52 controls to display the state of inserting the insertion object into the background image on the above-mentioned display.

[0065] As described later, the importance database 54 is a database that stores the visual importance of images preset for each type of image.

[0066] Next, the construction of the saliency map of the background image implemented in the foreground-background cutting unit 42 will be described.

[0067] Figure 3 FIG. shows a flowchart for constructing a saliency map, Figure 4 FIG. shows the change of the image when the process is executed. When input Figure 4 the object image to be inserted (original image) shown in (a) of FIG., first, in step S10, the original image is color-reduced by Kmeans which is a kind of non-hierarchical clustering analysis method. Kmeans is also called the K-average method and is one of the non-hierarchical clustering analysis methods. When the original image is color-reduced by Kmeans, as Figure 4 shown in (b) of FIG., a color-reduced image is generated.

[0068] In the next step S12, a histogram representing the frequency of each pixel value of the color-reduced original image is extracted. In the next step S14, the pixel values of each of the R, G, B channels corresponding to the histogram extracted in step S12 and the content of the pixel value representing the transparency called the alpha channel are extracted.

[0069] In the next step S16, the content represented by pixel values brighter than a pre-determined threshold is extracted as a saliency map. If it is extracted as a saliency map, as shown in (c) of Figure 4 , the foreground and background can be distinguished. Further, in step S18, when performing blurring processing, as shown in (d) of Figure 4 , the significant regions can be concentrated, and thus the foreground and background can be cut out.

[0070] Next, a method for calculating the centroid of the foreground image calculated by the foreground image centroid calculation unit 44 will be described.

[0071] Equation (1) is a general formula for calculating the physical centroid position in the XY orthogonal coordinate system.

[0072]

[0073] The centroid position is obtained by dividing the first moment by the zero moment.

[0074] Here, when calculating the centroid position, if the elements of color difference and importance are added, it becomes Equation (2).

[0075] f(x, y) = α x,y w(x, y)

[0076] w(x, y) is the color difference between the foreground and the background, and α x,y is a coefficient representing importance preset according to the type of the foreground image.

[0077] W(x, y) is calculated by Equation (3).

[0078]

[0079] Here, R x,y , G x,y , B x,y are the RGB values of each pixel of the foreground image in the RGB color space, and R bg , G bg , B bg is the average value of RGB of the background in the RGB color space (hereinafter referred to as the main color).

[0080] In addition, as the color space, not limited to RGB, HSV or Lab can be used.

[0081] In addition, when the foreground image includes a logo and text as insertion objects, it is calculated as in Equation (4).

[0082]

[0083] Among them, center imgis the center of the original image, α img is the importance of the foreground image, α text is the importance of the text, α logo is the importance of the identifier, W img is the color difference of the image, w text is the color difference of the text, W logo is the color difference of the identifier.

[0084] In addition, Figure 5 shows the importance of each type of image stored in the importance database 54. It is the result summarized by existing works or professional designers. For example, text is more likely to be noticed, so it is set to 1.0. Compared with buildings, people are more likely to be noticed, so the building is set to 0.05. Relatively, people are set to 0.1.

[0085] Next, the operation process executed by the above-mentioned processor 12 will be described.

[0086] Figure 6 shows a flowchart representing the operation process of the processor 12.

[0087] First, in step S20, the saliency map of the object image to be inserted is extracted. In the next step S22, the salient region is determined and the foreground and background are clipped. The clipped foreground and background are temporarily stored by dividing the layer into a foreground image layer 56 and a background image layer 58 as shown in Figure 7 .

[0088] In the next step S24, based on the color difference between the foreground and the background, the centroid position of the foreground image is calculated using the above-mentioned formulas (1) and (2). In the next step S26, the types of the foreground and the inserted object are identified, and the importance coefficients are read from the importance database 54.

[0089] In the next step S28, the centroid position of the inserted object is calculated by taking the position symmetric to the centroid position of the foreground with the image center as the center.

[0090] In the next steps S30 and S32, it is determined whether the inserted object overlaps with the foreground image or whether the inserted object exceeds the background image. In steps S30 and S32, if it is determined that the inserted object does not overlap with the foreground image and does not exceed the background image, the process proceeds to step S34, and the image with the inserted object is displayed and the process ends. That is, as shown in Figure 8 , when the background is an empty space where the inserted object can be placed and the inserted object is contained in the background, the image with the inserted object is displayed and the process ends.

[0091] On the other hand, in step S30, when it is determined that the object to be inserted overlaps with the foreground image, the process proceeds to step S36. In this step S36, the object to be inserted is moved towards the free space according to the center of gravity symmetry line (a line connecting the center of gravity of the foreground image and the center of gravity of the object to be inserted across the center of the image). In addition, in step S32, when it is determined that the object to be inserted extends beyond the background, the process proceeds to step S38. In this step S38, the object to be inserted is moved into the background according to the center of gravity symmetry line.

[0092] In the next step S40, it is determined whether there is free space for placing the object to be inserted. In this step S40, when it is determined that there is free space for placing the object to be inserted, the process proceeds to step S34, where the image with the object to be inserted is displayed and the process ends.

[0093] In step S40, when it is determined that there is no free space, the process proceeds to step S42 to perform a second-stage search for free space. That is, as Figure 8 shown, the center of gravity position of the object to be inserted is gradually moved around, and it is determined whether the object to be inserted is contained within the background image. In this embodiment, the initially calculated center of gravity position of the object to be inserted is set as X = 0, Y = 0. For example, the center of gravity position of the object to be inserted is moved around in the order of X = -1, Y = 0 → X = 0, Y = 1 → X = 1, Y = 0 → X = -1, Y = -1 → X = 2, Y = 0 to search for free space for the object to be inserted. In this step S42, when there is free space, the process proceeds to step S34, where the image with the object to be inserted is displayed and the process ends. When no free space is found even after performing the processing in step S42, an alarm is displayed and the process ends.

[0094] Next, an embodiment of the present disclosure will be described.

[0095] Figure 9 and Figure 10 represents Embodiment 1.

[0096] In this Embodiment 1, as Figure 9 shown, an object to be inserted composed of text such as "Overseas Travel" is inserted into the background image of an original image of 302×360 pixels. The size of the text box is set and the text is input. The text box is a box for inputting text, and the orientation of the text box is vertical.

[0097] The foreground image is recognized as a building, and the main color (R bg 、G bg 、B bg ) of the background image is as follows.

[0098] The main color (R bg 、G bg 、B bg) = (181, 195, 206)

[0099] Using the color difference w(x, y) between the RGB data of each pixel (x, y) of the foreground image and the RGB data of the main color of the background image, the centroid of the foreground image is obtained according to the above formulas (1), (2), and (3).

[0100] As a result, the centroid position (x fg , y fg ) of the foreground image is as follows.

[0101] The centroid position (x fg , y fg ) of the foreground image = (228, 237)

[0102] In addition, the center (x imgC , y imgC ) of the original image = (151, 180).

[0103] The importance levels of the building and the text are as follows.

[0104] The importance level α of the building fg = 0.05

[0105] The importance level α of the text txt = 1.0

[0106] When an inserted object is input as an image, it is transformed into text and the importance level is set.

[0107] As Figure 10 shown, taking the center (imgC) of the image as the center, symmetric with respect to the centroid position (fg) of the foreground image, according to formulas (5) and (6), the centroid position (txt) of the inserted object as text is calculated in such a way that the moments of the foreground image and the inserted object are balanced.

[0108]

[0109]

[0110] As a result, as Figure 10 shown, the centroid position (x txt , y txt ) of the inserted object is as follows.

[0111] The centroid position (x txt , y txt ) of the inserted object = (59, 112)

[0112] Figure 11 and Figure 12 represents Example 2.

[0113] In this second embodiment, as Figure 11 shown, an insertion object composed of the text "Kyoto Walk" is inserted into the background image of the original image of 360×310 pixels. The orientation of the text box is vertical.

[0114] The foreground image is recognized as a building, and the main color (R bg 、G bg 、B bg ) of the background image is as follows.

[0115] The main color (R bg 、G bg 、B bg ) of the background image = (167, 203, 204)

[0116] The center-of-gravity position of the foreground image is calculated in the same manner as in the first embodiment, as follows.

[0117] The center-of-gravity position (x fg , y fg ) of the foreground image = (215, 192)

[0118] In addition, the center (x imgC , y imgC ) of the original image = (180, 155).

[0119] The importance levels of the building and the text are as follows.

[0120] The importance level α of the building fg = 0.05

[0121] The importance level α of the text txt = 1.0

[0122] The center-of-gravity position of the insertion object is calculated in the same manner as in the first embodiment, as follows.

[0123] The center-of-gravity position (x txt , y txt ) of the insertion object = (141, 41)

[0124] As a result, as Figure 12 shown, the insertion object extends beyond the original image.

[0125] Therefore, as shown in the above step S38, the insertion object is moved according to the center-of-gravity line, and the insertion object is accommodated within the background image at the next position.

[0126] The center-of-gravity position (x txt , y txt ) of the moved insertion object = (145, 51)

[0127] Figure 13 andFigure 14 Indicates Example 3.

[0128] In this Example 3, as Figure 13 shown, an insertion object composed of the text "Nature Conservancy" is inserted into the background image of the original image of 360×239 pixels. The orientation of the text box is horizontal.

[0129] The foreground image is recognized as an animal, and the main color (R bg 、G bg 、B bg ) of the background image is as follows.

[0130] The main color (R bg 、G bg 、B bg ) of the background image = (184, 199, 216)

[0131] The center-of-gravity position of the foreground image is calculated in the same manner as in Example 1, as follows.

[0132] The center-of-gravity position (x fg , y fg ) of the foreground image = (221, 180)

[0133] In addition, the center (x imgC , y imgC ) of the original image = (180, 119).

[0134] The importance levels of the building and the text are as follows.

[0135] The importance level α of the animal fg = 0.1

[0136] The importance level α of the text txt = 1.0

[0137] The center-of-gravity position of the insertion object is calculated in the same manner as in Example 1, as follows.

[0138] The center-of-gravity position (x txt , y txt ) of the insertion object = (131, 47)

[0139] As a result, as Figure 14 shown, the insertion object overlaps with the foreground image.

[0140] Therefore, as shown in step S36 above, the insertion object is moved according to the center-of-gravity line so that the insertion object does not overlap with the foreground image at the next position.

[0141] The center-of-gravity position (x txt , y txt ) of the moved insertion object = (34, 21)

[0142] Figure 15 、 Figure 16 and Figure 17 This shows Example 4.

[0143] In this embodiment 4, Figure 15 As shown in the figure, an insertion object consisting of an illustration and the text "Children's Photo Studio" is inserted into the background image of the original image of 360×240 pixels. The orientation of the text frame is vertical.

[0144] The foreground image is identified as a person, and the main color of the background image (R bg , G bg 、B bg ) as shown below.

[0145] The main color of the background image (R bg , G bg 、B bg ) = (200, 198, 207)

[0146] The centroid position of the foreground image is calculated in the same manner as in Example 1 as shown below.

[0147] The center of gravity of the foreground image (x fg ,y fg ) = (166, 142)

[0148] In addition, the center of the original image (x imgC ,y imgC )=(180,120).

[0149] To extract the importance coefficients of people, illustrations, and text, the illustrations are first inserted onto the background image.

[0150] The configuration space of the illustration overlaps with the foreground image, e.g. Figure 1 As shown in the figure, the center of gravity of the illustration is moved to a nearby empty space. As a result, the center of gravity of the illustration is located as shown below.

[0151] The center of gravity of the illustration (x illus ,y illus )=(238,90)

[0152] Next, the text is inserted into the background image, but the illustration is included as the insertion target image. That is, the illustration is included in the foreground image, and the center of gravity position of the foreground image is recalculated.

[0153] As a result of the recalculation, the new foreground center of mass position is shown below.

[0154] New foreground center of gravity position (x fg ,y fg) = (185, 110)

[0155] When calculating the layout center position of the text based on the new foreground center position, as ​ shown, the layout space of the text overlaps with the foreground image, and the center position of the text is moved to the nearby empty space. As a result, as shown below, the text is arranged in the background image.

[0156] The center position of the text (x txt , y txt ) = (74, 110)

[0157] ​ represents Embodiment 5.

[0158] Embodiment 5 is an example of a case where the size (width and height) of the text is changed with the text as an insertion object and the color of the text is changed.

[0159] That is, ​ shows a screen displayed on the above-mentioned display 30. In this screen, an operation instruction unit 60 is arranged on the left side of the screen, and a result display unit 62 is arranged on the right side. The operation instruction unit 60 has a text size specifying unit 64 and a text color specifying unit 66. The text size specifying unit 64 specifies the size of the text. The text color specifying unit 66 specifies the color of the text. The text color specifying unit 66 can specify the color used in the image of the result display unit 62. Compared with the case where the color of the text is set to black, by setting the color used in the image as the color of the text, the sense of incongruity is reduced. However, the color of the text can also be specified as white or black.

[0160] Currently, if the size of the text is increased by the text size specifying unit 64 and the color of the text is darkened by the text color specifying unit 66, the display of the result display unit 62 changes from ​ the state of (a) to ​ the state of (b).

[0161] Here, since the size of the text increases, the color difference between the text and the background image becomes larger, so the weight of the text increases and the text moves towards the center of the screen.

[0162] In the above embodiment, the processor refers to a processor in a broad sense, including a general-purpose processor (such as a CPU: Central Processing Unit, etc.), a dedicated processor (such as a GPU: Graphics Processing Unit, an ASIC: Application Specific Integrated Circuit, an FPGA: Field Programmable Gate Array, a programmable logic device, etc.).

[0163] In addition, the operations of the processor in the above-described embodiments are not only implemented by a single processor, but may also be implemented by multiple processors located at physically separate locations cooperating with each other. Furthermore, the order of each operation of the processor is not limited to the order described in the above embodiments, and may be appropriately changed.

Claims

1. An image processing apparatus, the image processing apparatus including a processor, The processor performs the following processing: Receiving an image having a foreground and a background, Receiving an insertion object, Based on the color difference between the foreground and the background and the importance related to the type of the foreground, calculating the centroid position of the foreground using moments, and calculating the centroid position of the insertion object configuration space in a manner symmetric with respect to the image center and the centroid position of the foreground image, Outputting the insertion object in such a way that the insertion object is disposed at a position based on the calculated centroid position of the insertion object configuration space.

2. The image processing apparatus according to claim 1, wherein, The processor calculates the centroid position of the foreground in such a way that the centroid position of the insertion object belongs to the background.

3. The image processing apparatus according to claim 1 or 2, wherein, The processor takes into account the color difference between the insertion object and the background to calculate the centroid position of the insertion object.

4. The image processing apparatus according to claim 1 or 2, wherein, The processor takes into account data related to the type of the insertion object to calculate the position where the insertion object is disposed.

5. The image processing apparatus according to claim 1 or 2, wherein, When the insertion object exceeds the image, the processor moves the insertion object in such a way that the insertion object is accommodated within the image.

6. The image processing apparatus according to claim 1 or 2, wherein, When the insertion object overlaps with the foreground, the processor moves the insertion object in such a way that the insertion object is accommodated within the background.

7. The image processing apparatus according to claim 1 or 2, wherein, The processor receives a first insertion object and a second insertion object, calculates the position where the first insertion object is disposed based on the characteristics of the foreground, the background, and the first insertion object respectively, and adds the first insertion object as the foreground to calculate the position where the second insertion object is disposed.

8. A computer-readable medium storing a program for causing a computer to execute processing, The processing has the following steps: Receiving an image having a foreground and a background; Receiving an insertion object; Based on the color difference between the foreground and the background and the importance related to the type of the foreground, calculating the centroid position of the foreground using moments, and calculating the centroid position of the insertion object configuration space in a manner symmetric with respect to the image center and the centroid position of the foreground image; And Outputting the insertion object in such a way that the insertion object is disposed at a position based on the calculated centroid position of the insertion object configuration space.

9. An image processing method, the image processing method having the following steps: ​ ​ ​ ​ Output in such a way that the inserted object is arranged at a position based on the center of gravity position of the calculated inserted object configuration space.

10. A program product comprising a program that causes a computer to execute processing, The processing includes the following steps: Receiving an image having a foreground and a background; Receiving an inserted object; Calculating the center of gravity position of the foreground based on the color difference between the foreground and the background and the importance related to the type of the foreground using moments, and calculating the center of gravity position of the inserted object configuration space in a manner symmetric about the center of the image and the center of gravity position of the foreground image; and Output in such a way that the inserted object is arranged at a position based on the center of gravity position of the calculated inserted object configuration space.

Citation Information

Patent Citations

  • Thresher

    JP1978002258A

  • Suspension apparatus of thermal head

    JP1985023058A

  • Dust detector of electric cleaner

    JP1989022228A

  • Method and device for processing video frames

    US20120017238A1