This application is related to Context-Awareness Through Biased On-Device Image Classifiers, filed concurrently herewith and incorporated by reference herein.
This application is related to Methods and Systems for Low-Energy Image Classification, filed concurrently herewith and incorporated by reference herein.
This application is related to Two-Stage Vector Reduction Using Two-Dimensional and One-Dimensional Systolic Arrays, filed concurrently herewith and incorporated by reference herein.
Two or more images may be combined during multi-frame processing (MFP) to create an enhanced image. MFP enables various applications, such as high-dynamic range imaging (HDR), de-noising, image stabilizing, de-blurring, super-resolution imaging, de-hazing, and panoramic stitching.
One existing method of MFP includes taking a first photograph at a first time, taking a second photograph at a second time, and merging the first photograph with the second photograph to create a fused image. This method is relatively time consuming, taking approximately two seconds per fused image on a conventional mobile device. Moreover, the fused image may include one or more artifacts when a camera taking the photographs or one or more objects in the photographs move between the first time and the second time.
One known method of reducing a quantity of artifacts uses a super HDR (S-HDR) image sensor that interleaves a taking of a first photograph by a first sensor and a taking of a second photograph by a second sensor. However, the super HDR image sensor requires additional hardware that is typically application-specific and, thus, not generalizable. Another known method of reducing a quantity of artifacts uses a post-processing algorithmic solution using two computational steps: image alignment and image fusing. However, processing these two computational steps is generally slow (e.g., more than 1.8 seconds per frame and about one second total, respectively) and/or consumes substantial power.
Examples of the disclosure process a plurality of images (e.g., multi-frames) to generate an enhanced image. In some examples, images are processed using a specialized accelerator and algorithm that registers the images to a common coordinate system. In one example, a system includes a sensor module that generates a plurality of images and transmits the plurality of images to a first frame bus. An image sensor processor module retrieves the plurality of images from the first frame bus, processes the plurality of images, and transmits the plurality of processed images to the first frame bus. An accelerator module retrieves the plurality of processed images from the first frame bus, registers each image of the plurality of processed images, and transmits the plurality of registered images to a second frame bus. A processor module retrieves the plurality of registered images from the second frame bus and combines the plurality of registered images to generate a composite image.
This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used as an aid in determining the scope of the claimed subject matter.
Corresponding reference characters indicate corresponding parts throughout the drawings.
The disclosed system includes an architecture configured to perform multi-frame processing. Images are combined to generate an enhanced image to enable various applications including high-dynamic range imaging (HDR), super high-dynamic range imaging (S-HDR), de-noising, image stabilizing, de-blurring, super-resolution imaging, de-hazing, panoramic stitching, depth of field stacking, and rolling shutter correcting. The architecture includes one or more processors that process images and/or frames as they stream in and transmit the images to a hardware-specialized accelerator (e.g., a dedicated geometric image transformation engine) that registers one or more images in an energy- and/or time-efficient manner. The registered images are then combined or composited by one or more processors and streamed out for use and/or presentation.
The present disclosure describes utilizing a feature-based approach to take advantage of properties of invariance, uniqueness, stability, and independence. These characteristics enable a more robust and accurate frame alignment to be achieved. The disclosed system utilizes a plurality of algorithms and their associated hardware architecture. For example, the algorithms may include interest-point detection, feature extraction, feature matching, transform model, homography estimation, image resampling, image transformation, and/or image warping. In one example, the accelerator is realized in a system on a chip through low-level blocks, which allow stream processing through several architectural concepts such as two-stage vector reducing, hierarchical pipelining, and/or substantial local buffering.
Local buffering is utilized at various stages of processing to leverage the architectural elements described herein. In some examples, buffering data locally decreases or eliminates the need to re-fetch data from external memory, lowering memory bandwidth and/or local storage used. Additionally or alternatively, fine-grained parallel implementations are used within various processing elements of the accelerator. For example, many blocks involve a series of two-level vector reduction operations. The disclosed system employs arrays of specialized processing elements that are interconnected to exploit this computation pattern.
In at least some examples, the system is configured based on power and/or performance requirements of a given application. For example, a portable device in a vehicle may have greater access to battery and computing resources with fewer size constraints than a smartphone. The configuration may be altered to optimize speed of performance without consideration for energy usage. Thus, the accelerator may be scaled to cater to the performance constraints of the system described herein and/or the energy constraints of the device.
Aspects of the disclosure facilitate increasing speed, conserving memory, reducing processor load or an amount of energy consumed, and/or reducing network bandwidth usage by registering a plurality of images to a common coordinate system and/or by calculating one or more values, storing the one or more values in a local buffer, and reusing the one or more values. Local buffering is utilized at various stages of processing to leverage the architectural elements described herein. In some examples, buffering data locally decreases or eliminates the need to re-fetch data from external memory, lowering memory bandwidth and/or local storage used. Additionally or alternatively, fine-grained parallel implementations are used within various processing elements of the accelerator. For example, many blocks involve a series of two-level vector reduction operations. The disclosed system employs arrays of specialized processing elements that are interconnected to exploit this computation pattern. The disclosed architecture is pipelined, with several modules running in parallel, to facilitate processing images more quickly and efficiently.
A user 101 may operate the computing device 100. In some examples, the computing device 100 may be always on, or the computing device 100 may turn on and/or off in response to stimuli such as a change in light conditions, movement in the visual field, change in weather conditions, etc. In other examples, the computing device 100 may turn on and/or off in accordance with a policy. For example, the computing device 100 may be on during predetermined hours of the day, when a vehicle is on, etc.
The computing device 100, in some examples, includes a user interface device or interface module 102 for exchanging data between the computing device 100 and the user 101, computer-readable media, and/or another computing device (not shown). In at least some examples, the interface module 102 is coupled to or includes a presentation device configured to present information, such as text, images, audio, video, graphics, alerts, and the like, to the user 101. For example, the presentation device may include, without limitation, a display, speaker, and/or vibrating component. Additionally or alternatively, the interface module 102 is coupled to or includes an input device configured to receive information, such as user commands, from the user 101. For example, the input device may include, without limitation, a game controller, camera, microphone, and/or accelerometer. In at least some examples, the presentation device and the input device may be integrated in a common user-interface device configured to present information to the user 101 and receive information from the user 101. For example, the user-interface device may include, without limitation, a capacitive touch screen display and/or a controller including a vibrating component.
The computing device 100 includes one or more computer-readable media, such as a memory area 104 storing computer-executable instructions, video or image data, and/or other data, and one or more processors 106 programmed to execute the computer-executable instructions for implementing aspects of the disclosure. The memory area 104 includes any quantity of media associated with or accessible by the computing device 100. The memory area 104 may be internal to the computing device 100 (as shown in
In some examples, the memory area 104 stores, among other data, one or more applications. The applications, when executed by the processor 106, operate to perform functionality on the computing device 100. Example applications include mail application programs, web browsers, calendar application programs, address book application programs, messaging programs, media applications, location-based services, search programs, and the like. The applications may communicate with counterpart applications or services such as web services accessible via a network (not shown). For example, the applications may represent downloaded client-side applications that correspond to server-side services executing in a cloud.
The processor 106 includes any quantity of processing units, and the instructions may be performed by the processor 106 or by multiple processors within the computing device 100 or performed by a processor external to the computing device 100. The processor 106 is programmed to execute instructions such as those illustrated in the figures (e.g.,
The processor 106 is transformed into a special purpose microprocessor by executing computer-executable instructions or by otherwise being programmed. For example, the processor 106 may execute the computer-executable instructions to identify one or more interest points in a plurality of images, extract one or more features from the one or more interest points, register the plurality of images, and/or combining the plurality of images. Although the processor 106 is shown separate from the memory area 104, examples of the disclosure contemplate that the memory area 104 may be onboard the processor 106 such as in some embedded systems.
In this example, the memory area 104 stores one or more computer-executable components for multi-frame processing of images. A network communication interface 108, in some examples, exchanges data between the computing device 100 and a computer-readable media or another computing device (not shown). In at least some examples, the network communication interface 108 transmits the image to a remote device and/or receives requests from the remote device. Communication between the computing device 100 and a computer-readable media or another computing device may occur using any protocol or mechanism over any wired or wireless connection.
The block diagram of
An image signal processor (ISP) 208 is configured to retrieve or pull down one or more raw images 228 from the first frame bus 224 and clean up or otherwise process the raw images 228. The ISP 208 may place one or more processed images onto the first frame bus 224 (raw images 228 and processed images are represented as F0, F1 . . . FN in
An accelerator 210 is configured to retrieve and/or pull down one or more images 228 from the first frame bus 224 and align or register the images 228. The accelerator 210 may place one or more registered images 230 onto a second frame bus (e.g., aligned frame bus) 226. In some examples, the accelerator 210 includes an interest point-detection (IPD) module 212, a feature-extraction (FE) module 214, a homography estimation (HE) module 216, and/or an image warping (IWP) or warp module 218. Alternatively, the accelerator 210 may include any combination of modules that enables the computing device 200 to function as described herein.
The IPD module 212 may retrieve or take one or more images 228 from the first frame bus 224 and detect, identify, or search for one or more relevant interest points on the images 228. Interest-point detection helps identify pixel locations associated with relevant information. Examples of pixel locations include closed-boundary regions, edges, contours, line intersections, corners, etc. In one example, corners are used as interest points because corners form relatively robust control points and/or detecting corners has a relatively low computational complexity. The FE module 214 may extract one or more features from the interest points using, for example, a daisy feature-extraction algorithm. The HE module 216 may align, shift, or register one or more images 228 such that the images utilize the same or a common coordinate system. The IWP module 218 warps, modifies, or adjusts one or more images 228 such that the images 228 are aligned. One or more registered images 230 are placed on the aligned frame bus 226.
A processor module 219 includes a central processing unit (CPU) 220 and/or a graphics processing unit (GPU) 222 configured to retrieve or pull down one or more registered images 230 from the aligned frame bus 226 and combine or composite the images and place the composite images 232 onto the first frame bus 224. In at least some examples, the CPU 220 and/or GPU 222 are interchangeable.
Images 228 are consumed by the accelerator 210 and are replaced on the first frame bus 224 by the processor module 219 with composite images 232. In at least some examples, raw images 228 are consumed by the ISP 208 and are replaced on the first frame bus 224 by the ISP 208 with processed images. This consumption and/or replacement process enables the first frame bus 224 to run at or below capacity. In some examples, the computing device 200 includes a third bus (not shown) onto which the processor module 219 places the composite images 232. In some examples, one or more frame buses 224 and 226 are alternating, non-colliding, or isolated. This reduces an opportunity for an element of the architecture from being starved and/or from acting as a bottleneck to another element of the architecture. In this example, one or more frame buses 224 and 226 are connected to an application or another output, for instance, on a mobile device (not illustrated). In some examples, the frame buses 224 and 226 are connected to an output using a multiplexer (not illustrated).
Some examples of the disclosure are illustrated and described herein with reference to modules of the computing device residing or being positioned at a mobile device. Additionally or alternatively, at least some modules (e.g., the acceleration module or at least some submodules included in the acceleration module) may reside or be positioned at a remote computing device or server coupled to a plurality of mobile devices or image sources (e.g., sensor 202). At least some modules may be configured to receive or retrieve one or more images from a network location and transmit one or more images to the network location or another network location. For example, the computing system may implement daughter-card based acceleration in the cloud. In this manner, the computing system may be configured to generate an enhanced image based on any number of images taken at any time from any number of image sources.
An interest point includes or is associated with, in some examples, multiple pixels. In other examples, the interest point includes or is associated with only a single pixel. A predetermined number (e.g., four) of neighboring or abutting pixels may be retrieved or fetched with each pixel associated with an interest point. In some examples, the pixels (e.g., 8b/pixel) are retrieved from external memory 402 using an address value that is generated by the IPD module 212. Thus, an external memory bandwidth for this operation is 4MN×8b/frame, where M and N are the height and width, respectively, of the grayscale frame. For video graphics array (VGA) resolution at 30 fps, the bandwidth is 281 Mbps and, for 720p high definition (HD) resolution at 60 fps, the bandwidth is 1.6 Gbps. These figures are relatively modest since typical double data rate type three synchronous dynamic random-access memories (DDR3 DRAMs) provide a peak bandwidth of up to several 10s of Gbps.
In some examples, the abutting pixels are used to compute gradients along the horizontal and/or vertical directions at 404, which are buffered into a local first-in, first-out (FIFO) memory of size W×3×N×18b (in a nominal implementation W=3 and the memory is of size 12.7 kB for VGA and 25.3 kB for 720p HD). These gradients are used to evaluate a corner measure (Me) at 406. The data path includes one CORDIC-based (COordinate Rotation DIgital Computer) divider. The resulting corner measures are put in a local FIFO of depth R (e.g., 3). This FIFO is thus of size 9.8 kB for VGA and 19.5 kB for 720p HD. The Mc values are processed by a non-maximum suppression (NMS) block at 408, which pushes the identified interest point locations (x and/or y coordinates) onto another local FIFO of depth D (e.g., 512) at 410. Thus, the FIFO capacity may be equal to 5.2 kB for VGA and 6.1 kB for 720p HD. When all pixels are accessed from external memory, the IPD module 212 consumes approximately 70.31 Mbps for VGA, 0.46 Gbps for 1080p, and approximately 1.85 Gbps for 4k image resolutions at 30 fps.
S(x,y)=ΣuΣvw(u,v)[I(u+x,v+y)−I(u,v)]2 (1)
where w(u, v) is a window function (matrix) that contains the set of weights for each pixel in the frame patch. The weight matrix may include a circular window of Gaussian (isotropic response) or uniform values. For example, the system described herein utilizes uniform values to simplify implementation. A corner is then characterized by a large variation of S(x, y) in all directions around the pixel at (x, y). In order to aid the computation of S(x, y), the algorithm exploits a Taylor series expansion of I(u+x, v+y) as shown in Equation 2 below:
I(u+x,v+y)≈I(u,v)+Ix(u,v)x+Iy(u,v)y (2)
where Ix(u, v)x and Iy(u, v)y are the partial derivatives of the image patch I at (u, v) along the x and y directions, respectively. Based on this approximation, S(x, y) may be expressed as shown in Equations 3a and 3b below:
S(x,y)≈ΣuΣvw(u,v)·[Ix(u,v)·x−Iy(u,v)·y]2 (3a)
S(x,y)≈[x,y]A[x,y]T (3b)
where A is a structure tensor that is given by Equation 4 shown below:
To conclude that (x, y) is a corner location, the eigenvalues of A are computed. However, since computing the eigenvalues of A is computationally expensive, in at least some examples, at 510 the following corner measure Mc′(x, y) is computed, that approximates the characterization function based on the eigenvalues of A as shown in Equation 5 below:
M
c′(x,y)=det(A)−κ·trace2(A) (5)
To increase efficiency, the disclosure does not set the parameter κ, and instead uses a modified corner measure Mc(x, y), which amounts to evaluating the harmonic mean of the eigenvalues as shown in Equation 6 below:
M
c(x,y)=2·det(A)/[trace(A)+ε] (6)
where ε is a small arbitrary positive constant (that is used to avoid division by zero). After computing a corner measure [Mc(x, y)] at each pixel location (x, y) in the frame, the corner measure of each pixel is compared to the abutting pixels in the patch at 512. When a pixel has a higher corner measure than a corner measure of the rest of the abutting pixels at 514 or, in some examples, the remainder of the patch of pixels, then the corner measure is compared to a pre-specified threshold at 516. When it satisfies both criteria, it is marked as a corner at 522.
This process is called non-maximum suppression (NMS). The corners thus detected are invariant to lighting, translation, and rotation. If none of the examined pixels in the patch of pixels are identified as corners, then the next set of pixels is extracted at 520, and the process begins again at 502. In some examples, this process occurs iteratively until the entire image is examined. In other examples, when an image is identified and classified before the entire image is examined, the process is terminated.
Typical classification algorithms use histogram-based feature-extraction methods, such as scale-invariant feature transform (SIFT), histogram oriented gradient (HoG), gradient location and orientation histogram (GLOH), etc. The FE module 214 enables a computation engine using a modular framework to represent or mimic many other feature-extraction methods depending on tunable algorithmic parameters that may be set at run-time. As shown in
In some examples, different candidate blocks are swapped in and out to produce new overall descriptors. In addition, parameters that are internal to the candidate features may be tuned in order to increase the performance of the descriptor as a whole. In this example, the FE module 214 is pipelined to perform stream processing of pixels. The feature-extraction algorithm includes a plurality of processing steps that are heavily interleaved at the pixel, patch, and frame levels.
In a first block or filter module, the FE module 214 includes a pre-smoothing or G-Block 602 that is configured to smooth a P×P image patch of pixels 610 around each interest point by convolving it with a two-dimensional Gaussian filter of standard deviation (σs). In one example, it is convolved with a kernel having dimensions A×A 612. This results in a smoothened P×P image patch of pixels 614. The number of rows and/or columns in the G-Block 602 may be adjusted to achieve a desired energy and throughput scalability.
In a second block or gradient module, the FE module 214 includes a transformation or T-Block 604 that is configured to map the P×P smoothened patch of pixels 614 onto a length k vector with non-negative elements to create k×P×P feature maps 618. At a high level, the T-Block 604 is a single processing element that generates the T-Block features sequentially. There are four sub-blocks defined for the transformation, namely, T1, T2, T3, and T4 (collectively illustrated as “Gradient and Bin” 616).
In sub-block T1, at each pixel location (x, y), the disclosure computes gradients along both horizontal (Δx) and vertical (Δy) directions. The magnitude of the gradient vector is then apportioned into k bins (where k equals 4 in T1a and 8 in T1b mode), split equally along the radial direction—resulting in an output array of k feature maps, each of size P×P.
In sub-block T2, the gradient vector is quantized in a sine-weighted fashion into 4 (T2a) or 8 (T2b) bins. For T2a, the quantization is done as follows: |Δx|−Δx; |Δx|+Δx; |Δy|−Δy; |Δy|+Δy. For T2b, the quantization is done by concatenating an additional length 4 vector using Δ45 D45, which is the gradient vector rotated through 45 degrees.
In sub-block T3, at each pixel location (x, y), steerable filters are applied using n orientations, and the response is computed from quadrature pairs. Next, the result is quantized in a manner similar to T2a to produce a vector of length k=4n (T3a), and in a manner similar to T2b to produce a vector of length k=8n (T3b). In some examples, filters of second or higher-order derivatives and/or broader scales and orientations are used in combination with the different quantization functions.
In sub-block T4, two isotropic difference of Gaussian (DoG) responses are computed with different centers and scales (effectively reusing the G-block 602). These two responses are used to generate a length k=4 vector by rectifying the positive and negative parts into separate bins as described in T2.
In one example, only the T1 and T2 blocks are utilized. For example, the data path for the T-block 604 includes gradient-computation and quantization engines for the T1 (a), T1 (b), T2 (a), and T2 (b) modes of operation. In another example, T3 and T4 are also utilized. In some examples, various combinations of T1, T2, T3, and T4 are used to achieve different results. The T-block 604 outputs are buffered in a local memory of size 3×(R+2)×24b and the pooling region boundaries are stored in a local static random-access memory (SRAM) of size Np×3×8b.
In a third block or pooler module, the FE module 214 includes a spatial pooling or S-Block 606 configured to accumulate the weighted vectors, the k×P×P feature maps 618, from the T-Block 604 to give N linearly summed vectors of length k 620. These N vectors are concatenated to produce a descriptor of length kN. In the S-Block 606, there are a configurable number of parallel lanes for the spatial-pooling process. These lanes include comparators that read out Np pooling region boundaries from a local memory and compare with the current pixel locations. The power consumption and performance of the S-Block 606 may be adjusted by varying a number of lanes in S-Block 606.
In the final block or normalizer module, the FE module 214 includes a post normalization or N-Block 608 that is configured to remove descriptor dependency on image contrast. The output from the S-block 606 is processed by the N-block 608, which includes an efficient square-rooting algorithm and division module (based on CORDIC). In a non-iterative process, the S-Block 606 features are normalized to a unit vector (e.g., dividing by the Euclidean norm) and all elements above a threshold are clipped. The threshold is defined, in some examples, depending on the type of ambient-aware application operating on the mobile device or, in other examples, the threshold is defined by policies set by a user (e.g., user 101), the cloud, and/or an administrator. In some examples, a system with higher bandwidth, or more cost effective transmission, may set the threshold lower than other systems. In an iterative process, these steps repeat until a predetermined number of iterations has been reached.
Data precisions are tuned to increase an output signal-to-noise-ratio (SNR) for most images. The levels of parallelism in the system, the output precisions, memory sizes etc. may all be parameterized. Assuming no local data buffering between the IPD module 212 and FE modules 214, the feature-extraction block (for nominal ranges) consumes (assuming 64×64 patch size and 100 interest points) approximately 1.2 kB (4×4 two-dimensional array and 25 pooling regions) for a frame resolution of VGA (128×128 patch size and 100 interest points) and approximately 3.5 kB (8×8 two-dimensional array and 25 pooling regions) for a frame resolution of 720p HD. Local buffering between the IPD module 212 and FE module 214 enable those elements to work in a pipelined manner and, thus, mask the external data access bandwidth. Estimated storage capacities for the IPD module 212 and FE modules 214 are approximately 207.38 kB for VGA, 257.32 kB for 1080p, and approximately 331.11 kB for 4k image resolutions.
In another example, a spatial summation pattern 720, similar to the spatial histogram used in GLOH, may be used. The summing regions are arranged in a polar arrangement. The radii of the centers, their locations, the number of rings, and the number of locations per angular segment are all parameters that may be adjusted (0, 4, or 8) to facilitate increasing performance.
In yet another example, normalized Gaussian weighting functions are utilized to sum input regions over local pooling centers in a quadrilateral arrangement 730 (e.g., a 3×3 grid, a 4×4 grid, or a 5×5 grid). The sizes and the positions of these grid samples are tunable parameters.
In yet another example, a polar arrangement 740 of the Gaussian pooling centers is used instead of the rectangular arrangement 730. In at least some examples, the patterns for spatial pooling are stored in an on-chip memory along the borders of a two-dimensional-array (described below), and the spatially-pooled S-Block features are produced at the output. The number of lanes in the S-Block 606 may be adjusted to achieve a desired energy and throughput scalability.
In at least some examples, the FE module 214 includes an embedding or E-block (not shown) configured to reduce the feature vector dimensionality. The E-Block may include one or more sub-stages: principal component analysis (E1), locality preserving projections (E2), locally discriminative embedding (E3), etc. In one example of the present disclosure, the E-block is utilized to provide an option for extensibility.
This element of the disclosure estimates a homography automatically using a random sampling consensus (RANSAC) algorithm. Homography is a projection mapping between any two projection planes [points in the two planes are denoted by the co-ordinates (x, y) and (x′, y′)] with the same center of projection. In some examples, homography is utilized to align or register multiple images by shifting the images such that the images utilize the same or a common coordinate system. It is represented by a 3×3 matrix in homogeneous coordinates as shown in Equation 7 below:
The solution for a homography (e.g., finding the unknown hij's, and w in the above equation) are simplified through a least-square approximation. The solution entails finding the eigenvectors of an auxiliary matrix ATA with the smallest eigenvalue. The matrix A comprises combinations of the (x, y) and (x′, y′) coordinates from multiple interest points. In some examples, a small set of interest points is chosen, and the homograhy is solved for using the RANSAC algorithm (least-squares solution using the SVD algorithm, which is the Jacobi algorithm, in some examples). Next, the homography is applied to the other interest points, and the estimation error is determined. The selection of the subset of interest points is random and is continued until a set number of iterations. In some examples, the number of iterations is set by a user (e.g., user 101). In other examples, it is determined by the type of application utilizing the homography estimation. The final output of this module is the homography of the multiple images.
The homography matrix may be applied to the image or frame to derive a transformed frame. In some examples an affine transform is used to perform the warping. This module puts the registered or aligned frames onto a frame bus, from where a GPU and/or a CPU will read the frames and perform compositing.
In some examples, vector data may be processed in two stages utilizing two-dimensional-processing elements in a systolic array alongside an array of one-dimensional-processing elements. For example, the G-Block 602 may process images utilizing this two stage approach. The processing elements of the array iteratively process data, passing the results of any computations to the nearest neighbors of each processing element. In this example, an image is processed by a kernel, or type of filter, using this hardware architecture, resulting in a more efficient, faster processing of images on a device.
At least some of the modules described herein may utilize or incorporate a two-level vector reduction. In some examples, vector data, such as images, may be processed in two stages utilizing two-dimensional-processing elements in a systolic array alongside an array of one-dimensional-processing elements. The processing elements of the array iteratively process data, passing the results of any computations to the nearest neighbors of each processing element. In this example, an image is processed by a kernel, or type of filter, using this hardware architecture, resulting in a more efficient, faster processing of images on a device.
Utilizing a systolic array enables parallel processing, in two levels of reduction, of the data set U 806. Although the illustrated examples relate to processing images and/or image patches, any data sets may be processed in a systolic array in this manner. In the first level of reduction (e.g., L1), data sets U 806 and V 802 are processed element-wise using a first reduction function F 804. To achieve this, inter-vector data parallelism is utilized, which enables allowing the data set V 802 to be reused across all L1 lanes. The systolic array is utilized to perform the operations and/or to reduce resource costs.
As an example, in a first level of reduction, the first element of data set V 802 is applied to the first element of data set U 806 using function F 804, which yields the first element of data set W 808. In one example, the function F 804 is multiplication and, thus, the vector W 808 is generated by multiplying each element of vector V 802 (for instance, [v1, v2, . . . vN]) by the corresponding element of vector U 806 (for instance, [u1, u2, . . . uN]). Specifically, in this example, v1×u1=w1, v2×u2=w2, and so on until all elements of data set V 802 have been multiplied by all elements of data set U 806 resulting in a complete data set W 808 ([w1, w2, . . . wN]), which has the same number of elements as data sets V 802 and U 806.
In the second level of reduction (e.g., L2), each element wj of the resultant data set W 808 is processed by a second reduction function G 810 to generate an element hj 812. In one example, the function G 810 is an accumulator and/or addition and, thus, the element hj is a scalar product. In this example, the element hj is equal to the sum of w1+w2+ . . . +wN. The element hj is generated for each image patch of an image including a plurality of image patches to generate a resultant data set H=[h1, h2, hj . . . hM] 814.
When processing overlapping image patches, elements of the data set H 814 and/or and operations associated with generating the elements of the data set H 814 may be interleaved or reused to facilitate decreasing or eliminating the need to recalculate and/or re-fetch data repeatedly from external memory, lowering both memory bandwidth and local storage used.
Various combinations of functions are contemplated for the operations described above. In one example, function F 804 is multiplication and, thus, data set W 808 is the element-wise product of data sets U 806 and V 802. In that example, function G 810 may be addition or accumulation, in which case element hj is the scalar product. In another example of clustering, function F 804 is a distance and, thus, data set W 808 is a distance map of data sets U 806 and V 802 from a centroid. In that example, function G 810 is a comparator, in which case element hj is the nearest neighbor. In another example of image processing, function F 804 is an average and, thus, data set W 808 includes the mean filtered (by data set V 802) pixels of an image patch associated with data set U 806. In that example, function G 810 is a threshold, in which case element hj is an edge location of pixels. In another example of image processing, function F 804 is a gradient and, thus, data set W 808 includes the smoothed filtered (by data set V 802) pixels of an image patch associated with data set U 806. In that example, function G 810 is an addition, in which case element is a dominant optical flow of objects in the image. Although the disclosure is drawn to images, it is understood that the disclosure is not limited to images, but it may also be utilized to process other information such as tags, points in space, generic vectors, etc.
The disclosed systolic array architecture 900 provides the benefits discussed herein, feeding inputs a limited number of times, reusing data, and/or reducing bandwidth consumed as a result of accessing external memory (e.g., external memory 402). Further, the vector reduction process allows the system to perform two-dimensional convolution along any direction, with varying stride lengths, and kernel sizes.
In at least some examples, a control 908 manages an operation and/or a schedule (e.g., clock cycle) of the systolic array architecture 900. On a first clock cycle, element u1 associated with the first row is transmitted to a 2d-PE 906 positioned on the first row, first column, and element v1 associated with the first column is transmitted to the 2d-PE 906 positioned on the first row, first column. The F 804 and G 810 functions are implemented at the 2d-PE 906 positioned on the first row, first column (e.g., 2d-PE11) to generate element w11 (e.g., w11=v1×u1, and h1=w11). On each clock cycle, the elements are transmitted to adjacent 2d-PEs 906. For example, on a second clock cycle, one or more relevant elements (e.g., element u1) are transmitted to an adjacent 2d-PE 906 positioned on the first row, second column (e.g., 2d-PE12), and one or more relevant elements (e.g., element v1) are transmitted to an adjacent 2d-PE 906 positioned on the second row, first column (e.g., 2d-PE21), where they are processed with an element u2. For example, at 2d-PE12, element u1 is processed with element v2 (e.g., w12=v2×u1, and h1=v1×u1+v2×u1), and at 2d-PE21, element u2 is processed with element v1 (e.g., w21=v1×u2, and h2=w21). After N-clock cycles, 2d-PE2(N-1) generates element h1 (e.g., h1=v1×u1+v2×u1+ . . . vN×u1), and 2d-PE2(N-1) generates element h2 (e.g., h2=v1×u2+v2×u2+ . . . v(N-1)×u2), and so on. Accordingly, at any given point in time, the systolic array includes some combination of fully- and partially-convolved outputs. As shown in
At least a part of some of the outputs are reused, as at least some elements are re-fed into the engine by passing them from one processing element to its neighbors. In order to accommodate the partially-convolved outputs, a set of one-dimensional processing elements (1d-PEs) 910 is used along the edge of the 2d-PEs 906. The set of 1d-PEs 910 is, in some examples, arranged in a column, as illustrated in
The functions performed by the systolic array architecture 900 may be any operation that enables the system to function as described herein. The advantage of passing relevant elements to adjacent or near neighbor 2d-PEs 906 is that the computations are localized and sequential, thereby increasing an opportunity to reuse at least some elements and/or reducing a latency. This system is configurable to any image or kernel size, stride, type, etc.
As shown in
The output is stored in local memory to further reduce the latency of the processing. As shown in
Memory consumption associated with the block are RCd×8b for input/output FIFOs of depth d (e.g., 16) and PC×24b to store partially convolved outputs. If pixels are re-fetched from external memory, the hardware consumes an external memory bandwidth of TP2×8b. However, in this example, local buffers are added between the IPD module and the feature-extraction blocks to reduce an opportunity for re-fetching.
Frame processing times as low as 30 ms may be achieved using the disclosed accelerator. The disclosed accelerator yields an average speed up of 8× over a conventional GPU and 5× over a conventional field programmable gate array (FPGA) at a power level that is lower on average by 14× than the GPU and 3× than the FPGA.
Example computer readable media include flash memory drives, digital versatile discs (DVDs), compact discs (CDs), floppy disks, and tape cassettes. By way of example and not limitation, computer readable media comprise computer storage media and communication media. Computer storage media include volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media are tangible and mutually exclusive to communication media. Computer storage media are implemented in hardware and exclude carrier waves and propagated signals. Computer storage media for purposes of this disclosure are not signals per se. Example computer storage media include hard disks, flash drives, and other solid-state memory. In contrast, communication media typically embody computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism and include any information delivery media.
Although described in connection with an example computing system environment, examples of the disclosure are capable of implementation with numerous other general purpose or special purpose computing system environments, configurations, or devices.
Examples of well-known computing systems, environments, and/or configurations that may be suitable for use with aspects of the disclosure include, but are not limited to, mobile computing devices, personal computers, server computers, hand-held or laptop devices, multiprocessor systems, gaming consoles, microprocessor-based systems, set top boxes, programmable consumer electronics, mobile telephones, mobile computing and/or communication devices in wearable or accessory form factors (e.g., watches, glasses, headsets, or earphones), network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. Such systems or devices may accept input from a user in any way, including from input devices such as a keyboard or pointing device, via gesture input, proximity input (such as by hovering), and/or via voice input.
Examples of the disclosure may be described in the general context of computer-executable instructions, such as program modules, executed by one or more computers or other devices in software, firmware, hardware, or a combination thereof. The computer-executable instructions may be organized into one or more computer-executable components or modules. Generally, program modules include, but are not limited to, routines, programs, objects, components, and data structures that perform particular tasks or implement particular abstract data types. Aspects of the disclosure may be implemented with any number and organization of such components or modules. For example, aspects of the disclosure are not limited to the specific computer-executable instructions or the specific components or modules illustrated in the figures and described herein. Other examples of the disclosure may include different computer-executable instructions or components having more or less functionality than illustrated and described herein.
Aspects of the disclosure transform a general-purpose computer into a special-purpose computing device when configured to execute the instructions described herein.
The examples illustrated and described herein as well as examples not specifically described herein but within the scope of aspects of the disclosure constitute an example means for processing an image. For example, the elements described herein constitute at least an example means for generating an image, an example means for transmitting and/or retrieving an image to and/or from a frame bus, an example means for identifying one or more interest points in an image, an example means for extracting one or more features from an interest point, an example means for aligning or registering a plurality of images, and/or an example means for combining a plurality of images to generate a composite image.
The order of execution or performance of the operations in examples of the disclosure illustrated and described herein is not essential, unless otherwise specified. That is, the operations may be performed in any order, unless otherwise specified, and examples of the disclosure may include additional or fewer operations than those disclosed herein. For example, it is contemplated that executing or performing a particular operation before, contemporaneously with, or after another operation is within the scope of aspects of the disclosure.
When introducing elements of aspects of the disclosure or the examples thereof, the articles “a,” “an,” “the,” and “said” are intended to mean that there are one or more of the elements. The terms “comprising,” “including,” and “having” are intended to be inclusive and mean that there may be additional elements other than the listed elements. The phrase “one or more of the following: A, B, and C” means “at least one of A and/or at least one of B and/or at least one of C.” Having described aspects of the disclosure in detail, it will be apparent that modifications and variations are possible without departing from the scope of aspects of the disclosure as defined in the appended claims. As various changes could be made in the above constructions, products, and methods without departing from the scope of aspects of the disclosure, it is intended that all matter contained in the above description and shown in the accompanying drawings shall be interpreted as illustrative and not in a limiting sense.
Alternatively or in addition to the other examples described herein, examples include any combination of the following:
In some examples, the operations illustrated may be implemented as software instructions encoded on a computer readable medium, in hardware programmed or designed to perform the operations, or both. For example, aspects of the disclosure may be implemented as a system on a chip or other circuitry including a plurality of interconnected, electrically conductive elements.
While the aspects of the disclosure have been described in terms of various examples with their associated operations, a person skilled in the art would appreciate that a combination of operations from any number of different examples is also within scope of the aspects of the disclosure.
This application claims the benefit of U.S. Provisional Application No. 62/131,815, filed Mar. 11, 2015.
Number | Date | Country | |
---|---|---|---|
62131815 | Mar 2015 | US |