WO2013146566A1 - 画像処理装置および方法、並びにプログラム - Google Patents
画像処理装置および方法、並びにプログラム Download PDFInfo
- Publication number
- WO2013146566A1 WO2013146566A1 PCT/JP2013/058221 JP2013058221W WO2013146566A1 WO 2013146566 A1 WO2013146566 A1 WO 2013146566A1 JP 2013058221 W JP2013058221 W JP 2013058221W WO 2013146566 A1 WO2013146566 A1 WO 2013146566A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- path
- minimum cost
- minimum
- route
- Prior art date
Links
- 238000012545 processing Methods 0.000 title claims abstract description 50
- 238000000034 method Methods 0.000 title claims abstract description 38
- 238000001514 detection method Methods 0.000 claims abstract description 14
- 238000003672 processing method Methods 0.000 claims abstract description 5
- 230000008569 process Effects 0.000 claims description 24
- 238000004364 calculation method Methods 0.000 claims description 10
- 238000005516 engineering process Methods 0.000 description 41
- 230000009467 reduction Effects 0.000 description 35
- 238000007726 management method Methods 0.000 description 30
- 238000012217 deletion Methods 0.000 description 16
- 230000037430 deletion Effects 0.000 description 16
- 101100522111 Oryza sativa subsp. japonica PHT1-11 gene Proteins 0.000 description 9
- 239000011159 matrix material Substances 0.000 description 9
- 230000009466 transformation Effects 0.000 description 9
- 230000000717 retained effect Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000003384 imaging method Methods 0.000 description 3
- 238000004519 manufacturing process Methods 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000005304 joining Methods 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 230000011218 segmentation Effects 0.000 description 2
- 230000001174 ascending effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000015556 catabolic process Effects 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 238000005520 cutting process Methods 0.000 description 1
- 238000006731 degradation reaction Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000014759 maintenance of location Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
- 238000009966 trimming Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
- G06T3/4038—Image mosaicing, e.g. composing plane images from plane sub-images
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/698—Control of cameras or camera modules for achieving an enlarged field of view, e.g. panoramic image capture
-
- G—PHYSICS
- G03—PHOTOGRAPHY; CINEMATOGRAPHY; ANALOGOUS TECHNIQUES USING WAVES OTHER THAN OPTICAL WAVES; ELECTROGRAPHY; HOLOGRAPHY
- G03B—APPARATUS OR ARRANGEMENTS FOR TAKING PHOTOGRAPHS OR FOR PROJECTING OR VIEWING THEM; APPARATUS OR ARRANGEMENTS EMPLOYING ANALOGOUS TECHNIQUES USING WAVES OTHER THAN OPTICAL WAVES; ACCESSORIES THEREFOR
- G03B37/00—Panoramic or wide-screen photography; Photographing extended surfaces, e.g. for surveying; Photographing internal surfaces, e.g. of pipe
- G03B37/04—Panoramic or wide-screen photography; Photographing extended surfaces, e.g. for surveying; Photographing internal surfaces, e.g. of pipe with cameras or projectors providing touching or overlapping fields of view
Definitions
- the present technology relates to an image processing apparatus, method, and program, and more particularly, to an image processing apparatus, method, and program that can obtain a higher-quality panoramic image.
- a technique for generating a panoramic image using a plurality of captured images continuously captured while rotating the camera is known (for example, see Patent Document 1).
- Such a panoramic image is generated by arranging and combining a plurality of captured images.
- the moving subject when a moving subject is included in a captured image, the moving subject may be divided at a joint between adjacent captured images.
- the obtained panoramic image includes a segmented moving subject, and the panoramic image does not look good. That is, the quality of the panoramic image is degraded.
- the present technology has been made in view of such a situation, and makes it possible to obtain a higher-quality panoramic image.
- An image processing apparatus is an image processing apparatus that generates a panoramic image by connecting a plurality of captured images, and calculates a difference information between the adjacent captured images, Based on the positional relationship of each of the captured images and the difference information, a directed graph generating unit that generates a directed graph using the degree of detection of a moving subject as energy, and an Nth image from any starting point of the directed graph generated from the captured image
- a route search unit that searches for a minimum cost route to the end position of the captured image
- a panoramic image generation unit that generates a panoramic image by connecting regions of the captured images determined by the minimum cost route.
- the directed graph generation unit generates the directed graph based on the first to n-th captured images for n where n ⁇ N, and the route search unit causes the n-th graph in the directed graph to Each position corresponding to each position of the photographed image is set as an end point, and for each end point, the minimum cost path from the start point to the end point is searched, and one sheet is obtained based on the search result of the minimum cost path.
- the minimum cost path from the start point to the end position can be searched by repeatedly performing the process of searching for the minimum cost path for the directed graph generated from the first to (n + 1) th captured images. .
- the image processing apparatus includes an image holding unit that holds image data of the captured image, and a search for the minimum cost path for the directed graph generated from the first to nth captured images.
- a management unit that manages the image data of the photographed image in the image holding unit so that only the image data of the region of the photographed image indicated by the minimum cost path is held in the image holding unit; Can be provided.
- the management unit After the minimum cost path is searched for the directed graph generated from the first to nth captured images, the management unit has the highest priority among the minimum cost paths. It is possible to delete the image data of the area of the captured image that is indicated only by the low minimum cost path and not indicated by the other minimum cost path from the image holding unit.
- the management unit can repeatedly perform the process of deleting the image data based on the priority until the amount of image data held in the image holding unit reaches a predetermined data amount.
- the area of the captured image determined by the minimum cost path from the start point to the end position, including the minimum cost path for the directed graph generated from the first to nth captured images. Can be determined by the degree of risk that the moving subject on the photographed image will be divided.
- the management unit includes a total value of costs up to the minimum cost route, a difference between total values of the costs of the minimum cost routes adjacent to each other, a position of the end point of the minimum cost route, and a position of the minimum cost route adjacent to each other.
- the priority is determined based on at least one of the difference in the position of the end point or at least one of the image data amount of the area of the photographed image that is indicated only by the minimum cost path and not indicated by the other minimum cost path. Can be made.
- An image processing method or program is an image processing method or program for connecting a plurality of captured images to generate a panoramic image, calculating difference information between the adjacent captured images, Based on the positional relationship of the captured image and the difference information, a directed graph is generated with the detection degree of the moving subject as energy, and from the arbitrary start point of the directed graph generated from the captured image, the end of the Nth captured image A step of searching for a minimum cost route to a position and connecting the areas of the captured images determined by the minimum cost route to generate the panoramic image.
- difference information between the captured images adjacent to each other is calculated, and the positional relationship between the captured images and the difference information are calculated.
- a directed graph with the detection level of the moving subject as energy is generated, and a minimum cost path from an arbitrary start point of the directed graph generated from the captured image to the end position of the Nth captured image is searched for,
- the panoramic image is generated by joining the areas of the captured images determined by the minimum cost path.
- a higher quality panoramic image can be obtained.
- a photographing device such as a camera in one direction.
- each photographed image is photographed so that the photographed images adjacent to each other have overlapping portions, that is, the same subject is included.
- one panoramic image is generated from a plurality of captured images obtained in this way.
- camera shake correction is performed on the captured image, blur of the captured image due to camera shake during shooting is corrected, and for each captured image, a homogeneous transformation matrix indicating the positional relationship with the first captured image is obtained. It is done. By this homogeneous transformation matrix, the relative positional relationship of each captured image can be obtained.
- the captured image is projected (mapped) onto the cylindrical surface and trimmed as appropriate. This is because if the photographing apparatus does not move in one direction at the time of taking a photographed image, the vertical position of each photographed image will be shifted. Trimming is performed so that the positions are aligned.
- a captured image projected on the cylindrical surface is particularly referred to as a projected image.
- a higher-quality panoramic image is obtained by determining a joint between adjacent captured images (projected images) so that the moving subject is not divided as much as possible. It is to be made.
- the horizontal direction indicates the circumferential direction (hereinafter also referred to as Cx direction) of the cylindrical surface onto which each captured image is projected, and the vertical direction indicates the captured image of each captured image (projected image). This indicates the number, that is, the number of the captured image.
- the Cx direction is also a moving (rotating) direction of the photographing apparatus at the time of photographing a photographed image, and hereinafter, a direction in which the photographing apparatus moves among directions parallel to the moving direction of the photographing apparatus is also referred to as a + Cx direction.
- the direction opposite to the + Cx direction is also referred to as the ⁇ Cx direction.
- projection images MP (1) to MP (10) are obtained by projecting (mapping) the first to tenth captured images onto a cylindrical surface.
- the same moving subject V11 is included in each projection image MP (n) (where 1 ⁇ n ⁇ 10).
- the position in the Cx direction in the projection image MP (n) is represented by Cx (n)
- the joint between adjacent projection images MP (n) is assumed to be perpendicular to the Cx direction on the cylindrical surface, and the panoramic image is obtained by joining the projected images in the order of shooting time.
- the first projection image MP (1) and the second projection image MP (2) adjacent to each other are overlapped in the Cx direction (overlapping regions). ), The moving subject is detected.
- difference information between the pixels of the projected image MP (1) and the projected image MP (2) at that position is obtained.
- the difference information is a difference absolute value of the pixel value of the pixel.
- the difference information obtained in this way is information indicating the likelihood of a moving subject in the overlapping area. The larger the difference information, the higher the possibility that the overlapping area includes a moving subject.
- the position of the joint between the projection image MP (1) and the projection image MP (2) is determined. Without determination, moving subject detection is performed on an overlapping area of other projected images.
- Moving object detection is performed sequentially on the overlapping area of the ninth and tenth projection images.
- a moving subject map is generated based on the difference information obtained as a result.
- the sum of the difference information of each position having the same position in the Cx direction is obtained, and the value of the pixel of the moving subject map at the position in the Cx direction is obtained.
- the moving subject map is generated by using the sum of the difference information.
- the moving subject maps HM 1 and HM 2 are moving subject maps obtained by performing moving subject detection on the overlapping area of the first projection image MP (1) and the second projection image MP (2). is there.
- the value of the pixel at the position Cx in the moving subject maps HM 1 and 2 is the sum of absolute differences of the pixel values of the pixels of the projection image MP (1) and the projection image MP (2) at the position Cx, that is, the sum of the difference information. This indicates the degree of likelihood of the area of the moving subject at the position Cx.
- the value of the pixel at the position Cx of the moving subject map indicates the high risk of moving subject division that occurs when the position Cx is the position of the joint between the projected images.
- a directed graph having nodes at positions Cx (n) of the projection images MP (n) arranged on the cylindrical surface may be used.
- parts corresponding to those in FIG. 2 are denoted by the same reference numerals, and description thereof is omitted.
- the directed graph shown in FIG. 3 is a directed graph having nodes at positions determined by the position in the Cx direction and the shooting number, where the horizontal direction is the position in the Cx direction and the vertical direction is the shooting number of the shot image (projected image).
- the cost from the node at the position Cx (n ⁇ 1) to the node at the position Cx (n) in the directed graph that is, the cost (energy) from a certain node to a node adjacent in the vertical direction of the node is expressed as a moving subject map HM.
- the value of the pixel at the position Cx of n ⁇ 1, n is used. Further, the cost between nodes arranged in the Cx direction in the directed graph is set to zero.
- the cost between nodes arranged in the Cx direction is 0 because if pixels of the same projection image are used as pixels arranged in the Cx direction on the panoramic image, the image of the moving subject is divided at that position. This is because there is no failure.
- the route PT11 is a route that minimizes the total cost (hereinafter also referred to as the total cost).
- the position of the straight line portion in the vertical direction in the figure on the path PT11 is the position of the joint between the projected images.
- the position Cx corresponds to the projection image MP (n ⁇ 1) and the projection image MP (n). It is said to be the position of the joint.
- Equation (1) the smaller value of “S (Cx (n) -1)” and “S (Cx (n-1)) + Cost (Cx (n))” is the total cost.
- S (Cx (n)) (hereinafter also referred to as the minimum total cost S (Cx (n))).
- each projection image is obtained. It is possible to find the optimal joint position between.
- the line in the Cx direction among the broken lines representing the path PT11 indicates the region on the projection image MP (n) used for generating the panoramic image, and the vertical line among the broken lines representing the path PT11.
- the line indicates the position of the joint between the projected images.
- the joint between the projection image MP (1) and the projection image MP (2) determined by the path PT11 A region up to the position of is a cutout region KR (1) used for generating a panoramic image.
- the projection image MP (2) and the projection image MP (3) are determined from the joint position between the projection image MP (1) and the projection image MP (2) determined by the path PT11.
- the area up to the position of the joints) is the cutout area KR (2).
- the cutout areas KR (1) to KR (10) obtained in this way are connected (synthesized) to generate a panoramic image.
- the moving subject is determined by each joint determined by the path PT11.
- V11 is not divided. That is, since the obtained panoramic image does not include the divided moving subject V11, a high-quality panoramic image can be obtained.
- a route having the minimum total cost may be searched by dynamic programming.
- a directed graph is generated for all the projected images, and a joint having the minimum total cost in the directed graph is searched to determine a joint between the projected images.
- the position of the joint between the projection image MP (9) and the projection image MP (10) must be a position on the right side in the drawing with respect to the position of the joint between the projection image MP (9) and the projection image MP (8). Therefore, there are fewer positions that can be candidates for the joint position. That is, when the joint between the projected images is sequentially determined, the projection image captured later becomes more restrictive when determining the position of the joint, and the risk of dividing the moving subject increases.
- the problem of determining the position of the joint between the projected images is solved as a multistage determination problem by dynamic programming, thereby suppressing an increase in the amount of calculation required for determining the position of the joint.
- the problem of determining the position of the joint is made a multistage determination problem, so that the amount of memory used for image retention can be reduced by taking advantage of the characteristics. That is, if the problem of determining the position of the joint is a multistage determination problem with restrictions, the amount of memory used can be reduced by utilizing the principle of optimality.
- the principle of optimality is to guarantee that when the whole is optimized, that part is also optimized.
- the problem of determining the position of joints between projected images, that is, the cut-out area guarantees that each route up to the middle of the optimum route on the directed graph to be finally determined is the optimum route to that point. To do.
- the overlapping region of the first and second projection images It is possible to detect a moving subject in the overlapping area of the second and third projection images and the overlapping area of the third and fourth projection images.
- each position Cx ( Assume that all the minimum cost routes up to 4) have been obtained.
- the minimum cost route is a route having a minimum total cost.
- the optimum route finally obtained that is, the minimum cost route from the start point to the end point of the directed graph must always include one of the minimum cost routes to each position Cx (4).
- the image data of the region that will ultimately be the cutout region is always secured. That is, the image data of the cut-out areas of the first to fourth projection images used for generating the panoramic image is held.
- the eighth projection image is obtained.
- a minimum cost path to each position Cx (8) of MP (8) is obtained.
- the optimum route finally obtained that is, the minimum cost route from the start point to the end point of the directed graph, must always include one of the minimum cost routes to each position Cx (8).
- the minimum cost path to each position Cx (n) of the newly acquired n-th projection image MP (n) is obtained, and only the image data of the area of the projection image through which each minimum cost path passes is obtained. If the image data in the other area is retained and deleted, the amount of memory used can be greatly reduced.
- the minimum cost path from the starting point of the directed graph to each position Cx (n) is obtained at each position Cx (n) and is not included in these minimum cost paths.
- the image data in the image area is deleted. In other words, it is assumed that image data of an area other than the area indicated by each minimum cost path is deleted from the image data of each projection image.
- the minimum cost path to each position Cx (n) is prioritized with respect to the minimum cost path to be held in consideration of the moving subject division risk, the memory amount reduction effect, and the like. did.
- the image data in the image area indicated by only the minimum cost route is deleted from the memory in order from the lowest cost route having the lowest priority.
- P (Cx (n)) be the priority for holding information on the minimum cost path Path (Cx (n)) from the starting point of the directed graph to each position Cx (n).
- P (Cx (n)) be the priority for holding information on the minimum cost path Path (Cx (n)) from the starting point of the directed graph to each position Cx (n).
- the position Cx (8) minimum to each position 880 to 939.
- the minimum total cost S (Cx (8)) of the cost path is 55.
- the minimum total cost S (Cx (8)) of the cost path is 10.
- Each region of the projection image included in the path is smoothly connected. That is, it represents a joint where the risk of segmentation of the moving subject is lower.
- each image area is smoother than other routes. Since it is not possible to obtain a connected panoramic image, such a route may be deleted.
- the value of the minimum total cost S (Cx (n)) among the minimum cost paths to each position Cx (n) is calculated.
- FIG. 8 shows a directed graph at the time when up to the eighth captured image is captured, that is, up to the eighth projected image MP (8).
- the route adopted in this manner is less suitable than the route that was originally regarded as the optimum minimum cost route, but is almost the optimum route.
- the eighth projection image MP (8) When the eighth projection image MP (8) is obtained, it is not possible to specify which route will ultimately be the minimum cost route. Therefore, in the present technology, the minimum total cost S (Cx (8)) of the route to each position Cx (8) of the eighth projection image MP (8) having the largest photographing number currently obtained is considered. The route having the maximum minimum total cost S (Cx (8)) is deleted.
- the difference value ⁇ S (Cx (n) is excluded except for the position of the left end of the projection image at a position that is a candidate for a joint between the projection images, that is, at a position where the path from the starting point of the directed graph changes in the direction perpendicular to the Cx direction. ) Is a negative value.
- the increase in the cost of the route passing through a certain position, that is, the increase in the moving subject division risk may be small. Therefore, in the present technology, a route with a smaller absolute value of the difference value ⁇ S (Cx (n)) has a smaller priority P (Cx (n)) of the route.
- FIG. 12 shows a directed graph at the time when up to the eighth projection image MP (8) is obtained.
- the difference value ⁇ S (Cx (8)) of the route to each position Cx (8) of the eighth projection image MP (8) having the largest imaging number obtained at the present time is considered.
- ⁇ S (Cx (8) 940)
- is small, and the panorama is deleted while the memory cost is reduced by deleting the minimum cost path that is less affected by the deletion. Degradation of the image quality is suppressed.
- the minimum cost path Path (Cx (8) 880) having the minimum absolute value
- is deleted.
- ⁇ S (Cx (8) 880)
- 20).
- ⁇ S (Cx (8) 880)
- the minimum cost path Path (Cx (8) 1140) having a smaller absolute value
- is deleted from these two paths.
- ⁇ S (Cx (8) 1140)
- 65).
- ⁇ S (Cx (8) 1140)
- the minimum cost path from the starting point of the directed graph to each position Cx (n) of the projection image MP (n) is determined. Then, from these minimum cost paths, candidates for the position of the joint between the projection image MP (n ⁇ 1) and the projection image MP (n) are determined.
- the position of the joint that is a candidate is the position of the joint between the projected image MP (n) and the projected image MP (n + 1) as the Cx coordinate of the position is larger, that is, the position is closer to the + Cx direction.
- the selection range becomes narrower. Then, there is a high possibility that the route from the start point of the directed graph is a route with a high risk of dividing the moving subject in the (n + 1) th and subsequent projection images.
- the route P having higher position Cx (n) has a priority P (Cx (n)) of the route. Small value.
- FIG. 16 shows a directed graph at the time when up to the eighth projection image MP (8) is obtained.
- the minimum cost path from the start point to the end point of the directed graph is originally deleted. It may also include a route.
- the position that is a candidate for the joint that is, the position Cx (8) is considered, and the range of positions that can be candidates for the joint position of the next ninth projection image MP (9) is as wide as possible.
- the minimum cost route having the position Cx (8) closest to the + Cx direction is deleted.
- the memory amount can be efficiently reduced by deleting from the least cost path that is least likely to be adopted.
- the route having the maximum position Cx (8) is further deleted from the current three routes, that is, the substantial three routes remaining in the state shown in FIG.
- the route having a smaller difference value ⁇ Cx (n) has a smaller priority P (Cx (n)) of the route.
- FIG. 20 shows a directed graph at the time when up to the eighth projection image MP (8) is obtained.
- it is assumed that there is no difference value ⁇ Cx (8) for the minimum cost path Path (Cx (8) 610) located on the leftmost side.
- the minimum cost route from the start point to the end point of the directed graph includes the deleted minimum cost route. There is a possibility.
- the difference value ⁇ Cx (n) is taken into consideration, and the difference value is set so that the selection range of the position that becomes the position candidate of the joint after the next ninth projection image MP (9) is as wide as possible.
- the minimum cost path that minimizes ⁇ Cx (n) is deleted.
- the image data of the image area indicated only by the target path is the amount of image data that can be reduced by reducing the target path.
- the priority P (Cx (n)) of the route is set to a smaller value as the route has a larger image area length A (Cx (n)).
- FIG. 24 shows a directed graph at the time when up to the eighth projection image MP (8) is obtained.
- the image data is deleted from the memory with the minimum cost route to a certain position as a representative.
- the minimum cost path from the start point to the end point of the directed graph was originally deleted. It may also include a cost path.
- the minimum cost path having the larger image area length A (Cx (8)) is deleted from the two paths remaining in the state shown in FIG.
- the minimum image area length A (Cx (8)) is larger.
- maintaining image data can further be reduced.
- the minimum total cost S (Cx (n)), the difference value ⁇ S (Cx (n)) of the minimum total cost S (Cx (n)), the end point of the route It has been described that there is a position Cx (n), a difference value ⁇ Cx (n) of the position Cx (n) that is a joint candidate, and an image region length A (Cx (n)). In the present technology, these factors are comprehensively determined, and the value of the priority P (Cx (n)) of the minimum cost route to each position Cx (n) is determined by the following equation (2).
- ⁇ 1 to ⁇ 5 are the minimum total cost S (Cx (n)), absolute value
- ⁇ is a parameter indicating the degree of influence by other factors different from the above five elements, and ⁇ > 0.
- the priority obtained in Expression (2) is determined at each joint position indicated by the route. It shows the degree of risk that the moving subject on the projected image will be divided when the projected images are joined together. In other words, it is predicted that the lowest cost route with lower priority has a higher risk of dividing a moving subject.
- the final minimum cost path including the minimum cost path referred to here is a node from the node corresponding to the start end of the first projection image to the node corresponding to the end position of the last projection image in the directed graph.
- the least cost path is a node from the node corresponding to the start end of the first projection image to the node corresponding to the end position of the last projection image in the directed graph.
- the processing to delete the route selected based on the priority P (Cx (n)) will cause the used memory amount to be within the upper limit. It will be repeated until it fits.
- the present technology even when there is an upper limit on the amount of used memory, by deleting some routes according to the priority P (Cx (n)), the operation at the time of panorama image generation is performed. Instead of slightly increasing the risk of subject separation, the amount of memory for storing image data can be further reduced. As a result, a high-quality panoramic image can be obtained as much as possible while considering the balance between the amount of memory used and quality (image quality).
- FIG. 28 is a diagram illustrating a configuration example of an embodiment of an image processing apparatus to which the present technology is applied.
- the unit 28 includes an image acquisition unit 21, a projection unit 22, an image holding unit 23, a moving subject map generation unit 24, a directed graph generation unit 25, a minimum cost route search unit 26, a management unit 27, and a panoramic image generation.
- the unit 28 is configured.
- the image acquisition unit 21 sequentially acquires N photographed images continuously photographed by the photographing device and supplies them to the projection unit 22.
- N photographed images are images obtained by photographing while rotating the photographing apparatus, for example.
- the projection unit 22 acquires a homogeneous transformation matrix indicating the positional relationship between the captured images and a focal length F at the time of shooting the captured image, and acquires an image based on the acquired homogeneous transformation matrix and the focal length F.
- the captured image from the unit 21 is projected onto the cylindrical surface to generate a projection image.
- the projection unit 22 supplies the generated projection image, more specifically, image data of the projection image to the image holding unit 23.
- the focal length F of each captured image is assumed to be the same value.
- the image holding unit 23 includes a memory and the like, holds the image data of the projection image supplied from the projection unit 22, and stores the held image data as necessary, such as a moving subject map generation unit 24 and a panoramic image generation unit. 28.
- the image holding unit 23 deletes the held image data according to the control of the management unit 27.
- the moving subject map generation unit 24 generates a moving subject map based on the projection image supplied from the image holding unit 23 and supplies the moving subject map to the directed graph generation unit 25.
- the directed graph generation unit 25 generates a directed graph based on the moving subject map supplied from the moving subject map generation unit 24, and supplies the directed graph to the minimum cost route search unit 26 and the management unit 27.
- the minimum cost route search unit 26 searches for the minimum cost route based on the directed graph supplied from the directed graph generation unit 25, supplies the minimum cost route to the management unit 27, and obtains the final minimum cost obtained for the Nth projection image.
- the route is supplied to the panoramic image generation unit 28.
- the minimum cost route search unit 26 refers to the route adopted at the present time supplied from the management unit 27 and selects a route including any of those routes as the minimum cost route. A route.
- the management unit 27 manages the image data held in the image holding unit 23 based on the directed graph supplied from the directed graph generation unit 25 and the search result from the minimum cost route search unit 26. That is, the management unit 27 instructs to delete the image data held in the image holding unit 23. In addition, the management unit 27 supplies the minimum cost route search unit 26 with a route that is currently employed among the minimum cost routes, that is, a route that has not been deleted.
- the panorama image generation unit 28 generates and outputs a panorama image based on the minimum cost route supplied from the minimum cost route search unit 26 and the projection image supplied from the image holding unit 23.
- step S ⁇ b> 11 the image acquisition unit 21 acquires the n-th (1 ⁇ n ⁇ N) captured image captured by the imaging device and supplies the acquired image to the projection unit 22.
- step S12 the projection unit 22 acquires a homogeneous transformation matrix indicating the positional relationship between the first and n-th captured images and the focal length F of the n-th captured image.
- step S13 the projection unit 22 generates a projection image by projecting (mapping) the captured image from the image acquisition unit 21 onto the cylindrical surface based on the acquired homogeneous transformation matrix and the focal length F. That is, the projection unit 22 maps the n-th captured image at a position determined by the homogeneous transformation matrix on the cylindrical surface having the radius of the focal length F, and sets the mapped captured image as the n-th projected image. . Thereby, for example, the projection image MP (n) of FIG. 1 is obtained.
- the projection unit 22 supplies the image data of the projection image to the image holding unit 23 to hold it.
- the moving subject map generation unit 24 acquires and temporarily holds the image data.
- step S14 the moving subject map generation unit 24 generates a moving subject map based on the image data of the projection image acquired from the image holding unit 23, and supplies the moving subject map to the directed graph generation unit 25.
- the moving subject map generation unit 24 sets each position in the overlapping region of the (n ⁇ 1) th projection image MP (n ⁇ 1) and the nth projection image MP (n) at that position.
- the difference information of the pixel values of the pixels of a certain projection image MP (n ⁇ 1) and projection image MP (n) is obtained.
- the moving subject map generation unit 24 obtains the sum of the difference information of each position where the positions in the Cx direction in the overlapping region are the same, and obtains the pixel value of the moving subject map at the position in the Cx direction.
- a moving subject map is generated by using the sum of the difference information. That is, the difference information at each position is accumulated in a direction perpendicular to the Cx direction. Thereby, for example, the moving subject map HM n ⁇ 1, n of FIG. 2 is obtained.
- the unit 26 and the management unit 27 To the unit 26 and the management unit 27.
- the directed graph generation unit 25 arranges the projection images MP (k) from the first projection image to the n-th projection image based on the positional relationship in the Cx direction of the projection images and the imaging number. Go. That is, the positional relationship in the Cx direction of each projection image MP (k) is the positional relationship indicated by the homogeneous transformation matrix, and the projection images are arranged in the order of the shooting numbers in the direction perpendicular to the Cx direction. . And the directed graph production
- the cost (energy) between nodes adjacent in the Cx direction of the directed graph is 0, and the cost (energy) between nodes adjacent in the direction perpendicular to the Cx direction is the position in the Cx direction and those nodes.
- the cost from the position Cx (n ⁇ 1) to the position Cx (n) is the value of the pixel at the position Cx (n) in the moving subject map HM n ⁇ 1, n .
- step S ⁇ b> 16 the minimum cost route search unit 26 uses, for each position Cx (n) of the directed graph supplied from the directed graph generation unit 25, a dynamic cost planning or the like as the minimum cost route from the starting point of the directed graph to the position Cx (n).
- the starting point of the directed graph is the position of the end on the ⁇ Cx direction side of the first projection image MP (1).
- the minimum cost route search unit 26 refers to the minimum cost route to the position Cx (n ⁇ 1) of the directed graph supplied from the management unit 27, and includes a route including any of these minimum cost routes. As the minimum cost path to each position Cx (n).
- step S ⁇ b> 17 the management unit 27 determines a part of the projection image held in the image holding unit 23 based on the directed graph supplied from the directed graph generation unit 25 and the search result from the minimum cost route search unit 26. Delete the image data.
- the image holding unit 23 deletes a part of the held image data in response to an instruction from the management unit 27.
- the management unit 27 deletes image data of other regions other than the region of the projection image through which each minimum cost path from the starting point of the directed graph to each position Cx (n) passes, to the image holding unit 23. Instruct. That is, the deletion of the image data is instructed so that only the image data of the projected image area through which the minimum cost path to each position Cx (n) passes is retained.
- step S18 the management unit 27 determines whether or not the image holding unit 23 has a shortage of memory for holding the image data of the projection image.
- the amount of image data held in the image holding unit 23 is larger than a predetermined upper limit value of the memory amount, it is determined that the memory amount is insufficient.
- step S18 If it is determined in step S18 that the amount of memory is insufficient, the process proceeds to step S19 in order to further delete the image data held in the image holding unit 23.
- step S19 the management unit 27 determines a route to be deleted based on the directed graph supplied from the directed graph generation unit 25 and the search result from the minimum cost route search unit 26.
- the management unit 27 calculates the above equation (2) using the directed graph for the minimum cost path to each position Cx (n) of the directed graph, and the priority of each minimum cost path Path (Cx (n)). P (Cx (n)) is calculated. Then, the management unit 27 sets a route having the lowest priority P (Cx (n)) as a deletion target route among the minimum cost routes Path (Cx (n)).
- the route that is predicted to have a high risk of dividing the final moving subject at the present time is determined as the route to be deleted.
- management unit 27 supplies all routes to each position Cx (n) that are not currently targeted for deletion to the minimum cost route search unit 26.
- step S20 the management unit 27 deletes the route to be deleted determined in the process of step S19. That is, the management unit 27 instructs the image holding unit 23 to delete the image data of the projected image area through which only the route to be deleted passes, and the image holding unit 23 deletes the image data according to the instruction.
- n 8 and the minimum cost path to each position Cx (8) of the eighth projection image MP (8) is obtained.
- step S18 If it is determined in step S18 that the amount of memory is not insufficient, the process proceeds to step S21, and the image processing apparatus 11 determines whether or not the shooting of the shot image is completed. For example, when processing is performed up to the Nth photographed image, it is determined that photographing has been completed.
- step S21 it is determined whether processing has been performed for all the captured images, that is, whether N captured images have been acquired.
- step S21 If it is determined in step S21 that the shooting has not been completed, the process returns to step S11, and the above-described process is repeated.
- step S21 if it is determined in step S21 that shooting has been completed, the process proceeds to step S22.
- the shooting number n of the shot image processed immediately before is N. *
- the minimum cost route search unit 26 searches for the minimum cost route from the start point to the end point of the directed graph. That is, at this time, the minimum cost path from the starting point of the directed graph to each position Cx (N) is obtained by the process of the immediately preceding step S16. Therefore, the minimum cost route searching unit 26 sets the lowest cost route that is obtained at the present time as the final minimum cost route that has the lowest total cost.
- the end point of the directed graph is the position of the end on the + Cx direction side of the Nth projection image MP (N).
- the final minimum cost route may be determined by excluding the route deleted in the immediately preceding step S20, or the final route may not be deleted in the immediately preceding step S20.
- a minimum cost path may be determined.
- the minimum cost route search unit 26 supplies the determined minimum cost route to the panoramic image generation unit 28.
- step S23 the panoramic image generation unit 28 generates a panoramic image based on the minimum cost route supplied from the minimum cost route search unit 26 and the projection image supplied from the image holding unit 23.
- the panoramic image generation unit 28 generates a single panoramic image by cutting out a cutout region from each projection image using the regions of each projected image that the minimum cost path passes as cutout regions, and connecting the cutout regions side by side. .
- the panorama image generation unit 28 connects the cutout area KR (1) to the cutout area KR (10), thereby obtaining a panoramic image. Is generated.
- step S24 the panorama image generation unit 28 outputs the generated panorama image, and the panorama image generation process ends.
- the image processing apparatus 11 generates a directed graph using the projection images up to the nth image, and repeats the process of determining candidates for the joints up to the nth projection image.
- the position of the joint of the projected images from the first to the Nth image, that is, the minimum cost path is determined.
- the series of processes described above can be executed by hardware or can be executed by software.
- a program constituting the software is installed in the computer.
- the computer includes, for example, a general-purpose personal computer capable of executing various functions by installing a computer incorporated in dedicated hardware and various programs.
- FIG. 30 is a block diagram showing an example of the hardware configuration of a computer that executes the above-described series of processing by a program.
- a CPU Central Processing Unit
- ROM Read Only Memory
- RAM Random Access Memory
- An input / output interface 205 is further connected to the bus 204.
- An input unit 206, an output unit 207, a recording unit 208, a communication unit 209, and a drive 210 are connected to the input / output interface 205.
- the input unit 206 includes a keyboard, a mouse, a microphone, an image sensor, and the like.
- the output unit 207 includes a display, a speaker, and the like.
- the recording unit 208 includes a hard disk, a nonvolatile memory, and the like.
- the communication unit 209 includes a network interface and the like.
- the drive 210 drives a removable medium 211 such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory.
- the CPU 201 loads, for example, the program recorded in the recording unit 208 to the RAM 203 via the input / output interface 205 and the bus 204, and executes the program. Is performed.
- the program executed by the computer (CPU 201) can be provided by being recorded in the removable medium 211 as a package medium or the like, for example.
- the program can be provided via a wired or wireless transmission medium such as a local area network, the Internet, or digital satellite broadcasting.
- the program can be installed in the recording unit 208 via the input / output interface 205 by attaching the removable medium 211 to the drive 210.
- the program can be received by the communication unit 209 via a wired or wireless transmission medium and installed in the recording unit 208.
- the program can be installed in the ROM 202 or the recording unit 208 in advance.
- the program executed by the computer may be a program that is processed in time series in the order described in this specification, or in parallel or at a necessary timing such as when a call is made. It may be a program for processing.
- the present technology can take a cloud computing configuration in which one function is shared by a plurality of devices via a network and is jointly processed.
- each step described in the above flowchart can be executed by one device or can be shared by a plurality of devices.
- the plurality of processes included in the one step can be executed by being shared by a plurality of apparatuses in addition to being executed by one apparatus.
- the present technology can be configured as follows.
- An image processing apparatus that generates a panoramic image by connecting a plurality of captured images, A difference information calculation unit for calculating difference information between the captured images adjacent to each other; A directed graph generation unit that generates a directed graph with the degree of detection of a moving subject as energy based on the positional relationship between the captured images and the difference information; A route search unit that searches for a minimum cost route from an arbitrary start point of the directed graph generated from the captured image to an end position of the Nth captured image; An image processing apparatus comprising: a panorama image generation unit configured to connect the areas of the captured images determined by the minimum cost path to generate the panorama image.
- the directed graph generation unit generates the directed graph based on the first to nth captured images for n where n ⁇ N
- the route search unit searches the minimum cost route from the start point to the end point for each end point, with each of the positions corresponding to the respective positions of the n-th captured image in the directed graph as end points, and Based on the search result of the minimum cost path, the process of searching for the minimum cost path for the directed graph generated from the first to (n + 1) th captured images is repeatedly performed, so that the end point to the end point
- the image processing device according to [1], wherein the minimum cost route to a position is searched.
- An image holding unit for holding image data of the captured image; After the minimum cost path is searched for the directed graph generated from the first to nth captured images, only the image data of the area of the captured image indicated by the minimum cost path is included.
- the image processing apparatus according to [2], further comprising: a management unit that manages image data of the captured image in the image holding unit so as to be held in the image holding unit.
- the management unit searches for the minimum cost path for the directed graph generated from the first to nth captured images, and then has the lowest priority among the minimum cost paths.
- the image processing apparatus according to [3] wherein the image data of the area of the captured image that is indicated only by the minimum cost path and not indicated by the other minimum cost path is deleted from the image holding unit.
- the management unit repeatedly performs a process of deleting image data based on the priority until the amount of image data held in the image holding unit reaches a predetermined data amount.
- Image processing device [6] The priority is an area of the captured image determined by the minimum cost path from the start point to the end position, including the minimum cost path for the directed graph generated from the first to nth captured images.
- the image processing apparatus according to [4] or [5] which is determined by a degree of risk that the moving subject on the photographed image is divided when the images are joined together.
- the management unit determines whether the cost to the minimum cost path, the difference of the total cost of the minimum cost path adjacent to each other, the position of the end point of the minimum cost path, the position of the minimum cost path adjacent to each other.
- the priority is determined based on at least one of the difference in the position of the end point, or the amount of image data of the area of the captured image that is indicated only by the minimum cost route and not indicated by the other minimum cost route. 6].
- 11 image processing device 22 projection unit, 23 image holding unit, 24 moving subject map generation unit, 25 directed graph generation unit, 26 minimum cost path search unit, 27 management unit, 28 panoramic image generation unit
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Studio Devices (AREA)
- Image Processing (AREA)
Abstract
本技術は、より高品質なパノラマ画像を得ることができるようにする画像処理装置および方法、並びにプログラムに関する。 画像処理装置は、1枚目乃至N枚目の投影画像を用いてパノラマ画像を生成する場合に、1枚目からn枚目までの投影画像が得られた時点で、それらの投影画像のCx方向の各位置をノードとし、隣接する投影画像間の動被写体の検出結果をノード間のエネルギとする有向グラフを生成する。画像処理装置は、生成した有向グラフの始点から終点までのコストが最小となる最小コスト経路を探索し、その探索結果を用いてn+1枚目についての有向グラフの最小コスト経路を探索する。そして、画像処理装置は、N枚目の投影画像が得られたときに得られた最小コスト経路に基づいて、各投影画像をつなぎ合わせて、パノラマ画像を生成する。本技術は、画像処理装置に適用することができる。
Description
本技術は画像処理装置および方法、並びにプログラムに関し、特に、より高品質なパノラマ画像を得ることができるようにした画像処理装置および方法、並びにプログラムに関する。
例えば、カメラを回転させながら連続して撮影した複数の撮影画像を用いて、パノラマ画像を生成する技術が知られている(例えば、特許文献1参照)。このようなパノラマ画像は、複数撮影された撮影画像が並べられて合成されることで生成される。
しかしながら、上述した技術では、撮影画像に動被写体が含まれていると、隣接する撮影画像間のつなぎ目で動被写体が分断されてしまうことがある。そうすると、得られたパノラマ画像に分断された動被写体が含まれることになり、パノラマ画像の見栄えが悪くなってしまう。すなわち、パノラマ画像の品質が低下してしまう。
本技術は、このような状況に鑑みてなされたものであり、より高品質なパノラマ画像を得ることができるようにするものである。
本技術の一側面の画像処理装置は、複数の撮影画像をつなぎ合わせてパノラマ画像を生成する画像処理装置であって、互いに隣接する前記撮影画像間の差分情報を算出する差分情報算出部と、各前記撮影画像の位置関係と前記差分情報に基づいて動被写体の検出度合いをエネルギとした有向グラフを生成する有向グラフ生成部と、前記撮影画像から生成された有向グラフの任意の始点から、N枚目の前記撮影画像の終端位置までの最小コスト経路を探索する経路探索部と、前記最小コスト経路により定まる各前記撮影画像の領域をつなぎ合わせて前記パノラマ画像を生成するパノラマ画像生成部とを備える。
前記有向グラフ生成部には、n≦Nとなるnについて、1枚目乃至n枚目の前記撮影画像に基づいて前記有向グラフを生成させ、前記経路探索部には、前記有向グラフにおけるn枚目の前記撮影画像の各位置に対応する位置のそれぞれを終点として、前記終点ごとに、前記始点から前記終点までの前記最小コスト経路を探索させ、それらの前記最小コスト経路の探索結果に基づいて、1枚目乃至n+1枚目の前記撮影画像から生成された前記有向グラフについての前記最小コスト経路を探索する処理を繰り返し行なわせることで、前記始点から前記終端位置までの前記最小コスト経路を探索させることができる。
画像処理装置には、前記撮影画像の画像データを保持する画像保持部と、1枚目乃至n枚目の前記撮影画像から生成された前記有向グラフについての前記最小コスト経路の探索が行なわれた後、それらの前記最小コスト経路により示される前記撮影画像の領域の画像データのみが前記画像保持部に保持されるように、前記画像保持部における前記撮影画像の画像データを管理する管理部とをさらに設けることができる。
前記管理部には、1枚目乃至n枚目の前記撮影画像から生成された前記有向グラフについての前記最小コスト経路の探索が行なわれた後、それらの前記最小コスト経路のうち、最も優先度の低い前記最小コスト経路のみにより示され、他の前記最小コスト経路により示されていない前記撮影画像の領域の画像データを前記画像保持部から削除させることができる。
前記管理部には、前記画像保持部に保持されている画像データ量が、予め定められたデータ量となるまで、前記優先度に基づいて画像データを削除させる処理を繰り返し行なわせることができる。
前記優先度を、1枚目乃至n枚目の前記撮影画像から生成された前記有向グラフについての前記最小コスト経路を含む、前記始点から前記終端位置までの前記最小コスト経路により定まる前記撮影画像の領域をつなぎ合わせたときに、前記撮影画像上の動被写体が分断されるリスクの度合いにより定められるようにすることができる。
前記管理部には、前記最小コスト経路までのコストの合計値、互いに隣接する前記最小コスト経路のコストの合計値の差分、前記最小コスト経路の前記終点の位置、互いに隣接する前記最小コスト経路の前記終点の位置の差分、または前記最小コスト経路のみにより示され、他の前記最小コスト経路により示されていない前記撮影画像の領域の画像データ量の少なくとも何れかに基づいて、前記優先度を定めさせることができる。
本技術の一側面の画像処理方法またはプログラムは、複数の撮影画像をつなぎ合わせてパノラマ画像を生成する画像処理方法またはプログラムであって、互いに隣接する前記撮影画像間の差分情報を算出し、各前記撮影画像の位置関係と前記差分情報に基づいて動被写体の検出度合いをエネルギとした有向グラフを生成し、前記撮影画像から生成された有向グラフの任意の始点から、N枚目の前記撮影画像の終端位置までの最小コスト経路を探索し、前記最小コスト経路により定まる各前記撮影画像の領域をつなぎ合わせて前記パノラマ画像を生成するステップを含む。
本技術の一側面においては、複数の撮影画像をつなぎ合わせてパノラマ画像を生成する画像処理において、互いに隣接する前記撮影画像間の差分情報が算出され、各前記撮影画像の位置関係と前記差分情報に基づいて動被写体の検出度合いをエネルギとした有向グラフが生成され、前記撮影画像から生成された有向グラフの任意の始点から、N枚目の前記撮影画像の終端位置までの最小コスト経路が探索され、前記最小コスト経路により定まる各前記撮影画像の領域がつなぎ合わせられて前記パノラマ画像が生成される。
本技術の一側面によれば、より高品質なパノラマ画像を得ることができる。
以下、図面を参照して、本技術を適用した実施の形態について説明する。
〈第1の実施の形態〉
[パノラマ画像の生成について]
まず、パノラマ画像の生成方法の概要について説明する。
[パノラマ画像の生成について]
まず、パノラマ画像の生成方法の概要について説明する。
例えば、カメラ等の撮影装置を一方向に移動させながら、複数の撮影画像を撮影したとする。このとき、互いに隣接する撮影画像が重複部分を有するように、つまり同じ被写体が含まれるように各撮影画像が撮影される。
本技術では、このようにして得られた複数の撮影画像から1つのパノラマ画像が生成される。すなわち、撮影画像に対して手ぶれ補正が行なわれて、撮影中の手ぶれによる撮影画像のぼけが補正され、各撮影画像について、1枚目の撮影画像との位置関係を示す同次変換行列が求められる。この同次変換行列により、各撮影画像の相対的な位置関係が求まる。
また、各撮影画像を滑らかに接続するために、撮影画像が円筒面上に射影(マッピング)され、適宜、トリミングが行なわれる。これは、撮影画像の撮影時に撮影装置が一方向に移動していない場合には、各撮影画像の縦方向の位置にずれが生じてしまうからであり、円筒面上において各撮影画像の縦方向の位置が揃うようにトリミングが行なわれる。なお、以下では、円筒面上に射影された撮影画像を特に投影画像とも称することとする。
このようにして、円筒面上に各投影画像が並べられると、それらの投影画像の一部の領域が切り出されてつなぎ合わせられ、パノラマ画像とされる。
本技術は、以上のようにしてパノラマ画像を生成する場合に、なるべく動被写体が分断されないように隣接する撮影画像(投影画像)間のつなぎ目を決定することで、より高品質なパノラマ画像が得られるようにするものである。
以下、図1乃至図27を参照して、より具体的に本技術によるパノラマ画像の生成について説明していく。
なお、図1乃至図27において、横方向は各撮影画像が射影される円筒面の円周方向(以下、Cx方向とも称する)を示しており、縦方向は各撮影画像(投影画像)の撮影番号、つまり何枚目に撮影された撮影画像であるかを示している。ここで、Cx方向は、撮影画像の撮影時における撮影装置の移動(回転)方向でもあり、以下、特に撮影装置の移動方向と平行な方向のうち、撮影装置が移動する方向を+Cx方向とも称し、+Cx方向と反対の方向を-Cx方向とも称することとする。
また、図2乃至図27において、図1における場合と対応する部分には同一の符号を付してあり、その説明は適宜省略する。
例えば、図1に示すように、1枚目の撮影画像乃至10枚目の撮影画像を円筒面上に射影(マッピング)することにより、投影画像MP(1)乃至投影画像MP(10)が得られたとする。
図1の例では、1枚目の投影画像MP(1)の左端の位置はCx=0の位置であり、投影画像MP(1)の右端の位置はCx=640の位置となっている。また、10枚目の投影画像MP(10)の右端の位置はCx=1440の位置となっている。
また、各投影画像MP(n)(但し、1≦n≦10)には、同じ動被写体V11が含まれている。ここで、投影画像MP(n)におけるCx方向の位置をCx(n)で表すとすると、例えば、動被写体V11は、1枚目の投影画像MP(1)における位置Cx(1)=40乃至160の領域に存在している。また、動被写体V11は、2枚目の投影画像MP(2)では位置Cx(2)=180乃至300の領域に存在しており、10枚目の投影画像MP(10)では位置Cx(10)=1310乃至1430の領域に存在している。
ところで、隣接する投影画像MP(n)間のつなぎ目の位置、つまり接続位置を定めることを考える。ここで、投影画像MP(n)間のつなぎ目は、円筒面上においてCx方向と垂直であるものとし、パノラマ画像は、撮影時間順に投影画像をつなぎ合わせることで得られるものとする。
投影画像MP(n)間のつなぎ目の位置を決定する場合、まず互いに隣接する1枚目の投影画像MP(1)と2枚目の投影画像MP(2)のCx方向の重複領域(重なる領域)について、動被写体の検出が行なわれる。
すなわち、重複領域内の各位置について、その位置にある投影画像MP(1)と投影画像MP(2)の画素の差分情報が求められる。例えば、差分情報は画素の画素値の差分絶対値などとされる。このようにして得られる差分情報は、重複領域における動被写体らしさを示す情報であり、差分情報が大きいほど、重複領域には動被写体が含まれている可能性が高い。
本技術では、投影画像MP(1)と投影画像MP(2)の重複領域に対して動被写体の検出が行なわれると、投影画像MP(1)と投影画像MP(2)のつなぎ目の位置を決定せずに、他の投影画像の重複領域に対する動被写体検出が行なわれる。
すなわち、2枚目の投影画像MP(2)と3枚目の投影画像MP(3)の重複領域の動被写体検出,3枚目と4枚目の投影画像の重複領域の動被写体検出,・・・,9枚目と10枚目の投影画像の重複領域の動被写体検出が順次行なわれていく。
そして、隣接する投影画像の全ての組み合わせについて、重複領域での動被写体検出が行なわれると、その結果得られた差分情報に基づいて動被写体マップが生成される。
具体的には、互いに隣接する投影画像の重複領域において、Cx方向の位置が同じである各位置の差分情報の和を求め、そのCx方向の位置にある動被写体マップの画素の値を、求めた差分情報の和とすることで、動被写体マップが生成される。
これにより、図2に示す動被写体マップHM1,2乃至動被写体マップHM9,10が得られる。
例えば、動被写体マップHM1,2は、1枚目の投影画像MP(1)と2枚目の投影画像MP(2)の重複領域について動被写体検出を行なうことで得られた動被写体マップである。この動被写体マップHM1,2における位置Cxの画素の値は、位置Cxにある投影画像MP(1)と投影画像MP(2)の画素の画素値の差分絶対値和、つまり差分情報の和であり、その位置Cxにおける動被写体の領域らしさの度合いを示している。換言すれば、動被写体マップの位置Cxの画素の値は、その位置Cxを投影画像間のつなぎ目の位置としたときに生じる、動被写体の分断リスクの高さを示している。
したがって、各動被写体マップHMn-1,n(但し、n=2乃至10)を用いれば、なるべく動被写体が存在しない位置を、隣接する投影画像間のつなぎ目とし、動被写体の分断の少ない高品質なパノラマ画像を得ることができる。
具体的には、例えば図3に示すように、円筒面上に配置された各投影画像MP(n)の位置Cx(n)をノードとする有向グラフを用いればよい。なお、図3において図2における場合と対応する部分には同一の符号を付してあり、その説明は省略する。
図3に示す有向グラフは、横方向をCx方向の位置とし、縦方向を撮影画像(投影画像)の撮影番号として、Cx方向の位置と撮影番号により定まる位置にノードを有する有向グラフである。
有向グラフにおける位置Cx(n-1)のノードから、位置Cx(n)のノードへのコスト、つまりあるノードから、そのノードの縦方向に隣接するノードへのコスト(エネルギ)は、動被写体マップHMn-1,nの位置Cxにある画素の値とされる。また、有向グラフにおけるCx方向に並ぶノード間のコストは0とされる。
なお、Cx方向に並ぶノード間のコストが0とされるのは、パノラマ画像上のCx方向に並ぶ画素として、同じ投影画像の画素を用いれば、その位置においては動被写体の分断等による画像の破綻は生じないからである。
このような有向グラフにおいて、1枚目の投影画像MP(1)の図中、左端の位置Cx(1)=0から、10枚目の投影画像MP(10)の図中、右端の位置Cx(10)=1440までの経路のうち、ノード間のコストの合計が最小となる経路を探索すればよい。
但し、有向グラフにおいては、投影画像MP(1)の図中、左端部分と投影画像MP(10)の図中、右端部分を除き、互いに隣接する投影画像MP(n-1)と投影画像MP(n)の重複領域内にのみ経路が存在する。
図3の例では、経路PT11が、コストの合計(以下、合計コストとも称する)が最小となる経路となっている。この場合、経路PT11における図中、縦方向の直線部分の位置が、投影画像間のつなぎ目の位置とされる。換言すれば、経路PT11が位置Cx(n-1)と位置Cx(n)の両方の位置(ノード)を通る場合、その位置Cxが投影画像MP(n-1)と投影画像MP(n)とのつなぎ目の位置とされる。
例えば、図4に示すように、n枚目の投影画像MP(n)の位置Cx(n)までの経路のうち、コストの合計が最小となる経路を考えるとする。
図4から分かるように、有向グラフの始点である位置Cx(1)=0から、位置Cx(n)に到達する経路は、必ず位置Cx(n-1)か位置Cx(n)-1の何れか一方のノードを通るはずである。
したがって、有向グラフにおける位置Cx(n-1)のノードから、位置Cx(n)のノードへのコスト(エネルギ)をCost(Cx(n))とすると、有向グラフの始点から位置Cx(n)までの経路の最小の合計コストであるS(Cx(n))について、次式(1)の漸化式が成立する。なお、n=2乃至10である。
すなわち、式(1)では、「S(Cx(n)-1)」と「S(Cx(n-1))+Cost(Cx(n))」のうち、より小さい方の値が合計コストS(Cx(n))(以下、特に最小合計コストS(Cx(n))とも称する)とされる。
上述したように、位置Cx(1)=0から、位置Cx(n)に到達する経路は、必ず位置Cx(n-1)か位置Cx(n)-1の何れか一方のノードを通るはずである。
位置Cx(1)=0から位置Cx(n)-1までの経路の最小合計コストはS(Cx(n)-1)であり、位置Cx(n)-1から位置Cx(n)へのコストは0である。したがって、位置Cx(1)=0から、位置Cx(n)-1を通って位置Cx(n)に到達する経路の合計コストの最小値はS(Cx(n)-1)となる。
一方、位置Cx(1)=0から位置Cx(n-1)までの経路の最小合計コストはS(Cx(n-1))であり、位置Cx(n-1)から位置Cx(n)へのコストはCost(Cx(n))である。したがって、位置Cx(1)=0から、位置Cx(n-1)を通って位置Cx(n)に到達する経路の合計コストの最小値はS(Cx(n-1))+Cost(Cx(n))となる。
よって、これらの「S(Cx(n)-1)」と「S(Cx(n-1))+Cost(Cx(n))」のうちの小さい方の値が、位置Cx(1)=0から位置Cx(n)までの経路の最小合計コストとなる。
有向グラフにおける始点から終点、つまり位置Cx(1)=0から位置Cx(10)=1440までの経路の最小合計コストS(Cx(10))を各種の最適化手法により求めることで、各投影画像間の最適なつなぎ目の位置を求めることができる。
そして、各投影画像間のつなぎ目の位置が求まると、例えば図5に示すように、投影画像MP(n)上のつなぎ目間の切り出し領域KR(n)(但し、n=1乃至10)をつなぎ合わせれば、1つのパノラマ画像を得ることができる。なお、図5において、図1または図3における場合と対応する部分には同一の符号を付してあり、その説明は省略する。
図5では、経路PT11を表す折れ線のうち、Cx方向の線は、パノラマ画像の生成に用いられる投影画像MP(n)上の領域を示しており、経路PT11を表す折れ線のうちの縦方向の線は、投影画像間のつなぎ目の位置を示している。
したがって、例えば1枚目の投影画像MP(1)のうち、投影画像MP(1)の図中、左側の端から、経路PT11により定まる投影画像MP(1)と投影画像MP(2)のつなぎ目の位置までの領域が、パノラマ画像の生成に用いる切り出し領域KR(1)とされる。
また、2枚目の投影画像MP(2)のうち、経路PT11により定まる投影画像MP(1)と投影画像MP(2)のつなぎ目の位置から、投影画像MP(2)と投影画像MP(3)のつなぎ目の位置までの領域が、切り出し領域KR(2)とされている。
このようにして得られた切り出し領域KR(1)乃至切り出し領域KR(10)がつなぎ合わされて(合成されて)パノラマ画像が生成されるが、この例では経路PT11により定まる各つなぎ目によって、動被写体V11は分断されていない。つまり、得られるパノラマ画像には、分断された動被写体V11は含まれることはないので、高品質なパノラマ画像が得られる。
特に、本技術では、パノラマ画像の図中、左端から撮影時間順に投影画像をつなぎ合わせていくという制約があるため、有向グラフの始点から終点までの最小合計コストとなる経路の探索問題は多段階決定問題となる。そこで、本技術では、例えば動的計画法によって、最小合計コストとなる経路を探索すればよい。
以上のようにして、本技術では、全ての投影画像を対象として有向グラフを生成し、その有向グラフにおける最小合計コストとなる経路を探索することで、各投影画像のつなぎ目を決定する。これにより、1枚目の投影画像から順番に、逐次的に投影画像間のつなぎ目を決定していく場合と比べて、より適切なつなぎ目を定めることができる。
例えば、逐次的に投影画像間のつなぎ目を決定していく場合、図5の投影画像MP(9)に注目すると、投影画像MP(9)と投影画像MP(10)とのつなぎ目を決定する前に、既に投影画像MP(9)と投影画像MP(8)のつなぎ目位置は定められている。
したがって、投影画像MP(9)と投影画像MP(10)のつなぎ目の位置は、投影画像MP(9)と投影画像MP(8)のつなぎ目の位置よりも図中、右側の位置としなければならず、つなぎ目の位置の候補にできる位置が少なくなってしまう。つまり、逐次的に投影画像間のつなぎ目を決定していく場合、より後に撮影された投影画像ほど、つなぎ目の位置を決定する際の制約が大きくなり、動被写体分断のリスクが高くなってしまう。
これに対して、本技術では、全ての投影画像を考慮して、それらの投影画像間のつなぎ目の位置を同時に求めるため、動被写体の分断のリスクが低く、より適切な位置をつなぎ目の位置とすることができるようになる。
[計算コストと使用メモリ量の削減について]
次に、本技術の手法を採用することにより増加する計算コストの削減と、投影画像を保持しておくメモリの使用量の削減について説明する。
次に、本技術の手法を採用することにより増加する計算コストの削減と、投影画像を保持しておくメモリの使用量の削減について説明する。
全ての投影画像を用いて投影画像間の各つなぎ目の位置を同時に定めようとすると、最適化問題を解く必要があるので、一般的に計算量が多くなってしまう。また、全ての投影画像について動被写体の検出を行なってから、つなぎ目の位置を決定するには、全ての投影画像の画像データを保持する必要があるので、画像保持のための使用メモリ量が多くなってしまう。
そこで、本技術では、投影画像間のつなぎ目の位置の決定問題を、多段階決定問題として動的計画法により解くことにより、つなぎ目の位置の決定に必要となる計算量の増加が抑制される。
また、本技術では、つなぎ目の位置の決定問題を多段階決定問題とすることにより、その特性を生かして画像保持のための使用メモリ量の削減も実現される。すなわち、つなぎ目の位置の決定問題を、制約をおいて多段階決定問題とすれば、最適性の原理が成立することを利用して使用メモリ量の削減が可能である。
ここで、最適性の原理とは、全体が最適化された時はその部分も最適化されていることを保証するものである。投影画像間のつなぎ目の位置、つまり切り出し領域の決定問題で言い換えれば、最終的に決定する有向グラフ上の最適な経路の途中までの各経路が、そこまでの最適な経路になっていることを保証するものである。
この特性を利用すると、処理の過程で有向グラフにおける始点から各位置Cx(n)までの最適な経路候補を全て求めておき、その経路候補に含まれる投影画像の領域の画像データさえ保持すれば、全ての画像データを保持することなくパノラマ画像を生成することができる。なぜなら、最終的に動的計画法で決定される最適な経路がどの経路に決まったとしても、その途中までの経路は必ず各位置Cx(n)までの最適な経路候補の何れかになるので、パノラマ画像の生成に必要な画像データは必ず保持されているからである。
いま、図5中、1枚目の投影画像MP(1)の左端、つまり位置Cx(1)=0の位置から出発し、n枚目(但し、2≦n≦10)の投影画像MP(n)における位置Cx(n)に到達する最適な経路、つまり合計コストが最小となる経路をPath(Cx(n))とする。
この例では、10枚目の投影画像MP(10)が最後の投影画像であり、投影画像MP(10)の図中、右端の位置はCx(10)=1440であるから、経路Path(Cx(10))=Path(1440)が最終的に求めたい経路となる。
例えば図6に示すように、1枚目の投影画像MP(1)から4枚目の投影画像MP(4)まで取得された時点では、1枚目と2枚目の投影画像の重複領域、2枚目と3枚目の投影画像の重複領域、および3枚目と4枚目の投影画像の重複領域で動被写体の検出が可能である。
ここで、3枚目の投影画像MP(3)と4枚目の投影画像MP(4)の重複領域、すなわち位置Cx(4)=250乃至800の領域において、有向グラフにおける始点から各位置Cx(4)までの最小コスト経路を全て求めたとする。ここで、最小コスト経路とは、合計コストが最小となる経路である。
図6の例では、実質的に4つの最小コスト経路Path(Cx(4)=250)、最小コスト経路Path(Cx(4)=300)、最小コスト経路Path(Cx(4)=450)、および最小コスト経路Path(Cx(4)=800)が求められている。例えば、位置Cx(4)=450と位置Cx(4)=800の間にある各位置における最小コスト経路は、実質的に最小コスト経路Path(Cx(4)=450)と同じである。
この場合、最終的に求められる最適な経路、つまり有向グラフの始点から終点までの最小コスト経路は、必ず各位置Cx(4)までの最小コスト経路の何れかを含むはずである。
このことから、最小コスト経路Path(Cx(4)=250)乃至最小コスト経路Path(Cx(4)=800)の各最小コスト経路が通っている投影画像の領域の画像データさえ保持しておけば、5枚目以降の投影画像がどのようなものであっても、最終的に切り出し領域とされる領域の画像データは必ず確保されていることになる。つまり、パノラマ画像の生成に用いられる、1枚目から4枚目までの投影画像の切り出し領域の画像データは保持されていることになる。
また、図6に示す状態から、順次、投影画像が取得されていき、8枚目の投影画像MP(8)まで取得された時点では、例えば図7に示すように、8枚目の投影画像MP(8)の各位置Cx(8)までの最小コスト経路が求められる。
図7では、7枚目の投影画像MP(7)と8枚目の投影画像MP(8)との重複領域、つまり位置Cx(8)=610乃至1140までの各位置について、有向グラフにおける始点位置からそれらの各位置までの最小コスト経路が求められている。ここでは、実質的に4つの最小コスト経路Path(Cx(8)=610)、最小コスト経路Path(Cx(8)=880)、最小コスト経路Path(Cx(8)=940)、および最小コスト経路Path(Cx(8)=1140)が求められている。
この場合、最終的に求められる最適な経路、つまり有向グラフの始点から終点までの最小コスト経路には、必ず各位置Cx(8)までの最小コスト経路の何れかが含まれるはずである。
また、各位置Cx(8)までの最小コスト経路により示される、4枚目の投影画像MP(4)までのパノラマ画像の生成に必要な画像領域は、図6に示した4つの最小コスト経路Path(Cx(4)=250)乃至最小コスト経路Path(Cx(4)=800)が通る画像領域の一部となっている。そのため、最小コスト経路Path(Cx(8)=610)乃至最小コスト経路Path(Cx(8)=1140)の各最小コスト経路に示される、パノラマ画像の生成に必要な1枚目乃至4枚目の投影画像の領域の画像データは、必ず確保されていることになる。
さらに、4枚目の投影画像MP(4)の各位置Cx(4)における場合と同様に、最小コスト経路Path(Cx(8)=610)乃至最小コスト経路Path(Cx(8)=1140)の各最小コスト経路が通っている投影画像の領域の画像データさえ保持しておけば、9枚目以降の投影画像がどのようなものであっても、最終的に切り出し領域とされる領域の画像データは必ず確保されていることになる。
以上のように、新たに取得されたn枚目の投影画像MP(n)の各位置Cx(n)までの最小コスト経路を求め、各最小コスト経路が通る投影画像の領域の画像データのみを保持し、他の領域の画像データを削除すれば、使用メモリ量を大幅に削減することができる。
[使用メモリ量の更なる削減について]
上述したように本技術によれば、投影画像を保持しておくメモリの使用量を削減することができるが、例えば使用可能なメモリ量の上限が厳しい場合もある。そのような場合には、さらに使用メモリ量を削減することが必要となることもあるが、以下においては、さらなる使用メモリ量の削減手法について説明する。
上述したように本技術によれば、投影画像を保持しておくメモリの使用量を削減することができるが、例えば使用可能なメモリ量の上限が厳しい場合もある。そのような場合には、さらに使用メモリ量を削減することが必要となることもあるが、以下においては、さらなる使用メモリ量の削減手法について説明する。
例えば、デジタルカメラ等の撮影装置のメモリを有する信号処理回路でパノラマ画像を生成する処理が行なわれる場合について考える。この場合、メモリの容量には制限があり、その制限を超えてメモリを使用することはできない。
上述した使用メモリ量の削減手法では、理論的に利用する可能性がある画像データ全てを保持することで、最も動被写体の分断リスクが低いパノラマ画像を必ず生成することができた。仮に、理論的に利用する可能性がある画像データの一部でもメモリから削除すると、最も動被写体の分断リスクが低いパノラマ画像を生成することができなくなる場合もある。しかし、2番目,3番目に動被写体の分断リスクが低いパノラマ画像でも特に問題ないとすれば、保持しておく画像データのさらなる削減を見込むことができる。
先に述べたように、使用メモリ量を削減するために各位置Cx(n)において、有向グラフの始点から各位置Cx(n)までの最小コスト経路を求め、これらの最小コスト経路に含まれない画像領域内の画像データを削除したとする。つまり、各投影画像の画像データのうち、各最小コスト経路により示される領域以外の領域の画像データを削除したとする。
このような状態で、投影画像の画像データの保持に用いられている使用メモリ量が、予め定められたメモリ量の上限を超えている場合、保持している画像データの一部をさらに削除する必要がある。
そこで、本技術では、各位置Cx(n)までの最小コスト経路に対して、動被写体分断リスクやメモリ量の削減効果等を考慮して、保持すべき最小コスト経路の優先順位を付けることとした。そして、本技術では、優先順位の低い最小コスト経路から順番に、その最小コスト経路のみにより示される画像領域内の画像データをメモリから削除していく。
このように適宜、画像データを削除することで、使用メモリ量を削減することができるとともに、削除された経路の分だけ、計算コストを削減することができる。
ここで、有向グラフの始点から各位置Cx(n)までの最小コスト経路Path(Cx(n))の情報を保持する優先度をP(Cx(n))とする。この優先度P(Cx(n))を決定する要素は多数あるが、以下では、その主要素について具体的に説明する。
例えば、図7では、8枚目の投影画像MP(8)における位置Cx(8)=610,880,940,1140の各位置が、7枚目の投影画像MP(7)とのつなぎ目の位置の候補となっている。
また、位置Cx(8)=610乃至879の各位置までの最小コスト経路の最小合計コストS(Cx(8))は75であり、位置Cx(8)=880乃至939の各位置までの最小コスト経路の最小合計コストS(Cx(8))は55である。さらに、位置Cx(8)=940乃至1139の各位置までの最小コスト経路の最小合計コストS(Cx(8))は40であり、位置Cx(8)=1140乃至1280の各位置までの最小コスト経路の最小合計コストS(Cx(8))は10である。
各位置Cx(8)の最小コスト経路のうち、位置Cx(8)=610乃至879の各位置についての最小コスト経路が、投影画像MP(8)の図中、一番左側を通っており、位置Cx(8)=880乃至939の各位置についての最小コスト経路がその右側を通っている。
また、各位置Cx(8)の最小コスト経路のうち、位置Cx(8)=940乃至1139の各位置についての最小コスト経路が、投影画像MP(8)において位置Cx(8)=880乃至939の最小コスト経路よりも図中、右側を通っている。さらに、各位置Cx(8)の最小コスト経路のうち、位置Cx(8)=1140乃至1280の各位置についての最小コスト経路が、投影画像MP(8)の図中、一番右側を通っている。
図7の例で、8枚目の撮影画像、つまり投影画像MP(8)まで撮影された時点で、4つの最小コスト経路Path(Cx(8)=610)乃至最小コスト経路Path(Cx(8)=1140)が通っている投影画像の領域の画像データのみを保持しておけばよいことは上述した通りである。つまり、これらの最小コスト経路が通らない投影画像上の領域の画像データは保持しなくてもよいと説明した。
しかし、最小コスト経路Path(Cx(8)=610)乃至最小コスト経路Path(Cx(8)=1140)により示される投影画像の領域の画像データ全てを保持するほどメモリの容量がない場合も考えられる。そこで、本技術では、主に、以下において説明する5つの要素を考慮して、最小コスト経路Path(Cx(8)=610)乃至最小コスト経路Path(Cx(8)=1140)のなかから、情報を保持する優先度が低い最小コスト経路を選択する。そして、選択された最小コスト経路のみにより示される投影画像の領域の画像データを削除することで、使用メモリ量を削減する。
[最小合計コストを考慮した使用メモリ量の削減について]
まず、1つ目の要素として、最小合計コストS(Cx(n))を考慮した使用メモリ量の削減について説明する。
まず、1つ目の要素として、最小合計コストS(Cx(n))を考慮した使用メモリ量の削減について説明する。
例えば、n枚目の投影画像MP(n)が得られた時点における有向グラフの始点から各位置Cx(n)までの経路の最小合計コストS(Cx(n))の値は、小さければ小さいほど、その経路に含まれる投影画像の各領域が滑らかにつながっていることを表している。つまり、より動被写体の分断リスクが低いつなぎ目となっていることを表している。
そのため、各位置Cx(n)までの最小コスト経路のうち、最小合計コストS(Cx(n))の値が最も大きいものを採用しても、他の経路と比べて各画像領域が滑らかにつながるパノラマ画像を得ることはできないので、そのような経路は削除してもよいと考えられる。
そこで、本技術では、n枚目の投影画像MP(n)まで得られた時点で、各位置Cx(n)までの最小コスト経路のうち、最小合計コストS(Cx(n))の値が大きいものほど、その経路の優先度P(Cx(n))が小さくされる。
ここで、最小合計コストS(Cx(n))の値のみを、経路の削除要因とした場合における画像データの削除について、図8乃至図11を参照して説明する。
図8は、8枚目の撮影画像までが撮影された時点、つまり8枚目の投影画像MP(8)までが得られた時点における有向グラフを示している。
この例では、有向グラフの始点から、8枚目の投影画像MP(8)の各位置Cx(8)までの最小コスト経路として、実質的に4つの経路が得られている。すなわち、最小コスト経路Path(Cx(8)=610)、最小コスト経路Path(Cx(8)=880)、最小コスト経路Path(Cx(8)=940)、および最小コスト経路Path(Cx(8)=1140)が得られている。
また、それらの経路の最小合計コストS(Cx(8))は、それぞれ最小合計コストS(Cx(8)=610)=75、最小合計コストS(Cx(8)=880)=55、最小合計コストS(Cx(8)=940)=40、および最小合計コストS(Cx(8)=1140)=10となっている。
これらの4つの経路のうち、最小合計コストS(Cx(8))が最も大きい経路は、最小合計コストS(Cx(8)=610)=75となる最小コスト経路Path(Cx(8)=610)である。
したがって、まず最小コスト経路Path(Cx(8)=610)のみが通る各投影画像の領域の画像データがメモリから削除される。
その結果、図9に示すように、3つの最小コスト経路Path(Cx(8)=880)、最小コスト経路Path(Cx(8)=940)、および最小コスト経路Path(Cx(8)=1140)により示される投影画像の領域の画像データのみがメモリに保持された状態となる。
換言すれば、最小コスト経路Path(Cx(8)=880)、最小コスト経路Path(Cx(8)=940)、および最小コスト経路Path(Cx(8)=1140)の各経路上に含まれない投影画像の領域の画像データは、メモリに保持されない。これにより、図8に示した状態と比べて、画像データの保持に使用されているメモリ量を低減させることができる。
もちろん、最後の投影画像が得られたときに、本来であれば有向グラフの始点から終点までの最小コスト経路が、削除してしまった最小コスト経路Path(Cx(8)=610)を含む可能性もある。
しかし、既に最小コスト経路Path(Cx(8)=610)を削除してしまったので、この場合には、最小コスト経路Path(Cx(8)=610)を含まない、他の経路が最終的な最小コスト経路として採用されることになる。このようにして採用された経路は、本来であれば最適な最小コスト経路とされていた経路よりは適していないが、ほぼ最適な経路となる。
8枚目の投影画像MP(8)までが得られた時点では、最終的にどの経路が最小コスト経路となるかを特定することができない。そのため、本技術では現時点で得られている最も撮影番号の大きい8枚目の投影画像MP(8)の各位置Cx(8)までの経路の最小合計コストS(Cx(8))が考慮され、最小合計コストS(Cx(8))が最大となる経路が削除される。
つまり、図8に示した状態から、最小合計コストS(Cx(8))が最大となる最小コスト経路Path(Cx(8)=610)が削除される。なお、実際に経路が削除される場合には、位置Cx(8)=610乃至879の各位置までの経路の最小合計コストS(Cx(8))の値が無限大の値とされる。
ところで、このように最小コスト経路Path(Cx(8)=610)を削除して図9に示した状態となったとしても、まだメモリ量が不足することも有り得る。
そのような場合には、現時点、つまり図9に示す状態で残っている実質的な3つの経路のうち、最小合計コストS(Cx(8))が最も大きい経路がさらに削除される。
ここでは、3つの最小コスト経路Path(Cx(8)=880)、最小コスト経路Path(Cx(8)=940)、および最小コスト経路Path(Cx(8)=1140)のうち、最小合計コストが最大となる最小コスト経路Path(Cx(8)=880)が削除される。つまり、最小コスト経路Path(Cx(8)=880)のみが通る各投影画像の領域の画像データがメモリから削除される。
その結果、図10に示すように、2つの最小コスト経路Path(Cx(8)=940)、および最小コスト経路Path(Cx(8)=1140)により示される投影画像の領域の画像データのみがメモリに保持された状態となる。
換言すれば、最小コスト経路Path(Cx(8)=940)、および最小コスト経路Path(Cx(8)=1140)の各経路上に含まれない投影画像の領域の画像データは、メモリに保持されない。これにより、図9に示した状態と比べて、画像データの保持に使用されているメモリ量をさらに低減させることができる。
さらに、それでもメモリ量が不足する場合には、図10に示す状態で残っている2つの経路のうち、最小合計コストS(Cx(8))が大きい方の経路がさらに削除される。
ここでは、2つの最小コスト経路Path(Cx(8)=940)、および最小コスト経路Path(Cx(8)=1140)のうち、より最小合計コストが大きい最小コスト経路Path(Cx(8)=940)が削除される。つまり、最小コスト経路Path(Cx(8)=940)のみが通る各投影画像の領域の画像データがメモリから削除される。
その結果、図11に示すように最小コスト経路Path(Cx(8)=1140)により示される投影画像の領域の画像データのみがメモリに保持された状態となる。これにより、さらなるメモリ量削減を実現することができる。
[最小合計コストの差分値を考慮した使用メモリ量の削減について]
続いて、2つ目の要素として、最小合計コストS(Cx(n)-1)と最小合計コストS(Cx(n))の差分値ΔS(Cx(n))=S(Cx(n))-S(Cx(n)-1)を考慮した使用メモリ量の削減について説明する。
続いて、2つ目の要素として、最小合計コストS(Cx(n)-1)と最小合計コストS(Cx(n))の差分値ΔS(Cx(n))=S(Cx(n))-S(Cx(n)-1)を考慮した使用メモリ量の削減について説明する。
例えば、有向グラフにおける各位置Cx(n)において、位置Cx(n)の+Cx方向に隣接する位置(ノード)へのコストは0となるので、殆どの位置Cx(n)では、位置Cx(n)における差分値ΔS(Cx(n))は0となる。
ところが、投影画像間のつなぎ目の候補となる位置、つまり有向グラフの始点からの経路がCx方向と垂直な方向に変化する位置では、投影画像の左端の位置を除き、差分値ΔS(Cx(n))は負の値となる。
差分値ΔS(Cx(n))の絶対値が小さいほど、位置Cx(n)までの最小コスト経路により示される領域の画像データを削除したことにより生じる、位置Cx(n)よりも+Cx方向にある位置を通る経路のコストの増加分、つまり動被写体分断リスクの増加分が小さくて済む。そこで、本技術では、差分値ΔS(Cx(n))の絶対値が小さい経路ほど、その経路の優先度P(Cx(n))は小さい値とされる。
ここで、差分値ΔS(Cx(n))の値のみを、経路の削除要因とした場合における画像データの削除について、図12乃至図15を参照して説明する。
図12は、8枚目の投影画像MP(8)までが得られた時点における有向グラフを示している。
この例では、有向グラフの始点から、8枚目の投影画像MP(8)の各位置Cx(8)までの最小コスト経路として、実質的に4つの経路が得られている。すなわち、最小コスト経路Path(Cx(8)=610)、最小コスト経路Path(Cx(8)=880)、最小コスト経路Path(Cx(8)=940)、および最小コスト経路Path(Cx(8)=1140)が得られている。
また、それらの経路の最小合計コストS(Cx(8))は、それぞれ最小合計コストS(Cx(8)=610)=75、最小合計コストS(Cx(8)=880)=55、最小合計コストS(Cx(8)=940)=40、および最小合計コストS(Cx(8)=1140)=10となっている。
この例では、投影画像MP(8)におけるつなぎ目の候補となる位置は、位置Cx(8)=610,880,940,1140の4つの位置となっている。
そして、これらの位置Cx(8)における差分値ΔS(Cx(n))は、それぞれ差分値ΔS(Cx(8)=610)=75,差分値ΔS(Cx(8)=880)=-20,差分値ΔS(Cx(8)=940)=-15,差分値ΔS(Cx(8)=1140)=-30となっている。
最小コスト経路Path(Cx(8)=610)乃至最小コスト経路Path(Cx(8)=1140)の4つの経路のうち、差分値ΔS(Cx(8))の絶対値|ΔS(Cx(8))|が最小となる経路は、絶対値|ΔS(Cx(8))|=(|ΔS(Cx(8)=940)|=15)となる最小コスト経路Path(Cx(8)=940)である。
したがって、まず最小コスト経路Path(Cx(8)=940)が削除される。つまり、最小コスト経路Path(Cx(8)=940)のみが通る各投影画像の領域の画像データがメモリから削除される。その結果、図13に示すように、3つの最小コスト経路Path(Cx(8)=610)、最小コスト経路Path(Cx(8)=880)、および最小コスト経路Path(Cx(8)=1140)により示される投影画像の領域の画像データのみがメモリに保持された状態となる。
換言すれば、最小コスト経路Path(Cx(8)=610)、最小コスト経路Path(Cx(8)=880)、および最小コスト経路Path(Cx(8)=1140)の各経路上に含まれない投影画像の領域の画像データは、メモリに保持されない。これにより、図12に示した状態と比べて、画像データの保持に使用されているメモリ量を低減させることができる。
このように最小コスト経路Path(Cx(8)=940)を削除すると、図8乃至図11を参照して説明した場合と同様に、本来であれば有向グラフの始点から終点までの最小コスト経路が、削除してしまった最小コスト経路Path(Cx(8)=940)を含む可能性もある。
しかし、8枚目の投影画像MP(8)までが得られた時点では、最終的にどの経路が最小コスト経路となるかを特定することができない。
そのため、本技術では現時点で得られている最も撮影番号の大きい8枚目の投影画像MP(8)の各位置Cx(8)までの経路の差分値ΔS(Cx(8))が考慮され、絶対値|ΔS(Cx(8))|が最小となる経路が削除される。つまり、図12に示した状態から、その経路の削除による他の経路への影響が小さい最小コスト経路Path(Cx(8)=940)が削除される。
最小コスト経路Path(Cx(8)=940)の削除により、位置Cx(8)=940乃至1139までの各最小コスト経路は、実質的に最小コスト経路Path(Cx(8)=880)と同じ経路となる。そのため、それらの位置の最小合計コストS(Cx(8))は絶対値|ΔS(Cx(8)=940)|=15の分だけ増加し、最小合計コストS(Cx(8))=55となる。
絶対値|ΔS(Cx(8))|が15という小さい値であれば、この位置Cx(8)=940における最小コスト経路Path(Cx(8)=940)を削除しても、特に問題は生じないと考えられる。
何故なら、最小コスト経路Path(Cx(8)=940)の最小合計コストはS(Cx(8)=940)=40であったが、この経路を削除しても、最小合計コストS(Cx(8)=940)=55となり、最小合計コストの増加分は15にしかならないからである。すなわち、投影画像をつなぎ合わせるときの滑らかさが15ポイント分だけ低下するだけであるので、最小コスト経路Path(Cx(8)=940)を削除したとしても、最終的に得られるパノラマ画像の品質に大きな影響はないからである。
逆に、図12の状態から位置Cx(8)=1140における最小コスト経路Path(Cx(8)=1140)を削除したとすると、その位置Cx(8)=1140における最小合計コストS(Cx(8)=1140)は、10であったものが40となってしまう。
そうすると、最小合計コストS(Cx(8)=1140)は30ポイントも低下してしまう。つまり、投影画像をつなぎ合わせるときの滑らかさが30ポイント分だけ低下し、最終的に得られるパノラマ画像の品質が劣化してしまう。
このように、本技術では、絶対値|ΔS(Cx(n))|が小さく、削除による他の経路への影響の少ない最小コスト経路を削除することで、メモリ量の削減を図りつつ、パノラマ画像の画質の低下が抑制される。
ところで、絶対値|ΔS(Cx(n))|が小さい最小コスト経路Path(Cx(8)=940)を削除して図13に示した状態となったとしても、まだメモリ量が不足することも有り得る。
そのような場合には、現時点、つまり図13に示す状態で残っている実質的な3つの経路のうち、絶対値|ΔS(Cx(n))|が最も小さい経路がさらに削除される。
図13に示す状態では、3つの最小コスト経路Path(Cx(8)=610)、最小コスト経路Path(Cx(8)=880)、および最小コスト経路Path(Cx(8)=1140)が残っている。そして、これらの経路の差分値ΔS(Cx(8))は、それぞれ差分値ΔS(Cx(8)=610)=75,差分値ΔS(Cx(8)=880)=-20,差分値ΔS(Cx(8)=1140)=-45となっている。
そこで、これらの3つの経路のうち、絶対値|ΔS(Cx(8))|が最小となる最小コスト経路Path(Cx(8)=880)が削除される。最小コスト経路Path(Cx(8)=880)の絶対値|ΔS(Cx(8))|は(|ΔS(Cx(8)=880)|=20)である。
最小コスト経路Path(Cx(8)=880)の削除により、この最小コスト経路Path(Cx(8)=880)のみが通る各投影画像の領域の画像データがメモリから削除される。その結果、図14に示すように、2つの最小コスト経路Path(Cx(8)=610)、および最小コスト経路Path(Cx(8)=1140)により示される投影画像の領域の画像データのみがメモリに保持された状態となる。
換言すれば、最小コスト経路Path(Cx(8)=610)、および最小コスト経路Path(Cx(8)=1140)の各経路上に含まれない投影画像の領域の画像データは、メモリに保持されない。これにより、図13に示した状態と比べて、画像データの保持に使用されているメモリ量をさらに低減させることができる。
なお、最小コスト経路Path(Cx(8)=880)が削除されると、位置Cx(8)=880乃至1139までの各最小コスト経路は、実質的に最小コスト経路Path(Cx(8)=610)と同じ経路となる。そのため、それらの位置の最小合計コストS(Cx(8))は絶対値|ΔS(Cx(8)=880)|=20の分だけ増加し、最小合計コストS(Cx(8))=75となる。
さらに、それでもメモリ量が不足する場合には、図14に示す状態で残っている2つの経路のうち、絶対値|ΔS(Cx(8))|が小さい方の経路がさらに削除される。
図14に示す状態では、2つの最小コスト経路Path(Cx(8)=610)、および最小コスト経路Path(Cx(8)=1140)が残っている。そして、これらの経路の差分値ΔS(Cx(8))は、それぞれ差分値ΔS(Cx(8)=610)=75,差分値ΔS(Cx(8)=1140)=-65となっている。
そこで、これらの2つの経路のうち、絶対値|ΔS(Cx(8))|がより小さい最小コスト経路Path(Cx(8)=1140)が削除される。最小コスト経路Path(Cx(8)=1140)の絶対値|ΔS(Cx(8))|は(|ΔS(Cx(8)=1140)|=65)である。
最小コスト経路Path(Cx(8)=1140)の削除により、この最小コスト経路Path(Cx(8)=1140)のみが通る各投影画像の領域の画像データがメモリから削除される。
その結果、図15に示すように、最小コスト経路Path(Cx(8)=610)により示される投影画像の領域の画像データのみがメモリに保持された状態となる。これにより、図14に示した状態と比べて、画像データの保持に使用されているメモリ量をさらに低減させることができる。
なお、最小コスト経路Path(Cx(8)=1140)が削除されると、位置Cx(8)=1140乃至1280までの各最小コスト経路は、実質的に最小コスト経路Path(Cx(8)=610)と同じ経路となる。そのため、それらの位置の最小合計コストS(Cx(8))は絶対値|ΔS(Cx(8)=1140)|=65の分だけ増加し、最小合計コストS(Cx(8))=75となる。
[つなぎ目の候補からの幅を考慮した使用メモリ量の削減について]
さらに、3つ目の要素として、投影画像間のつなぎ目の候補となる位置から、投影画像の右側の端、つまり+Cx方向側の端までの幅を考慮した使用メモリ量の削減について説明する。
さらに、3つ目の要素として、投影画像間のつなぎ目の候補となる位置から、投影画像の右側の端、つまり+Cx方向側の端までの幅を考慮した使用メモリ量の削減について説明する。
例えば、n枚目の投影画像MP(n)までが得られた時点で、有向グラフの始点から投影画像MP(n)の各位置Cx(n)までの最小コスト経路が定まる。そして、それらの最小コスト経路から、投影画像MP(n-1)と投影画像MP(n)とのつなぎ目の位置の候補が定まる。
ここで、候補とされたつなぎ目の位置は、その位置のCx座標が大きいほど、つまりその位置が+Cx方向側にあるほど、投影画像MP(n)と投影画像MP(n+1)とのつなぎ目の位置の選択範囲が狭くなる。そうすると、有向グラフの始点からの経路は、n+1枚目以降の投影画像において、動被写体の分断リスクが高い経路となる可能性が高くなってしまう。
そこで、本技術では、投影画像MP(n)の各位置Cx(n)までの最小コスト経路のうち、位置Cx(n)が大きい経路ほど、その経路の優先度P(Cx(n))は小さい値とされる。
ここで、位置Cx(n)の大きさのみを、経路の削除要因とした場合における画像データの削除について、図16乃至図19を参照して説明する。
図16は、8枚目の投影画像MP(8)までが得られた時点における有向グラフを示している。
この例では、有向グラフの始点から、8枚目の投影画像MP(8)の各位置Cx(8)までの最小コスト経路として、実質的に4つの経路が得られている。すなわち、最小コスト経路Path(Cx(8)=610)、最小コスト経路Path(Cx(8)=880)、最小コスト経路Path(Cx(8)=940)、および最小コスト経路Path(Cx(8)=1140)が得られている。
これらの4つの最小コスト経路のうち、その経路の終点である位置Cx(8)が最も大きいのは、位置Cx(8)=1140を終点とする最小コスト経路Path(Cx(8)=1140)であるから、この最小コスト経路Path(Cx(8)=1140)が削除される。つまり、最小コスト経路Path(Cx(8)=1140)のみが通る各投影画像の領域の画像データがメモリから削除される。
その結果、図17に示すように、3つの最小コスト経路Path(Cx(8)=610)、最小コスト経路Path(Cx(8)=880)、および最小コスト経路Path(Cx(8)=940)により示される投影画像の領域の画像データのみがメモリに保持された状態となる。
換言すれば、最小コスト経路Path(Cx(8)=610)、最小コスト経路Path(Cx(8)=880)、および最小コスト経路Path(Cx(8)=940)の各経路上に含まれない投影画像の領域の画像データは、メモリに保持されない。これにより、図16に示した状態と比べて、画像データの保持に使用されているメモリ量を低減させることができる。
このように、つなぎ目の候補となる位置が最も+Cx方向側にある最小コスト経路を削除する場合においても、本来であれば有向グラフの始点から終点までの最小コスト経路が、削除してしまった最小コスト経路を含む可能性もある。
しかし、8枚目の投影画像MP(8)までが得られた時点では、最終的にどの経路が最小コスト経路となるかを特定することができない。そのため、本技術では、つなぎ目の候補となる位置、つまり位置Cx(8)が考慮され、次の9枚目の投影画像MP(9)のつなぎ目の位置の候補となり得る位置の範囲が極力広くなるように、位置Cx(8)が最も+Cx方向側にある最小コスト経路が削除される。
図16では、終点の位置Cx(8)が最大となる最小コスト経路Path(Cx(8)=1140)が削除される。しかし、9枚目以降の投影画像について各位置Cx(n)までの最小コスト経路を探索するときに、削除された最小コスト経路を含む経路が最小コスト経路として採用されるのは、9枚目以降の投影画像のつなぎ目の位置が位置Cx(8)=1140よりも+Cx方向側にある場合だけである。
したがって、そのような経路は採用される可能性が低い経路であるといえる。そこで、本技術では、このような採用される可能性が最も低い最小コスト経路から削除していくことで、効率的なメモリ量の削減が実現される。
ところで、位置Cx(8)が最大となる最小コスト経路Path(Cx(8)=1140)を削除して図17に示した状態となったとしても、まだメモリ量が不足することも有り得る。
そのような場合には、現時点、つまり図17に示す状態で残っている実質的な3つの経路のうち、位置Cx(8)が最大となる経路がさらに削除される。
図17に示す状態では、3つの最小コスト経路Path(Cx(8)=610)、最小コスト経路Path(Cx(8)=880)、および最小コスト経路Path(Cx(8)=940)が残っているので、それらの経路のうち、位置Cx(8)が最大となる最小コスト経路Path(Cx(8)=940)が削除される。
最小コスト経路Path(Cx(8)=940)の削除により、この最小コスト経路Path(Cx(8)=940)のみが通る各投影画像の領域の画像データがメモリから削除される。その結果、図18に示すように、2つの最小コスト経路Path(Cx(8)=610)、および最小コスト経路Path(Cx(8)=880)により示される投影画像の領域の画像データのみがメモリに保持された状態となる。
換言すれば、最小コスト経路Path(Cx(8)=610)、および最小コスト経路Path(Cx(8)=880)の各経路上に含まれない投影画像の領域の画像データは、メモリに保持されない。これにより、図17に示した状態と比べて、画像データの保持に使用されているメモリ量をさらに低減させることができる。
さらに、それでもメモリ量が不足する場合には、図18に示す状態で残っている2つの経路のうち、位置Cx(8)が大きい方の経路がさらに削除される。
図18に示す状態では、2つの最小コスト経路Path(Cx(8)=610)、および最小コスト経路Path(Cx(8)=880)が残っているので、位置Cx(8)がより大きい最小コスト経路Path(Cx(8)=880)が削除される。
最小コスト経路Path(Cx(8)=880)の削除により、この最小コスト経路Path(Cx(8)=880)のみが通る各投影画像の領域の画像データがメモリから削除される。
その結果、図19に示すように、最小コスト経路Path(Cx(8)=610)により示される投影画像の領域の画像データのみがメモリに保持された状態となる。これにより、図18に示した状態と比べて、画像データの保持に使用されているメモリ量をさらに低減させることができる。
[つなぎ目の候補となる位置の差分値を考慮した使用メモリ量の削減について]
さらに、4つ目の要素として、投影画像MP(n)のつなぎ目の候補となる位置Cx(n)の差分値ΔCx(n)を考慮した使用メモリ量の削減について説明する。
さらに、4つ目の要素として、投影画像MP(n)のつなぎ目の候補となる位置Cx(n)の差分値ΔCx(n)を考慮した使用メモリ量の削減について説明する。
例えば、有向グラフにおける投影画像MP(n)の互いに隣接するつなぎ目の候補となる位置Cx(n)の差分値ΔCx(n)が小さいほど、それらの2つの位置Cx(n)の間に動被写体が存在する確率は低くなる。
そのため、その位置Cx(n)までの最小コスト経路の削除により生じる、削除した経路よりも+Cx方向側にある他の経路の動被写体分断リスクの増加は小さくなる。そこで、本技術では、差分値ΔCx(n)が小さい経路ほど、その経路の優先度P(Cx(n))は小さい値とされる。
ここで、差分値ΔCx(n)の値のみを、経路の削除要因とした場合における画像データの削除について、図20乃至図23を参照して説明する。
図20は、8枚目の投影画像MP(8)までが得られた時点における有向グラフを示している。
この例では、有向グラフの始点から、8枚目の投影画像MP(8)の各位置Cx(8)までの最小コスト経路として、実質的に4つの経路が得られている。すなわち、最小コスト経路Path(Cx(8)=610)、最小コスト経路Path(Cx(8)=880)、最小コスト経路Path(Cx(8)=940)、および最小コスト経路Path(Cx(8)=1140)が得られている。
また、最小コスト経路Path(Cx(8)=1140)についての差分値ΔCx(8)は、その最小コスト経路の終点である位置Cx(8)=1140と、その図中、左側に位置する最小コスト経路Path(Cx(8)=940)の終点である位置Cx(8)=940との差分「200」である。
同様に、最小コスト経路Path(Cx(8)=940)についての差分値ΔCx(8)は、その最小コスト経路の終点の位置Cx(8)=940と、その図中、左側に位置する最小コスト経路Path(Cx(8)=880)の終点の位置Cx(8)=880との差分「60」である。
さらに、最小コスト経路Path(Cx(8)=880)についての差分値ΔCx(8)は、その最小コスト経路の終点の位置Cx(8)=880と、その図中、左側に位置する最小コスト経路Path(Cx(8)=610)の終点の位置Cx(8)=610との差分「270」である。なお、図中、最も左側に位置する最小コスト経路Path(Cx(8)=610)についての差分値ΔCx(8)は無いものとする。
図20の例では、差分値ΔCx(8)が求められた3つの最小コスト経路のうち、差分値ΔCx(8)の値が最も小さい経路は、差分値ΔCx(8)が60となる最小コスト経路Path(Cx(8)=940)であるから、この最小コスト経路Path(Cx(8)=940)が削除される。つまり、最小コスト経路Path(Cx(8)=940)のみが通る各投影画像の領域の画像データがメモリから削除される。
その結果、図21に示すように、3つの最小コスト経路Path(Cx(8)=610)、最小コスト経路Path(Cx(8)=880)、および最小コスト経路Path(Cx(8)=1140)により示される投影画像の領域の画像データのみがメモリに保持された状態となる。
換言すれば、最小コスト経路Path(Cx(8)=610)、最小コスト経路Path(Cx(8)=880)、および最小コスト経路Path(Cx(8)=1140)の各経路上に含まれない投影画像の領域の画像データは、メモリに保持されない。これにより、図20に示した状態と比べて、画像データの保持に使用されているメモリ量を低減させることができる。
このように、差分値ΔCx(n)が最小となる最小コスト経路を削除する場合においても、本来であれば有向グラフの始点から終点までの最小コスト経路が、削除してしまった最小コスト経路を含む可能性もある。
しかし、8枚目の投影画像MP(8)まで得られた時点では、最終的にどの経路が最小コスト経路となるかを特定することができない。そのため、本技術では、差分値ΔCx(n)が考慮され、次の9枚目の投影画像MP(9)以降においてつなぎ目の位置の候補となる位置の選択範囲が極力広くなるように、差分値ΔCx(n)が最小となる最小コスト経路が削除される。
ところで、差分値ΔCx(n)が最小となる最小コスト経路Path(Cx(8)=940)を削除して図21に示した状態となったとしても、まだメモリ量が不足することも有り得る。
そのような場合には、現時点、つまり図21に示す状態で残っている3つの経路のうち、差分値ΔCx(n)が最小となる経路がさらに削除される。
図21に示す状態では、3つの最小コスト経路Path(Cx(8)=610)、最小コスト経路Path(Cx(8)=880)、および最小コスト経路Path(Cx(8)=1140)が残っており、それらの経路のうち、最小コスト経路Path(Cx(8)=880)と最小コスト経路Path(Cx(8)=1140)について、差分値ΔCx(n)が求められている。
図21では、最小コスト経路Path(Cx(8)=1140)についての差分値ΔCx(8)は、その最小コスト経路の終点である位置Cx(8)=1140と、その図中、左側に位置する最小コスト経路Path(Cx(8)=880)の終点である位置Cx(8)=880との差分「260」である。
また、最小コスト経路Path(Cx(8)=880)についての差分値ΔCx(8)は、その最小コスト経路の終点である位置Cx(8)=880と、その図中、左側に位置する最小コスト経路Path(Cx(8)=610)の終点である位置Cx(8)=610との差分「270」である。
そこで、それらの2つの経路のうち、差分値ΔCx(n)がより小さい方の最小コスト経路Path(Cx(8)=1140)が削除される。
最小コスト経路Path(Cx(8)=1140)の削除により、この最小コスト経路Path(Cx(8)=1140)のみが通る各投影画像の領域の画像データがメモリから削除される。その結果、図22に示すように、2つの最小コスト経路Path(Cx(8)=610)、および最小コスト経路Path(Cx(8)=880)により示される投影画像の領域の画像データのみがメモリに保持された状態となる。
換言すれば、最小コスト経路Path(Cx(8)=610)、および最小コスト経路Path(Cx(8)=880)の各経路上に含まれない投影画像の領域の画像データは、メモリに保持されない。これにより、図21に示した状態と比べて、画像データの保持に使用されているメモリ量をさらに低減させることができる。
さらに、それでもメモリ量が不足する場合には、図22に示す状態で残っている2つの経路のうち、差分値ΔCx(n)が最小となる経路がさらに削除される。
図22に示す状態では、2つの最小コスト経路Path(Cx(8)=610)、および最小コスト経路Path(Cx(8)=880)が残っており、それらの経路のうち、最小コスト経路Path(Cx(8)=880)について、差分値ΔCx(n)が求められている。
そこで、差分値ΔCx(n)が求められている最小コスト経路Path(Cx(8)=880)が削除される。最小コスト経路Path(Cx(8)=880)の削除により、この最小コスト経路Path(Cx(8)=880)のみが通る各投影画像の領域の画像データがメモリから削除される。
その結果、図23に示すように、最小コスト経路Path(Cx(8)=610)により示される投影画像の領域の画像データのみがメモリに保持された状態となる。これにより、図22に示した状態と比べて、画像データの保持に使用されているメモリ量をさらに低減させることができる。
[画像データの削減量を考慮した使用メモリ量の削減について]
最後に、5つ目の要素として、1つの経路を削除したときに生じる画像データの削減量を考慮した使用メモリ量の削減について説明する。
最後に、5つ目の要素として、1つの経路を削除したときに生じる画像データの削減量を考慮した使用メモリ量の削減について説明する。
例えば、有向グラフにおける始点から、投影画像MP(n)の各位置Cx(n)までの経路のうちの1つの経路に注目したとする。この場合、各経路により示される画像領域のなかで、注目する経路でのみ示される画像領域の画像データが、注目する経路の削減によって削減可能な画像データ量である。
各経路により示される画像領域のなかで、注目する最小コスト経路でのみ示される画像領域の大きさを画像領域長A(Cx(n))とすると、この画像領域長A(Cx(n))が大きいほど、削減できるメモリ量は多くなる。そこで、本技術では、画像領域長A(Cx(n))が大きい経路ほど、その経路の優先度P(Cx(n))は小さい値とされる。
ここで、画像領域長A(Cx(n))の値のみを、経路の削除要因とした場合における画像データの削除について、図24乃至図27を参照して説明する。
図24は、8枚目の投影画像MP(8)までが得られた時点における有向グラフを示している。
この例では、有向グラフの始点から、8枚目の投影画像MP(8)の各位置Cx(8)までの最小コスト経路として、実質的に4つの経路が得られている。すなわち、最小コスト経路Path(Cx(8)=610)、最小コスト経路Path(Cx(8)=880)、最小コスト経路Path(Cx(8)=940)、および最小コスト経路Path(Cx(8)=1140)が得られている。
また、最小コスト経路Path(Cx(8)=610)についての画像領域長A(Cx(8)=610)は、最小コスト経路Path(Cx(8)=610)を表す折れ線のうち、領域RQ11内に含まれている図中、横方向の線分の長さの総和であり、画像領域長A(Cx(8)=610)=110となっている。
すなわち画像領域長A(Cx(8)=610)は、最小コスト経路Path(Cx(8)=610)を位置Cx(8)=610から、他の最小コスト経路との分岐点まで辿ったときに、その分岐点から位置Cx(8)=610までの間に通った投影画像の領域のCx方向の長さの総和である。
同様に、最小コスト経路Path(Cx(8)=880)についての画像領域長A(Cx(8)=880)は、最小コスト経路Path(Cx(8)=880)を表す折れ線のうち、領域RQ12内に含まれている図中、横方向の線分の長さの総和であり、画像領域長A(Cx(8)=880)=390となっている。
また、最小コスト経路Path(Cx(8)=940)についての画像領域長A(Cx(8)=940)は、最小コスト経路Path(Cx(8)=940)を表す折れ線のうち、領域RQ13内に含まれている図中、横方向の線分の長さの総和であり、画像領域長A(Cx(8)=940)=500となっている。
さらに、最小コスト経路Path(Cx(8)=1140)についての画像領域長A(Cx(8)=1140)は、最小コスト経路Path(Cx(8)=1140)を表す折れ線のうち、領域RQ14内に含まれている図中、横方向の線分の長さの総和であり、画像領域長A(Cx(8)=1140)=840となっている。
図24の例では、これらの4つの最小コスト経路のうち、画像領域長A(Cx(8))の値が最大となる経路は、画像領域長A(Cx(8)=1140)=840となる最小コスト経路Path(Cx(8)=1140)であるから、この最小コスト経路Path(Cx(8)=1140)が削除される。
つまり、最小コスト経路Path(Cx(8)=1140)のみが通る各投影画像の領域の画像データがメモリから削除される。位置Cx(8)=1141乃至1280の各位置における画像領域長A(Cx(8))も、画像領域長A(Cx(8)=1140)と同じであるが、ここでは、つなぎ目の候補となる位置までの最小コスト経路を代表として画像データがメモリから削除されている。
最小コスト経路Path(Cx(8)=1140)の削除が行なわれると、図25に示すように、3つの最小コスト経路Path(Cx(8)=610)、最小コスト経路Path(Cx(8)=880)、および最小コスト経路Path(Cx(8)=940)により示される投影画像の領域の画像データのみがメモリに保持された状態となる。
換言すれば、最小コスト経路Path(Cx(8)=610)、最小コスト経路Path(Cx(8)=880)、および最小コスト経路Path(Cx(8)=940)の各経路上に含まれない投影画像の領域の画像データは、メモリに保持されない。これにより、図24に示した状態と比べて、画像データの保持に使用されているメモリ量を低減させることができる。
このように、画像領域長A(Cx(8))が最大となる最小コスト経路を削除する場合においても、本来であれば有向グラフの始点から終点までの最小コスト経路が、削除してしまった最小コスト経路を含む可能性もある。
しかし、8枚目の投影画像MP(8)まで得られた時点では、最終的にどの経路が最小コスト経路となるかを特定することができない。そのため、本技術では、8枚目の投影画像MP(8)の各位置Cx(8)までの最小コスト経路のなかで、最小コスト経路のみで示される画像領域の大きさが最大となる経路が削除される。つまり、画像領域長A(Cx(8))が最大となる最小コスト経路が削除される。
ところで、画像領域長A(Cx(8))が最大となる最小コスト経路Path(Cx(8)=1140)を削除して図25に示した状態となったとしても、まだメモリ量が不足することも有り得る。
そのような場合には、現時点、つまり図25に示す状態で残っている3つの経路のうち、画像領域長A(Cx(8))が最大となる経路がさらに削除される。
図25に示す状態では、3つの最小コスト経路Path(Cx(8)=610)、最小コスト経路Path(Cx(8)=880)、および最小コスト経路Path(Cx(8)=940)が残っている。そして、それらの経路のうち、画像領域長A(Cx(8))が最大となるのは、画像領域長A(Cx(8)=940)=500となる最小コスト経路Path(Cx(8)=940)である。
そこで、それらの3つの経路のうち、画像領域長A(Cx(8))が最大となる最小コスト経路Path(Cx(8)=940)が削除される。
最小コスト経路Path(Cx(8)=940)の削除により、この最小コスト経路Path(Cx(8)=940)のみが通る各投影画像の領域の画像データがメモリから削除される。その結果、図26に示すように、2つの最小コスト経路Path(Cx(8)=610)、および最小コスト経路Path(Cx(8)=880)により示される投影画像の領域の画像データのみがメモリに保持された状態となる。
換言すれば、最小コスト経路Path(Cx(8)=610)、および最小コスト経路Path(Cx(8)=880)の各経路上に含まれない投影画像の領域の画像データは、メモリに保持されない。これにより、図25に示した状態と比べて、画像データの保持に使用されているメモリ量をさらに低減させることができる。
さらに、それでもメモリ量が不足する場合には、図26に示す状態で残っている2つの経路のうち、画像領域長A(Cx(8))がより大きい方の最小コスト経路が削除される。ここでは、画像領域長A(Cx(8)=610)=110,画像領域長A(Cx(8)=880)=390であるから、より画像領域長A(Cx(8))が大きい最小コスト経路Path(Cx(8)=880)が削除される。
最小コスト経路Path(Cx(8)=880)の削除により、この最小コスト経路Path(Cx(8)=880)のみが通る各投影画像の領域の画像データがメモリから削除される。その結果、図27に示すように、最小コスト経路Path(Cx(8)=610)により示される投影画像の領域の画像データのみがメモリに保持された状態となる。
換言すれば、最小コスト経路Path(Cx(8)=610)上に含まれない投影画像の領域の画像データは、メモリに保持されない。これにより、図26に示した状態と比べて、画像データの保持に使用されているメモリ量をさらに低減させることができる。
[優先度を用いた削減経路の決定について]
以上では、使用メモリ量の削減を目的として削除される経路を決定するための5つの要素について説明したが、次に、これらの5つの要素に基づいて、削除される経路を決定する方法について説明する。
以上では、使用メモリ量の削減を目的として削除される経路を決定するための5つの要素について説明したが、次に、これらの5つの要素に基づいて、削除される経路を決定する方法について説明する。
削除される経路を決定するための5つの要素として、最小合計コストS(Cx(n))、最小合計コストS(Cx(n))の差分値ΔS(Cx(n))、経路の終点となる位置Cx(n)、つなぎ目の候補となる位置Cx(n)の差分値ΔCx(n)、および画像領域長A(Cx(n))があると説明した。本技術では、これらの要素が総合的に判断され、各位置Cx(n)までの最小コスト経路の優先度P(Cx(n))の値が、次式(2)により定められる。
なお、式(2)において、α1乃至α5は、各要素である最小合計コストS(Cx(n))、絶対値|ΔS(Cx(n))|、位置Cx(n)、差分値ΔCx(n)、および画像領域長A(Cx(n))に乗算される、それらの要素の影響度を示すパラメータである。つまり、α1乃至α5は各要素の優先度P(Cx(n))への寄与率に応じて定められ、α1>0,α2>0,α3>0,α4>0,α5>0である。なお、これらのα1乃至α5パラメータは、例えばnの値や削除すべき画像データ量などに応じて、動的に定められるようにしてもよい。
また、式(2)において、βは、上述した5つの要素とは異なる他の要因による影響度を示すパラメータであり、β>0である。
特に、α5=0である場合、式(2)で得られる優先度は、最小コスト経路を含む経路が最終的な最小コスト経路として採用されたとき、その経路により示されるつなぎ目の位置で各投影画像をつなぎ合わせたときに、投影画像上の動被写体が分断されるリスクの度合いを示している。つまり、優先度が低い最小コスト経路ほど、動被写体の分断リスクが高いと予測される。
なお、ここでいう最小コスト経路を含む最終的な最小コスト経路とは、有向グラフにおける、1枚目の投影画像の開始端に対応するノードから、最後の投影画像の終端位置に対応するノードまでの最小コスト経路である。
式(2)の計算によって、各要素の線形結合により各位置Cx(n)までの最小コスト経路の優先度P(Cx(n))が求められると、それらの経路が優先度P(Cx(n))の小さいものから順に、削除対象の経路として選択され、選択された経路が削除されていく。
画像データを保持するためのメモリ量に上限が定められている場合には、優先度P(Cx(n))に基づいて選択された経路を削除する処理が、使用メモリ量が上限値内に収まるまで繰り返し行なわれていく。
このように本技術によれば、使用メモリ量に上限がある場合であっても、優先度P(Cx(n))に応じていくつかの経路を削除することで、パノラマ画像生成時の動被写体分断リスクが若干高くなる代わりに、画像データを保存するメモリ量の更なる削減が可能となる。これにより、使用メモリ量と品質(画質)のバランスを考慮しながら、極力高品質なパノラマ画像を得ることができる。
[画像処理装置の構成例]
次に、本技術を適用した具体的な実施の形態について説明する。
次に、本技術を適用した具体的な実施の形態について説明する。
図28は、本技術を適用した画像処理装置の一実施の形態の構成例を示す図である。
図28の画像処理装置11は、画像取得部21、投影部22、画像保持部23、動被写体マップ生成部24、有向グラフ生成部25、最小コスト経路探索部26、管理部27、およびパノラマ画像生成部28から構成される。
画像取得部21は、撮影装置により連続して撮影されたN枚の撮影画像を、順次、取得して投影部22に供給する。ここで、N枚の撮影画像は、例えば撮影装置を回転させながら撮影して得られた画像である。
投影部22は、撮影画像間の位置関係を示す同次変換行列と、撮影画像の撮影時の焦点距離Fとを取得するとともに、取得した同次変換行列と焦点距離Fに基づいて、画像取得部21からの撮影画像を円筒面上に射影して投影画像を生成する。
投影部22は、生成された投影画像、より詳細には投影画像の画像データを画像保持部23に供給する。なお、ここでは各撮影画像の焦点距離Fは同じ値であるものとする。
画像保持部23は、メモリなどからなり、投影部22から供給された投影画像の画像データを保持するとともに、保持している画像データを必要に応じて動被写体マップ生成部24やパノラマ画像生成部28に供給する。また、画像保持部23は、管理部27の制御にしたがって、保持している画像データを削除する。
動被写体マップ生成部24は、画像保持部23から供給された投影画像に基づいて動被写体マップを生成し、有向グラフ生成部25に供給する。有向グラフ生成部25は、動被写体マップ生成部24から供給された動被写体マップに基づいて有向グラフを生成し、最小コスト経路探索部26および管理部27に供給する。
最小コスト経路探索部26は、有向グラフ生成部25から供給された有向グラフに基づいて最小コスト経路を探索し、管理部27に供給するとともに、N枚目の投影画像について求められた最終的な最小コスト経路をパノラマ画像生成部28に供給する。なお、最小コスト経路探索部26は、最小コスト経路を探索するときには、管理部27から供給された、現時点において採用されている経路を参照して、それらの経路の何れかを含む経路を最小コスト経路とする。
管理部27は、有向グラフ生成部25から供給された有向グラフと、最小コスト経路探索部26からの探索結果とに基づいて、画像保持部23に保持されている画像データを管理する。すなわち、管理部27は、画像保持部23に保持されている画像データの削除を指示する。また、管理部27は、各最小コスト経路のうち、現時点において採用されている経路、つまり削除されていない経路を最小コスト経路探索部26に供給する。
パノラマ画像生成部28は、最小コスト経路探索部26から供給された最小コスト経路と、画像保持部23から供給された投影画像とに基づいてパノラマ画像を生成し、出力する。
[パノラマ画像生成処理の説明]
ところで、撮影装置によりN枚の撮影画像の連続撮影が開始され、それらの撮影画像間の同次変換行列が求められると、画像処理装置11によりパノラマ画像生成処理が行なわれ、パノラマ画像が生成される。以下、図29のフローチャートを参照して、画像処理装置11によるパノラマ画像生成処理について説明する。
ところで、撮影装置によりN枚の撮影画像の連続撮影が開始され、それらの撮影画像間の同次変換行列が求められると、画像処理装置11によりパノラマ画像生成処理が行なわれ、パノラマ画像が生成される。以下、図29のフローチャートを参照して、画像処理装置11によるパノラマ画像生成処理について説明する。
ステップS11において、画像取得部21は、撮影装置により撮影されたn枚目(但し、1≦n≦N)の撮影画像を取得して投影部22に供給する。
ステップS12において、投影部22は、1枚目とn枚目の撮影画像の位置関係を示す同次変換行列と、n枚目の撮影画像の焦点距離Fとを取得する。
ステップS13において、投影部22は、取得した同次変換行列と焦点距離Fに基づいて、画像取得部21からの撮影画像を円筒面上に射影(マッピング)して投影画像を生成する。すなわち、投影部22は、焦点距離Fを半径とする円筒面上の同次変換行列により定まる位置にn枚目の撮影画像をマッピングし、マッピングされた撮影画像をn枚目の投影画像とする。これにより、例えば図1の投影画像MP(n)が得られる。
n枚目の投影画像が得られると、投影部22は、その投影画像の画像データを画像保持部23に供給し、保持させる。また、動被写体マップ生成部24は、画像保持部23にn枚目の投影画像の画像データが保持されると、その画像データを取得して一時的に保持する。
ステップS14において、動被写体マップ生成部24は、画像保持部23から取得した投影画像の画像データに基づいて動被写体マップを生成し、有向グラフ生成部25に供給する。
例えば、動被写体マップ生成部24は、(n-1)枚目の投影画像MP(n-1)とn枚目の投影画像MP(n)との重複領域内の各位置について、その位置にある投影画像MP(n-1)と投影画像MP(n)の画素の画素値の差分情報を求める。
そして、動被写体マップ生成部24は、重複領域内のCx方向の位置が同じである各位置の差分情報の和を求め、そのCx方向の位置にある動被写体マップの画素の値を、求めた差分情報の和とすることで、動被写体マップを生成する。すなわち、各位置の差分情報のCx方向と垂直な方向への累積が行なわれる。これにより、例えば図2の動被写体マップHMn-1,nが得られる。
ステップS15において、有向グラフ生成部25は、動被写体マップ生成部24から供給された動被写体マップHMk-1,k(但し、k=2乃至n)に基づいて有向グラフを生成し、最小コスト経路探索部26および管理部27に供給する。
例えば、有向グラフ生成部25は、1枚目の投影画像からn枚目の投影画像までの各投影画像MP(k)を、それらの投影画像のCx方向の位置関係と撮影番号とに基づいて並べていく。つまり、各投影画像MP(k)のCx方向の位置関係が、同次変換行列により示される位置関係となり、かつ各投影画像がCx方向と垂直な方向に撮影番号順で並ぶように配置される。そして、有向グラフ生成部25は、そのようにして投影画像を並べたときの投影画像MP(k)上の各位置Cx(k)をノードとする有向グラフを生成する。
このとき、有向グラフのCx方向に隣接するノード間のコスト(エネルギ)は0とされ、Cx方向と垂直な方向に隣接するノード間のコスト(エネルギ)は、そのCx方向の位置と、それらのノードが存在する投影画像間の動被写体マップとに基づいて与えられる。つまり、位置Cx(n-1)から位置Cx(n)へのコストは、動被写体マップHMn-1,nにおける位置Cx(n)にある画素の値とされる。
ステップS16において、最小コスト経路探索部26は、有向グラフ生成部25から供給された有向グラフの各位置Cx(n)について、有向グラフの始点から位置Cx(n)までの最小コスト経路を動的計画法等により探索し、管理部27に供給する。ここで、有向グラフの始点とは、1枚目の投影画像MP(1)の-Cx方向側の端の位置である。
なお、このとき、最小コスト経路探索部26は、管理部27から供給された、有向グラフの位置Cx(n-1)までの最小コスト経路を参照し、これらの最小コスト経路の何れかを含む経路を、各位置Cx(n)までの最小コスト経路として求める。
ステップS17において、管理部27は、有向グラフ生成部25から供給された有向グラフと、最小コスト経路探索部26からの探索結果とに基づいて、画像保持部23に保持されている投影画像の一部の画像データを削除させる。画像保持部23は、管理部27の指示に応じて、保持している画像データのうちの一部を削除する。
具体的には、管理部27は、有向グラフの始点から各位置Cx(n)までの各最小コスト経路が通過する投影画像の領域を除く他の領域の画像データの削除を画像保持部23に対して指示する。つまり、各位置Cx(n)までの最小コスト経路が通過する投影画像の領域の画像データのみが保持されるように、画像データの削除が指示される。
例えば、図6の例では、n=4となっており、4枚目の投影画像MP(4)の各位置Cx(4)までの最小コスト経路が求められる。この例では、実質的に4つの最小コスト経路Path(Cx(4)=250)、最小コスト経路Path(Cx(4)=300)、最小コスト経路Path(Cx(4)=450)、および最小コスト経路Path(Cx(4)=800)が求められている。
したがって、この場合、画像保持部23では、最小コスト経路Path(Cx(4)=250)乃至最小コスト経路Path(Cx(4)=800)の各最小コスト経路が通っている投影画像の領域の画像データのみを残し、他の画像データは削除される。これにより、理論的にパノラマ画像の生成に使用される可能性のない画像データは削除され、理論的に使用される可能性のある画像データのみが保持されることになる。
ステップS18において、管理部27は、画像保持部23において投影画像の画像データを保持するためのメモリ量が不足しているか否かを判定する。
例えば、予め定められたメモリ量の上限値よりも、画像保持部23に保持されている画像データのデータ量が多い場合、メモリ量が不足していると判定される。
ステップS18においてメモリ量が不足していると判定された場合、画像保持部23に保持されている画像データをさらに削除するため、処理はステップS19に進む。
ステップS19において、管理部27は、有向グラフ生成部25から供給された有向グラフと、最小コスト経路探索部26からの探索結果とに基づいて、削除対象とする経路を決定する。
すなわち、管理部27は、有向グラフの各位置Cx(n)までの最小コスト経路について、有向グラフを用いて上述した式(2)を計算し、各最小コスト経路Path(Cx(n))の優先度P(Cx(n))を算出する。そして、管理部27は、各最小コスト経路Path(Cx(n))のうち、最も優先度P(Cx(n))が小さい経路を削除対象とする経路とする。
これにより、各位置Cx(n)までの経路のうち、現時点において最終的な動被写体の分断リスクが高くなると予測される経路が削除対象の経路とされる。
また、管理部27は、現時点において削除対象とされていない、各位置Cx(n)までの全ての経路を最小コスト経路探索部26に供給する。
ステップS20において、管理部27は、ステップS19の処理で決定した削除対象の経路を削除する。すなわち、管理部27は、削除対象の経路のみが通る投影画像の領域の画像データの削除を画像保持部23に指示し、画像保持部23は、その指示にしたがって画像データを削除する。
例えば、図8の例では、n=8となっており、8枚目の投影画像MP(8)の各位置Cx(8)までの最小コスト経路が求められている。この例では、実質的に4つの最小コスト経路Path(Cx(8)=610)、最小コスト経路Path(Cx(8)=880)、最小コスト経路Path(Cx(8)=940)、および最小コスト経路Path(Cx(8)=1140)が求められている。
この状態から、例えば最小コスト経路Path(Cx(8)=610)が削除対象の経路として選択されたとすると、最小コスト経路Path(Cx(8)=610)のみが通る投影画像の領域の画像データが画像保持部23から削除される。この場合、最小コスト経路Path(Cx(8)=611)乃至最小コスト経路Path(Cx(8)=879)のそれぞれも削除されたことになる。
削除対象の経路が削除されると、その後、処理はステップS18に戻り、上述した処理が繰り返し行なわれる。
また、ステップS18において、メモリ量が不足していないと判定された場合、ステップS21に進み、画像処理装置11は撮影画像の撮影が終了したか否かを判定する。例えば、N枚目の撮影画像まで処理が行なわれた場合、撮影が終了したと判定される。
なお、撮影画像の撮影を行いながらパノラマ画像生成処理が行なわれるようにすることが可能であるが、撮影画像の撮影が終了してからパノラマ画像生成処理が行なわれるようにしてもよい。そのような場合には、ステップS21では、全ての撮影画像について処理が行なわれたか、つまりN枚の撮影画像が取得されたかが判定される。
ステップS21において、まだ撮影が終了していないと判定された場合、処理はステップS11に戻り、上述した処理が繰り返される。
これに対して、ステップS21において、撮影が終了したと判定された場合、処理はステップS22に進む。この場合、直前に処理された撮影画像の撮影番号nはNである。
ステップS22において、最小コスト経路探索部26は、有向グラフの始点から終点までの最小コスト経路を探索する。すなわち、この時点においては、直前のステップS16の処理によって、有向グラフの始点から各位置Cx(N)までの最小コスト経路が求められている。そこで、最小コスト経路探索部26は、現時点で求められている最小コスト経路のうち、最も合計コストが低いものを最終的な最小コスト経路とする。ここで、有向グラフの終点とは、N枚目の投影画像MP(N)の+Cx方向側の端の位置である。
なお、この場合、直前のステップS20の処理で削除された経路を除外して最終的な最小コスト経路が決定されてもよいし、直前のステップS20の処理で経路を削除せずに最終的な最小コスト経路が決定されてもよい。
最終的な最小コスト経路が決定されると、最小コスト経路探索部26は、決定した最小コスト経路をパノラマ画像生成部28に供給する。
ステップS23において、パノラマ画像生成部28は、最小コスト経路探索部26から供給された最小コスト経路と、画像保持部23から供給された投影画像とに基づいてパノラマ画像を生成する。
例えば、パノラマ画像生成部28は、最小コスト経路が通る各投影画像の領域を切り出し領域として、各投影画像から切り出し領域を切り出し、それらの切り出し領域を並べてつなぎ合わせることで1つのパノラマ画像を生成する。
例えば、図5に示した経路PT11が最終的な最小コスト経路として採用された場合、パノラマ画像生成部28は、切り出し領域KR(1)乃至切り出し領域KR(10)をつなぎ合わせることで、パノラマ画像を生成する。
ステップS24において、パノラマ画像生成部28は、生成したパノラマ画像を出力し、パノラマ画像生成処理は終了する。
以上のようにして画像処理装置11は、n枚目までの投影画像を用いて有向グラフを生成し、n枚目の投影画像までのつなぎ目の候補を定める処理を繰り返し行なうことで、最終的に1枚目からN枚目までの投影画像のつなぎ目の位置、つまり最小コスト経路を決定する。
このように、全ての投影画像を考慮して各投影画像間のつなぎ目の位置を決定することで、なるべく動被写体が分断されないような投影画像間のつなぎ目の位置を求めることができ、その結果、より高品質なパノラマ画像を得ることができる。また、n枚目の投影画像までのつなぎ目の候補を定めながら、適宜、画像保持部23から画像データを削除するようにしたので、計算コストと使用メモリ量を削減することができる。
ところで、上述した一連の処理は、ハードウェアにより実行することもできるし、ソフトウェアにより実行することもできる。一連の処理をソフトウェアにより実行する場合には、そのソフトウェアを構成するプログラムが、コンピュータにインストールされる。ここで、コンピュータには、専用のハードウェアに組み込まれているコンピュータや、各種のプログラムをインストールすることで、各種の機能を実行することが可能な、例えば汎用のパーソナルコンピュータなどが含まれる。
図30は、上述した一連の処理をプログラムにより実行するコンピュータのハードウェアの構成例を示すブロック図である。
コンピュータにおいて、CPU(Central Processing Unit)201,ROM(Read Only Memory)202,RAM(Random Access Memory)203は、バス204により相互に接続されている。
バス204には、さらに、入出力インターフェース205が接続されている。入出力インターフェース205には、入力部206、出力部207、記録部208、通信部209、及びドライブ210が接続されている。
入力部206は、キーボード、マウス、マイクロホン、撮像素子などよりなる。出力部207は、ディスプレイ、スピーカなどよりなる。記録部208は、ハードディスクや不揮発性のメモリなどよりなる。通信部209は、ネットワークインターフェースなどよりなる。ドライブ210は、磁気ディスク、光ディスク、光磁気ディスク、又は半導体メモリなどのリムーバブルメディア211を駆動する。
以上のように構成されるコンピュータでは、CPU201が、例えば、記録部208に記録されているプログラムを、入出力インターフェース205及びバス204を介して、RAM203にロードして実行することにより、上述した一連の処理が行われる。
コンピュータ(CPU201)が実行するプログラムは、例えば、パッケージメディア等としてのリムーバブルメディア211に記録して提供することができる。また、プログラムは、ローカルエリアネットワーク、インターネット、デジタル衛星放送といった、有線または無線の伝送媒体を介して提供することができる。
コンピュータでは、プログラムは、リムーバブルメディア211をドライブ210に装着することにより、入出力インターフェース205を介して、記録部208にインストールすることができる。また、プログラムは、有線または無線の伝送媒体を介して、通信部209で受信し、記録部208にインストールすることができる。その他、プログラムは、ROM202や記録部208に、あらかじめインストールしておくことができる。
なお、コンピュータが実行するプログラムは、本明細書で説明する順序に沿って時系列に処理が行われるプログラムであっても良いし、並列に、あるいは呼び出しが行われたとき等の必要なタイミングで処理が行われるプログラムであっても良い。
また、本技術の実施の形態は、上述した実施の形態に限定されるものではなく、本技術の要旨を逸脱しない範囲において種々の変更が可能である。
例えば、本技術は、1つの機能をネットワークを介して複数の装置で分担、共同して処理するクラウドコンピューティングの構成をとることができる。
また、上述のフローチャートで説明した各ステップは、1つの装置で実行する他、複数の装置で分担して実行することができる。
さらに、1つのステップに複数の処理が含まれる場合には、その1つのステップに含まれる複数の処理は、1つの装置で実行する他、複数の装置で分担して実行することができる。
さらに、本技術は、以下の構成とすることも可能である。
[1]
複数の撮影画像をつなぎ合わせてパノラマ画像を生成する画像処理装置であって、
互いに隣接する前記撮影画像間の差分情報を算出する差分情報算出部と、
各前記撮影画像の位置関係と前記差分情報に基づいて動被写体の検出度合いをエネルギとした有向グラフを生成する有向グラフ生成部と、
前記撮影画像から生成された有向グラフの任意の始点から、N枚目の前記撮影画像の終端位置までの最小コスト経路を探索する経路探索部と、
前記最小コスト経路により定まる各前記撮影画像の領域をつなぎ合わせて前記パノラマ画像を生成するパノラマ画像生成部と
を備える画像処理装置。
[2]
前記有向グラフ生成部は、n≦Nとなるnについて、1枚目乃至n枚目の前記撮影画像に基づいて前記有向グラフを生成し、
前記経路探索部は、前記有向グラフにおけるn枚目の前記撮影画像の各位置に対応する位置のそれぞれを終点として、前記終点ごとに、前記始点から前記終点までの前記最小コスト経路を探索し、それらの前記最小コスト経路の探索結果に基づいて、1枚目乃至n+1枚目の前記撮影画像から生成された前記有向グラフについての前記最小コスト経路を探索する処理を繰り返し行なうことで、前記始点から前記終端位置までの前記最小コスト経路を探索する
[1]に記載の画像処理装置。
[3]
前記撮影画像の画像データを保持する画像保持部と、
1枚目乃至n枚目の前記撮影画像から生成された前記有向グラフについての前記最小コスト経路の探索が行なわれた後、それらの前記最小コスト経路により示される前記撮影画像の領域の画像データのみが前記画像保持部に保持されるように、前記画像保持部における前記撮影画像の画像データを管理する管理部と
をさらに備える[2]に記載の画像処理装置。
[4]
前記管理部は、1枚目乃至n枚目の前記撮影画像から生成された前記有向グラフについての前記最小コスト経路の探索が行なわれた後、それらの前記最小コスト経路のうち、最も優先度の低い前記最小コスト経路のみにより示され、他の前記最小コスト経路により示されていない前記撮影画像の領域の画像データを前記画像保持部から削除させる
[3]に記載の画像処理装置。
[5]
前記管理部は、前記画像保持部に保持されている画像データ量が、予め定められたデータ量となるまで、前記優先度に基づいて画像データを削除させる処理を繰り返し行なう
[4]に記載の画像処理装置。
[6]
前記優先度は、1枚目乃至n枚目の前記撮影画像から生成された前記有向グラフについての前記最小コスト経路を含む、前記始点から前記終端位置までの前記最小コスト経路により定まる前記撮影画像の領域をつなぎ合わせたときに、前記撮影画像上の動被写体が分断されるリスクの度合いにより定められる
[4]または[5]に記載の画像処理装置。
[7]
前記管理部は、前記最小コスト経路までのコストの合計値、互いに隣接する前記最小コスト経路のコストの合計値の差分、前記最小コスト経路の前記終点の位置、互いに隣接する前記最小コスト経路の前記終点の位置の差分、または前記最小コスト経路のみにより示され、他の前記最小コスト経路により示されていない前記撮影画像の領域の画像データ量の少なくとも何れかに基づいて、前記優先度を定める
[6]に記載の画像処理装置。
複数の撮影画像をつなぎ合わせてパノラマ画像を生成する画像処理装置であって、
互いに隣接する前記撮影画像間の差分情報を算出する差分情報算出部と、
各前記撮影画像の位置関係と前記差分情報に基づいて動被写体の検出度合いをエネルギとした有向グラフを生成する有向グラフ生成部と、
前記撮影画像から生成された有向グラフの任意の始点から、N枚目の前記撮影画像の終端位置までの最小コスト経路を探索する経路探索部と、
前記最小コスト経路により定まる各前記撮影画像の領域をつなぎ合わせて前記パノラマ画像を生成するパノラマ画像生成部と
を備える画像処理装置。
[2]
前記有向グラフ生成部は、n≦Nとなるnについて、1枚目乃至n枚目の前記撮影画像に基づいて前記有向グラフを生成し、
前記経路探索部は、前記有向グラフにおけるn枚目の前記撮影画像の各位置に対応する位置のそれぞれを終点として、前記終点ごとに、前記始点から前記終点までの前記最小コスト経路を探索し、それらの前記最小コスト経路の探索結果に基づいて、1枚目乃至n+1枚目の前記撮影画像から生成された前記有向グラフについての前記最小コスト経路を探索する処理を繰り返し行なうことで、前記始点から前記終端位置までの前記最小コスト経路を探索する
[1]に記載の画像処理装置。
[3]
前記撮影画像の画像データを保持する画像保持部と、
1枚目乃至n枚目の前記撮影画像から生成された前記有向グラフについての前記最小コスト経路の探索が行なわれた後、それらの前記最小コスト経路により示される前記撮影画像の領域の画像データのみが前記画像保持部に保持されるように、前記画像保持部における前記撮影画像の画像データを管理する管理部と
をさらに備える[2]に記載の画像処理装置。
[4]
前記管理部は、1枚目乃至n枚目の前記撮影画像から生成された前記有向グラフについての前記最小コスト経路の探索が行なわれた後、それらの前記最小コスト経路のうち、最も優先度の低い前記最小コスト経路のみにより示され、他の前記最小コスト経路により示されていない前記撮影画像の領域の画像データを前記画像保持部から削除させる
[3]に記載の画像処理装置。
[5]
前記管理部は、前記画像保持部に保持されている画像データ量が、予め定められたデータ量となるまで、前記優先度に基づいて画像データを削除させる処理を繰り返し行なう
[4]に記載の画像処理装置。
[6]
前記優先度は、1枚目乃至n枚目の前記撮影画像から生成された前記有向グラフについての前記最小コスト経路を含む、前記始点から前記終端位置までの前記最小コスト経路により定まる前記撮影画像の領域をつなぎ合わせたときに、前記撮影画像上の動被写体が分断されるリスクの度合いにより定められる
[4]または[5]に記載の画像処理装置。
[7]
前記管理部は、前記最小コスト経路までのコストの合計値、互いに隣接する前記最小コスト経路のコストの合計値の差分、前記最小コスト経路の前記終点の位置、互いに隣接する前記最小コスト経路の前記終点の位置の差分、または前記最小コスト経路のみにより示され、他の前記最小コスト経路により示されていない前記撮影画像の領域の画像データ量の少なくとも何れかに基づいて、前記優先度を定める
[6]に記載の画像処理装置。
11 画像処理装置, 22 投影部, 23 画像保持部, 24 動被写体マップ生成部, 25 有向グラフ生成部, 26 最小コスト経路探索部, 27 管理部, 28 パノラマ画像生成部
Claims (9)
- 複数の撮影画像をつなぎ合わせてパノラマ画像を生成する画像処理装置であって、
互いに隣接する前記撮影画像間の差分情報を算出する差分情報算出部と、
各前記撮影画像の位置関係と前記差分情報に基づいて動被写体の検出度合いをエネルギとした有向グラフを生成する有向グラフ生成部と、
前記撮影画像から生成された有向グラフの任意の始点から、N枚目の前記撮影画像の終端位置までの最小コスト経路を探索する経路探索部と、
前記最小コスト経路により定まる各前記撮影画像の領域をつなぎ合わせて前記パノラマ画像を生成するパノラマ画像生成部と
を備える画像処理装置。 - 前記有向グラフ生成部は、n≦Nとなるnについて、1枚目乃至n枚目の前記撮影画像に基づいて前記有向グラフを生成し、
前記経路探索部は、前記有向グラフにおけるn枚目の前記撮影画像の各位置に対応する位置のそれぞれを終点として、前記終点ごとに、前記始点から前記終点までの前記最小コスト経路を探索し、それらの前記最小コスト経路の探索結果に基づいて、1枚目乃至n+1枚目の前記撮影画像から生成された前記有向グラフについての前記最小コスト経路を探索する処理を繰り返し行なうことで、前記始点から前記終端位置までの前記最小コスト経路を探索する
請求項1に記載の画像処理装置。 - 前記撮影画像の画像データを保持する画像保持部と、
1枚目乃至n枚目の前記撮影画像から生成された前記有向グラフについての前記最小コスト経路の探索が行なわれた後、それらの前記最小コスト経路により示される前記撮影画像の領域の画像データのみが前記画像保持部に保持されるように、前記画像保持部における前記撮影画像の画像データを管理する管理部と
をさらに備える請求項2に記載の画像処理装置。 - 前記管理部は、1枚目乃至n枚目の前記撮影画像から生成された前記有向グラフについての前記最小コスト経路の探索が行なわれた後、それらの前記最小コスト経路のうち、最も優先度の低い前記最小コスト経路のみにより示され、他の前記最小コスト経路により示されていない前記撮影画像の領域の画像データを前記画像保持部から削除させる
請求項3に記載の画像処理装置。 - 前記管理部は、前記画像保持部に保持されている画像データ量が、予め定められたデータ量となるまで、前記優先度に基づいて画像データを削除させる処理を繰り返し行なう
請求項4に記載の画像処理装置。 - 前記優先度は、1枚目乃至n枚目の前記撮影画像から生成された前記有向グラフについての前記最小コスト経路を含む、前記始点から前記終端位置までの前記最小コスト経路により定まる前記撮影画像の領域をつなぎ合わせたときに、前記撮影画像上の動被写体が分断されるリスクの度合いにより定められる
請求項5に記載の画像処理装置。 - 前記管理部は、前記最小コスト経路までのコストの合計値、互いに隣接する前記最小コスト経路のコストの合計値の差分、前記最小コスト経路の前記終点の位置、互いに隣接する前記最小コスト経路の前記終点の位置の差分、または前記最小コスト経路のみにより示され、他の前記最小コスト経路により示されていない前記撮影画像の領域の画像データ量の少なくとも何れかに基づいて、前記優先度を定める
請求項6に記載の画像処理装置。 - 複数の撮影画像をつなぎ合わせてパノラマ画像を生成する画像処理方法であって、
互いに隣接する前記撮影画像間の差分情報を算出し、
各前記撮影画像の位置関係と前記差分情報に基づいて動被写体の検出度合いをエネルギとした有向グラフを生成し、
前記撮影画像から生成された有向グラフの任意の始点から、N枚目の前記撮影画像の終端位置までの最小コスト経路を探索し、
前記最小コスト経路により定まる各前記撮影画像の領域をつなぎ合わせて前記パノラマ画像を生成する
ステップを含む画像処理方法。 - 複数の撮影画像をつなぎ合わせてパノラマ画像を生成する画像処理用のプログラムであって、
互いに隣接する前記撮影画像間の差分情報を算出し、
各前記撮影画像の位置関係と前記差分情報に基づいて動被写体の検出度合いをエネルギとした有向グラフを生成し、
前記撮影画像から生成された有向グラフの任意の始点から、N枚目の前記撮影画像の終端位置までの最小コスト経路を探索し、
前記最小コスト経路により定まる各前記撮影画像の領域をつなぎ合わせて前記パノラマ画像を生成する
ステップを含む処理をコンピュータに実行させるプログラム。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012-080130 | 2012-03-30 | ||
JP2012080130 | 2012-03-30 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2013146566A1 true WO2013146566A1 (ja) | 2013-10-03 |
Family
ID=49259821
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/JP2013/058221 WO2013146566A1 (ja) | 2012-03-30 | 2013-03-22 | 画像処理装置および方法、並びにプログラム |
Country Status (1)
Country | Link |
---|---|
WO (1) | WO2013146566A1 (ja) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114742707A (zh) * | 2022-04-18 | 2022-07-12 | 中科星睿科技(北京)有限公司 | 多源遥感图像拼接方法、装置、电子设备和可读介质 |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004088678A (ja) * | 2002-08-29 | 2004-03-18 | Hitachi Ltd | 画像処理方法及び装置 |
JP2008003683A (ja) * | 2006-06-20 | 2008-01-10 | Matsushita Electric Ind Co Ltd | 画像生成装置及びその方法並びに記録媒体 |
JP2011097246A (ja) * | 2009-10-28 | 2011-05-12 | Sony Corp | 画像処理装置および方法、並びにプログラム |
-
2013
- 2013-03-22 WO PCT/JP2013/058221 patent/WO2013146566A1/ja active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004088678A (ja) * | 2002-08-29 | 2004-03-18 | Hitachi Ltd | 画像処理方法及び装置 |
JP2008003683A (ja) * | 2006-06-20 | 2008-01-10 | Matsushita Electric Ind Co Ltd | 画像生成装置及びその方法並びに記録媒体 |
JP2011097246A (ja) * | 2009-10-28 | 2011-05-12 | Sony Corp | 画像処理装置および方法、並びにプログラム |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114742707A (zh) * | 2022-04-18 | 2022-07-12 | 中科星睿科技(北京)有限公司 | 多源遥感图像拼接方法、装置、电子设备和可读介质 |
CN114742707B (zh) * | 2022-04-18 | 2022-09-27 | 中科星睿科技(北京)有限公司 | 多源遥感图像拼接方法、装置、电子设备和可读介质 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8818046B2 (en) | Image processing device, image processing method, and program | |
US8416989B2 (en) | Image processing apparatus, image capture apparatus, image processing method, and program | |
JP4698754B2 (ja) | シーンチェンジ検出方法および装置 | |
CN108463994B (zh) | 图像处理装置、图像处理方法和存储介质 | |
CN103379291A (zh) | 图像处理装置、图像处理方法和程序 | |
US20090262180A1 (en) | Apparatus for generating panoramic images and method thereof | |
US9679223B2 (en) | Image processing method and apparatus | |
US20090225174A1 (en) | Image processing apparatus, image processing method, hand shake blur area estimation device, hand shake blur area estimation method, and program | |
CN104272344A (zh) | 图像处理装置、图像处理方法、图像处理程序以及记录介质 | |
US8994838B2 (en) | Motion adaptive cropping for video stabilization | |
JP5870636B2 (ja) | 画像処理装置および方法、並びにプログラム | |
JP2005269419A (ja) | 画像変形推定方法および画像変形推定装置 | |
US8340469B2 (en) | Information processing apparatus, information processing method, program, and image processing apparatus | |
US9317904B2 (en) | Image processing system and image processing method | |
JP5884723B2 (ja) | 画像合成装置、画像合成方法及びプログラム | |
WO2013146566A1 (ja) | 画像処理装置および方法、並びにプログラム | |
JP2010250611A (ja) | 画像処理装置、画像処理方法及び記録媒体 | |
JP2007181184A (ja) | 撮像装置および撮像方法、並びに撮像装置の設計方法 | |
CN109889736A (zh) | 基于双摄像头、多摄像头的图像获取方法、装置及设备 | |
US10853954B1 (en) | Image processing apparatus, image processing method and storage media | |
JP6915685B2 (ja) | 学習装置、超解像化装置、学習方法、超解像化方法およびプログラム | |
JP2018132946A (ja) | 視差算出装置 | |
JP2009302723A (ja) | 画像処理装置、方法およびプログラム | |
JP6398377B2 (ja) | 情報処理装置、情報処理方法及びプログラム | |
JP6955386B2 (ja) | 超解像装置及びプログラム |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 13768556 Country of ref document: EP Kind code of ref document: A1 |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 13768556 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: JP |
|
NENP | Non-entry into the national phase |
Ref country code: DE |