Image processing device and image processing method
By generating defocus maps and selecting images based on focus, the technique enhances composite image quality, facilitating precise detection of minute deformities.
Patent Information
- Application Number
- JP2020058310
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-03-27
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-03-27
AI Technical Summary
Existing methods for generating composite images, such as panoramic photographs, result in deteriorated image quality at overlapping areas due to blur, affecting the detection of minute deformities.
A technique that generates a defocus map for each image, selects images based on defocus values, and composites them to minimize image quality deterioration in overlapping regions.
Reduces image quality degradation in overlapping areas, enabling clearer composite images for accurate detection of fine deformities like cracks.
Smart Images

Figure 0007546369000008 
Figure 0007546369000007 
Figure 0007546369000001
Abstract
Description
[Technical field]
[0001] The present invention relates to a technique for generating a composite image by aligning and combining a plurality of images. [Background technology]
[0002] In the inspection of buildings, a method for detecting abnormalities such as cracks from captured images is required to be in focus and clear. In addition, in order to detect small abnormalities in the inspection target area, a high-resolution image is required, so a method is used in which multiple high-resolution images are synthesized to generate a single synthetic image. When generating a synthetic image, as in Patent Document 1 and Patent Document 2, adjacent images are aligned using overlapping areas set at the time of shooting, and the images are synthesized. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP 2006-175620 A [Patent Document 2] Patent No. 6513309 Summary of the Invention [Problem to be solved by the invention]
[0004] However, the technologies disclosed in Patent Documents 1 and 2 aim to generate a composite image as a panoramic photograph like a landscape photograph, and perform processing to make the images appear smooth and inconspicuous. At this time, blending (processing to average the pixel values of each image for each pixel) is performed on the overlapping areas for alignment, but if one of the areas contains a degradation factor such as blurring, the image quality of the overlapping areas is affected. As a result, detection of small abnormalities from the images is affected.
[0005] The present invention provides a technique for reducing degradation in image quality in overlapping areas between images that arise when a composite image is generated by aligning and combining multiple images. [Means for solving the problem]
[0006] According to one aspect of the present invention, there is provided a method for generating a defocus map corresponding to each of a plurality of images acquired by capturing an image of a structure, the method comprising: a synthesis means for synthesizing the plurality of images based on the plurality of images and a defocus map corresponding to each of the plurality of images to generate a synthetic image; Equipped with The synthesis means generates the synthetic image using any one of the plurality of images based on a result of comparing defocus values in corresponding regions in defocus maps corresponding to the overlapping regions in the plurality of images, the corresponding regions being overlapped with each other in the plurality of images, for the overlapping regions corresponding to the same portion of the building. death, The synthesis means generates the overlapping region of the synthetic image based on a partial image corresponding to the overlapping region in an image corresponding to the defocus map having the corresponding region including a greater number of defocus values equal to or less than a predetermined threshold value among the plurality of images. do It is characterized by: Effect of the Invention
[0007] According to the configuration of the present invention, when a composite image is generated by aligning and combining multiple images, degradation of image quality in overlapping areas between images that occurs as a result of the alignment can be reduced. [Brief description of the drawings]
[0008] [Figure 1] FIG. 1 is a block diagram showing an example of the hardware configuration of an image processing device 100. [Diagram 2] 5A to 5C are diagrams illustrating generation of a composite image. [Diagram 3] FIG. 4A is a diagram showing an example of the configuration of a table, and FIG. 4B is a diagram showing an example of the configuration of overlap area information. [Figure 4]4 is a flowchart of a process performed by the image processing device 100 to generate a composite image by aligning and combining a plurality of images. [Diagram 5] 10 is a flowchart showing details of the process in step S403. [Figure 6] FIG. 13 is a diagram showing an example of a defocus map. [Figure 7] 2A is a diagram showing an example of a defocus map of an image 201, and FIG. 2B is a diagram showing an example of a defocus map of an image 202. FIG. [Figure 8] FIG. 13 is a diagram showing an example of a composite image. [Figure 9] 9A is a diagram showing a defocus map 901 of an image 801, and FIG. 9B is a diagram showing a defocus map 902 of an image 802. FIG. [Figure 10] 8 is a flowchart of processing performed by the image processing device 100 to generate a composite image 803 by aligning and combining an image 801 and an image 802. [Figure 11] FIG. 8 is a diagram for explaining a process for acquiring a partial region corresponding to an image 801 when the selected image is the image 801. [Figure 12] FIG. 13 is a diagram for explaining a third embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0009] Hereinafter, the embodiments will be described in detail with reference to the attached drawings. Note that the following embodiments do not limit the invention according to the claims. Although the embodiments describe a number of features, not all of these features are essential to the invention, and the features may be combined in any manner. Furthermore, in the attached drawings, the same reference numbers are used for the same or similar configurations, and duplicated descriptions are omitted.
[0010] [First embodiment] In this embodiment, a composite image is generated by aligning and compositing a plurality of images. At this time, a defocus map is generated for each image that shares an overlapping area between the images generated by the alignment, and an image to be used for the overlapping area of the composite image is selected from the respective images based on the defocus map of the respective images. Then, a partial image corresponding to the overlapping area in the selected image is obtained, and the obtained partial image is composited into the overlapping area in the composite image. First, an example of the hardware configuration of an image processing device 100 according to this embodiment will be described with reference to the block diagram of FIG. 1.
[0011] The CPU 101 executes various processes using computer programs and data stored in the RAM 103 and the ROM 102. As a result, the CPU 101 controls the operation of the entire image processing device 100, and executes or controls each process to be described later as being performed by the image processing device 100.
[0012] The ROM 102 stores setting data for the image processing device 100 that does not need to be rewritten, computer programs and data related to the basic operations of the image processing device 100, and computer programs and data related to the startup of the image processing device 100.
[0013] The RAM 103 has areas for storing computer programs and data loaded from the ROM 102 or HDD (hard disk drive) 104, and computer programs and data received from external devices via a communication unit 107. The RAM 103 further has a work area used when the CPU 101 executes various processes. In this way, the RAM 103 can provide various areas as needed.
[0014] The HDD 104 stores an OS (operating system) and computer programs and data for causing the CPU 101 to execute or control each process described below as being performed by the image processing device 100. The computer programs and data stored in the HDD 104 are loaded into the RAM 103 as appropriate under the control of the CPU 101, and become the subject of processing by the CPU 101.
[0015] Note that the HDD 104 is given as an example of a storage device, and other types of storage devices may be used in addition to or instead of the HDD 104. Such a storage device may be realized, for example, by a medium (recording medium) and a drive device that reads and writes computer programs and data from and to the medium. Known examples of such media include flexible disks (FDs), CD-ROMs, DVDs, USB memories, MOs, and flash memories. In addition, such a storage device may be a flash memory such as a USB memory, or a server device that is communicably connected to the image processing device 100.
[0016] The display unit 105 is a device that displays the processing results by the CPU 101 as images and characters, and is implemented, for example, as a liquid crystal display (LCD), an organic light emitting display (OLED), a touch panel screen, etc. Note that, although the image processing device 100 is configured to have the display unit 105 in FIG. 1, the configuration is not limited to this, and for example, the display unit 105 may be an external device that can communicate with the image processing device 100 via wired or wireless communication. Furthermore, the display unit 105 may be a projection device such as a projector that projects images and characters.
[0017] The operation unit 106 is a user interface including a keyboard, a mouse, and a touch panel screen, and allows the user to input various instructions to the CPU 101 by operating it.
[0018] The communication unit 107 functions as a communication interface for performing data communication with an external device, and the image processing device 100 can perform data communication with the external device via the communication unit 107.
[0019] CPU 101, ROM 102, RAM 103, HDD 104, display unit 105, operation unit 106, and communication unit 107 are all connected to a bus 110. Note that the hardware configuration shown in Fig. 1 is merely an example of a configuration capable of executing each process described below, and the definition may be modified or changed.
[0020] Next, a process performed by the image processing device 100 to generate a composite image by aligning and combining a plurality of images will be described with reference to the flowchart of FIG.
[0021] In step S401, the CPU 101 first acquires a plurality of images (input images) to be composited. The source of the plurality of images is not limited to a specific source. For example, the CPU 101 may read the plurality of images to be composited from the HDD 104, or may download the plurality of images to be composited from an external device via the communication unit 107. Also, an imaging unit may be provided inside or outside the image processing device 100, and the CPU 101 may acquire a plurality of images (captured images) captured by the imaging unit as the composite targets.
[0022] In this embodiment, it is assumed that a table 301, which specifies the vertical and horizontal sizes (width and height) of a composite image and the file names of images to be composited, as shown in Fig. 3(a) is registered in advance in HDD 104. Table 301 specifies that the width of the composite image is 5000 pixels and the height of the composite image is 2000 pixels. Table 301 also specifies that the file names of the images to be composited are "IMG_0013.jpg" and "IMG_0014.jpg".
[0023] Therefore, in step S401, CPU 101 refers to the file names of images to be synthesized registered in table 301, and acquires an image with file name "IMG_0013.jpg" and an image with file name "IMG_0014.jpg" from HDD 104, etc. In the following, it is assumed that the image with file name "IMG_0013.jpg" and the image with file name "IMG_0014.jpg" each have a width of 3000 pixels and a height of 2000 pixels. In addition, the images to be synthesized may be images that have been subjected to distortion correction and tilt correction.
[0024] Then, CPU 101 aligns the positions of the multiple images acquired as the objects to be synthesized (the image with the file name "IMG_0013.jpg" and the image with the file name "IMG_0014.jpg") and determines the positions of the multiple images in the synthesized image. Note that the alignment of the multiple images can be performed by a known method. For example, the SIFT (Scale Invariant Feature Transform) method is used to calculate feature points from each image, and the image-to-image matching of the feature points is performed to align the images.
[0025] In step S402, CPU 101 generates information for identifying an overlapping area between images that occurs as a result of the image alignment performed in step S401, and generates overlapping area information including the generated information.
[0026] Here, a case where an image with the file name "IMG_0013.jpg" and an image with the file name "IMG_0014.jpg" are aligned and combined to generate a composite image will be described with reference to FIG.
[0027] FIG. 2(a) shows an image 201 (an image with a file name "IMG_0013.jpg") and an image 202 (an image with a file name "IMG_0014.jpg") to be synthesized. FIG. 2(b) shows a synthesized image 203 generated by aligning and synthesizing the images 201 and 202. Here, as shown in FIG. 2(c), the image content included in an image region 211 in the image 201 is the same as (or has a high degree of similarity with) the image content included in an image region 212 in the image 202. However, as a result of aligning the images 201 and 202, the image regions 211 and 212 become regions that overlap each other (overlapping regions). The image regions 211 and 212 are used as alignment regions when synthesizing the images 201 and 201. As a result, as shown in FIG. 2(d), the image regions 211 and 212 correspond to an overlapping region 213 in the synthesized image 203.
[0028] Therefore, in step S402, CPU 101 generates overlapping area information including information defining image area 211 that corresponds to overlapping area 213 in image 201, and information defining image area 212 that corresponds to overlapping area 213 in image 202. An example of the configuration of overlapping area information is shown in Fig. 3(b).
[0029] The "overlap area ID" is a unique identifier for each overlap area issued by the CPU 101 for each overlap area that occurs as a result of the alignment of the images 201 and 202. As shown in Fig. 2, there is only one overlap area, the overlap area 213, that occurs as a result of the alignment of the images 201 and 202, and therefore in Fig. 3(b) the overlap area ID="0" issued by the CPU 101 for this one overlap area 213 is registered.
[0030] The "composite area coordinates" are the coordinates (2000, 0) of the upper left corner and the coordinates (3000, 2000) of the lower right corner of the overlap area 213 in the composite image 203 when the position of the upper left corner of the composite image 203 is set as the origin. Note that, since FIG. 3(b) shows an example in which the overlap area is rectangular, the composite area coordinates are coordinate information capable of identifying this rectangular area. However, the shape of the overlap area is not limited to a rectangle, and for any shape, information defining the overlap area in the composite image is registered in the overlap area coordinates.
[0031] "Image 1_file name" is the file name "IMG_0013.jpg" of image 201. "Image 1_overlapped area coordinates" are the coordinates (2000, 0) of the upper left corner and the coordinates (3000, 2000) of the lower right corner of image area 211 that corresponds to overlapped area 213 in image 201, when the position of the upper left corner of image 201 is set as the origin. "Image 2_filename" is the file name "IMG_0014.jpg" of image 202. "Image 2_overlapping area coordinates" are the coordinates (0, 0) of the upper left corner and the coordinates (1000, 2000) of the lower right corner of image area 212 that corresponds to overlapping area 213 in image 202, when the position of the upper left corner of image 202 is taken as the origin.
[0032] In this way, if the number of images sharing the overlap area corresponding to overlap area ID="0" is N (N is an integer greater than or equal to 2), the set of "image i_file name" and "image i_overlap area coordinates" for i=1, ..., N is associated with overlap area ID="0" and included in the overlap area information.
[0033] In step S403, CPU 101 performs processing to select an image to be used in overlapping area 213 from image 201 and image 202. Details of the processing in step S403 will be described later with reference to the flowchart in FIG.
[0034] In step S404, the CPU 101 extracts an image (partial image) in an image area corresponding to the overlap area 213 from the image selected in step S403, that is, an image in the image area 211 in the case of the image 201, and an image in the image area 212 in the case of the image 202. Then, the CPU 101 composites the extracted partial image into the overlap area 213 in the composite image 203, and outputs the composite image 203 obtained by the composite. The output destination of the composite image 203 is not limited to a specific output destination. For example, the CPU 101 may output the composite image 203 to the display unit 105 to display the composite image 203 on the display unit 105, or may output the composite image 203 to the HDD 104 to store the composite image 203 in the HDD 104. The CPU 101 may also control the communication unit 107 to output (transmit) the composite image 203 to an external device.
[0035] Next, details of the image selection process in step S403 above will be described with reference to the flowchart in Fig. 5. In the flowchart in Fig. 5, the processes of steps S503 to S508 are performed for each overlap area ID registered in the overlap area information. In this embodiment, since only one overlap area ID is registered in the overlap area information, the processes of steps S503 to S508 are performed for this one overlap area ID.
[0036] In step S503, CPU 101 selects one of the overlap area IDs registered in the overlap area information as a selected overlap area ID, and identifies the file name registered in the overlap area information in association with the selected overlap area ID. In the example of Fig. 3(b), file names "IMG_0013.jpg" and "IMG_0014.jpg" registered in the overlap area information in association with the selected overlap area ID="0" are identified. CPU 101 then acquires image 201 with file name "IMG_0013.jpg" and image 202 with file name "IMG_0014.jpg" from HDD 104, etc.
[0037] In step S504, the CPU 101 generates a defocus map indicating the degree of focus corresponding to each pixel of the image 201 and the image 202 acquired from the HDD 104 or the like in step S503.
[0038] An example of a defocus map generated for a certain image (image of interest) is shown in Fig. 6. The width and height of the defocus map 601 are the same as those of the image of interest. The value (defocus value) at a pixel position (x, y) of the defocus map 601 is a value obtained by quantifying, as an absolute value, the amount of shift in focus before and after the focus of an object captured at the pixel position (x, y) of the image of interest.
[0039] The defocus value can be obtained as information on the defocus amount at the pixel position by using an image plane phase difference imaging sensor when capturing an image of interest. It should be noted that a known technique can be used to obtain the defocus value information. For example, an autofocus technique using the amount of shift before and after the focus detected by an image plane phase difference imaging sensor has already been widely put to practical use.
[0040] In the defocus map 601 of FIG. 6, an area assigned with "0" indicates area 0 consisting of a collection of pixels having a defocus value of "0". In the defocus map 601 of FIG. 6, an area assigned with "1" indicates area 1 consisting of a collection of pixels having a defocus value of "1". In the defocus map 601 of FIG. 6, an area assigned with "2" indicates area 2 consisting of a collection of pixels having a defocus value of "2". Boundary 603 represents the boundary between the areas (area 0, area 1, area 2).
[0041] Region 0 is a region that is not out of focus in the focus unit of the imaging device that captured the image of interest. Region 1 is a region that is less focused (more blurred) than Region 0, and Region 2 is a region that is less focused than Region 1. In this way, regions with higher defocus values are regions with lower degrees of focus.
[0042] 7(a) and 7(b) show examples of defocus maps generated for the images 201 and 202, respectively. In the defocus map 701 generated for the image 201, a corresponding region 711 corresponding to the overlap region 213 (image region 211) includes regions 0, 1, and 2. In the defocus map 702 generated for the image 202, a corresponding region 712 corresponding to the overlap region 213 (image region 212) includes only region 0.
[0043] In step S505, the CPU 101 selects, as a selected image, one of the images 201 and 202 that has not been selected. Then, the CPU 101 obtains a defocus value within a corresponding region that corresponds to the overlap region 213 in the defocus map that corresponds to the selected image.
[0044] In step S506, CPU 101 determines whether or not both image 201 and image 202 have been selected as selected images. If the result of this determination is that both image 201 and image 202 have been selected as selected images, the process proceeds to step S508. On the other hand, if any image remains among image 201 and image 202 that has not yet been selected as a selected image, the process proceeds to step S505.
[0045] Through such processing, CPU 101 acquires a defocus value in a corresponding region 711 in defocus map 701 that corresponds to overlap region 213. Corresponding region 711 is a region in defocus map 701 that corresponds to image region 211 specified by "image 1_overlap region coordinates" in the overlap region information. CPU 101 also acquires a defocus value in a corresponding region 712 in defocus map 702 that corresponds to overlap region 213. Corresponding region 712 is a region in defocus map 702 that corresponds to image region 212 specified by "image 2_overlap region coordinates" in the overlap region information.
[0046] In step S508, the CPU 101 selects the image to be used for the overlapping region 213 of the composite image 203 from among the images 201 and 202 based on the defocus value within the corresponding region 711 of the defocus map 701 and the defocus value within the corresponding region 712 of the defocus map 702.
[0047] There are various methods for selecting the image to be used for the overlapping region 213 of the composite image 203 from among the images 201 and 202 based on the defocus value within the corresponding region 711 and the defocus value within the corresponding region 712.
[0048] For example, the CPU 101 counts the number N1 of pixels with a defocus value of "0" within the corresponding region 711 and the number N2 of pixels with a defocus value of "0" within the corresponding region 712. Then, if N1 > N2, the CPU 101 selects the image 201 as the image to be used for the overlapping region 213 of the composite image 203, and if N1 < N2, the CPU 101 selects the image 202 as the image to be used for the overlapping region 213 of the composite image 203. In the examples of FIGS. 7(a) and (b), as described above, the corresponding region 711 contains pixels with a defocus value other than "0", while the corresponding region 712 is composed only of pixels with a defocus value of "0", so N1 < N2. Therefore, in this case, the image 202 is selected as the image to be used for the overlapping region 213 of the composite image 203.
[0049] In the case where N1 = N2, for example, the CPU 101 counts the number M1 of pixels with a defocus value of "1" within the corresponding region 711 and the number M2 of pixels with a defocus value of "1" within the corresponding region 712. Then, if M1 > M2, the CPU 101 selects the image 201 as the image to be used for the overlapping region 213 of the composite image 203, and if M1 < M2, the CPU 101 selects the image 202 as the image to be used for the overlapping region 213 of the composite image 203.
[0050] Also, when M1 = M2, the CPU 101 counts the number of pixels P1 with a defocus value of "2" within the corresponding region 711 and the number of pixels P2 with a defocus value of "2" within the corresponding region 712. Then, if P1 > P2, the CPU 101 selects Image 201 as the image to be used for the overlapping region 213 of the composite image 203, and if P1 < P2, the CPU 101 selects Image 202 as the image to be used for the overlapping region 213 of the composite image 203.
[0051] Also, when P1 = P2, either Image 201 or Image 202 may be selected as the image to be used for the overlapping region 213 of the composite image 203, and the selection criteria in that case are not limited to specific selection criteria. For example, the older / newer one of Image 201 and Image 202 in terms of the shooting date and time may be selected, or it may be selected randomly.
[0052] Also, in addition to selecting the image to be used for the overlapping region 213 of the composite image 203 based on the defocus value within the corresponding region 711 and the defocus value within the corresponding region 712 from among Image 201 and Image 202, for example, the following methods can also be considered.
[0053] For example, the CPU 101 obtains the total value / average value AV1 of the defocus values within the corresponding region 711 and the total value / average value AV2 of the defocus values within the corresponding region 712. Then, if AV1 < AV2, the CPU 101 selects Image 201 as the image to be used for the overlapping region 213 of the composite image 203, and if AV1 > AV2, the CPU 101 selects Image 202 as the image to be used for the overlapping region 213 of the composite image 203.
[0054] Also, the image to be used for the overlapping region 213 of the composite image 203 may be selected based on the defocus values within the regions outside the corresponding regions (within the non-corresponding regions) in the respective defocus maps of Image 201 and Image 202.
[0055] For example, CPU 101 may apply “the ratio of the number of pixels having a defocus value of “0” in an area other than corresponding area 711 in defocus map 701 to the number of pixels in that area” to N1 above, and apply “the ratio of the number of pixels having a defocus value of “0” in an area other than corresponding area 712 in defocus map 702 to the number of pixels in that area” to N2 above.
[0056] For example, CPU 101 may apply "the number of pixels with a defocus value of "0" in areas other than corresponding area 711 in defocus map 701" to the above N1, and apply "the number of pixels with a defocus value of "0" in areas other than corresponding area 712 in defocus map 702" to the above N2.
[0057] Also, a distribution of pixels with a defocus value other than 0 may be obtained from the defocus maps of each of images 201 and 202, and the selection candidates for images to be used in overlap region 213 of composite image 203 may be narrowed down using the distribution. If non-zero defocus values are distributed in the defocus map of an image of interest, the image of interest may be unreliable due to noise generated during capture of the image of interest, etc., and therefore the image of interest is excluded from the selection candidates. Then, from the images remaining as selection candidates, an image to be used in overlap region 213 of composite image 203 is selected using any of the above methods.
[0058] Furthermore, the image to be used for the overlap region 213 of the composite image 203 from the images 201 and 202 is not limited to being selected based on the defocus values in the corresponding regions 711 and 712, but may be selected in the following manner, for example.
[0059] For example, a subject area in the image region of the composite image in which a defect such as a crack to be detected is likely to appear can be identified in advance, and image selection can be performed in a manner similar to that described above based on the defocus values of images 201 and 202 corresponding to that subject area.
[0060] In this manner, in this embodiment, a composite image can be generated in which an image with less blur is applied to the overlapping image area (overlapping area) when multiple images are aligned and combined. This makes it possible to obtain a composite image with an overlapping area made up of clear images, making it possible to detect finer defects such as cracks from such a composite image.
[0061] The so-called inspection process, which detects defects such as cracks from the composite image, may be performed by the image processing device 100 or an external device. In the former case, the image processing device 100 performs such an inspection process, and then displays the result of the inspection process in the form of images and text on the display unit 105. In the latter case, the image processing device 100 transfers the generated composite image to the external device or a device accessible by the external device.
[0062] [Second embodiment] The following describes the differences from the first embodiment, and unless otherwise specified below, it is assumed that the present embodiment is the same as the first embodiment. In the first embodiment, the image used for the overlapping region 213 of the composite image 203 is either the image 201 or the image 202. In this embodiment, a partial region having a predetermined defocus value is obtained from a corresponding region corresponding to the overlapping region 213 in the defocus maps of the images 201 and 202. Then, a combination of the images corresponding to the partial region in the images 201 and 202 is composited into the overlapping region 213 of the composite image 203.
[0063] Fig. 8 shows an example of a composite image according to this embodiment. In Fig. 8, images 801 and 802 are aligned and combined to generate a composite image 803. When aligning the images, an overlapping area occurs between images 801 and 802. In the overlapping area, an image in a partial area corresponding to area 811 in image 801 is combined with area 811, and in the overlapping area, an image in a partial area corresponding to area 812 in image 802 is combined with area 812.
[0064] 9(a) shows a defocus map 901 of an image 801, and FIG. 9(b) shows a defocus map 902 of an image 802. In the defocus map 901, a corresponding region 911 is a region corresponding to the overlapping region between the images 801 and 802, and in the defocus map 902, a corresponding region 912 is a region corresponding to the overlapping region between the images 801 and 802.
[0065] In this embodiment, a region in image 801 that corresponds to region 811 is determined based on the defocus value in corresponding region 911, and the image in the determined region is composited with region 811. Similarly, a region in image 802 that corresponds to region 812 is determined based on the defocus value in corresponding region 912, and the image in the determined region is composited with region 812.
[0066] The process performed by the image processing device 100 to generate a composite image 803 by aligning and combining an image 801 and an image 802 will be described with reference to the flowchart in Fig. 10. Note that in Fig. 10, the same process steps as those shown in Fig. 5 are assigned the same step numbers, and the description of these process steps will be omitted.
[0067] In step S1001, CPU 101 refers to the "defocus value within the corresponding region corresponding to overlap region 213 in the defocus map corresponding to the selected image" acquired in step S505, and acquires from the corresponding region an "area consisting of pixels with a defocus value of '0'" as a partial region.
[0068] When the selected image is image 801, the process for acquiring a partial region corresponding to the image 801 will be described with reference to Fig. 11. In step S1001, CPU 101 acquires the remaining region, excluding "rectangular region 1102 surrounding the region of pixels whose defocus value is not 0" shown in Fig. 11(b) from corresponding region 911 shown in Fig. 11(a), as partial region 1103 shown in Fig. 11(c). Similar process is performed on image 802, and as a result, a partial region corresponding to image 802 is acquired.
[0069] In step S1002, CPU 101 combines (splices together) a partial image in image 801 corresponding to the partial region acquired in step S1001 for defocus map 901 and a partial image in image 802 corresponding to the partial region acquired in step S1001 for defocus map 902 to generate an image to be synthesized in an overlapping region of synthesized image 803. The partial image in image 801 corresponding to the partial region acquired in step S1001 for defocus map 901 is synthesized in region 811. Moreover, the partial image in image 802 corresponding to the partial region acquired in step S1001 for defocus map 902 is synthesized in region 812.
[0070] When partial images are combined (stitched together), if there is an overlapping portion between the partial images, any partial image may be used for that portion. For example, as described in the first embodiment, a partial area of an image captured earlier may be used, or a partial area may be selected at random and used.
[0071] Furthermore, for portions of the overlapping region in the composite image 803 where no partial images exist (a collection of pixels with a defocus value other than 0), the portion with the lowest defocus value is selected from the corresponding portions of the images to be used for composition.
[0072] In this way, according to this embodiment, it is possible to assign clearer images to each of the finely divided regions of the overlapping region, and as a result, defects such as cracks can be detected more accurately.
[0073] In this embodiment, the "region of pixels whose defocus value is not 0" is represented by a rectangular region 1102 surrounding the region, and the partial region 1103 is obtained by excluding the rectangular region 1102 from the corresponding region 911. However, the region surrounding the "region of pixels whose defocus value is not 0" is not limited to a rectangular region, and may be a region of another shape. Furthermore, for region A whose defocus value is not 0, if the defocus value of region B corresponding to region A in another image is 0, region A may be replaced with region B.
[0074] [Third embodiment] In each of the above embodiments, as shown in Figures 2 and 8, an example of combining two adjacent images has been shown, but this is not limited to this, and similar processing can be applied when combining two or more images.
[0075] For example, a composite image 1211 shown in FIG. 12(a) is a composite image obtained by aligning and compositing images 1201, 1202, 1203, and 1204. As a result of such alignment, overlapping areas 1221 to 1224 where two images overlap, overlapping areas 1231 and 1232 where three images overlap, and overlapping area 1241 where four images overlap are generated as shown in FIG. 12(b). In such a case, image 1201 is used as an image to be composited in overlapping areas 1221, 1231, and 1241, and image 1203 is used as an image to be composited in overlapping areas 1222, 1223, and 1232. Note that an image to be composited in one overlapping area may be generated from a plurality of images, as in the second embodiment.
[0076] Note that the numerical values, processing timing, processing order, information structure, etc. used in the above explanation are given as examples to provide a concrete explanation, and are not intended to be limiting to these numerical values, processing timing, processing order, information structure, etc.
[0077] In addition, a part or all of the embodiments described above may be used in appropriate combination. In addition, a part or all of the embodiments described above may be used selectively.
[0078] (Other embodiments) The present invention can also be realized by a process in which a program for implementing one or more of the functions of the above-described embodiments is supplied to a system or device via a network or a storage medium, and one or more processors in a computer of the system or device read and execute the program. The present invention can also be realized by a circuit (e.g., ASIC) that implements one or more of the functions.
[0079] The invention is not limited to the above-described embodiments, and various modifications and variations are possible without departing from the spirit and scope of the invention. Accordingly, the following claims are appended to apprise the public of the scope of the invention. [Explanation of symbols]
[0080] 100: Image processing device 101: CPU 102: ROM 103: RAM 104: HDD 105: Display unit 106: Operation unit 107: Communication unit 110: Bus
Claims
1. A generating means for generating a defocus map corresponding to each of a plurality of images acquired by imaging the structure; a synthesis means for synthesizing the plurality of images based on the plurality of images and a defocus map corresponding to each of the plurality of images to generate a synthetic image; Equipped with the synthesis means generates the synthetic image using any one of the plurality of images based on a result of comparing defocus values in corresponding regions in defocus maps corresponding to the plurality of images, the corresponding regions being overlapped in the plurality of images in which the overlapped regions correspond to the same portion of the building; The synthesis means generates the overlapping region of the synthetic image based on a partial image corresponding to the overlapping region in an image corresponding to the defocus map having the corresponding region including a greater number of defocus values equal to or less than a predetermined threshold value among the plurality of images.
13. An image processing device comprising:
2. A generating means for generating a defocus map corresponding to each of a plurality of images acquired by imaging a structure; a synthesis means for synthesizing the plurality of images based on the plurality of images and a defocus map corresponding to each of the plurality of images to generate a synthetic image; Equipped with the synthesis means generates the synthetic image using any one of the plurality of images based on a result of comparing defocus values in corresponding regions in defocus maps corresponding to the plurality of images, the corresponding regions being overlapped in the plurality of images in which the overlapped regions correspond to the same portion of the building; The image processing device is characterized in that the synthesis means generates the overlapping area of the synthetic image based on a partial image corresponding to the overlapping area in an image corresponding to the defocus map in which the total value of the defocus values within the corresponding area is smaller among the multiple images.
3. A generating means for generating a defocus map corresponding to each of a plurality of images acquired by imaging a structure; a synthesis means for synthesizing the plurality of images based on the plurality of images and a defocus map corresponding to each of the plurality of images to generate a synthetic image; Equipped with the synthesis means generates the synthetic image using any one of the plurality of images based on a result of comparing defocus values in corresponding regions in defocus maps corresponding to the plurality of images, the corresponding regions being overlapped in the plurality of images in which the overlapped regions correspond to the same portion of the building; The image processing device is characterized in that the synthesis means generates the overlapping area of the synthetic image based on a partial image corresponding to the overlapping area in an image corresponding to the defocus map in which the average value of the defocus value within the corresponding area is smaller among the multiple images.
4. A generating means for generating a defocus map corresponding to each of the plurality of images; a synthesis means for synthesizing the plurality of images based on the plurality of images and a defocus map corresponding to each of the plurality of images to generate a synthetic image; Equipped with The image processing device is characterized in that the synthesis means generates an image of an overlapping area corresponding to an area shared by the multiple images in the synthetic image based on a defocus value within a non-corresponding area, which is an area other than the area corresponding to the overlapping area in a defocus map corresponding to each of the multiple images.
5. The image processing device according to claim 4, characterized in that the synthesis means determines a selection candidate image to be selected as an image to be used for an overlapping area corresponding to an area shared by the multiple images in the synthesized image among the multiple images based on a distribution of defocus values within a corresponding area corresponding to the overlapping area in a defocus map corresponding to each of the multiple images.
6. The image processing apparatus according to claim 1 , wherein the composite image is an image used for detecting an abnormality.
7. A generation step of generating a defocus map corresponding to each of a plurality of images acquired by imaging the structure; a synthesis step of synthesizing the plurality of images based on the plurality of images and a defocus map corresponding to each of the plurality of images to generate a synthetic image; Equipped with In the synthesis step, for overlapping regions in the plurality of images corresponding to the same portion of the building, the synthesis image is generated using any one of the plurality of images based on a result of comparing defocus values in corresponding regions in defocus maps corresponding to the overlapping regions, the corresponding regions being included in the defocus maps corresponding to the plurality of images; In the synthesis step, the overlapping region of the synthetic image is generated based on a partial image corresponding to the overlapping region in an image corresponding to the defocus map having the corresponding region including a larger number of defocus values equal to or less than a predetermined threshold value among the plurality of images.
13. An image processing method comprising:
8. A generation step of generating a defocus map corresponding to each of a plurality of images acquired by imaging a structure; a synthesis step of synthesizing the plurality of images based on the plurality of images and a defocus map corresponding to each of the plurality of images to generate a synthetic image; Equipped with In the synthesis step, for overlapping regions in the plurality of images corresponding to the same portion of the building, the synthesis image is generated using any one of the plurality of images based on a result of comparing defocus values in corresponding regions in defocus maps corresponding to the overlapping regions, the corresponding regions being included in the defocus maps corresponding to the plurality of images; An image processing method characterized in that, in the synthesis process, the overlapping area of the synthetic image is generated based on a partial image corresponding to the overlapping area in an image corresponding to the defocus map among the multiple images, in which the total value of the defocus values within the corresponding area is smaller.
9. A generation step of generating a defocus map corresponding to each of a plurality of images acquired by imaging a structure; a synthesis step of synthesizing the plurality of images based on the plurality of images and a defocus map corresponding to each of the plurality of images to generate a synthetic image; Equipped with In the synthesis step, for overlapping regions in the plurality of images corresponding to the same portion of the building, the synthesis image is generated using any one of the plurality of images based on a result of comparing defocus values in corresponding regions in defocus maps corresponding to the overlapping regions, the corresponding regions being included in the defocus maps corresponding to the plurality of images; An image processing method characterized in that, in the synthesis step, the overlapping area of the synthetic image is generated based on a partial image corresponding to the overlapping area in an image among the multiple images corresponding to the defocus map in which the average defocus value within the corresponding area is smaller.
10. A generating step of generating a defocus map corresponding to each of the plurality of images; a synthesis step of synthesizing the plurality of images based on the plurality of images and a defocus map corresponding to each of the plurality of images to generate a synthetic image; Equipped with An image processing method characterized in that, in the synthesis process, an image of an overlapping area corresponding to an area shared by the multiple images in the synthetic image is generated based on a defocus value within a non-corresponding area, which is an area other than the area corresponding to the overlapping area in a defocus map corresponding to each of the multiple images.
11. A computer program for causing a computer to function as each of the means of the image processing device according to any one of claims 1 to 6.
Citation Information
Patent Citations
Printing apparatus, data processing apparatus and printing method
JP2006175620A
Image synthesis device, image synthesis method, and image synthesis program
JP6513309B2
Image processing system, server device, image processing method, and image processing program
WO2019031086A1
