Information processing device and information processing program
The information processing device and program address the challenge of unnatural image replacements by automatically setting geometric transformation areas based on the replacement area's shape and perspective, ensuring seamless integration of sample images into original images.
Patent Information
- Application Number
- JP2020177539
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-10-22
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2040-10-22
AI Technical Summary
Existing image processing systems require manual setting of geometric transformation areas to replace parts of an image, which can result in unnatural replacements due to mismatched shapes and perspectives.
An information processing device and program that automatically sets geometric transformation areas by identifying the shape of the replacement area and applying projective transformations to match the original image's perspective, allowing for seamless integration of sample images without user-defined boundaries.
Enables natural-looking replacements by automatically adjusting geometric transformations to match the original image's perspective, reducing user input and enhancing the visual coherence of the composite image.
Smart Images

Figure 0007543836000013 
Figure 0007543836000018 
Figure 0007543836000011
Abstract
Description
[Technical field]
[0001] The present invention relates to an information processing device and an information processing program. [Background technology]
[0002] Patent Document 1 discloses an image synthesis device comprising a means for inputting an original image, a means for inputting a texture image, a means for designating a pasting area into which the texture image is to be pasted into the original image, a means for designating a usage area of the texture image corresponding to the pasting area of the original image, and an image synthesis means for synthesizing the usage area of the texture image with the pasting area of the original image, wherein the image synthesis means has a function for setting a mask having at least one window area in the pasting area of the original image, and a function for performing pseudo perspective transformation on the usage area of the texture image.
[0003] Patent document 2 discloses an image simulation device comprising: a storage means for storing processing target data representing an original image to be processed, material data which is image data of materials which may constitute an item represented by the original image, and fitting mask data which represents an fitting area which is an area in the original image occupied by an image of a changeable material; a transformation means for transforming the material data to fit the shape of the fitting area to generate transformed material data; an embedding means for updating the processing target data in the fitting area based on the transformed material data; and a display means for displaying an image represented by the processing target data updated by the embedding means.
[0004] Patent document 3 discloses an image processing device that includes an area detection unit that detects a designated area from an original image, an image processing unit that deforms the shape of a sample image, which is a sample image, to match the shape of the designated area and deforms the texture of the sample image to express depth that matches the designated area, and an image synthesis unit that synthesizes the deformed sample image with the designated area of the original image. [Prior art documents] [Patent documents]
[0005] [Patent Document 1] Japanese Patent Application Publication No. 6-274650 [Patent Document 2] Japanese Patent Application Publication No. 8-287225 [Patent Document 3] JP 2018-81430 A Summary of the Invention [Problem to be solved by the invention]
[0006] There are cases where a user wishes to replace a wall surface, which is a part of an original image of a photographed room, with a sample image of a wall surface, etc., with a different pattern. In this case, the sample image may be geometrically transformed according to the replacement area so that the replaced image does not look unnatural. However, the geometric transformation area in which the sample image is geometrically transformed needs to be set by the user.
[0007] An object of the present invention is to provide an information processing device and an information processing program that allow a user to replace a part of an original image with a geometrically transformed image without setting a geometrically transformed area. [Means for solving the problem]
[0008] An information processing device according to a first aspect includes a processor, which sets a geometric transformation area for generating a geometrically transformed image by geometrically transforming a sample image from a replacement area set in a part of an original image, generates a geometrically transformed image by geometrically transforming the sample image into the geometric transformation area, and replaces the replacement area using the geometric transformation image.
[0009] In an information processing device according to a second aspect, in the information processing device according to the first aspect, the processor sets the geometric transformation area by setting a plurality of specific points for identifying the geometric transformation area including the shape of the replacement area from the shape of the replacement area.
[0010] An information processing device according to a third aspect is an information processing device according to the second aspect, in which the processor obtains a mask image of the same size as the original image, in which the replacement area and areas other than the replacement area are represented in binary, and sets the multiple specific points based on the positional relationship between a reference point of the mask image and the replacement area.
[0011] An information processing device according to a fourth aspect is an information processing device according to the third aspect, in which, when a portion of the geometric transformation area represented by the plurality of specific points protrudes from the mask image, the processor geometrically transforms an extended sample image, which is an extension of the sample image corresponding to the protruding portion, into the geometric transformation area.
[0012] An information processing device according to a fifth aspect is an information processing device according to the fourth aspect, in which the extended sample image is generated by adding an inverted image of the peripheral portion of the sample image to the peripheral portion as an additional sample image.
[0013] An information processing device according to a sixth aspect is an information processing device according to any one of the third to fifth aspects, wherein the processor sets the plurality of specific points based on the positional relationship between the reference point and the replacement area, using the center point of the mask image as the reference point.
[0014] An information processing device according to a seventh aspect is an information processing device according to any one of the third to fifth aspects, wherein the processor adjusts the position of the reference point so that the angle of view determined by two straight lines respectively connecting the reference point and two specific points among the plurality of specific points is maximized.
[0015] An information processing device according to an eighth aspect is the information processing device according to the seventh aspect, wherein the processor adjusts a position of the reference point using a degree of coincidence between the replaced region and the geometric transformation region.
[0016] An information processing device according to a ninth aspect is the information processing device according to any one of the first to eighth aspects, wherein the processor adjusts a size of the sample image in accordance with a size of the geometric transformation area.
[0017] An information processing device according to a 10th aspect is an information processing device according to any one of the first to ninth aspects, wherein the processor accepts a selection of the original image, accepts a selection of the sample image, and displays an image in which the replacement area has been replaced using the geometrically transformed image.
[0018] An information processing program according to an eleventh aspect causes a computer to execute a process of setting a geometric transformation area when generating a geometrically transformed image by geometrically transforming a sample image from a replacement area set in a part of an original image, generating a geometrically transformed image by geometrically transforming the sample image into the geometric transformation area, and replacing the replacement area using the geometric transformation image. Effect of the Invention
[0019] According to the first and eleventh aspects, a part of an original image can be replaced with a geometrically transformed image without the user having to set a geometrically transformed area.
[0020] According to the second aspect, it is possible to set a geometric transformation area that matches the shape of the replacement area, as compared to a case in which a geometric transformation area is set regardless of the shape of the replacement area.
[0021] According to the third aspect, it is possible to set a geometrically transformed area that matches the shape of the replacement area, compared to a case in which a geometrically transformed area is set regardless of the positional relationship between the reference point of the mask image and the replacement area.
[0022] According to the fourth aspect, when a part of the geometric transformation region protrudes from the mask image, the image after replacement becomes more natural, compared to the case where the sample image is not expanded.
[0023] According to the fifth aspect, the pattern at the boundary between the sample image and the additional sample image is prevented from becoming unnatural.
[0024] According to the sixth aspect, a plurality of specific points can be set easily without performing complex processing.
[0025] According to the seventh aspect, the shape of the projective transformation region can be made closer to the shape of the replaced region, compared to the case where the position of the reference point is fixed.
[0026] According to the eighth aspect, the shape of the projection transformation area can be made closer to the shape of the replacement area, compared to a case in which the position of the reference point is adjusted regardless of the angle of view determined by two straight lines respectively connecting the reference point and two of the multiple specific points.
[0027] According to the ninth aspect, the image after replacement becomes more natural, compared to a case where the size of the sample image is fixed regardless of the size of the geometric transformation region.
[0028] According to the tenth aspect, compared to a case where selection of an original image and a sample image is not accepted, it is possible to obtain an image obtained by projecting a part of an original image using a sample image for various original images and sample images. [Brief description of the drawings]
[0029] [Figure 1] 1 is a configuration diagram of an information processing device according to a first embodiment. [Diagram 2] 4 is a flowchart of information processing according to the first embodiment. [Diagram 3] FIG. 2 is a diagram showing an example of an original image. [Figure 4] FIG. 13 is a diagram illustrating an example of a mask image. [Diagram 5] FIG. 13 is a diagram for explaining a vanishing point. [Figure 6] FIG. 13 is a diagram showing an example of a sample image. [Figure 7] FIG. 13 is a diagram for explaining setting of a projective transformation region. [Figure 8] FIG. 13 is a diagram for explaining setting of a projective transformation region. [Figure 9] 11 is a diagram for explaining a case where a sample image is transformed into a projection transformation domain. FIG. [Figure 10] FIG. 13 is a diagram illustrating an example of a projectively transformed image. [Figure 11]FIG. 13 is a diagram illustrating an example of a composite image after projective transformation. [Figure 12] 10 is a flowchart of information processing according to the second embodiment. [Figure 13] FIG. 13 is a diagram for explaining the extension of a sample image. [Figure 14] FIG. 13 is a diagram for explaining the extension of a sample image. [Figure 15] 13 is a flowchart of information processing according to the third embodiment. [Figure 16] FIG. 13 is a diagram for explaining movement of a vanishing point. [Figure 17] FIG. 13 is a diagram for explaining movement of a vanishing point. [Figure 18] 13 is a flowchart of information processing according to the fourth embodiment. [Figure 19] FIG. 11 is a diagram for explaining correction of a sample image. [Figure 20] FIG. 11 is a diagram for explaining correction of a sample image. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0030] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
[0031] (First embodiment)
[0032] FIG. 1 is a configuration diagram of an information processing device 30 according to this embodiment. The information processing device 30 is a device including a general computer. In this embodiment, the information processing device 30 generates and displays a composite image in which, among indoor images taken of the interior of a real estate property, an image of a part of the interior, such as wallpaper and flooring, is replaced with a sample image of another interior. In addition, the image to be processed by the information processing device 30 is not limited to an indoor image of a real estate property, and an image of an interior with walls, windows, etc. can be applied. Therefore, an indoor image other than a real estate property, for example, an indoor image of one's own room, may be used. Furthermore, the image is not limited to an indoor image, and may be an image of a building such as a house or a building existing in a landscape.
[0033] As shown in Fig. 1, the information processing device 30 includes a controller 31. The controller 31 includes a central processing unit (CPU) 31A, a read only memory (ROM) 31B, a random access memory (RAM) 31C, and an input / output interface (I / O) 31D. The CPU 31A, the ROM 31B, the RAM 31C, and the I / O 31D are connected to each other via a system bus 31E. The system bus 31E includes a control bus, an address bus, and a data bus. The CPU 31A is an example of a processor.
[0034] In addition, an operation unit 32, a display unit 33, a communication unit 34, and a storage unit 35 are connected to the I / O 31D.
[0035] The operation unit 32 includes, for example, a mouse and a keyboard.
[0036] The display unit 33 is configured with, for example, a liquid crystal display.
[0037] The communication unit 34 is an interface for performing data communication with an external device.
[0038] The storage unit 35 is configured with a non-volatile external storage device such as a hard disk, and stores an information processing program 35A, an indoor image database 35B, a sample image database 35C, etc., which will be described later. The CPU 31A loads the information processing program 35A stored in the storage unit 35 into the RAM 31C and executes it.
[0039] Next, the operation of the information processing device 30 according to the present embodiment will be described with reference to Fig. 2. The information processing shown in Fig. 2 is executed by causing the CPU 31A to execute the information processing program 35A. Note that the information processing shown in Fig. 2 is executed, for example, when an instruction to execute the information processing program 35A is given by a user operation.
[0040] In step S100, the CPU 31A displays a menu screen (not shown) for the user to select an indoor image to be viewed, etc., on the display unit 33. Here, the user operates the operation unit 32 to select an indoor image that the user wishes to view.
[0041] In step S102, CPU 31A accepts the selection of an indoor image. If the selection of an indoor image has been accepted, the process proceeds to step S104. On the other hand, if the selection of an indoor image has not been accepted, the process waits until the selection of an indoor image is accepted.
[0042] In step S104, the original image of the selected indoor image is acquired by reading it from the indoor image database 35B of the storage unit 35, and is displayed on the display unit 33. The storage unit 35 stores image data of various original images of indoor images in advance as the indoor image database 35B.
[0043] FIG. 3 shows an example of an original image of an indoor image. As shown in FIG. 3, an original image 40 of an indoor image is an image obtained by photographing the inside of a room. Here, the user operates the operation unit 32 to specify an area of the original image 40 where the user wishes to replace an image of a part of the interior, such as wallpaper and flooring, with a sample image of another interior. In this embodiment, as an example, a case will be described in which the user specifies a wall 44 excluding a right window 42. When specifying the wall 44, for example, a range including the wall 44 is specified as the specified area by dragging the mouse of the operation unit 32.
[0044] In step S106, CPU 31A accepts the designation of a designated area. If a designated area is designated, the process proceeds to step S108. On the other hand, if a designated area is not designated, the process waits until a designated area is designated.
[0045] In step S108, the CPU 31A sets a replacement area based on the designated area. Specifically, the replacement area is set by cutting out the area of the wall 44 from the designated area using a known image processing method. As a result, the area of the wall 44, which is a part of the original image 40, is set as the replacement area. Hereinafter, the wall 44 may be referred to as the replacement area 44. Note that, as a known image processing method, for example, the method disclosed in JP 2017-126304 A is used, but is not limited thereto.
[0046] In step S110, the CPU 31A generates a mask image based on the replacement area set in step S108. Here, the mask image is a binary image in which the replacement area and other areas of the original image other than the replacement area are expressed in binary, and the mask image is of the same size as the original image 40. An example of the mask image is shown in FIG. 4. As shown in FIG. 4, the mask image 50 is a binary image in which the pixel value of each pixel in the replacement area 44 is expressed as "1" and the pixel value of each pixel in the other areas 46 other than the replacement area 44 is expressed as "0".
[0047] Here, in this embodiment, as shown in FIG. 5, a case will be described where the original image 40 is an image having a vanishing point S. Here, the vanishing point is a point where a plurality of lines that are actually parallel intersect when they are drawn non-parallel in perspective. In the case of the original image 40 having such a vanishing point, for example, the boundary line K1 between the wall 44 and the ceiling 46 and the boundary line K2 between the wall 44 and the window 42 are actually parallel, but are non-parallel in the original image 40. Therefore, if the replacement area 44 is directly replaced with the sample image 60 with wood grain in the horizontal direction as shown in FIG. 6, the image will not express a sense of perspective. Therefore, in this embodiment, a projection transformation area is set, a projection transformation area image is generated by projecting the sample image into the projection transformation area, and the replacement area 44 is replaced using the projection transformation image. Note that the projection transformation is an example of a geometric transformation, the projection transformation area is an example of a geometric transformation area, and the projection transformation image is an example of a geometric transformation image.
[0048] Therefore, in step S112, CPU 31A sets a projection transformation region from replacement region 44. Here, the projection transformation region is a region when generating a projection transformation image by projecting a sample image.
[0049] Specifically, the projection transformation region is set by setting a plurality of specific points for specifying a projection transformation region including the shape of the replacement region 44 from the shape of the replacement region 44. The plurality of specific points are set, for example, from the positional relationship between a reference point of the mask image 50 and the replacement region 44. The reference point of the mask image 50 is a point that can be regarded as the vanishing point of the original image 40. The reason why a point that is assumed to be the vanishing point of the original image 40 is used as the reference point is that by setting the projection transformation region using a reference point that can be regarded as the vanishing point of the original image 40, a projection transformation image in which unnaturalness is suppressed can be obtained.
[0050] In this embodiment, as shown in FIG. 7, a case will be described where the center point of the mask image 50 is set as the reference point F as an example, but the position of the reference point F is not limited to the center point.
[0051] For the sake of simplicity, the following description will be given by taking a replacement region of a simple shape as an example. In FIG. 8, straight lines L1 and L2 are specified, which extend from a reference point F toward the outer edge of the mask image 50 and contact the replacement region 44 from the outside, that is, straight lines L1 and L2 circumscribing the replacement region 44. Then, the intersections of the straight lines L1 and L2 with one side H1 of the mask image 50 (the right side in the example of FIG. 8) are specified as specific points T1 and T2. Next, the points on the outer edge of the replacement region 44, which are connected with the specific points T1 and T2 by straight lines to form a closed region that includes the replacement region 44, are specified as specific points. In the example of FIG. 7, the replacement region 44 has a shape obtained by rotating a trapezoid by 90 degrees, and both ends of the upper side of the trapezoid are specified points T3 and T4.
[0052] In the example of Fig. 8, a trapezoidal region surrounded by connecting specific points T1 to T4 with straight lines becomes the projection transformation region 70. Note that in the example of Fig. 8, the replacement region 44 and the projection transformation region 70 coincide with each other.
[0053] 7, a trapezoidal region surrounded by connecting specific points T1 to T4 with straight lines becomes the projection transformation region 70. In the example of FIG. 7, the projection transformation region 70 is set so as to include the replacement region 44.
[0054] In step S114, CPU 31A accepts the selection of a sample image. The user refers to the menu screen and operates operation unit 32 to select from the menu screen a sample image to be substituted for the designated area designated in step S106. Image data of sample images of various wallpapers, flooring materials, etc. is stored in advance in storage unit 35 as sample image database 35C. In this embodiment, the size of the sample image is, as an example, the same as that of original image 40 and mask image 50.
[0055] If the selection of the sample image has been accepted, the process proceeds to step S116. On the other hand, if the selection of the sample image has not been accepted, the process waits until the selection of the sample image is accepted.
[0056] In step S116, the CPU 31A acquires the selected sample image by reading it from the sample image database 35C in the storage unit 35. Then, as shown in Fig. 9, the acquired sample image 60 is projectively transformed into the projective transformation region 70. As a result, a projectively transformed image 80 as shown in Fig. 10 is generated.
[0057] In step S118, CPU 31A generates a composite image in which replacement region 44 is replaced using projection-transformed image 80, and displays the composite image on display unit 33. Specifically, a logical product is calculated between corresponding pixels in mask image 50 and projection-transformed image 80 to generate a replacement image. Then, replacement region 44 in original image 40 is replaced with the generated replacement image. As a result, a composite image 40A is obtained in which the right wall is replaced with projection-transformed image 80 obtained by projection-transforming sample image 60, as shown in FIG. 11. Furthermore, because replacement is performed using projection-transformed image 80 obtained by projection transformation, a composite image 40A in which the sense of incongruity is suppressed is obtained.
[0058] The user may refer to composite image 40A displayed on display unit 33, and if the user wishes to change the sample image, may operate operation unit 32 to instruct a change of the sample image.
[0059] Therefore, in step S120, CPU 31A determines whether or not a change to the sample image has been instructed. If a change to the sample image has been instructed, the process proceeds to step S114. On the other hand, if a change to the sample image has not been instructed, the process proceeds to step S122.
[0060] Furthermore, if the user wishes to change the replacement area, the user may operate the operation unit 32 to instruct the change of the replacement area.
[0061] Therefore, in step S122, CPU 31A determines whether or not a change to the replacement area has been instructed. If a change to the replacement area has been instructed, the process proceeds to step S106. On the other hand, if a change to the replacement area has not been instructed, the process proceeds to step S124.
[0062] Furthermore, if the user wishes to change the indoor image to be viewed, the user may operate the operation unit 32 to instruct a change of the indoor image.
[0063] Therefore, in step S124, CPU 31A determines whether or not a command to change the indoor image has been issued. If a command to change the indoor image has been issued, the process proceeds to step S102. On the other hand, if a command to change the indoor image has not been issued, the process proceeds to step S126.
[0064] In step S126, CPU 31A determines whether or not an instruction to end the process has been given, and if an instruction to end the process has not been given, proceeds to step S120, and if an instruction to end the process has been given, ends this routine.
[0065] Second embodiment
[0066] Next, a second embodiment will be described. The same parts as those in the first embodiment are given the same reference numerals, and detailed descriptions thereof will be omitted. The configuration of the information processing device 30 is the same as that in the first embodiment, and therefore the description thereof will be omitted.
[0067] Fig. 12 shows a flowchart of information processing according to the second embodiment. The information processing shown in Fig. 12 differs from the information processing shown in Fig. 2 in that steps S115A and S115B are added. The other steps are the same as the information processing in Fig. 2, so a description thereof will be omitted.
[0068] In the example of Figure 8 described in the first embodiment, the specific points T1 and T2 are located on the right side of the mask image 50, but depending on the shape of the replacement region 44, the positions of the specific points T1 and T2 may be on a line extending one side H1 of the mask image 50, as shown in Figure 13.
[0069] In this case, a part of the projection transformation region 70 represented by the specific points T1 to T4 protrudes from the mask image 50, so an extended sample image is generated by extending the sample image 60.
[0070] Therefore, in step S115A, it is determined whether or not it is necessary to generate an expanded sample image by expanding the sample image 60. In other words, it is determined whether or not a part of the projection transformation region 70 protrudes from the mask image 50. If it is determined that a part of the projection transformation region 70 protrudes from the mask image 50, the process proceeds to step S115B. On the other hand, if it is determined that the projection transformation region 70 does not protrude from the mask image 50, the process proceeds to step S116.
[0071] In step S115B, an extended sample image is generated by extending the sample image 60 in accordance with the portion of the projection transformation region 70 that protrudes from the mask image 50.
[0072] Specifically, as shown in FIG. 14, a rectangular additional sample image 60A having a width W1 of the specific point T1 protruding in the Y direction is added to the upper side of the sample image 60. A rectangular additional sample image 60B having a width W2 of the specific point T2 protruding in the Y direction is added to the lower side of the sample image 60. A width W3 to be extended in the Y direction is calculated so that the extended sample image has the same aspect ratio as the sample image 60, and a rectangular additional sample image 60C having the calculated width W3 is added to the left side of the sample image 60. As a result, an extended sample image 62 is generated by extending the sample image 60 in accordance with the portion of the projection transformation region 70 protruding from the mask image 50. Then, the generated extended sample image 62 is projectively transformed into the projection transformation region 70.
[0073] It is preferable that the extended sample image 62 is generated by adding an inverted image of the peripheral portion of the sample image 60 as an additional sample image to the peripheral portion. For example, the additional sample image 60A is an image obtained by inverting the image along the upper side of the sample image 60. Similarly, the additional sample image 60B is an image obtained by inverting the image along the lower side of the sample image 60, and the additional sample image 60C is an image obtained by inverting the image along the left side of the sample image 60. This prevents the pattern at the boundary between the sample image 60 and the additional sample images 60A to 60C from becoming unnatural.
[0074] Third embodiment
[0075] Next, a third embodiment will be described. The same parts as those in the above embodiment are denoted by the same reference numerals, and detailed description thereof will be omitted. The configuration of the information processing device 30 is the same as that in the first embodiment, and description thereof will be omitted.
[0076] In the third embodiment, a case will be described in which the position of the reference point F is adjusted so that the reference point F approaches the vanishing point of the original image 40.
[0077] Fig. 15 shows a flowchart of information processing according to the third embodiment. The information processing shown in Fig. 15 is different from the information processing shown in Fig. 12 in that a process of step S113 is added. The other processes are the same as the information processing in Fig. 12, and therefore description thereof will be omitted.
[0078] In step S113, the CPU 31A adjusts the position of the reference point F so that the reference point F approaches the vanishing point of the original image 40, thereby adjusting the projection transformation region.
[0079] Specifically, the position of the reference point F is adjusted so that the angle of view determined by two straight lines respectively connecting the reference point F and two of the plurality of specific points is maximized.
[0080] For example, a case will be described where the projection transformation region set by executing the process of step S112 is the projection transformation region 70 as shown in Fig. 16. In this case, as shown in Fig. 17, the reference point F is moved in the Y direction to newly identify specific points T1 to T4, and the straight lines L1 and L2 are updated. Then, a position where the angle of view θ determined by the new reference point F and the straight lines L1 and L2 is the maximum angle of view is searched for, and this position is set as the adjusted reference point F1.
[0081] Comparing the shapes of the projection transformation region 70 shown in Fig. 16 and the projection transformation region 70A shown in Fig. 17, the projection transformation region 70A shown in Fig. 17 has a shape closer to the replaced region 44. That is, the reference point F1 is closer to the vanishing point than the reference point F. In this way, by adjusting the position of the reference point F so that the angle of view θ determined by the reference point F and the straight lines L1 and L2 becomes the maximum angle of view, the shape of the projection transformation region 70 becomes closer to the shape of the replaced region 44.
[0082] Furthermore, when adjusting the position of the reference point F, the position of the reference point F may be adjusted using the degree of match between the replacement region 44 and the projection transformation region 70. Specifically, the position of the reference point F is moved in the Y direction to newly identify specific points T1 to T4, and the projection transformation region 70 is updated by updating the straight lines L1 and L2. Then, the degree of match between the replacement region 44 and the new projection transformation region 70 is calculated. As the degree of match, for example, the similarity in the shapes of the replacement region 44 and the projection transformation region 70 may be used, or the matching rate of the areas of the replacement region 44 and the projection transformation region 70 may be used.
[0083] Then, the reference point F is moved in the Y direction and the same process is repeated until the calculated degree of match satisfies a predetermined condition. Note that the predetermined condition may be that the calculated degree of match is equal to or greater than a predetermined threshold, or that the number of times the reference point F has been moved is equal to or greater than a predetermined number of times. In this way, by adjusting the position of the reference point F using the degree of match between the replaced region 44 and the projective transformation region 70, the reference point F approaches the vanishing point.
[0084] Note that a binary search method may be used to move the reference point F. For example, the intersection of a straight line connecting the specific points T1 and T2 and a perpendicular line that passes through the reference point F and perpendicularly intersects with the straight line connecting the specific points T1 and T2 is found. Then, the position in the Y direction that bisects the distance from the found intersection to the specific point T1 is set as the new reference point F. If the reference point F is not determined even when the reference point F is moved in the Y direction from the found intersection to the specific point T1, the reference point F is moved in the Y direction from the found intersection to the specific point T2, and the same process is performed.
[0085] Furthermore, the reference point F may be moved not only in the Y direction but also in the X direction to search for a position where the angle of view θ is the maximum angle of view, and set as the adjusted reference point F1. This brings the reference point F even closer to the vanishing point.
[0086] Furthermore, when it is possible to obtain not only the original image 40 in the XY plane but also the original image in the YZ plane and the original image in the ZX plane, the position of the reference point F may be adjusted three-dimensionally by moving the reference point F in the X direction for the original image 40 in the XY plane, moving the reference point F in the Z direction for the original image in the YZ plane, and moving the reference point F in the X direction for the original image in the ZX plane. This brings the reference point F even closer to the vanishing point.
[0087] (Fourth embodiment)
[0088] Next, a fourth embodiment will be described. The same parts as those in the above-mentioned embodiment are denoted by the same reference numerals, and detailed description thereof will be omitted. The configuration of the information processing device 30 is the same as that in the first embodiment, and description thereof will be omitted.
[0089] Fig. 18 shows a flowchart of information processing according to the fourth embodiment. The information processing shown in Fig. 18 differs from the information processing shown in Fig. 2 in that a process of step S115 is added. The other processes are the same as the information processing in Fig. 2, and therefore description thereof will be omitted.
[0090] In step S115, the CPU 31A adjusts the size of the sample image 60 in accordance with the size of the projection transformation region 70. For example, as shown in Fig. 19, when the projection transformation region 70 has a relatively vertically elongated shape, the sample image 60 is corrected to be vertically elongated to perform projection transformation on the projection transformation region 70. This makes the composite image after replacing the replacement region 44 more natural.
[0091] Specifically, as shown in FIG. 20, correction coefficients in the X and Y directions for correcting sample image 60 are determined based on the angle of view θ determined by reference point F and straight lines L1, L2, and the distance D in the X direction from reference point F to projective transformation region 70, and sample image 60T is generated by correcting sample image 60 based on the determined correction coefficients.
[0092] For example, when the angle of view θ is a right angle (90 degrees), the correction coefficients in the X and Y directions are set to "1.0", and the larger the angle of view θ, the larger the correction coefficient in the Y direction is made, and the smaller the angle of view θ, the smaller the correction coefficient in the Y direction is made.
[0093] Moreover, the longer the distance D from the reference point F to the projective transformation area 70, the smaller the correction coefficient in the X direction is made, and the shorter the distance D, the larger the correction coefficient in the X direction is made.
[0094] Then, a sample image 60T is generated by correcting the sample image 60 so that the length in the X direction of the sample image 60 corresponds to the correction coefficient in the X direction and the length in the Y direction of the sample image 60 corresponds to the correction coefficient in the Y direction. This results in a sample image 60T that corresponds to the size of the projection transformation region 70.
[0095] Then, in step S116, the sample image 60T whose size has been corrected is projectively transformed onto the projective transformation region 70. As a result, the composite image after replacing the replacement region 44 becomes more natural.
[0096] Although the present invention has been described above using each embodiment, the present invention is not limited to the scope described in each embodiment. Various modifications or improvements can be made to each embodiment without departing from the gist of the present invention, and the forms in which such modifications or improvements are made are also included in the technical scope of the present invention.
[0097] For example, in the present embodiment, a case has been described in which projective transformation is used as the geometric transformation, but other transformation methods such as affine transformation may be used instead of projective transformation.
[0098] In the present embodiment, the information processing program 35A is installed in the storage unit 35, but the present invention is not limited to this. The information processing program 35A according to the present embodiment may be provided in a form recorded in a computer-readable storage medium. For example, the information processing program 35A according to the present embodiment may be provided in a form recorded in an optical disc such as a CD (Compact Disc)-ROM and a DVD (Digital Versatile Disc)-ROM, or in a form recorded in a semiconductor memory such as a USB (Universal Serial Bus) memory and a memory card. The information processing program 35A according to the present embodiment may be obtained from an external device via a communication line connected to the communication unit 34.
[0099] In the above embodiment, the term "processor" refers to a processor in a broad sense, including general-purpose processors (e.g., CPU: Central Processing Unit, etc.) and dedicated processors (e.g., GPU: Graphics Processing Unit, ASIC: Application Specific Integrated Circuit, FPGA: Field Programmable Gate Array, programmable logic device, etc.).
[0100] In addition, the operations of the processor in the above embodiments may be performed not only by one processor, but also by multiple processors located at physically separate locations working together. The order of the operations of the processor is not limited to the order described in the above embodiments, and may be changed as appropriate. [Explanation of symbols]
[0101] 30 Information processing device 35 Storage section 35A Information Processing Program 35B Indoor Image Database 35C Sample Image Database 40 Original images 44 Replacement area 50 Mask Images 60, 60T sample images 60A, 60B, 60C additional sample images 62 Extended sample images 70, 70A Projection transformation domain 80 Projection Transformation Images
Claims
1. A processor is provided. The processor, A geometric transformation area for generating a geometrically transformed image by geometrically transforming a sample image from a replacement area set in a part of an original image having a vanishing point is set using a reference point that can be regarded as the vanishing point; A geometrically transformed image is generated by geometrically transforming the sample image into the geometric transformation domain; The replacement region is replaced using the geometric transformation image. Information processing device.
2. The processor, A geometric transformation area is set by setting a plurality of specific points for specifying the geometric transformation area including the shape of the replacement area from the shape of the replacement area.
2. The information processing device according to claim 1.
3. The processor, A mask image is obtained in which the replacement area and the area other than the replacement area are expressed by a binary value and the mask image has the same size as the original image; The plurality of specific points are set based on the positional relationship between the reference points of the mask image and the replacement area.
3. The information processing device according to claim 2.
4. The processor, When a part of the geometric transformation area represented by the plurality of specific points protrudes from the mask image, the sample image is expanded in accordance with the protruding portion, and the expanded sample image is geometrically transformed into the geometric transformation area.
4. The information processing device according to claim 3.
5. The extended sample image is generated by adding an inverted image of the peripheral portion of the sample image to the peripheral portion as an additional sample image.
5. The information processing device according to claim 4.
6. The processor, The center point of the mask image is set as the reference point, and the plurality of specific points are set based on the positional relationship between the reference point and the replacement area.
6. The information processing device according to claim 3.
7. The processor, The position of the reference point is adjusted so that an angle of view determined by two straight lines respectively connecting the reference point and two specific points among the plurality of specific points is maximized.
6. The information processing device according to claim 3.
8. The processor, The position of the reference point is adjusted using the degree of coincidence between the replacement area and the geometric transformation area.
8. The information processing device according to claim 7.
9. The processor, The size of the sample image is adjusted according to the size of the geometric transformation area. The information processing device according to any one of claims 1 to 8.
10. The processor, Accepting a selection of the original image; Accepting a selection of the sample image; An image in which the replacement area is replaced using the geometrically transformed image is displayed. The information processing device according to any one of claims 1 to 9.
11. On the computer, A geometric transformation area for generating a geometrically transformed image by geometrically transforming a sample image from a replacement area set in a part of an original image having a vanishing point is set using a reference point that can be regarded as the vanishing point; A geometrically transformed image is generated by geometrically transforming the sample image into the geometric transformation domain; The replacement region is replaced using the geometric transformation image. An information processing program that executes processing.
Citation Information
Patent Citations
Image synthesizer
JP1994274650A
Image designing device
JP1995168872A
Image simulation device
JP1996287225A
Reform simulation system
JP2002352259A
Decoration simulation device, decoration simulation method and program
JP2017175523A
