The present invention contains subject matter related to Japanese Patent Application JP 2007-309220 filed on Nov. 29, 2007 and Japanese Patent Application JP 2008-218803 filed on Aug. 27, 2008 in the Japanese Patent Office respectively, the entire contents of which being incorporated herein by reference.
1. Field of the Invention
The present invention relates to a motion vector detecting apparatus and a motion vector detecting method that are suitably applied when detecting a motion vector from moving image data and carrying out image processing such as high-efficiency encoding, and also to a program that carries out a motion vector detecting process.
2. Description of the Related Art
In the past, in the field of moving image processing, motion information, that is, information on the direction of motion and the size of an object in images at different points in time, has been used to efficiently carry out image processing. For example, motion detection results are used during motion-compensated interframe encoding as part of high-efficiency encoding of images or during motion-based parameter control by a television noise reduction apparatus that uses an interframe time domain filter. Block matching is known as one method of calculating motion. During block matching, a one-frame image is divided into blocks that are units of a predetermined number of pixels and a search is conducted to find regions to which such blocks have moved. A motion vector detecting process that uses block matching has been commercialized by MPEG methods and the like, and image processing that uses motion vectors has become established as the most typical type of processing.
However, since block matching is processing that is carried out in block units, the detection of motion in each frame image will not necessarily be carried out with very high precision. For this reason, the present applicant proposed the motion vector detecting process disclosed in Japanese Unexamined Patent Application Publication No. 2005-175869. In this motion vector detecting process, evaluation values relating to motion for each pixel position are detected from an image signal, the detected evaluation values are held as an evaluation value table, and a plurality of vectors are extracted from the data in the evaluation value table as candidate vectors for the image. After this, for the plurality of candidate vectors that have been extracted, the correlation of pixels across frames that are associated by candidate vectors is determined for each pixel in every frame, and candidate vectors that connect pixels determined to have the highest correlation are decided as the motion vectors for such pixels. Such processing will be described in detail later in the embodiments of the invention.
The evaluation value obtained by the correlation determining unit 3 is supplied to an evaluation value table calculating unit 4 where the evaluation value is totaled by an evaluation value totaling unit 4a and the totaling result is stored in an evaluation value table memory 4b. The stored data of the evaluation value table memory 4b is supplied from an output terminal 5 as evaluation value table data to a circuit that forms the next stage.
By carrying out the processing shown in
When motion vectors are detected based on the evaluation value table data, the extent to which optimal motion vectors are decided will depend on the performance of the evaluation value table. According to the existing method shown in
However, in the processing by the existing method, for an image where there is almost no spatial gradient in some directions or in every direction, such as at positions where stripes or flat blocks of color appear in the image, if the evaluation value table is produced by merely determining the correlation as described above, there is the possibility of erroneous movements being included, which reduces the reliability of the evaluation value table. If the reliability of the evaluation value table falls, the precision of the motion vectors that are detected will also fall.
Also, if an existing evaluation value table is used, since erroneous movements will also be included when a plurality of different movements occur in the same image, the evaluation values caused by the actual movements will no longer stand out, which makes it difficult to detect the respective motion vectors.
It is desirable to improve the precision when detecting motion vectors using evaluation value information for motion vectors. It is further desirable to make it possible to detect a plurality of movements when a plurality of different movements are present.
The present invention is applied in the case where motion vectors are detected from moving image data. As the processing, evaluation value information is generated based on pixel value correlation information across a plurality of frames, and motion vectors are extracted for pixels that compose a frame in the moving image data based on the evaluation value table. After this, motion vectors are decided out of the motion vectors extracted as candidates. According to an embodiment of the present invention, evaluation value information can be formed from pixel value correlation information generated based on the movement direction of pixels.
According to an embodiment of the present invention, when the motion vectors are detected from the candidate vectors, information based on the movement direction of the pixel is used as the evaluation value information for obtaining the candidate vectors. This makes it possible to obtain pixel value correlation information that is narrowed to actual candidates and therefore a suitable evaluation value table can be obtained.
According to an embodiment of the present invention, when generating evaluation value information that is a frequency distribution of a correlation determination result, by considering information based on the movement direction or orientation of motion of the focus pixel and/or information based on the movement direction of a pixel that is a movement destination candidate, it is possible to reduce the number of erroneous movements for flat blocks of color or repeated patterns in an image. Accordingly, it is possible to generate evaluation value information that is highly reliable and to improve the precision of the detected motion vectors. In the case where a plurality of movements are present in the search area, for example, it is possible to obtain suitable evaluation values for the respective movements and simultaneously calculate the plurality of movements.
Preferred embodiments of the present invention will now be described in the following order.
A first embodiment of the present invention will now be described with reference to
This embodiment is a motion vector detecting apparatus that detects motion vectors from moving image data. As the detection processing, an evaluation value table for motion vectors is formed, data in the evaluation value table is totaled, and motion vectors are determined. Note that although a stored set of evaluation value information for the motion vectors is referred to as an “evaluation value table” in the following description, the evaluation value table may not need to be constructed of stored information in the form of a table, and may simply be information showing evaluation values for motion vectors. For example, the evaluation values may be converted into a histogram and evaluation value information in the form of a histogram may be stored thereafter.
The evaluation value table data generated by the evaluation value table forming unit 12 is supplied to a motion vector detecting unit 13 where a plurality of motion vectors are extracted from the evaluation value table as candidate vectors inside one image (i.e., inside one frame). Here, a plurality of candidate vectors are extracted based on peaks appearing in the evaluation value table. The plurality of candidate vectors extracted at the motion vector detecting unit 13 are supplied to a motion vector deciding unit 14. For each pixel in every image, the motion vector deciding unit 14 carries out region matching or the like to determine the correlation between pixels across frames that are associated by the respective vectors in the plurality of candidate vectors that have been extracted at the motion vector detecting unit 13, and sets a candidate vector that connects blocks with the highest correlation as the motion vector corresponding to each pixel. The processing that obtains such motion vectors is executed by control carried out by a control unit (controller) 16.
Data on the set motion vectors is output from a motion vector output terminal 15. When doing so, as necessary the data may be appended to the image signal obtained at the image signal input terminal 11. The output motion vector data is used in high-efficiency encoding of the image data, for example. Alternatively, the motion vectors may be used in high-definition processing when the images are displayed on a television set. The motion vectors detected by the processing in this embodiment may also be used in other image processing.
The flowchart in
In the present embodiment, the evaluation value table forming processing at the evaluation value table forming unit 12 is carried out using the configuration shown in
The example configuration in
The difference across frames between the pixel value of the focus pixel stored in the focus pixel memory 21 and a pixel value input into the input terminal 11 is detected by the subtractor 22. Data on the detected difference is supplied to the absolute value calculating unit 23 and data on an absolute value of the difference is supplied to a correlation determining unit 30. The correlation determining unit 30 includes a comparator unit 31 that compares the supplied difference with a set threshold to obtain an evaluation value. As the evaluation value, as one example a binary value is set so that the correlation is “high” when the difference is equal to or below the threshold and so that the correlation is “low” when the difference exceeds the threshold.
The evaluation value obtained at the correlation determining unit 30 is supplied to a pixel selecting unit 40. The pixel selecting unit 40 includes a gate unit 41 that selects the binary value output from the correlation determining unit 30. As a configuration for controlling the gate unit 41, the pixel selecting unit 40 includes an motion orientation calculating unit 42, a spatial gradient determining unit 43, and a comparator unit 44. The motion orientation calculating unit 42 calculates the relative position of the focus pixel and the reference pixel from the data stored in the focus pixel memory 21 and calculates the orientation of motion from the relative position. When the orientation of motion has been calculated, the spatial gradient determining unit 43 reads data on the adjacent pixel in the orientation of motion from the focus pixel inside the same frame as the focus pixel from the focus pixel memory 21 and calculates the difference in pixel values between the pixel data of the focus pixel and the adjacent pixel data. Here, the difference in pixel values is the difference in luminance values between the pixels. The calculated difference values are sent to the comparator unit 44 that compares the difference value with an adjacent difference determining threshold set in advance, and when the comparison result is that the difference does not exceed the threshold, the evaluation value supplied to the gate unit 41 is prevented from passing through the gate. Conversely, when the comparison result is that the difference exceeds the threshold, the evaluation value supplied to the gate unit 41 is allowed to pass through the gate. The number of adjacent pixels, where the spatial gradient determining unit 43 has determined that a spatial gradient is present, is counted by a counter (not shown) provided in the pixel selecting unit 40.
The evaluation values that have passed the gate unit 41 included in the pixel selecting unit 40 are supplied to an evaluation value table calculating unit 50, are totaled at an evaluation value totaling unit 51, and the totaled result is stored in an evaluation value table memory 52. After this, the data stored in the evaluation value table memory 52 is supplied as evaluation value table data from an output terminal 12a to a circuit that forms the next stage.
As shown in
First, the motion orientation calculating unit 42 uses the data stored in the focus pixel memory 21 to calculate the relative position of the focus pixel in the previous frame and a reference pixel in the present frame (step S21). Once the relative position has been calculated, the relative position seen from the focus pixel is regarded as motion, and the orientation of such motion from the focus pixel is obtained by the motion orientation calculating unit 42 (step S22).
After this, an adjacent pixel in the orientation of motion in the same frame when looking from the focus pixel is read from the focus pixel memory 21 (step S23) and the difference between the pixel value of the adjacent pixel that has been read out and the pixel value of the focus pixel is calculated by the spatial gradient determining unit 43. When the difference value has been calculated, the difference value is compared with a threshold by the comparator unit 44 (step S25) and when the difference value exceeds the threshold, the evaluation value of the present focus pixel is allowed to pass through the gate unit 41, and the counter that counts the number of pixels where it is determined that a spatial gradient is present counts up by one (step S26). When the difference value does not exceed the threshold, the evaluation value of the present focus pixel is prevented from being passed through the gate unit 41 to prohibit the writing of such evaluation value in the evaluation value table (step S27).
The absolute value of the difference between the focus pixel and the reference pixel is detected by the correlation calculating unit 20 and it is determined whether the absolute value of the difference is below a threshold (step S28). When this determination finds that the difference is below the threshold, the evaluation value is sent from the correlation determining unit 30 to the gate unit 41 included in the pixel selecting unit 40. Conversely, when the difference is not below the threshold, the evaluation value is not sent to the gate unit 41 to prohibit the writing of the evaluation value in the evaluation value table (step S27).
When the processing up to this point has been carried out, out of the data that has been sent from the correlation determining unit 30 to the gate unit 41 in the pixel selecting unit 40 (i.e., out of the data where there is pixel correlation), the number (i.e., frequency) of the pixels allowed in the pixel selecting to pass the gate unit 41 is written into the evaluation value table (step S29). By writing in the evaluation value table in this way, information showing the number of pixels where there is a spatial gradient and where correlation has been determined is written in the evaluation value table. The number of pixels where correlation has been determined is the “frequency”, and is used as the evaluation value. Note that the frequency may be used as it is as the evaluation value or as another example, a value produced by dividing the frequency by the count value in step S26 may be used as a normalized evaluation value. Similarly, in the other example flowcharts that will be described later, when obtaining the evaluation values, it is possible to use the frequency as it is as an evaluation value or to use a value normalized by the count value.
An overview of the processing with the configuration shown in
First, as shown in
Here, in the present embodiment, as shown in
When the orientation of motion has been determined, as shown in
Note that although counting is executed when totaling is carried out at the evaluation value totaling unit 51 under the control of the pixel selecting unit 40 in the example in
In the examples shown in
Such configuration will now be described with reference to
In the configuration shown in
Whenever the pixel data of a frame is supplied, the spatial gradient pattern calculating unit 62 expresses, for each pixel, whether a spatial gradient is present between the focus pixel and a peripheral pixel using the value “0” or “1”, and stores such values as flags in the focus pixel pattern memory 63. After this, by referring to the flags, it is determined whether a spatial gradient is present based on an orientation in which movement has been detected. Flags showing whether a spatial gradient is present at each pixel generated for the present frame (i.e., at each reference pixel) at a given time t can be used at a time t+1 when the next frame is obtained as flags showing whether a spatial gradient is present at each pixel in the previous frame (i.e., at each focus pixel).
In the motion orientation calculating unit 66, relationships between relative positions (movement) inside the search area and closest directions are calculated in advance, and the calculated data is stored as the motion orientation LUT 65. The values of the stored LUT are sent to the focus pixel pattern memory 63, and the spatial gradient calculated by the spatial gradient pattern calculating unit 62 and the pattern for the adjacent pixel in the orientation of motion read out from the motion orientation LUT 65 are compared at the pattern comparator unit 64. When, as the comparison result, it is determined that a gradient is present, control is carried out to allow the evaluation value to pass the gate unit 61. Conversely, when it is determined that no gradient is present, control is carried out to prevent the evaluation value from passing the gate unit 61. When it has been determined at the pattern comparator unit 64 that there is a spatial gradient, the counter that counts up the number of pixels where there is a spatial gradient counts up by one.
As shown in
First, the spatial gradient pattern calculating unit 62 uses the data stored in the focus pixel memory 21 to calculate the relative position of the focus pixel in the previous frame and a reference pixel in the present frame (step S31) and determines the orientation of motion from the relative position. Data on the determined orientation of motion is read from the motion orientation LUT 65 (step S32), a pattern of the adjacent pixel in the orientation of motion is read from the focus pixel pattern memory 63 (step S33), and the pattern of the difference with the adjacent pixel is determined (step S34). When this determination determines that a spatial gradient is present, the counter for a value that shows that a spatial gradient is present counts up by one (step S35).
It is also determined whether the absolute value of the difference between the focus pixel and the reference pixel obtained at the correlation calculating unit 20 is below a threshold (step S37). When the determination finds that the difference is below the threshold, the evaluation value is sent from the correlation determining unit 30 to the gate unit 61 in the pixel selecting unit 60. Conversely, when it is determined in step S34 that there is no spatial gradient or when it is determined in step S37 that the difference between the focus pixel and the reference pixel exceeds a threshold, the evaluation value is prevented from passing the gate unit 61 and the evaluation value in question is not written in the evaluation value table memory 52 (step S36).
After this, the number (i.e., frequency) of values that have been allowed in the pixel selection to pass the gate unit 61 out of the data sent from the correlation determining unit 30 to the gate unit 61 in the pixel selecting unit 60 (i.e., the data where there is pixel correlation) is written into the evaluation value table (step S38).
As shown in
A second embodiment of the present invention will now be described with reference to
The present embodiment also relates to a motion vector detecting apparatus that detects motion vectors from moving image data. This motion vector detecting apparatus is the same as the first embodiment described above in that an evaluation value table is formed from pixel value correlation information and motion vectors are determined from the data of such evaluation value table.
The overall configuration and overall processing of the motion vector detecting apparatus are the same as the configuration shown in
In the present embodiment, the evaluation value table forming unit 12 included in the motion vector detecting apparatus shown in
In the present embodiment, the spatial gradients in the orientation of motion at both the focus pixel and the reference pixel are taken into account when obtaining pixel value correlation information and forming the evaluation value table. The definitions of “focus pixel” and “reference pixel” are the same as those given above in the first embodiment. That is, a focus pixel is a pixel position of a point (standard point) used as a standard for determining a motion vector and a reference pixel is a pixel within a search area in an earlier or later frame than the focus pixel.
The example configuration shown in
After this, data on the detected difference is supplied to the correlation determining unit 30. The correlation determining unit 30 includes a comparator unit 31 that compares the supplied difference with a set threshold to obtain an evaluation value. As the evaluation value, as one example a binary value is set so that the correlation is “high” when the difference is equal to or below the threshold and so that the correlation is “low” when the difference exceeds the threshold.
The evaluation value obtained at the correlation determining unit 30 is supplied to a pixel selecting unit 70. The pixel selecting unit 70 includes a gate unit 71 that selects the binary value output from the correlation determining unit 30. As a configuration for controlling the gate unit 71, the pixel selecting unit 70 includes an motion orientation calculating unit 72, a spatial gradient determining unit 73, and a comparator unit 74. The motion orientation calculating unit 72 calculates the relative position of the focus pixel and the reference pixel from the data stored in the reference pixel memory 24 and the data stored in the focus pixel memory 25 and calculates the orientation of motion from the relative position.
When the orientation of motion has been calculated, the spatial gradient determining unit 73 reads the pixel data of the reference pixel and the adjacent pixel in the orientation of motion from the reference pixel memory 24 and calculates the difference in pixel values between the pixel data of the reference pixel and the adjacent pixel data. The spatial gradient determining unit 73 also reads the pixel data of the focus pixel and the adjacent pixel in the orientation of motion from the focus pixel memory 25 and calculates the difference in pixel values between the pixel data of the focus pixel and the adjacent pixel data.
The comparator unit 74 determines if the difference with the adjacent pixel in the orientation of motion exceeds a threshold for both the focus pixel and the reference pixel, and when both differences exceed the threshold, the evaluation value supplied to the gate unit 71 is allowed to pass. When the difference does not exceed the threshold for either of the focus pixel and the reference pixel, the evaluation value supplied to the gate unit 71 is prevented from passing. When the spatial gradient determining unit 73 has determined that a spatial gradient is present, a counter, not shown that counts the number of pixels where it is determined that a spatial gradient is present counts up by one.
The evaluation values that have passed the gate unit 71 included in the pixel selecting unit 70 are supplied to an evaluation value table calculating unit 50, are totaled by an evaluation value totaling unit 51, and the totaled result is stored in an evaluation value table memory 52. After this, the stored data of the evaluation value table memory 52 is supplied as evaluation value table data from an output terminal 12a to a circuit that forms the next stage.
As shown in
First, the motion orientation calculating unit 72 calculates the relative position of the reference pixel and the focus pixel corresponding to such reference pixel (step S41) and calculates the orientation of motion from such relative position (step S42). After this, the pixel data of the adjacent pixel in the orientation of motion is read from the focus pixel memory 25 (step S43) and the difference between the read adjacent pixel and the focus pixel is calculated (step S44). Once the difference with the adjacent pixel has been calculated, it is determined whether the difference exceeds a threshold set in advance (step S45), and when the threshold is not exceeded in such determination, the present evaluation value is prevented from passing the gate unit 71 and writing into the evaluation value table is prohibited (step S50).
In step S45, when it has been determined that the difference between the focus pixel and the adjacent pixel exceeds the threshold, a counter for a value showing that a spatial gradient is present in the determination for the adjacent pixel counts up by one (step S46), the adjacent pixel in the orientation of motion is read from the reference pixel memory 24 (step S47), and the difference between the read adjacent pixel and the reference pixel is calculated (step S48). Once the difference with the adjacent pixel has been calculated, it is determined whether the difference exceeds a threshold set in advance (step S49), and when it is determined that the difference does not exceed the threshold, the present evaluation value is prevented from passing the gate unit 71 and writing into the evaluation value table is prohibited (step S50).
In addition, it is determined whether the absolute value of the difference between the focus pixel and the reference pixel obtained by detecting the pixel correlation at the correlation calculating unit 20′ and the correlation determining unit 30 is below a threshold (step S201). When this determination finds that the difference is below the threshold, the evaluation value is sent from the correlation determining unit 30 to the gate unit 71 included in the pixel selecting unit 70. When the difference is not below the threshold, writing into the evaluation value table is prohibited (step S50).
After this, out of the data sent from the correlation determining unit 30 to the gate unit 71 in the pixel selecting unit 70 (i.e., the data where there is pixel correlation), the number (frequency) of evaluation values that have passed the gate unit 71 in the pixel selecting processing is written in the evaluation value table (step S202).
Note that in the flowchart shown in
An overview of the processing with the configuration shown in
First, as shown in
Here in the present embodiment, as shown in
When the orientation of motion has been determined, as shown by the arrow drawn with a thick line in
In this determination, only when it has been determined that there is a spatial gradient at both the focus pixel and the reference pixel, the evaluation value of the reference pixel d1 at this time is written into the evaluation value table.
Although it is determined whether a spatial gradient is present in the calculation processing in the example shown in
This configuration will now be described with reference to
In the configuration shown in
Whenever the pixel data of a frame is supplied, the spatial gradient pattern calculating unit 82 expresses, for each pixel, whether a spatial gradient is present between the focus pixel and a peripheral pixel using the value “0” or “1”, and stores such values as flags in the reference pixel pattern memory 83. After this, by referring to the flags, it is determined whether a spatial gradient is present based on an orientation in which movement has been detected. Flags showing whether a spatial gradient is present at each pixel generated for the present frame (i.e., at each reference pixel) at a given time t can be used at a time t+1 when the next frame is obtained as flags showing whether a spatial gradient is present at each pixel in the previous frame (i.e., at each focus pixel). To do so, a configuration is used where the data stored in the reference pixel pattern memory 83 is moved to the focus pixel pattern memory 84.
In the motion orientation calculating unit 87, relationships between relative positions (movement) inside the search area and closest directions are calculated in advance, and the calculated data is stored as the motion orientation LUT 86. The values of the stored LUT are sent to the reference pixel pattern memory 83 and the focus pixel pattern memory 84, and the spatial gradient pattern calculated by the spatial gradient pattern calculating unit 82 and the pattern for the adjacent pixel in the orientation of motion read out from the motion orientation LUT 86 are compared at both the reference pixel and the focus pixel at the pattern comparator unit 85. When, as the comparison result, it is determined that a spatial gradient is present at both the focus pixel and the reference pixel, control is carried out to allow the evaluation value to pass the gate unit 81. Conversely, when it is determined that a spatial gradient is not present, control is carried out to prevent the evaluation value from passing the gate unit 81. When it has been determined by the pattern comparator unit 85 that spatial gradients are present, a counter (not shown) that counts up the number of pixels where there is a spatial gradient counts up by one.
As shown in
First, the spatial gradient pattern calculating unit 82 calculates the relative position of the focus pixel in the previous frame and a reference pixel in the present frame (step S51) and determines the orientation of motion from the relative position. Data on the determined orientation of motion is read from the motion orientation LUT 86 (step S52), a pattern of the adjacent pixel in the orientation of motion is read from the focus pixel pattern memory 84 (step S53), and the pattern of the difference with the adjacent pixel is determined (step S54). When this determination determines that a spatial gradient is not present at the focus pixel, the evaluation value is prevented from passing the gate unit 81 so that the evaluation value in question is not written into the evaluation value table memory 52 (step S58).
Conversely, when the determination determines that a spatial gradient is present, the counter that counts a value showing that a spatial gradient is present counts up by one (step S55), the pattern of the adjacent pixel in the orientation of motion is read from the reference pixel pattern memory 83 (step S56), and the pattern of the difference with the adjacent pixel is determined (step S57). When the determination determines that there is no spatial gradient at the reference pixel, the evaluation value is prevented from passing the gate unit 81 and the evaluation value in question is not written into the evaluation value table memory 52 (step S58).
It is also determined whether the absolute value of the difference between the focus pixel and the reference pixel obtained by detecting the pixel correlation at the correlation calculating unit 20′ and the correlation determining unit 30 is below a threshold (step S211). When the determination finds that the difference is below the threshold, the evaluation value is sent from the correlation determining unit 30 to the gate unit 81 included in the pixel selecting unit 80. Conversely, when it is determined that the difference between the focus pixel and the reference pixel is not below the threshold, the evaluation value is not sent to the gate unit 81 and the evaluation value in question is not written in the evaluation value table memory 52 (step S58).
After this, the number (i.e., frequency) of values that have been allowed by the pixel selection to pass the gate unit 81 out of the data sent from the correlation determining unit 30 to the gate unit 81 in the pixel selecting unit 80 (i.e., the data where there is pixel correlation) is written into the evaluation value table (step S212).
As shown in
Note that in the flowchart shown in
As shown in
A third embodiment of the present invention will now be described with reference to
The present embodiment also relates to a motion vector detecting apparatus that detects motion vectors from moving image data. This motion vector detecting apparatus is the same as the first embodiment described above in that an evaluation value table is formed from pixel value correlation information and motion vectors are determined from the data of such evaluation value table.
The overall configuration and overall processing of the motion vector detecting apparatus are the same as the configuration shown in
In the present embodiment, the evaluation value table forming unit 12 included in the motion vector detecting apparatus shown in
In the present embodiment, a plurality of spatial gradients in the orientation of motion at both the focus pixel and the reference pixel are taken into account when forming the evaluation value table. The plurality of spatial gradients referred to here are, for example, a closest orientation to the orientation of motion and a second closest orientation that is the next closest orientation following the closest orientation. The definitions of “focus pixel” and “reference pixel” are the same as those given earlier in the first and second embodiments. That is, a focus pixel is a pixel position of a point (standard point) used as a standard for determining a motion vector and a reference pixel is a pixel within a search area in an earlier or later frame than the focus pixel.
The example configuration shown in
After this, the detected difference data is supplied to the correlation determining unit 30. The correlation determining unit 30 includes a comparator unit 31 that compares the supplied difference with a set threshold to obtain an evaluation value. As the evaluation value, as one example a binary value is set so that the correlation is “high” when the difference is equal to or below the threshold and so that the correlation is “low” when the difference exceeds the threshold.
The evaluation value obtained at the correlation determining unit 30 is supplied to a pixel selecting unit 90. The pixel selecting unit 90 includes a gate unit 91 that selects the binary value output from the correlation determining unit 30. As a configuration for controlling the gate unit 91, the pixel selecting unit 90 includes an motion orientation calculating unit 92, a spatial gradient determining unit 93, and a comparator unit 94. The motion orientation calculating unit 92 calculates the relative position of the focus pixel and the reference pixel from the data stored in the reference pixel memory 24 and the data stored in the focus pixel memory 25 and calculates the orientation of motion from the relative position.
When the orientation of motion has been calculated, the spatial gradient determining unit 93 reads the pixel data of the reference pixel and the adjacent pixels in the orientation of motion from the reference pixel memory 24 and calculates the differences in pixel values between the pixel data of the reference pixel and the adjacent pixel data. In the present embodiment, as the adjacent pixels, data of two pixels, that is, the adjacent pixel in the closest orientation to the orientation of motion and the adjacent pixel in the second closest orientation that is the next closest orientation to the orientation of motion, is read and the difference between the reference pixel and the adjacent pixel in the closest orientation and the difference between the reference pixel and the adjacent pixel in the second closest orientation are respectively calculated.
The spatial gradient determining unit 93 also reads the pixel data of the focus pixel and the adjacent pixels in the orientation of motion from the focus pixel memory 25 and calculates the differences in pixel values between the pixel data of the focus pixel and the adjacent pixel data. In this case also, two pixels, that is, the adjacent pixel in the closest orientation to the orientation of motion and the adjacent pixel in the second closest orientation that is the next closest orientation to the orientation of motion, are read as the adjacent pixels, and the difference between the focus pixel and the adjacent pixel in the closest orientation and the difference between the focus pixel and the adjacent pixel in the second closest orientation are respectively calculated.
The comparator unit 94 determines if the differences with the adjacent pixels in the closest orientation and the second closest orientation exceed a threshold for both the focus pixel and the reference pixel, and when all such differences exceed the threshold, the evaluation value supplied to the gate unit 91 is allowed to pass. When even just one of such differences does not exceed the threshold for either of the focus pixel and the reference pixel, the evaluation value supplied to the gate unit 91 is prevented from passing. When the comparator unit 94 has determined that there are differences that exceed the threshold (i.e., has determined that a spatial gradient is present), a counter, not shown, that counts the number of pixels where it is determined that a spatial gradient is present counts up by one.
The evaluation values that have passed the gate unit 91 included in the pixel selecting unit 90 are supplied to an evaluation value table calculating unit 50, are totaled by an evaluation value totaling unit 51, and the totaled result is stored in an evaluation value table memory 52. After this, the data stored in the evaluation value table memory 52 is supplied as evaluation value table data from an output terminal 12a to a circuit that forms the next stage.
As shown in
First, the motion orientation calculating unit 92 calculates the relative position of the reference pixel and the focus pixel corresponding to such reference pixel (step S61) and calculates the orientation of motion from such relative position (step S62). After this, the pixel data of the adjacent pixels in the closest orientation and the second closest orientation to the orientation of motion are read from the focus pixel memory 25 (step S63) and the differences between the read adjacent pixels in the closest orientation and the second closest orientation and the focus pixel are calculated (step S64). Once the differences with the adjacent pixels have been calculated, it is determined whether the respective differences exceed a threshold set in advance (step S65), and when the threshold is not exceeded in either of such determinations, the present evaluation value is prevented from passing the gate unit 91 and is prohibited from being written into the evaluation value table (step S70).
When it is determined in step S65 that the differences between the focus pixel and the adjacent pixels in both the closest orientation and the second closest orientation exceed the threshold, a counter for a value showing that a spatial gradient is present counts up by one (step S66), the adjacent pixels in the closest orientation and the second closest orientation are read from the reference pixel memory 24 (step S67), and the differences between the read adjacent pixels in the closest orientation and the second closest orientation and the reference pixel are calculated (step S68). Once the differences with the adjacent pixels have been calculated, it is determined whether the respective differences exceed a threshold set in advance (step S69), and when the threshold is not exceeded in either of such determinations, the present evaluation value is prevented from passing the gate unit 91 and is prohibited from being written in the evaluation value table (step S70).
In addition, it is determined whether the absolute value of the difference between the focus pixel and the reference pixel obtained by detecting the pixel correlation at the correlation calculating unit 20′ and the correlation determining unit 30 is below a threshold (step S221). When this determination finds that the difference is below the threshold, the evaluation value is sent from the correlation determining unit 30 to the gate unit 91 included in the pixel selecting unit 90. After this, out of the data sent from the correlation determining unit 30 to the gate unit 91 in the pixel selecting unit 90 (i.e., the data where there is pixel correlation), the number (frequency) of evaluation values that have passed the gate unit 91 in the pixel selecting processing is written in the evaluation value table (step S222).
Note that in the flowchart shown in
An overview of the processing with the configuration shown in
First, as shown in
Next, as shown in
When the orientation of motion has been determined, as shown by the arrows drawn with thick lines in
In addition, for the pixels adjacent to the reference pixel, the pixel that is adjacent in the closest orientation (in this example, horizontally to the left) to the orientation of motion and the pixel that is adjacent in the second closest orientation (in this example, diagonally upward to the left) to the orientation of motion are read out, and the respective differences between the read adjacent pixels and the reference pixel d1 are determined.
In this determination, only when it has been determined that there is a spatial gradient in any of the closest orientation and the second closest orientation at the focus pixel and there is also a spatial gradient in any of the closest orientation and the second closest orientation at the reference pixel, the evaluation value of the reference pixel d1 at this time is written into the evaluation value table.
Although it is determined whether there is a spatial gradient in the calculation processing in the example shown in
This configuration will now be described with reference to
In the configuration shown in
Whenever the pixel data of a frame is supplied, the spatial gradient pattern calculating unit 102 expresses, for each pixel, whether a spatial gradient is present between the focus pixel and a peripheral pixel using the value “0” or “1”, and stores such values as flags in the reference pixel pattern memory 103. After this, by referring to the flags, it is determined whether a spatial gradient is present based on an orientation where movement has been detected. Flags showing whether a spatial gradient is present at each pixel generated for the present frame (i.e., at each reference pixel) at a given time t can be used at a time t+1 when the next frame is obtained as flags showing whether a spatial gradient is present at each pixel in the previous frame (i.e., at each focus pixel). To do so, a configuration is used where the data stored in the reference pixel pattern memory 103 is moved to the focus pixel pattern memory 104.
In the motion orientation calculating unit 107, relationships between relative positions (movement) inside the search area and closest directions are calculated in advance, and the calculated data is stored as the motion orientation LUT 106. The values of the stored LUT are sent to the reference pixel pattern memory 103 and the focus pixel pattern memory 104, and the spatial gradient patterns for the closest orientation and the second closest orientation calculated by the spatial gradient pattern calculating unit 102 and the patterns for the two adjacent pixels in the orientation of motion read out from the motion orientation LUT 106 are compared for both the reference pixel and the focus pixel at the pattern comparator unit 105. When, as the comparison result, it is determined that a spatial gradient is present at both the focus pixel and the reference pixel, control is carried out to allow the evaluation value to pass the gate unit 101. Conversely, when it is determined that a spatial gradient is not present, control is carried out to prevent the evaluation value from passing the gate unit 101. When it has been determined by the pattern comparator unit 105 that spatial gradients are present, a counter (not shown) that counts up the number of pixels where there is a spatial gradient counts up by one.
As shown in
First, the spatial gradient pattern calculating unit 102 calculates the relative position of the focus pixel in the previous frame and a reference pixel in the present frame (step S71) and determines the orientation of motion from the relative position. Data on the determined orientation of motion is read from the motion orientation LUT 106 (step S72), patterns of the adjacent pixels in the orientation of motion (here, the closest orientation and the second closest orientation) are read from the focus pixel pattern memory 104 (step S73), and the patterns of the differences with the adjacent pixels are determined (step S74). When this determination determines that a spatial gradient is not present at the focus pixel, the evaluation value is prevented from passing the gate unit 101 so that the evaluation value in question is not written into the evaluation value table memory 52 (step S78).
Conversely, when the determination determines that a spatial gradient is present, the counter that counts a value showing that a spatial gradient is present counts up by one (step S75), patterns of the adjacent pixels in the orientation of motion (here, the closest orientation and the second closest orientation) are read from the reference pixel pattern memory 103 (step S76), and the patterns of the differences with the adjacent pixel are determined (step S77). When the determination determines that there is no spatial gradient at the reference pixel, the evaluation value is prevented from passing the gate unit 101 and the evaluation value in question is not written into the evaluation value table memory 52 (step S78).
It is also determined whether the absolute value of the difference between the focus pixel and the reference pixel obtained by detecting the pixel correlation at the correlation calculating unit 20′ and the correlation determining unit 30 is below a threshold (step S231). When the determination finds that the difference is below the threshold, the evaluation value is sent from the correlation determining unit 30 to the gate unit 101 included in the pixel selecting unit 100. Conversely, when it is determined that the difference between the focus pixel and the reference pixel is not below the threshold, the evaluation value is not sent to the gate unit 101 and the evaluation value in question is not written in the evaluation value table memory 52 (step S78).
After this, the number (i.e., frequency) of values that have been allowed in the pixel selection to pass the gate unit 101 out of the data sent from the correlation determining unit 30 to the gate unit 101 in the pixel selecting unit 100 (i.e., the data where there is pixel correlation) is written into the evaluation value table (step S232).
As shown in
Note that in the flowchart shown in
A fourth embodiment of the present invention will now be described with reference to
The present embodiment also relates to a motion vector detecting apparatus that detects motion vectors from moving image data. This motion vector detecting apparatus is the same as the first embodiment described above in that an evaluation value table is formed from pixel value correlation information and motion vectors are determined from the data of such evaluation value table.
The overall configuration and overall processing of the motion vector detecting apparatus are the same as the configuration shown in
In the present embodiment, an evaluation value table is formed having taken into account a plurality of spatial gradients in the orientation of motion at both the focus pixel and the reference pixel. Here, as the plurality of spatial gradients, reference is made to the closest orientation to the orientation of motion and the orientations of normals to the orientation of motion. The definitions of “focus pixel” and “reference pixel” are the same as those described above earlier in the first and second embodiments. That is, a focus pixel is a pixel position of a point (standard point) used as a standard for determining a motion vector and a reference pixel is a pixel within a search area in an earlier or later frame than the focus pixel.
In the flowchart shown in
That is, it is determined whether the absolute value of the difference between the focus pixel and the reference pixel is below a threshold (step S231). When this determination finds that the difference is below the threshold, the evaluation value is sent from the correlation determining unit 30 to the gate unit 101 included in the pixel selecting unit 100.
As the processing of the pixel selecting unit 100, the spatial gradient pattern calculating unit 102 calculates the relative position of the focus pixel in the previous frame and a reference pixel in the present frame (step S71) and determines the orientation of motion from the relative position. Data on the determined orientation of motion is read from the motion orientation LUT 106 (step S72).
After this, spatial gradient patterns of an adjacent pixel in the orientation of motion and adjacent pixels in the orientation of normals that are perpendicular to the orientation of motion are read from the focus pixel pattern memory 104 (step S73′). Patterns of the differences between the adjacent pixels read in this way and the pattern read from the motion orientation LUT 106 are then determined (step S74). When this determination determines that a spatial gradient is not present at the focus pixel, the evaluation value is prevented from passing the gate unit 101 so that the evaluation value in question is not written into the evaluation value table memory 52 (step S78). Conversely, when the determination determines that a spatial gradient is present, the counter that counts a value showing that a spatial gradient is present counts up by one (step S75).
In addition, the spatial gradient patterns of the adjacent pixel in the orientation of motion and the adjacent pixels in the orientations of normals that are perpendicular to the orientation of motion are read from the reference pixel pattern memory 103 (step S76′). Patterns of the differences between the adjacent pixels read in this way and the pattern read from the motion orientation LUT 106 are then determined (step S77). When the determination determines that there is no spatial gradient at the reference pixel, the evaluation value is prevented from passing the gate unit 101 and the evaluation value in question is not written into the evaluation value table memory 52 (step S78).
It is also determined whether the absolute value of the difference between the focus pixel and the reference pixel obtained by detecting the pixel correlation at the correlation calculating unit 20′ and the correlation determining unit 30 is below a threshold (step S231). When the determination finds that the difference is below the threshold, the evaluation value is sent from the correlation determining unit 30 to the gate unit 101 included in the pixel selecting unit 100. Conversely, when it is determined that the difference is not below the threshold, the evaluation value is not sent to the gate unit 101 and the evaluation value in question is not written in the evaluation value table memory 52 (step S78).
After this, the number (i.e., frequency) of values that have been allowed in the pixel selection to pass the gate unit 101 out of the data sent from the correlation determining unit 30 to the gate unit 101 in the pixel selecting unit 100 (i.e., the data where there is pixel correlation) is written into the evaluation value table (step S232).
Note that in the flowchart shown in
An overview of the processing in the flowchart shown in
First, as shown in
In the present embodiment, when the orientation of motion has been determined, as shown by the arrows drawn with thick lines in
In addition, among the pixels adjacent to the reference pixel also, the pixel that is adjacent in the closest orientation to the orientation of motion (in this example, horizontally to the left) and pixels that are adjacent in the orientations of normals that are perpendicular to the orientation of motion (in this example, directly above and directly below the reference pixel) are read out, and the respective differences between the read adjacent pixels and the reference pixel d1 are determined.
In this determination, only when it has been determined that there are spatial gradients for all of the adjacent pixels in the closest orientation and the orientations of normals at the focus pixel and there is a spatial gradient for any of the adjacent pixels in the closest orientation and the orientations of normals at the reference pixel, the evaluation value of the reference pixel d1 at this time is written into the evaluation value table.
In this way, it is possible to make a suitable determination of whether a spatial gradient is present by determining spatial gradients in the orientation of motion and the orientations of normals.
An adjacent pixel in one orientation that is closest to the orientation of motion is selected as the adjacent pixel in the orientation of motion in the examples shown in
The flowchart in
That is, it is determined whether the absolute value of the difference between the focus pixel and the reference pixel is below a threshold (step S231). When this determination finds that the difference is below the threshold, the evaluation value is sent from the correlation determining unit 30 to the gate unit 101 included in the pixel selecting unit 100.
As the processing of the pixel selecting unit 100, the spatial gradient pattern calculating unit 102 calculates the relative position of the focus pixel in the previous frame and a reference pixel in the present frame (step S71) and determines the orientation of motion from the relative position. Data on the determined orientation of motion is read from the motion orientation LUT 106 (step S72).
After this, an adjacent pixel in the closest orientation to the orientation of motion, an adjacent pixel in the second closest orientation to the orientation of motion, spatial gradient patterns of adjacent pixels in the orientations of normals that are perpendicular to the closest orientation to the orientation of motion, and spatial gradient patterns of adjacent pixels in the orientations of normals that are perpendicular to the second closest orientation to the orientation of motion are read from the focus pixel pattern memory 104 (step S73″). Patterns of the differences between the adjacent pixels read in this way and the pattern read from the motion orientation LUT 106 are then determined (step S74). When this determination determines that a spatial gradient is not present at the focus pixel, the evaluation value is prevented from passing the gate unit 101 so that the evaluation value in question is not written into the evaluation value table memory 52 (step S78). Conversely, when the determination determines that a spatial gradient is present, the counter that counts a value showing that a spatial gradient is present counts up by one (step S75).
In addition, an adjacent pixel in the closest orientation to the orientation of motion, an adjacent pixel in the second closest orientation to the orientation of motion, spatial gradient patterns of adjacent pixels in the orientations of normals that are perpendicular to the closest orientation to the orientation of motion, and spatial gradient patterns of adjacent pixels in the orientations of normals that are perpendicular to the second closest orientation to the orientation of motion are read from the reference pixel pattern memory 103 (step S76″). Patterns of the differences between the adjacent pixels read in this way and the pattern read from the motion orientation LUT 106 are then determined (step S77) When the determination determines that there is no spatial gradient at the reference pixel, the evaluation value is prevented from passing the gate unit 101 and the evaluation value in question is not written into the evaluation value table memory 52 (step S78).
It is also determined whether the absolute value of the difference between the focus pixel and the reference pixel obtained by detecting the pixel correlation at the correlation calculating unit 20′ and the correlation determining unit 30 is below a threshold (step S231). When the determination finds that the difference is below the threshold, the evaluation value is sent from the correlation determining unit 30 to the gate unit 101 included in the pixel selecting unit 100. Conversely, when it is determined that the difference is not below the threshold, the evaluation value is not sent to the gate unit 101 and the evaluation value in question is not written in the evaluation value table memory 52 (step S78).
After this, the number (i.e., frequency) of values that have been allowed in the pixel selection to pass the gate unit 101 out of the data sent from the correlation determining unit 30 to the gate unit 101 in the pixel selecting unit 100 (i.e., the data where there is pixel correlation) is written into the evaluation value table (step S232).
Note that in the flowchart shown in
Also, although the adjacent pixels in the orientations of normals to the closest orientation and the adjacent pixels in the orientations of normals to the second closest orientation are read in the flowchart in
Alternatively, it is possible to determine whether a spatial gradient is present by reading only the adjacent pixel in the second closest orientation at only one of the focus pixel and the reference pixel.
An overview of the processing in the flowchart shown in
First, as shown in
In the present embodiment, when the orientation of motion has been determined, as shown by the arrows drawn with thick lines in
Among the pixels adjacent to the reference pixel also, a pixel that is adjacent in the closest orientation (in this example, horizontally to the left) to the orientation of motion is read out, and the pixel that is adjacent in the second closest orientation (in this example, diagonally upward to the left) is also read out. Among the pixels adjacent to the reference pixel, pixels that are adjacent in the orientations of normals that are perpendicular to the closest orientation (in this example, directly above and directly below the reference pixel) are read out, and pixels that are adjacent in the orientations of normals that are perpendicular to the second closest orientation (in this example, diagonally below to the left and diagonally above to the right of the focus pixel) are also read out. The respective differences between the read adjacent pixels and the reference pixel d1 are determined.
In this determination, only when it has been determined that there is a spatial gradient for an adjacent pixel in any of the closest orientations and the orientations of normals at the focus pixel and there is a spatial gradient for an adjacent pixel in any of the closest orientations and the orientations of normals at the reference pixel also, the evaluation value of the reference pixel d1 at this time is written into the evaluation value table.
In this way, it is possible to make a suitable determination of whether a spatial gradient is present by determining spatial gradients in the orientation of motion and the orientations of normals.
Note that in the above description, although it is determined that there is a spatial gradient when there is a difference that exceeds the threshold for the adjacent pixels in the closest orientation to the orientation of motion and in the orientations of normals to the closest orientation, it is also possible to determine that there is a spatial gradient when there is a difference that exceeds the threshold for any of the adjacent pixel in the closest orientation to the orientation of motion or one or two of the adjacent pixels in the orientations of normals to such orientation.
A fifth embodiment of the present invention will now be described with reference to
The present embodiment also relates to a motion vector detecting apparatus that detects motion vectors from moving image data. This motion vector detecting apparatus is the same as the first embodiment described above in that an evaluation value table is formed from pixel value correlation information and motion vectors are determined from the data of such evaluation value table.
The overall configuration and overall processing of the motion vector detecting apparatus are the same as the configuration shown in
In the present embodiment, the evaluation value table forming unit 12 in the motion vector detecting apparatus shown in
In the present embodiment, as an adjacent pixel relating to the orientation of motion, an adjacent pixel in an opposite orientation to the orientation of motion is read and a difference with such adjacent pixel is determined. The definitions of “focus pixel” and “reference pixel” are the same as those given above in the earlier embodiments. That is, a focus pixel is a pixel position of a point (standard point) used as a standard for determining a motion vector and a reference pixel is a pixel within a search area in an earlier or later frame than the focus pixel.
The example configuration shown in
After this, the detected difference data is supplied to the correlation determining unit 30. The correlation determining unit 30 includes a comparator unit 31 that compares the supplied difference with a set threshold to obtain an evaluation value. As the evaluation value, as one example a binary value is set so that the correlation is “high” when the difference is equal to or below the threshold and so that the correlation is “low” when the difference exceeds the threshold.
The evaluation value obtained at the correlation determining unit 30 is supplied to a pixel selecting unit 110. The pixel selecting unit 110 includes a gate unit 111 that selects the binary value output from the correlation determining unit 30. As a configuration for controlling the gate unit 111, the pixel selecting unit 110 includes an motion orientation calculating unit 112, a spatial gradient determining unit 113, and a comparator unit 114. The motion orientation calculating unit 112 calculates the relative position of the focus pixel and the reference pixel from the data stored in the reference pixel memory 24 and the data stored in the focus pixel memory 25 and calculates the orientation of motion from the relative position.
When the orientation of motion has been calculated, the spatial gradient determining unit 113 reads the pixel data of the reference pixel and the adjacent pixel in the opposite orientation to the orientation of motion from the reference pixel memory 24 and calculates the difference in pixel values between the pixel data of the reference pixel and the adjacent pixel data.
The spatial gradient determining unit 113 also reads the pixel data of the focus pixel and the adjacent pixel in the opposite orientation to the orientation of motion from the focus pixel memory 25 and calculates the difference in pixel values between the pixel data of the focus pixel and the adjacent pixel data.
The comparator unit 114 determines if the difference with the adjacent pixel in the opposite orientation to the orientation of motion exceeds a threshold at both the focus pixel and the reference pixel. When both differences exceed the threshold, the evaluation value supplied to the gate unit 111 is allowed to pass. When the difference does not exceed the threshold at either of the focus pixel and the reference pixel, the evaluation value supplied to the gate unit 111 is prevented from passing.
The evaluation values that have passed the gate unit 111 included in the pixel selecting unit 110 are supplied to an evaluation value table calculating unit 50, are totaled by an evaluation value totaling unit 51, and the totaled result is stored in an evaluation value table memory 52. After this, the data stored in the evaluation value table memory 52 is supplied as evaluation value table data from an output terminal 12a to a circuit that forms the next stage. Note that the number of pixels where it has been determined, in the determination by the pixel selecting unit 110 which uses the threshold, that a spatial gradient is present is counted by a counter (not shown).
As shown in
First, the motion orientation calculating unit 112 calculates the relative position of the reference pixel and the focus pixel corresponding to such reference pixel (step S81) and calculates the orientation of motion from such relative position (step S82). After this, the pixel data of the adjacent pixel in the opposite direction to the orientation of motion is read from the focus pixel memory 25 (step S83) and the difference between the read adjacent pixel in the opposite orientation and the focus pixel is calculated (step S84). Once the difference with the adjacent pixel has been calculated, it is determined whether the difference exceeds a threshold set in advance (step S85), and when the threshold is not exceeded in such determination, the present evaluation value is prevented from passing the gate unit 111 and is prohibited from being written into the evaluation value table (step S90).
When it is determined in step S85 that the difference between the focus pixel and the adjacent pixel exceeds the threshold, a counter for a value showing that a spatial gradient is present counts up by one (step S86), the adjacent pixel in the opposite orientation to the orientation of motion is read from the reference pixel memory 24 (step S87), and the difference between the read adjacent pixel in the opposite orientation to the orientation of motion and the reference pixel is calculated (step S88). Once the difference with the adjacent pixel has been calculated, it is determined whether the difference exceeds a threshold set in advance (step S89), and when it is determined that the difference does not exceed the threshold, the present evaluation value is prevented from passing the gate unit 111 and is prohibited from being written in the evaluation value table (step S90).
In addition, it is determined whether the absolute value of the difference between the focus pixel and the reference pixel obtained at the correlation calculating unit 20′ is below a threshold (step S241). When this determination finds that the difference is below the threshold, the evaluation value is sent from the correlation determining unit 30 to the gate unit 111 included in the pixel selecting unit 100. When the difference is not below the threshold, the evaluation value is not sent to the gate unit 111 so that the evaluation value in question is not written into the evaluation value table memory 52 (step S90)
Also, when the difference is below the threshold in step S241, the evaluation value is sent from the correlation determining unit 30 to the gate unit 111 in the pixel selecting unit 110.
After the processing thusfar has been carried out, the number (i.e., frequency) of values that have been allowed in the pixel selection to pass the gate unit 111 out of the data sent from the correlation determining unit 30 to the gate unit 111 in the pixel selecting unit 110 (i.e., the data where there is pixel correlation) is written into the evaluation value table (step S242).
Note that in the flowchart shown in
An overview of the processing with the configuration shown in
First, as shown in
In the present embodiment, when the orientation of motion has been determined, as shown by the arrows drawn with the thick line in
Among the pixels that are adjacent to the reference pixel also, the pixel that is adjacent in the opposite orientation (in this example, horizontally to the right) to the orientation of motion is read out, and the difference between the read adjacent pixel and the reference pixel d1 is determined.
In this determination, only when it has been determined that there is a spatial gradient for the adjacent pixel at the focus pixel and there is also a spatial gradient for the adjacent pixel at the reference pixel, the evaluation value of the reference pixel d1 at this time is written into the evaluation value table.
In this way, it is possible to make a suitable determination of whether a spatial gradient is present by determining a spatial gradient in the opposite orientation to the orientation of motion.
Although only the adjacent pixel in the opposite orientation to the orientation of motion is read and a difference thereof is determined in the example in
First, the configuration will be described with reference to
In the configuration in
Whenever the pixel data of a frame is supplied, the spatial gradient pattern calculating unit 122 expresses, for each pixel, whether a spatial gradient is present between the focus pixel and a peripheral pixel using the value “0” or “1”, and stores such values as flags in the reference pixel pattern memory 123. After this, by referring to the flags, it is determined whether a spatial gradient is present based on an orientation where movement has been detected. Flags showing whether a spatial gradient is present at each pixel generated for the present frame (i.e., at each reference pixel) at a given time t can be used at a time t+1 when the next frame is obtained as flags showing whether a spatial gradient is present at each pixel in the previous frame (i.e., at each focus pixel). To d0 so, a configuration is used where the data stored in the reference pixel pattern memory 123 is moved to the focus pixel pattern memory 124.
In the motion orientation calculating unit 127, relationships between relative positions (movement) inside the search area and closest directions are calculated in advance, and the calculated data is stored as the motion orientation LUT 126. The values of the stored LUT are sent to the reference pixel pattern memory 123 and the focus pixel pattern memory 124, and (i) a spatial gradient pattern calculated by the spatial gradient pattern calculating unit 122 having considered the adjacent pixel in the same orientation as the orientation of motion and the adjacent pixel in the opposite orientation and (ii) patterns for the two orientations read out from the motion orientation LUT 126 are compared for both the reference pixel and the focus pixel at the pattern comparator unit 125. When, as the comparison result, it is determined that a spatial gradient is present at both the focus pixel and the reference pixel, control is carried out to allow the evaluation value to pass the gate unit 121. Conversely, when it is determined that a spatial gradient is not present, control is carried out to prevent the evaluation value from passing the gate unit 121. When it has been determined by the pattern comparator unit 125 that there is a spatial gradient, a counter (not shown) that counts up the number of pixels where there is a spatial gradient counts up by one.
As shown in
First, the spatial gradient pattern calculating unit 122 calculates the relative position of the focus pixel in the previous frame and a reference pixel in the present frame (step S91) and determines the orientation of motion from the relative position. Data on the determined orientation of motion and data on the opposite orientation is read from the motion orientation LUT 126 (step S92), patterns of the adjacent pixels in the orientation of motion and the opposite orientation are read from the focus pixel pattern memory 124 (step S93), and the patterns of the respective differences with the adjacent pixels are determined (step S94). When this determination determines that a spatial gradient is not present at the focus pixel, the evaluation value is prevented from passing the gate unit 121 so that the evaluation value in question is not written into the evaluation value table memory 52 (step S98).
Conversely, when the determination determines that a spatial gradient is present, the counter that counts a value showing that a spatial gradient is present counts up by one (step S95), the patterns of the adjacent pixels in the orientation of motion and the opposite orientation are read from the reference pixel pattern memory 123 (step S96), and the patterns of the differences with the adjacent pixels are determined (step S97) When the determination determines that there is no spatial gradient at the reference pixel, the evaluation value is prevented from passing the gate unit 121 and the evaluation value in question is not written into the evaluation value table memory 52 (step S98).
It is also determined whether the absolute value of the difference between the focus pixel and the reference pixel obtained at the correlation calculating unit 20′ and the correlation determining unit 30 is below a threshold (step S251) When the determination finds that the difference is below the threshold, the evaluation value is sent from the correlation determining unit 30 to the gate unit 121 included in the pixel selecting unit 120. Conversely, when it is determined that the difference between the focus pixel and the reference pixel is not below the threshold, the evaluation value is not sent to the gate unit 121 and the evaluation value in question is not written in the evaluation value table memory 52 (step S98).
After this, the number (i.e., frequency) of values that have been allowed in the pixel selection to pass the gate unit 121 out of the data sent from the correlation determining unit 30 to the gate unit 121 of the pixel selecting unit 120 (i.e., the data where there is pixel correlation) is written into the evaluation value table (step S252).
Note that in the flowchart shown in
An overview of the processing with the configuration shown in
First, as shown in
In the present embodiment, when the orientation of motion has been determined, as shown by the arrows drawn with thick lines in
Among the pixels adjacent to the reference pixel also, the pixel that is adjacent in the orientation of motion (that is, horizontally to the left) is read out, the pixel that is adjacent in the opposite orientation (in this example, horizontally to the right) to the orientation of motion is also read out, and the differences between the read adjacent pixels and the reference pixel d1 are determined.
In this determination, only when it has been determined that there is a spatial gradient with the adjacent pixels in both directions at the focus pixel and there is a spatial gradient with the adjacent pixels in both directions at the reference pixel, the evaluation value of the reference pixel d1 at this time is written into the evaluation value table.
In this way, it is possible to make a suitable determination of whether a spatial gradient is present by determining spatial gradients in both the orientation of motion and the opposite orientation.
Note that it is possible to determine whether a spatial gradient is present using a combination of other adjacent pixels with the adjacent pixel in the orientation of motion and the adjacent pixel in the opposite orientation to the orientation of motion.
For example, it is possible to determine whether a spatial gradient is present from adjacent pixels in the orientations of normals and adjacent pixels in the second closest orientation in addition to the adjacent pixel in the orientation of motion and the adjacent pixel in the opposite orientation to the orientation of motion.
In the flowchart shown in
That is, the spatial gradient pattern calculating unit 122 calculates the relative position of the focus pixel in the previous frame and a reference pixel in the present frame (step S91) and determines the orientation of motion from the relative position. Data on the closest orientation to the determined orientation of motion, data on the opposite orientation, data on orientations of normals, and data on the second closest orientation are read from the motion orientation LUT 126 (step S92′), patterns of the adjacent pixels in the closest orientation to the orientation of motion, the opposite orientation, the orientations of normals, and the second closest orientation are read from the focus pixel pattern memory 124 (step S93′), and the patterns of the respective differences with the adjacent pixels are determined (step S94). When this determination determines that the threshold is not exceed by one or all of the differences and that a spatial gradient is not present at the focus pixel, the evaluation value is prevented from passing the gate unit 121 so that the evaluation value in question is not written into the evaluation value table memory 52 (step S98).
Conversely, when the determination determines that the threshold is exceeded in all of the orientations and a spatial gradient is present, the counter that counts a value showing that a spatial gradient is present counts up by one (step S95), the patterns of the adjacent pixels in the closest orientation to the orientation of motion, the opposite orientation, the orientations of normals, and the second closest orientation are read from the reference pixel pattern memory 123 (step S96′), and the patterns of the differences with the adjacent pixels are determined (step S97). When the determination determines that the threshold is not exceeded by one or all of the differences and that there is no spatial gradient at the reference pixel, the evaluation value is prevented from passing the gate unit 121 and the evaluation value in question is not written into the evaluation value table memory 52 (step S98).
It is also determined whether the absolute value of the difference between the focus pixel and the reference pixel detected by the correlation calculating unit 20′ is below a threshold (step S251). When the determination finds that the difference is below the threshold, the evaluation value is sent from the correlation determining unit 30 to the gate unit 121 included in the pixel selecting unit 120. Conversely, when it is determined that the difference is not below the threshold, the evaluation value is not sent to the gate unit 121 and the evaluation value in question is not written in the evaluation value table memory 52 (step S98).
After this, the number (i.e., frequency) of values that have been allowed in the pixel selection to pass the gate unit 121 out of the data sent from the correlation determining unit 30 to the gate unit 121 in the pixel selecting unit 120 (i.e., the data where there is pixel correlation) is written into the evaluation value table (step S252).
Note that in the flowchart shown in
An overview of an example of processing with the flowchart shown in
As shown in
Note that when determining whether a spatial gradient is present in the flowchart shown in
A sixth embodiment of the present invention will now be described with reference to
The present embodiment also relates to a motion vector detecting apparatus that detects motion vectors from moving image data. This motion vector detecting apparatus is the same as the various embodiments described above in that an evaluation value table is formed from pixel value correlation information and motion vectors are determined from the data of such evaluation value table.
The overall configuration and overall processing of the motion vector detecting apparatus are the same as the configuration shown in
In the present embodiment, the evaluation value table forming unit 12 in the motion vector detecting apparatus shown in
In the present embodiment, an adjacent pixel in the orientation of motion (i.e., a lower-level adjacent pixel) and an adjacent pixel in the orientation of motion that is separated by a predetermined number of pixels (i.e., a higher-level adjacent pixel) are read and the respective differences for the lower-level adjacent pixel and the higher-level adjacent pixel are determined. The lower-level adjacent pixel and the higher-level adjacent pixel will be described later with reference to
The example configuration in
After this, the detected difference data is supplied to the correlation determining unit 30. The correlation determining unit 30 includes a comparator unit 31 that compares the supplied difference with a set threshold to obtain an evaluation value. As the evaluation value, as one example a binary value is set so that the correlation is “high” when the difference is equal to or below the threshold and so that the correlation is “low” when the difference exceeds the threshold.
The evaluation value obtained at the correlation determining unit 30 is supplied to a pixel selecting unit 130. The pixel selecting unit 130 includes a gate unit 131 that selects the binary value output from the correlation determining unit 30. As a configuration for controlling the gate unit 131, the pixel selecting unit 130 includes an motion orientation calculating unit 132, a spatial gradient determining unit 133, and a comparator unit 134. The motion orientation calculating unit 132 calculates the relative position of the focus pixel and the reference pixel from the data stored in the reference pixel memory 24 and the data stored in the focus pixel memory 25 and calculates the orientation of motion from the relative position.
When the orientation of motion has been calculated, the spatial gradient determining unit 133 reads the reference pixel and the pixel data of the lower-level adjacent pixel and the pixel data of the higher-level adjacent pixel from the reference pixel memory 24 and calculates the differences in pixel values between the pixel data of the reference pixel and the adjacent pixel data.
The comparator unit 134 determines if the differences with the lower-level adjacent pixel and the higher-level adjacent pixel in the orientation of motion exceed a threshold at both the focus pixel and the reference pixel, and when the differences exceed the threshold, the evaluation value supplied to the gate unit 131 is allowed to pass. When the difference does not exceed the threshold with any of the higher-level and lower-level at the focus pixel and the reference pixel, the evaluation value supplied to the gate unit 131 is prevented from passing.
The evaluation values that have passed the gate unit 131 in the pixel selecting unit 130 are supplied to an evaluation value table calculating unit 50, are totaled by an evaluation value totaling unit 51, and the totaled result is stored in an evaluation value table memory 52. Also, the number of pixels that have been supplied to the gate unit 131 in the pixel selecting unit 130 where there is a spatial gradient is counted by a counter (not shown). After this, the data stored in the evaluation value table memory 52 is supplied as evaluation value table data from an output terminal 12a to a circuit that forms the next stage.
As shown in
First, the motion orientation calculating unit 132 calculates the relative position of the reference pixel and the focus pixel corresponding to such reference pixel (step S101) and calculates the orientation of motion from such relative position (step S102). After this, the motion orientation calculating unit 112 reads the pixel data of the adjacent pixels in the orientation of motion (i.e., the lower-level adjacent pixel and the upper-level adjacent pixel) from the focus pixel memory 25 (step S103).
Hereinafter, the processing of the upper-level and the processing of the lower-level are carried out in parallel.
First, in the processing of the upper-level (i.e., the right side in
In step S105, when it has been determined that the difference exceeds the threshold, a counter for a value showing that a spatial gradient is present on the upper level counts up by one (step S106), the upper-level adjacent pixel in the orientation of motion is read from the reference pixel memory 24 (step S107), and the difference between the read upper-level adjacent pixel and the reference pixel is calculated (step S108) Once the difference with the upper-level adjacent pixel has been calculated, it is determined whether the difference exceeds a threshold set in advance (step S109), and when it is determined that the difference does not exceed the threshold, the present evaluation value is prevented from passing the gate unit 131 and is prohibited from being written in the evaluation value table (step S110).
In addition, it is determined whether the absolute value of the difference between the focus pixel and the reference pixel obtained at the correlation calculating unit 20′ is below a threshold (step S261). When this determination finds that the difference is below the threshold, the evaluation value is sent from the correlation determining unit 30 to the gate unit 131 in the pixel selecting unit 130. When the difference is not below the threshold, the evaluation value is not sent to the gate unit 131 (step S110).
In the processing of the lower-level (i.e., the left side in
In step S112, when it has been determined that the difference exceeds the threshold, a counter for a value showing that a spatial gradient is present on the lower level counts up by one (step S113), the lower-level adjacent pixel in the orientation of motion is read from the reference pixel memory 24 (step S114), and the difference between the read lower-level adjacent pixel and the reference pixel is calculated (step S115) Once the difference with the lower-level adjacent pixel has been calculated, it is determined whether the difference exceeds a threshold set in advance (step S116), and when it is determined that the difference does not exceed the threshold, the present evaluation value is prevented from passing the gate unit 131 and is prohibited from being written in the evaluation value table (step S110).
In addition, it is determined whether the absolute value of the difference between the focus pixel and the reference pixel detected by the correlation calculating unit 20′ is below a threshold (step S262). When this determination finds that the difference is below the threshold, the evaluation value is sent from the correlation determining unit 30 to the gate unit 131. When the difference is not below the threshold, the evaluation value is not sent to the gate unit 131 (step S110).
After the processing thusfar has been carried out, when it has been determined that there are differences that exceed the threshold for both the upper-level adjacent pixel and the lower-level adjacent pixel at both the focus pixel and the reference pixel, the number (i.e., frequency) of values that have been allowed to pass the gate unit 131 out of the data sent from the correlation determining unit 30 to the gate unit 131 of the pixel selecting unit 130 (i.e., the data where there is pixel correlation) is written into the evaluation value table (step S263)
Note that in the flowchart shown in
Also, although selection is carried out by the pixel selecting unit 130 in the flowchart shown in
An overview of the processing with the configuration shown in
First, in
On the other hand, a predetermined number of pixels are set as a unit called a “block”, and the adjacent pixels on the upper level for the focus pixel are set as pixels at positions that are one block away. In the example in
Alternatively, as shown in
On the other hand, a predetermined number of pixels are set as a unit called a “block”, and the adjacent pixels on the upper level for the reference pixel are set as pixels at positions that are one block away. In the example in
Alternatively, as shown in
After setting the adjacent levels in this way, when calculating an evaluation value table with the focus pixel d0 of the previous frame F0 and the reference pixel d1 of the present frame F1 set as shown in
Although it is determined whether there is a spatial gradient by reading the adjacent pixels on the respective levels in the orientation of motion and comparing the differences with a threshold in the example in
In the evaluation value table forming unit 12 shown in
In the configuration shown in
Whenever the pixel data of a frame is supplied, the spatial gradient pattern calculating unit 142 expresses, for each pixel, whether a spatial gradient is present between the focus pixel and a peripheral pixel using the value “0” or “1”, and stores such values as flags in the reference pixel pattern memory 143. After this, by referring to the flags, it is determined whether a spatial gradient is present based on an orientation where movement has been detected. Flags showing whether a spatial gradient is present at each pixel generated for the present frame (i.e., at each reference pixel) at a given time t can be used at a time t+1 when the next frame is obtained as flags showing whether a spatial gradient is present at each pixel in the previous frame (i.e. at each focus pixel). To do so, a configuration is used where the data stored in the reference pixel pattern memory 143 is moved to the focus pixel pattern memory 144.
In the motion orientation calculating unit 147, relationships between relative positions (movement) inside the search area and closest directions are calculated in advance, and the calculated data is stored as the motion orientation LUT 146. Spatial gradient patterns on the lower level and spatial gradient patterns on the upper level are stored in the motion orientation LUT 146. The values of the stored LUT are sent to the reference pixel pattern memory 143 and the focus pixel pattern memory 144, and (i) a spatial gradient pattern calculated by the spatial gradient pattern calculating unit 142 having considered the adjacent pixel in the same orientation as the orientation of motion and the adjacent pixel in the opposite orientation and (ii) patterns for the two orientations read out from the motion orientation LUT 146 are compared for both the reference pixel and the focus pixel on both the lower level and the upper level by the pattern comparator unit 145. When, as the comparison result, it is determined that a spatial gradient is present at both the focus pixel and the reference pixel, control is carried out to allow the evaluation value to pass the gate unit 141. Conversely, when it is determined that a spatial gradient is not present, control is carried out to prevent the evaluation value from passing the gate unit 141. When it has been determined by the pattern comparator unit 145 that there is a spatial gradient, the counter (not shown) that counts up the number of pixels where there is a spatial gradient counts up by one.
As shown in
First, the spatial gradient pattern calculating unit 142 calculates the relative position of the focus pixel in the previous frame and a reference pixel in the present frame (step S121) and determines the orientation of motion from the relative position. Data on the determined orientation of motion is read from the motion orientation LUT 146 (step S122), patterns of the adjacent pixels on the lower level and the upper level in the orientation of motion are read from the focus pixel pattern memory 144 (step S123), and the patterns of the differences with the adjacent pixels on the respective levels are determined (step S124). When this determination determines that a spatial gradient is not present at the focus pixel, the evaluation value is prevented from passing the gate unit 141 so that the evaluation value in question is not written into the evaluation value table memory 52 (step S128).
Conversely, when the determination on the two levels determines that a spatial gradient is present, the counter that counts a value showing that a spatial gradient is present counts up by one (step S125), the patterns of the adjacent pixels on the lower level and the upper level in the orientation of motion are read from the reference pixel pattern memory 143 (step S126), and the patterns of the differences with the adjacent pixels on the respective levels are determined (step S127). When the determination determines that there is no spatial gradient at the reference pixel, the evaluation value is prevented from passing the gate unit 141 and the evaluation value in question is not written into the evaluation value table memory 52 (step S128).
It is also determined whether the absolute value of the difference between the focus pixel and the reference pixel detected by the correlation calculating unit 20′ is below a threshold (step S271). When the determination finds that the difference is below the threshold, the evaluation value is sent from the correlation determining unit 30 to the gate unit 141 in the pixel selecting unit 140. Conversely, when it is determined that the difference between the focus pixel and the reference pixel is not below the threshold, the evaluation value is not sent to the gate unit 141 and the evaluation value in question is not written into the evaluation value table memory 52 (step S128).
After the processing thusfar, the number (i.e., frequency) of values that have been allowed in the pixel selection to pass the gate unit 141 out of the data sent from the correlation determining unit 30 to the gate unit 141 included in the pixel selecting unit 140 (i.e., the data where there is pixel correlation) is written into the evaluation value table (step S252).
In this way, it is also possible to use the LUT and the pattern memory to determine whether there is a spatial gradient on each level.
Note that in the flowchart shown in
Also, although selection is carried out by the pixel selecting unit 140 based on the result of calculating the differences with the adjacent pixels and determining whether a spatial gradient is present using the same conditions for the upper level and the lower level at the focus pixel and the reference pixel, it is also possible to change the selection conditions between the upper level and the lower level. For example, it is possible to use a configuration that carries out only a determination of correlation between the focus pixel and the reference pixel on the lower level and carries out selection based on whether a spatial gradient is present at the reference pixel and the focus pixel on the upper level. In addition, when selecting based on whether a spatial gradient is present, it is possible to use a configuration that selects pixels not only when a spatial gradient is present at both the reference pixel and the focus pixel but also when a spatial gradient is present at only one of the reference pixel and the focus pixel. In addition, in the opposite case, it is possible to use a configuration that carries out only a determination of correlation between the focus pixel and the reference pixel on the upper level and carries out selection based on whether a spatial gradient is present at the reference pixel and the focus pixel (or at one of the reference pixel and the focus pixel) on the lower level.
As shown in
Note that the sixth embodiment has been described by way of an example where it is determined whether a spatial gradient is present using different levels from a comparison with adjacent pixels on the lower level and the upper level in the orientation of motion. However, similar to the first to fifth embodiments described above, it is also possible to use processing that carries out a determination for adjacent pixels in the opposite orientation to the orientation of motion, the orientations of normals, or the closest orientation and the second closest orientation to the orientation of motion and in such case to determine whether a spatial gradient is present from a comparison with adjacent pixels on the lower level and the upper level in the respective orientations.
Next, examples of the configuration and operation of the motion vector detecting unit 13 in a motion vector detecting apparatus having the configuration shown in
In the motion vector detecting unit 13, evaluation value table data is supplied to an input terminal 13a. As one example, the evaluation value table data is data on an evaluation value table for motion vectors obtained by the processing in one of the first to third embodiments described above, and is data produced by totaling motion vectors that are possible candidate vectors inside one frame.
For example, the data is supplied from the evaluation value table memory 52 included in the evaluation value table calculating unit 50 shown in
The evaluation value table data converting unit 111 converts the supplied evaluation value table data to data such as frequency values or derivative values thereof. The converted data is subjected to processing by a frequency order sorting unit 112 that rearranges the candidate vectors inside one frame in order of frequency. The evaluation value table data where the candidate vectors have been rearranged in order of frequency is supplied to a candidate vector evaluating unit 113. Here, among the candidate vectors that have been rearranged in order of frequency, a predetermined number of candidate vectors in order starting from the highest-order candidate vector are supplied to the candidate vector evaluating unit 113. As one example, the candidate vectors from the first candidate vector with the highest frequency to the tenth candidate vector are extracted out of the candidate vectors with the highest frequencies in one frame and are supplied to the candidate vector evaluating unit 113.
The candidate vector evaluating unit 113 carries out processing that further evaluates the respective high-frequency candidate vectors that have been supplied according to decided conditions. In this evaluating processing, it is possible to carry out evaluation according to determined conditions, such as where candidate vectors among the predetermined number of candidate vectors with the highest frequency values are still excluded if the frequency value is no greater than a predetermined threshold value and is therefore not so high.
Alternatively, as another example, it is possible to evaluate the reliability of the candidate vectors using data used in pixel selection at the evaluation value table forming unit 12 (see
Based on the evaluation results for the respective candidate vectors obtained in this way by the candidate vector evaluating unit 113, a candidate vector reliability determining unit 114 selects a candidate vector with high reliability out of the candidate vectors and data on the candidate vector with high reliability is output from an output terminal 13b.
Reliability data on the candidate vector output from the output terminal 13b is supplied to the motion vector deciding unit 14 shown in
First, processing that sorts the candidate vectors shown on the evaluation value table data in order of frequency is carried out (step S111). Out of the evaluation value table that has been rearranged in order of frequency, a predetermined number of candidate vectors in order from the vector with the highest frequency are fetched. As one example of this predetermined number, it is possible to fetch the candidate vectors in order up to the tenth vector starting from the vector with the highest frequency (step S112).
After this, processing that evaluates whether the fetched plurality of candidate vectors are suitable as candidate vectors and discards unsuitable candidate vectors as necessary is carried out (step S113). For example, evaluation processing is carried out that determines the magnitudes of the frequency values of the respective fetched candidate vectors and lowers the evaluation values of candidate vectors with frequency values that are no greater than a threshold. A variety of processing could conceivably be used as this evaluation processing for candidate vectors, and the evaluation processing used will affect the precision with which candidate vectors are fetched.
Based on the result of the evaluation processing, the reliability is determined for the respective candidate vectors and only the candidate vectors with high reliability, that is candidate vectors that have a high probability of being assigned to the image are supplied to the motion vector deciding unit 14 (see
Next, examples of the configuration and operation of the motion vector deciding unit 14 in the motion vector detecting apparatus with the configuration shown in
In this example, when the respective pixel positions are set as the focus pixel, a fixed block that is a region including a predetermined number of pixels in the periphery of the focus pixel is set and motion vectors are determined.
The configuration shown in
After this, at a data reading unit 213, pixel signals of a fixed block of a predetermined size that is centered on the focus pixel are read from the image signal stored in the focus pixel memory 212. In the same way, at the data reading unit 213, pixel signals of a fixed block of a predetermined size that is centered on the reference pixel are read from the image signal stored in the reference pixel memory 211. Next, the data reading unit 213 determines the pixel positions of the focus pixel and the reference pixels to be read by the data reading unit 213 from the data on the candidate vectors supplied from the motion vector detecting unit 13 (see
After this, the image signal of the fixed region centered on the focus pixel and the image signal of the fixed region centered on the reference pixel that have been read by the data reading unit 213 are supplied to an evaluation value calculating unit 214 and the differences between the pixel signals in both fixed regions are detected. By doing so, the evaluation value calculating unit 214 determines the image signals for the fixed regions of all of the reference pixels connected by the candidate vectors to the focus pixel currently being evaluated and compares such pixel signals with the pixel signals in the fixed region centered on the focus pixel.
After this, the evaluation value calculating unit 214 selects the reference pixel with the fixed region that most closely resembles the pixel signals of the fixed region centered on the focus pixel.
Data on the candidate vector that connects the selected reference pixel and the focus pixel is sent to a vector determining unit 215. The vector determining unit 215 carries out deciding processing that assigns the candidate vector in question as the motion vector from the focus pixel and the decided candidate vector is output from the output terminal 15.
The flowchart in
This operation will now be described in order in accordance with
After this, the differences between the pixel levels (pixel values: in this example, luminance values) of the pixels in the respective fixed blocks and the pixel levels of pixels inside a fixed block set for the focus pixel are calculated, and absolute values of such differences are added for entire blocks to calculate totals for the absolute differences (step S124). The processing thusfar is carried out for the reference pixels shown by all of the candidate vectors for the present focus pixel.
After this, the reference pixel with the lowest total is found out of the totals for the absolute differences obtained by the comparison with the focus pixel for the plurality of reference pixels. In this processing, once the reference pixel with the lowest total has been determined, the candidate vector that connects the determined reference pixel and the focus pixel is assigned and decided as the motion vector for the focus pixel (step S125).
In this example, the focus pixel d10 is present in the frame F10 (the focus frame) and a plurality of candidate vectors V11, V12 are present between such frame and the next frame F11 (the reference frame) on the time axis. The frame F11 includes reference pixels d11, d12 that are connected to the focus pixel d10 with the candidate vectors V11, V12.
For the state shown in
After this, the differences between the pixel values of the pixels in the fixed block B11 and the pixel values of the pixels in the fixed block B10 are calculated, absolute values of the differences are found, and these absolute values are added up for the entire block to produce a total of absolute differences. In the same way, the differences between the pixel values of the pixels in the fixed block B12 and the pixel values of the pixels in the fixed block B10 are calculated, absolute values of the differences are found, and these absolute values are added up for the entire block to produce a total of absolute differences. After this, the totals of the absolute differences are compared to see which is the lower value. When it is determined in this comparison that the total of absolute differences when the fixed block B11 is used is the lower of the two, for example, the candidate vector V11 that connects the reference pixel d11 in the center of the fixed block B11 and the focus pixel d10 is selected. The selected candidate vector V11 is assigned as the motion vector of the focus pixel d10.
Note that although a case where there are two candidate vectors has been described in
With the processing that decides a vector by selecting one of the candidate vectors as described above, a vector where the state of the pixels around the focus pixel and the state of the pixels around the reference pixel are similar is selected, which means that motion vectors can be suitably assigned to the respective pixels.
In particular, by combining the above processing with the evaluation value table forming processing of the embodiments described above, it is possible to extract candidate vectors using an evaluation value table in which the candidates are suitably narrowed and carry out deciding processing on such suitable candidate vectors so that motion vectors are assigned extremely suitably.
Note that aside from being carried out with the configurations and flowcharts described earlier in this specification, the processing in the respective embodiments of the present invention described above may be combined as appropriate with the processing in other embodiments. Also, although processing that determines a spatial gradient at the focus pixel was described in the first embodiment, the processing in the first embodiment may be carried out only on reference pixels.
In the respective embodiments of the present invention described above, aside from a configuration where it is determined whether a spatial gradient is present and predetermined values are included in an evaluation value table only for pixels where a spatial gradient is present, it is also possible to use a configuration that changes the values included in the evaluation value table for each pixel using the magnitude of the spatial gradient and/or pixel value correlation information.
Also, although the selection processing for the focus pixel was not described in detail in the embodiments described above, as one example it is possible to use a configuration where all of the pixels in one frame are set in order as the focus pixel and motion vectors are detected for the respective pixels. Alternatively, according to an embodiment of the present invention, representative pixels may be selected in one frame as focus pixels and motion vectors may be detected for the selected pixels.
Also, although examples where the present invention is applied to a motion vector detecting apparatus have been described in the embodiments above, this motion vector detecting apparatus may be combined with various types of image processing apparatus. For example, according to an embodiment of the present invention, the motion vector detecting apparatus may be combined with an encoding apparatus that carries out high-efficiency encoding so that data can be encoded using motion vector data. Alternatively, according to another embodiment of the present invention, the motion vector detecting apparatus may be combined with an image display apparatus that displays image data that has been input (or received) and/or an image recording apparatus that records images, with the motion vector data being used to increase the image resolution.
It is also possible to convert the various component elements that carry out motion vector detection according to an embodiment of the present invention to a program, to install such program in various types of information processing apparatus such as a computer that carries out various types of data processing, and to execute the same processing as described above when executing processing that detects motion vectors from an image signal input into the information processing apparatus.
It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and alterations may occur depending on design requirements and other factors insofar as they are within the scope of the appended claims or the equivalents thereof.
Number | Date | Country | Kind |
---|---|---|---|
2007-309220 | Nov 2007 | JP | national |
2008-218803 | Aug 2008 | JP | national |