1. Field of the Invention
The present invention relates to techniques for editing an image in which an in-focus position can be set as desired after the image has been shot.
2. Description of the Related Art
An image capturing apparatus called a light field camera has been garnering attention in recent years. In addition to having an image capturing lens, the light field camera has a microlens array disposed on a surface of an image sensor, and light field information (light field data) indicating a travel direction of light is recorded along with an intensity of the light received by the image sensor. An image shot by a light field camera (a light field image) can on the basis of that light field data produce an image in which a desired position is in focus.
Japanese Patent Laid-Open No. 2014-011574 discloses generating a moving image that uses light field images as frames (a light field moving image), and determining an in-focus position (focus distance) in each frame of the light field moving image through user operations.
However, according to Japanese Patent Laid-Open No. 2014-011574, it is not easy to make fine adjustments to the focus distance in each frame of the light field moving image, and it has been difficult to visually confirm changes in the focus distance as time passes in the moving image.
The present invention has been made in consideration of the aforementioned problems, and realizes a technique that enables a focus distance in a frame at any desired time to be set with ease in a moving image in which an in-focus position can be set as desired in each frame after shooting.
In order to solve the aforementioned problems, the present invention provides an information processing apparatus comprising: an obtaining unit configured to obtain a moving image in which each frame is constituted by an image having a plurality of pieces of light field information; and a setting unit configured to set a focus distance for each frame of the moving image, wherein the setting unit displays a range of settable focus distances for each frame of the moving image.
In order to solve the aforementioned problems, the present invention provides a control method of an information processing apparatus, the method comprising: obtaining a moving image in which each frame is constituted by an image having a plurality of pieces of light field information; setting a focus distance for each frame of the moving image; and displaying a range of settable focus distances for each frame of the moving image.
In order to solve the aforementioned problems, the present invention provides a non-transitory computer-readable storage medium storing a program for causing a computer to execute a control method of an information processing apparatus, the method comprising: obtaining a moving image in which each frame is constituted by an image having a plurality of pieces of light field information; setting a focus distance for each frame of the moving image; and displaying a range of settable focus distances for each frame of the moving image.
According to the present invention, a focus distance in a frame at any desired time to be set with ease in a moving image in which an in-focus position can be set as desired in each frame after shooting.
Further features of the present invention will become apparent from the following description of exemplary embodiments (with reference to the attached drawings).
Embodiments of the present invention will be described in detail below. The following embodiments are merely examples for practicing the present invention. The embodiments should be properly modified or changed depending on various conditions and the structure of an apparatus to which the present invention is applied. The present invention should not be limited to the following embodiments. Also, parts of the embodiments to be described later may be properly combined.
Hereinafter, an embodiment in which a personal computer (“PC” hereinafter) that edits a moving image shot by a light field camera (a “light field moving image”) is applied as an information processing apparatus according to the present invention will be described. Note that the present invention can also be applied in an electronic device such as a smartphone, a tablet terminal, or the like that includes a light field camera.
In the light field moving image, each frame is constituted of a multi-viewpoint image having a plurality of pieces of light field information, and an in-focus position can be set as desired in each frame after the image has been shot.
In the stated light field moving image, the focus distance in a frame can easily be set at a desired time in a GUI (graphical user interface) of a moving image editing application according to the present embodiment.
Apparatus Configuration
First, the configuration of the information processing apparatus according to the present embodiment will be described with reference to
As illustrated in
The CPU 101 controls the various function blocks of the PC 100. The RAM 102 is a main memory that stores data. The RAM 102 is primarily used as a storage region for various types of data, such as a region for storing or loading programs executed by the CPU 101, a work region for programs being executed, and so on.
Image data to be displayed in the display device 110 is rendered in the VRAM 103. The image data generated by the VRAM 103 is transferred to the display control unit 109 and an image is then displayed in the display device 110. Note that the VRAM 103 may be the same as the RAM 102 as long as the data transfer speed of the RAM 102 is sufficiently high.
The ROM 104 is used to store various types of programs and data such as a boot program, application programs (such as the moving image editing application described in the present embodiment), an operating system (“OS” hereinafter), and the like.
The hard disk drive (“HDD” hereinafter) 105 is a high-capacity storage device that stores the stated applications, control programs such as the OS, content data such as moving images (including light field moving images, which will be described later) and still images, and so on.
The image processing unit 108 carries out encoding processing, decoding processing, and so on on image data stored in the HDD 105, image displayed in the display device 110, and so on.
The display control unit 109 controls the image data stored in the VRAM 103 to be read out and displayed in the display device 110.
The display device 110 includes a display unit such as a liquid crystal panel, an organic EL panel, or the like, and displays images on the basis of control signals from the display control unit 109. A moving image editing window (see
The memory I/F 106 controls the reading out and writing of data from and to the recording medium 111, which is a memory card 150, an external hard disk 160, or the like.
The recording medium 111 stores various control programs executed in the PC 100, content, data, and so on.
The input I/F 107 accepts user operations made through the operation unit 112, which is a mouse 113, a keyboard 114, a touch panel provided as part of the display device 110, and so on, and sends control signals to the CPU 101. The CPU 101 accepts the control signals input from the operation unit 112 and controls the various function blocks of the PC 100.
In the PC 100, the touch panel is formed as an integral part of an LCD panel, and is capable of detecting contact made with the display device 110. An input coordinate system of the touch panel is then associated with a display coordinate system of the display device 110. This makes it possible to configure a GUI that makes a user feel as if he or she can actually directly manipulate windows displayed in the display device 110.
The internal bus 113 is connected to the aforementioned function blocks so as to be capable of data communication therewith, and functions as a transmission path for sending various types of data, control information, and so on to the function blocks of the PC 100.
Overview of Moving Image Editing Application
Next, the moving image editing application according to the present embodiment will be described with reference to
As illustrated in
The focusable distance may differ depending on the moving image, and the design may be such that a focusable range is displayed differently depending on the moving image.
As will be described later, the focusable distance for each moving image is recorded in a header portion of the moving image file; on the basis of this information, the UI illustrated in
File Structure
Next, the file structure of a light field moving image 300, which is a subject of editing according to the present embodiment, will be described with reference to
As illustrated in
Next, a light field moving image focus distance setting process performed by the moving image editing application running on the PC 100 according to the present embodiment will be described with reference to
In step S401, the CPU 101 determines whether or not a moving image in the file display area 210 has been added to the timeline 240. In the case where a result of the determination indicates that a moving image has been added, the process advances to step S402; however, in the case where a moving image has not been added, the process returns to step S401 and stands by until a moving image is added to the timeline. The following assumes that a light field moving image read from the HDD 105, the recording medium 111, or the like has been added to the timeline 240 of the moving image editing application window 200 illustrated in
In step S402, the CPU 101 obtains information such as the total time, the frame rate, and so on of the moving image from the attribute information of the moving image added in step S401, and then renders the reproduction timing of the moving image on the timeline 240 in accordance with the current settings of the timeline 240.
In step S403, the CPU 101 obtains a total number of frames Fmax of the moving image from the attribute information of the moving image.
In step S404, the CPU 101 sets a variable i, for counting the number of frames, to i=1.
In step S405, the CPU 101 obtains the focus distance of an ith frame from the focus information in the attribute information of the moving image, and stores that focus distance in the RAM 102 along with a frame number of the frame.
In step S406, the CPU 101 determines whether or not the position of the ith frame matches the current reproduction position in the timeline 240. In the case where a result of the determination indicates a match, the process advances to step S407, whereas in the case where there is no match, the process advances to step S410.
In step S407, the CPU 101 determines whether or not the ith frame is light field data by referring to the refocus-capable flag of the ith frame in the focus information included in the attribute information of the moving image. In the case where a result of the determination indicates that the ith frame is light field data, the process advances to step S408, whereas in the case where the ith frame is not light field data, the process advances to step S409.
In step S408, the CPU 101 generates an image focused at the focus distance obtained in step S405, from the light field data stored in the image data portion 340 of the ith frame. A variety of processes exist for generating an image focused at a specific distance from light field data, but as this is not a feature of the present invention, detailed descriptions thereof will be omitted.
In step S409, the CPU 101 displays the image of the ith frame in the preview area 220.
In step S410, the CPU 101 increments i by 1.
In step S411, the CPU 101 determines whether or not i is greater than Fmax. In the case where a result of the determination indicates that i is greater than Fmax, the process advances to step S412, whereas in the case where i is less than or equal to Fmax, the process moves to step S405.
In step S412, the CPU 101 renders the Fmax focus distances stored in the RAM 102 in the setting area 250, and the process then ends.
Note that in addition to light field moving images, moving image files generated through existing compression/encoding methods have a total number of frames for the moving image, the focus distances for each frame, and so on stored in a predetermined region in the same manner as the light field moving images according to the present embodiment, and thus this processing can be applied thereto as well.
In step S601 of
In step S602, the CPU 101 obtains a frame number F and a vertical axis value L of the position where the click was made in the moving image of segment 1. The vertical axis value L serves as the focus distance set for the Fth frame. The obtained frame number and vertical axis value are stored in the RAM 102 in association with each other. Hereinafter, the position where the user clicked in the setting area 250 will be called a “node”, and a dot is displayed in the node position.
In step S603, the CPU 101 obtains, from the RAM 102, the position of a node that is, in segment 1, adjacent in the horizontal axis direction to the node set in step S602. Next, for the two obtained nodes, a frame number Fa of the moving image of the node on the left side and a focus distance La of that frame, and a frame number Fb of the moving image of the node on the right side and a focus distance Lb of that frame, are respectively obtained.
In step S604, the CPU 101 calculates the focus distance for each frame in segment 1 and stores those focus distances with the frame numbers in the RAM 102. The calculated focus distances may be stored in a region of the focus information for the corresponding frames in the attribute information of the light field moving image. Details of this process will be given later.
In step S605, the CPU 101 renders the Fmax focus distances stored in the RAM 102 in the setting area 250, and the process then ends.
In step S611 of
In step S612, the CPU 101 calculates a focus distance Li of the ith frame through Formula 1, from the focus information in the attribute information of the moving image of segment 1.
Li=(L−La)/(F−Fa)×(i−Fa)+La (1)
The obtained focus distance is stored in the RAM 102 along with the frame number.
In step S613, the CPU 101 determines whether or not the position of the ith frame matches the current reproduction position in the timeline 240. In the case where a result of the determination indicates a match, the process advances to step S614, whereas in the case where there is no match, the process advances to step S616.
In step S614, the CPU 101 generates an image focused at the focus distance calculated in step S612, from the light field data stored in the image data portion 340 of the ith frame.
In step S615, the CPU 101 displays the image of the ith frame in the preview area 220.
In step S616, the CPU 101 increments i by 1.
In step S617, the CPU 101 determines whether or not i is greater than F. In the case where a result of the determination indicates that i is greater than F, the process advances to step S618, whereas in the case where i is less than or equal to F, the process moves to step S611.
In step S618, the CPU 101 calculates the focus distance L1 of the ith frame through Formula 2, from the focus information in the attribute information of the moving image of segment 1.
Li=(Lb−L)/(Fb−F)×(i−F)+L (2)
The obtained focus distance is stored in the RAM 102 along with the frame number.
Steps S619 to S622 are the same as steps S613 to S616.
In step S623, the CPU 101 determines whether or not i is greater than Fb. In the case where a result of the determination indicates that i is greater than Fb, the process ends, whereas in the case where i is less than or equal to Fb, the process moves to step S618.
Note that the lines, nodes, and so on rendered in the setting area 250 are assumed to have been accepted through a dragging operation made by the user. In the case where a line has been dragged, display control is carried out so that the line moves in the setting area 250 while holding the line shape, and when the dragging operation stops, the vertical axis values of each frame are obtained as the focus distances of those frames. Meanwhile, in the case where a node has been dragged, display control is carried out so that lines connected to the dragged node follow the node that moves, and when the dragging operation stops, the vertical axis values of each frame are obtained as the focus distances of those frames.
As described thus far, according to the present embodiment, the focus distance of a frame can easily be set at a desired time in a light field moving image in which the in-focus position of each frame can be set as desired after the moving image has been shot. Furthermore, changes in the in-focus position as time passes in the moving image can be visually confirmed.
Next, a moving image editing process according to a second embodiment will be described.
The first embodiment describes a configuration in which a single focus distance can be set for each frame in the setting area 250, a change in the in-focus position is rendered as a single polygonal line, and an image focused at the set in-focus position is generated. As opposed to this, the present embodiment describes a configuration in which two focus distances can be set for each frame, and a range can be set for the focus distance.
Note that processes that are the same as those in the first embodiment will be assigned the same reference numerals and descriptions thereof will be omitted. Furthermore, the PC configuration, moving image editing application overview, and file structure of the light field moving image according to the present embodiment are the same as those described in the first embodiment with reference to
In step S901 of
In step S902, the CPU 101 obtains the frame number F and the vertical axis value L at the position clicked in the frames of segment 1 and stores that information in the RAM 102.
In step S903, the CPU 101 obtains, from the RAM 102, the position of a node that is, in segment 1, adjacent in the horizontal axis direction to the node set in step S902. Next, for the two obtained nodes, the frame number Fa of the moving image at the node on the left side and the frame number Fb of the moving image at the node on the right side are obtained. In the example illustrated in
In step S904, the CPU 101 determines whether or not another node is present at the same frame position as the position clicked in step S901. In the case where a result of the determination indicates a node is present, the process advances to step S905, whereas in the case where no node is present, the process advances to step S908.
In step S905, the CPU 101 compares a focus distance Lo at the other node present at the same frame position with the vertical axis value L. In the case where a result of the comparison indicates that the value L is greater than the focus distance Lo, the process advances to step S906, whereas in the case where the value L is less than or equal to the focus distance Lo, the process advances to step S907.
In step S906, in the case where a plurality of adjacent nodes in the horizontal axis direction are present at the same frame position, the CPU 101 obtains the focus distance at the node having the greater focus distance (“maximum focus distance” hereinafter). Details of this process will be given later.
In step S907, in the case where a plurality of adjacent nodes in the horizontal axis direction are present at the same frame position, the CPU 101 obtains the focus distance at the node having the smaller focus distance (“minimum focus distance” hereinafter). Details of this process will be given later.
In step S908, for the two adjacent nodes obtained in step S903, the CPU 101 obtains the focus distance La at the node on the left side and the focus distance Lb at the node on the right side.
In step S909, the CPU 101 calculates the focus distance of each frame of the moving image in segment 1 using the frame numbers and focus distances at the nodes adjacent in the horizontal axis direction obtained in steps S906 to S0908. The focus distance calculation process is the same as that described in the first embodiment with reference to
In step S910, the CPU 101 renders the Fmax focus distances stored in the RAM 102 in the setting area 250, and the process then ends.
In step S921 of
In step S922, the CPU 101 obtains a maximum focus distance Lah of the adjacent nodes on the left side.
In step S923, the CPU 101 obtains the focus distance La of the adjacent nodes on the left side.
In step S924, the CPU 101 determines whether or not a plurality of adjacent nodes are present on the right side. In the case where a result of the determination indicates a plurality of nodes are present, the process advances to step S925, whereas in the case where a plurality of nodes are not present, the process advances to step S926.
In step S925, the CPU 101 obtains a maximum focus distance Lbh of the adjacent nodes on the right side, and the process ends.
In step S926, the CPU 101 obtains the focus distance Lb of the adjacent nodes on the right side, and the process ends.
In step S931 of
In step S932, the CPU 101 obtains a minimum focus distance Lal of the adjacent nodes on the left side.
In step S933, the CPU 101 obtains the focus distance La of the adjacent nodes on the left side.
In step S934, the CPU 101 determines whether or not a plurality of adjacent nodes are present on the right side. In the case where a result of the determination indicates a plurality of nodes are present, the process advances to step S935, whereas in the case where a plurality of nodes are not present, the process advances to step S936.
In step S935, the CPU 101 obtains a minimum focus distance Lbl of the adjacent nodes on the right side, and the process ends.
In step S936, the CPU 101 obtains the focus distance Lb of the adjacent nodes on the right side, and the process ends.
As illustrated in
Like the first embodiment, the maximum focus distance line and the minimum focus distance line rendered in the setting area 250 can be dragged by the user independent from each other. With respect to the dragging of the nodes, display control is carried out so that in the case where a plurality of nodes are present at the same frame position, both of the frame positions consistently match. For example, in
As described thus far, according to the present embodiment, in a light field moving image in which the in-focus position can be set as desired in each frame after the image has been shot, a plurality of focus distances can be set for the frames at desired times, which makes it possible to set a range for the in-focus position. Furthermore, changes in the in-focus position range as time passes in the moving image can be visually confirmed.
Although the focus distance range is expressed in the setting area 250 using polygonal lines in the present embodiment, the focus distance range may be represented by a curve using a technique such as spline interpolation instead of polygonal lines. The focus distance range may be displayed in any format as long as the format enables the focus distance range to be visually confirmed in the setting area 250; instead of a line display, a color of the focus distance range may be changed, a predetermined graphic such as an arrow may be rendered in the focus distance range in an identifiable manner, and so on.
Meanwhile, in the application window 200, an image to be displayed in the preview area 220 cannot be generated in the case where a light field moving image in which the focus distance is not stored in the focus information of the attribute information has been added to the timeline 240. In such a case, a pan-focus image of each frame may be generated and displayed as an initial display. An image focused at a distance set in the application window 200 in advance, an image focused on a main object in the moving image, or the like, for example, may be displayed as well.
In addition, in the setting area 250, the maximum value 251 and the minimum value 252 on the vertical axis may be variable within a range over which the light field data can be focused. For example, in
Meanwhile, in the case where a depth map is stored for each frame in the attribute information of the light field moving image and a specific object has been designated by clicking in the preview area 220, the distance to that object may be obtained from the depth map and displayed in the setting area 250. This enables the user to confirm the focus distance to the object to be focused on in the setting area 250.
In addition, in the case where a maximum depth distance in the depth map is compared with the vertical axis maximum value 251 in the setting area 250 and the maximum value 251 is greater, it is possible that an image not in focus anywhere in the screen will be generated. For example, assuming the distance from the camera lens surface to the wall 224 is 9 m in
In addition, in the process for generating an image of a frame in a light field moving image in which the focus distance has been changed, the moving image editing application according to the present embodiment may be provided with a function for generating a moving image file in a different format by applying a known compression/encoding method such as H.264. Although the focus range cannot be changed in moving image data generated in this manner, such moving image data can be viewed using a typical moving image player.
Embodiments of the present invention can also be realized by a computer of a system or apparatus that reads out and executes computer executable instructions (e. g., one or more programs) recorded on a storage medium (which may also be referred to more fully as a ‘non-transitory computer-readable storage medium’) to perform the functions of one or more of the above-described embodiments and/or that includes one or more circuits (e. g., application specific integrated circuit (ASIC)) for performing the functions of one or more of the above-described embodiments, and by a method performed by the computer of the system or apparatus by, for example, reading out and executing the computer executable instructions from the storage medium to perform the functions of one or more of the above-described embodiments and/or controlling the one or more circuits to perform the functions of one or more of the above-described embodiments. The computer may comprise one or more processors (e. g., central processing unit (CPU), micro processing unit (MPU)) and may include a network of separate computers or separate processors to read out and execute the computer executable instructions. The computer executable instructions may be provided to the computer, for example, from a network or the storage medium. The storage medium may include, for example, one or more of a hard disk, a random-access memory (RAM), a read only memory (ROM), a storage of distributed computing systems, an optical disk (such as a compact disc (CD), digital versatile disc (DVD), or Blu-ray Disc (BD)™), a flash memory device, a memory card, and the like.
While the present invention has been described with reference to exemplary embodiments, it is to be understood that the invention is not limited to the disclosed exemplary embodiments. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.
This application claims the benefit of Japanese Patent Application No. 2015-011684, filed Jan. 23, 2015 which is hereby incorporated by reference herein in its entirety.
Number | Date | Country | Kind |
---|---|---|---|
2015-011684 | Jan 2015 | JP | national |