The present disclosure relates to the field of information technology and, more particularly, to an image processing method, a chip, a processor, a computer system, and a mobile device thereof.
Currently in the design and implementation of a field-programmable gate array (FPGA) or an application specific integrated circuit (ASIC) chip, the main power consumption and area are generated by random access memory (RAM). When the area of the RAM is small, the power consumption and area of the corresponding system will be small.
In existing technologies, various algorithms, such as Harris algorithm and Census algorithm, are usually implemented separately, i.e., a separate buffer is provided for each algorithm. When an image is processed by an algorithm, multiple rows of pixels of the image need to be read from a corresponding buffer, and the corresponding pixels are selected. Because the pixels are read from the buffer in entire lines, the read speed may be affected, especially for large-sized images, the processing efficiency may be significantly degraded.
Thus, how to improve processing efficiency has become an urgent technical problem in chip design.
In accordance with the disclosure, there is provided an image processing method. The method comprises acquiring a plurality of pixel rows of an image according to a rectangular pixel region, and storing the plurality of pixel rows as blocks in a plurality of line buffers. A pixel row is stored as a block in a storage space of the plurality of line buffers, and a number of bits of the block in a line buffer is smaller than a number of pixel columns of the image.
Also, in accordance with the disclosure, there is provided a chip. The chip comprises a controller and a plurality of line buffers. The controller is configured to acquire a plurality of pixel rows of an image according to a rectangular pixel region, and store the plurality of pixel rows as blocks in a plurality of line buffers. A pixel row is stored as a block in a storage space of the plurality of line buffers, and a number of bits of the block in a line buffer is smaller than a number of pixel columns of the image.
Also, in accordance with the disclosure, there is provided a processor. The processor comprises a chip. The chip comprises a controller and a plurality of line buffers. The controller is configured to acquire a plurality of pixel rows of an image according to a rectangular pixel region, and store the plurality of pixel rows as blocks in a plurality of line buffers. A pixel row is stored as a block in a storage space of the plurality of line buffers, and a number of bits of the block in a line buffer is smaller than a number of pixel columns of the image.
Technical solutions of the present disclosure will be described with reference to the drawings. It will be appreciated that the described embodiments are some rather than all of the embodiments of the present disclosure. Other embodiments conceived by those having ordinary skills in the art on the basis of the described embodiments without inventive efforts should fall within the scope of the present disclosure.
It should be understood that sequence numbers of the foregoing processes do not mean execution sequences in the embodiments of the present disclosure. The execution sequences of the processes should be determined according to functions and internal logic of the processes, and should not be construed as any limitation on the implementation processes of the embodiments of the present disclosure.
It should be understood that the various embodiments described in the specification may be implemented separately or in combination, which is not limited by the present disclosure.
The technical solution provided by the present disclosure may be applied to various algorithms, such as Harris algorithm or Census algorithm, which is not limited by the present disclosure.
The technical solution provided by the present disclosure stores multiple rows of pixels of an image as blocks in line buffers, which may improve the reading-out speed of pixels from the line buffers and, accordingly, improve the processing efficiency.
Further, the technical solution provided by the present disclosure may allow a plurality of algorithms to share line buffers, such that a separate buffer may be no longer provided to each algorithm, thereby reducing the consumption of storage resources.
In the disclosed embodiments, a rectangular pixel region may be the smallest rectangular pixel region for the pixel selection in the algorithm, i.e., a window for the pixel selection in the algorithm. It should be understood that when the window for the pixel selection in the algorithm is not a rectangular area, the rectangular pixel region may be the smallest rectangular pixel region which covers the window. The number of rows of the rectangular pixel region may be the same as or different from the number of columns of the rectangular pixel region. For example, for Harris algorithm, the rectangular pixel region may be a 3×3 pixel region, while for the Census algorithm, the rectangular pixel region may be a 13×13 pixel region.
The data to be processed 102 may include data of an image (i.e., image data), or other similar multimedia data. In some embodiments, the data to be processed 102 may include sensing data from a sensor, which may be a vision sensor (e.g., a camera, an infrared sensor), a near field sensor (e.g., an ultrasonic sensor, a radar), and/or a position sensor, etc. In some embodiments, the data to be processed 102 may include information of a user (i.e., user information), such as biometric information including facial features, fingerprints, retinal information, and/or DNA samples, etc. In the disclosed embodiments, the image data is taken as an example, but the present disclosure is not limited thereto.
In some embodiments, a mobile device, which is also referred to as a portable device, may process data using the technical solution provided by the present disclosure. The mobile device may be a drone, an unmanned boat, an autonomous vehicle, or a robot, etc., which is not limited by the present disclosure.
The sensing system 330 may be configured to measure posture information of the mobile device 300, i.e., position information and status information of the mobile device 300 in space, such as three-dimensional (3D) position, 3D angle, 3D speed, 3D acceleration, and/or 3D angular velocity, etc. The sensing system 330 may include, for example, at least one of a gyroscope, an electronic compass, an inertial measurement unit (IMU), a vision sensor, a global positioning system (GPS), a barometer, and/or an airspeed meter.
In one embodiment, the sensing system 330 may be further configured to acquire images, i.e., the sensing system 330 may include a sensor for acquiring images, such as a camera. The control system 320 may be configured to control the movement of the mobile device 300. The control system 320 may control the mobile device 300 in accordance with preset program instructions. For example, the control system 320 may control the movement of mobile device 300 based on the posture information of mobile device 300 measured by sensing system 330. The control system 320 may also control the mobile device 300 based on the control signals from a remote control. For example, for a drone, the control system 320 may be a flight control system or a control circuit in the flight control system.
The processing system 340 may be configured to process images acquired by the sensing system 330. For example, the processing system 340 may include an image signal processing (ISP) chip. In one embodiment, the processing system 340 may be the system 100 in
It should be understood that the above-mentioned divisions and naming of the components of the mobile device 300 are merely for illustrative purposes, which is not intended to limit the scope of the present disclosure. In addition, the mobile device 300 may further include other components which are not drawn in
First, a plurality of rows of pixels of (i.e., a plurality of pixel rows) of an image are acquired according to a first rectangular pixel region (Step 410). In particular, the pixels used for follow-on algorithm processing may be acquired according to the first rectangular pixel region. The pixel may be a pixel output by a module of a preceding stage algorithm, or a pixel stored in the memory.
In one embodiment, the number of the acquired pixel rows may be not less than a difference between the number of pixel rows of the first rectangular pixel region and a preset value. The preset value may be 1 or other values. In one embodiment, the number of the acquired pixel rows may be equal to a difference between the number of pixel rows of the first rectangular pixel region and the preset value. For example, the number of the acquired pixel rows may be equal to the number of pixel rows of the first rectangular pixel region minus one. That is, when the first rectangular pixel region is a 13×13 pixel region, the number of the acquired pixel rows may be 12. Then the acquired pixel rows may be stored in line buffers for the algorithm to be processed.
After the plurality of pixel rows of the image are acquired, the plurality of acquired pixel rows are stored as blocks in a plurality of line buffers, where each pixel row is stored as a block in a storage space of the plurality of line buffers, and the number of bits of the block in one line buffer is smaller than the number of pixel columns of the image (S420).
In the disclosed embodiments, the plurality of acquired pixel rows may be stored as blocks in a plurality of line buffers. In other words, the plurality of acquired pixel rows may be no longer stored as rows, instead the plurality of acquired pixel rows may be stored as blocks in the plurality of line buffers, where each pixel row is stored as a block in a storage space of the plurality of line buffers. That is, each of acquired pixel rows of the image may occupy one block in the storage space of the plurality of lines buffers instead of occupying one line buffer. The number of bits per block in a line buffer may be smaller than the number of pixel columns of the image. Thus, the number of pixel columns to be read from the line buffer may be smaller than the number of pixel columns of the image, such that the read speed may be increased, and the processing efficiency may be improved accordingly.
In one embodiment, when storing a plurality of pixel rows as blocks in the line buffers, a requirement of a plurality of rectangular pixel regions may be considered. For example, the plurality of pixel rows may be stored as blocks in a plurality of line buffers according to a first rectangular pixel region and a second rectangular pixel region.
In particular, after acquiring a plurality of pixel rows of an image according to the first rectangular pixel region, the plurality of acquired pixel rows may be stored as blocks in a plurality of line buffers according to the second rectangular pixel region and the first rectangular pixel region. That is, two rectangular pixel regions may be considered when storing the acquired pixel rows. In one embodiment, the second rectangular pixel region may have a smaller number of pixel rows than the first rectangular pixel region. That is, the pixels may be acquired according to a rectangular pixel region having a large number of pixel rows, and the acquired pixels may be stored in the line buffers according to both the rectangular pixel region having a large number of pixel rows and the rectangular pixel region having a small number of pixel rows.
In one embodiment, the number of blocks in one column of the plurality of line buffers may be equal to the number of pixel rows of the second rectangular pixel region. That is, the number of blocks in the vertical direction of the storage space formed by the plurality of line buffers may be equal to the number of pixel rows of the second rectangular pixel region. For example, when the second rectangular pixel region is a 3×3 pixel region, the number of blocks in the vertical direction may be three. In another embodiment, the number of blocks in the vertical direction of the storage space formed by the plurality of line buffers may be different from the number of pixel rows of the second rectangular pixel region.
In one embodiment, the number of bits of one block (i.e., the horizontal width of one block) in one of the plurality of line buffers may be not less than the number of pixel columns of the second rectangular pixel region. For example, when the second rectangular pixel region is a 3×3 pixel region, the horizontal width of one block may be not less than 3. In another embodiment, the number of bits of one block (i.e., the horizontal width of one block) in one of the plurality of line buffers may be smaller than the number of pixel columns of the second rectangular pixel region.
A product of the number of blocks in one column of the plurality of line buffers (i.e., in the vertical direction of the storage space of the plurality of line buffers) and the number of blocks in one line buffer (i.e., in the horizontal direction of the storage space of the plurality of line buffers) may be not less than the difference between the number of pixel rows of the first rectangular pixel region and a preset value. That is, the product of the number of blocks in the vertical direction of the storage space and the number of blocks in the horizontal direction of the storage space may be not less than a value associated with the number of pixel rows of the first rectangular pixel region. The value associated with the number of pixel rows of the first rectangular pixel region may be the difference between the number of pixel rows of the first rectangular pixel region and the preset value, and the preset value may be 1 or other values. For example, when the first rectangular pixel region is a pixel region of 13×13, the product of the number of blocks in the vertical direction of the storage space of the plurality of line buffers and the number of blocks in the horizontal direction of the storage space of the plurality of line buffers may be not less than 12.
In one embodiment, the product of the number of blocks in one column of the plurality of line buffers and the number of blocks in one line buffer may be equal to the number of pixel rows of the first rectangular pixel region minus one. That is, the product of the number of blocks in the vertical direction of the storage space of the plurality of line buffers and the number of blocks in the horizontal direction of the storage space of the plurality of line buffers may be equal to the number of pixel rows of the first rectangular pixel region minus one. For example, when the first rectangular pixel region is a pixel region of 13×13, the product of the number of blocks in the vertical direction of the storage space of the plurality of line buffers and the number of blocks in the horizontal direction of the storage space of the plurality of line buffers may be equal to 12.
In one embodiment, the plurality of pixel rows may be sequentially stored as a plurality of blocks, in an order from top to bottom and from left to right in the storage space of the plurality of line buffers. That is, the plurality of blocks corresponding to the plurality of acquired pixel rows may be arranged in an order from top to bottom and from left to right. It should be understood that the storage order of the blocks may vary, for example, the blocks may be arranged in an order from left to right and from top to bottom in the storage space of the plurality of line buffers, which is not limited by the present disclosure.
As shown in
It should be understood that
In one embodiment, the first rectangular pixel region may be the smallest rectangular pixel region for a pixel selection in a first algorithm of a plurality of algorithms, and the second rectangular pixel region may be the smallest rectangular pixel region for a pixel selection in a second algorithm of the plurality of algorithms. The first rectangular pixel region may cover the second rectangular pixel region.
In one embodiment, the first rectangular pixel region and the second rectangular pixel region may be the largest and smallest rectangular pixel regions for the pixel selection in the plurality of algorithms, respectively. In the storage design, both the largest region (e.g., the first rectangular pixel region) and the smallest region (e.g., the second rectangular pixel region) for selecting pixels may be considered, thereby allowing multiple algorithms to share the line buffers.
The present disclosure does not limit the number of rectangular pixel regions to be considered in the storage design. In one embodiment, only one rectangular pixel region may be considered, such as the above-mentioned largest one. In another embodiment, a plurality of rectangular pixel regions may be considered, such as the above-mentioned largest one and smallest one.
In one embodiment, for the second algorithm, the pixels in the corresponding line buffers of the plurality of line buffers may be read according to the second rectangular pixel region, and the corresponding pixels may be selected to be output to a module of the second algorithm (i.e., a second algorithm module). The second algorithm may correspond to the smallest rectangular pixel region, which includes the smallest number of pixels. Thus, the corresponding pixels may be acquired once, then output to the second algorithm module.
In one embodiment, the second algorithm may be Harris algorithm, and the second rectangular pixel region may be a pixel region of 3×3. Taking
In one embodiment, for the first algorithm, the read pixels may be registered in a register, i.e., the pixels obtained from multiple read may be registered in the register. The multi-registered pixels which are obtained from multiple read and then registered in the register (i.e., which are registered in the register from multiple read) may be spliced according to the first rectangular pixel region, and corresponding pixels may be selected to be output to a module of first algorithm, i.e., a first algorithm module. Because the first algorithm corresponds to the largest rectangular pixel region, the pixels required for the first algorithm processing may be obtained by splicing the pixels which are obtained from multiple read and then registered in the register, then outputting the spliced pixels to the first algorithm module.
It should be understood that for another algorithm corresponding to a rectangular pixel region which has a size between the second algorithm and the first algorithm, the required pixels may be obtained by splicing the pixels which are registered in the register from multiple read. The first algorithm is explained for illustrative purposes, which is not intended to limit the scope of the present disclosure.
In one embodiment, the first algorithm may be Census algorithm, the rectangular pixel region may be a pixel region of 5×5 or 7×7, and every processing may require 5 rows and 5 columns of pixels or 7 rows and 7 columns of pixels. For illustrative purposes, as shown in
In one embodiment, the plurality of pixel rows may be acquired by a first input first output (FIFO) manner, through which the data may be stopped from being read after receiving the back pressure, thereby controlling the timing of data reading.
In the disclosed embodiments, a plurality of pixel rows may be stored as blocks in line buffers according to a rectangular pixel region. The number of bits per block in a line buffer may be smaller than the number of pixel columns of the image. Thus, the number of columns of pixels to be read from the line buffer may be smaller than the number of pixel columns of the image, such that the read speed of the data may be increased, and the processing efficiency may be improved accordingly.
Further, through storing the plurality of pixel rows in line buffers according to a plurality of rectangular pixel regions, multiple algorithms may be able to share the line buffers, such that a separate line buffer may be no longer desired to be provided for each algorithm, which reduces the consumption of the storage resources.
The above embodiments describe the technical solution of the storage designs using the line buffer, but the embodiment of the present disclosure is not limited thereto. That is, the storage designs in the foregoing embodiments may be implemented separately, without depending on whether shared or not. In addition, the technical solution of sharing the line buffers provided by the present disclosure may also be implemented separately, without depending on the storage designs in the foregoing embodiments.
The present disclosure further provides another image processing method, which is described below in conjunction with
Step 610: according to the second rectangular pixel region, reading pixels from corresponding line buffers of a plurality of line buffers, and selecting read pixels to output to the second algorithm module, where the second rectangular pixel region is the smallest rectangular pixel region for the pixel selection in the second algorithm; and
Step 620: registering the read pixels into a register, and according to the first rectangular pixel region, splicing the multi-registered pixels in the register and selecting corresponding pixels to output to the first algorithm module, where the first rectangular pixel region is the smallest rectangular pixel region for the pixel selection in the first algorithm, and the first rectangular pixel region covers the second rectangular pixel region.
In the disclosed embodiments, a plurality of algorithms may share line buffers. In particular, for an algorithm corresponding to a small rectangular pixel region, the pixels required for one processing may be read once from the line buffers. For an algorithm corresponding to a large rectangular pixel region, through registering the read pixels into the register and splicing the multi-registered pixels in the register, the pixels required for one processing may be obtained. Thus, a plurality of algorithms may be able to share the line buffers, and separate line buffers may be no longer desired to be provided for each algorithm, which reduces the consumption of the storage resources.
The present disclosure further provides a chip, a processor, a computer system, and a mobile device. It should be understood that the disclosed chip, processor, computer system, and mobile device may perform any one of the disclosed methods. That is, for the specific working process of the following various products, reference may be made to the corresponding process in the foregoing method embodiments.
In one embodiment, the number of the acquired pixel rows may be not less than a difference between the number of pixel rows of the first rectangular pixel region and a preset value.
In one embodiment, the number of the acquired pixel rows may be equal to the number of pixel rows of the first rectangular pixel region minus one.
In one embodiment, the number of blocks in a column of the plurality of line buffers may be equal to the number of pixel rows of the second rectangular pixel region, where the number of pixel rows of the second rectangular pixel region may be smaller than the number of pixel rows of the first rectangular pixel region.
In one embodiment, the number of bits of the block in one of the plurality of line buffers may be not less than the number of columns in the second rectangular pixel region.
In one embodiment, the first rectangular pixel region may be the smallest rectangular pixel region for a pixel selection in a first algorithm of a plurality of algorithms, and the second rectangular pixel region may be the smallest rectangular pixel region for a second algorithm of the plurality of algorithms to select pixels, where the first rectangular pixel region covers the second rectangular pixel region.
In one embodiment, as shown in
In one embodiment, as shown in
In one embodiment, the first algorithm may be Census algorithm, and the second algorithm may be Harris algorithm.
In one embodiment, the controller 710 may be configured to store the plurality of pixel rows as a plurality of blocks in the storage space of the plurality of line buffers 720, in an order from top to bottom and from left to right.
In one embodiment, as shown in
It should be understood that, in the disclosed chip, the controller may be implemented by a circuit, which may be a single circuit or a circuit composed of several circuits, which is not limited by the present disclosure. It should also be understood that the various units or modules in the embodiments of the present disclosure may be integrated into one chip or distributed in different chips.
The present disclosure also provides a processor, which may include any of the disclosed chips.
The memory 1020 may be configured to store computer executable instructions. The memory 1020 may be any appropriate types of memories, including, for example, a high speed random access memory (RAM), a non-volatile memory such as at least one disk, which is not limited by the present disclosure.
The processor 1010 may be configured to access the memory 1020 and execute the computer executable instructions to perform the operations in the disclosed image processing method. The processor 1010 may include a microprocessor, a field-programmable gate array (FPGA), a central processing unit (CPU), and/or a graphics processing unit (GPU), etc., which is not limited by the present disclosure.
The present disclosure also provide a mobile device, which may include the disclosed chip, processor or computer system.
The disclosed chip, processor, computer system, and mobile device may be corresponding to an execution body of the disclosed image processing method, and the foregoing and other operations and/or functions of the modules in the disclosed chip, processor, computer system, and mobile device are respectively used to implement corresponding procedures of the foregoing methods. For brevity, details are not described herein again.
The present disclosure further provides a computer storage medium. A code is stored in the computer storage medium and configured to execute the disclosed image processing method.
It should be understood that, the term “and/or” in this specification describes only an association relationship for describing associated objects and represents that three relationships may exist. For example, A and/or B may represent the following three cases, only A exists, both A and B exist, and only B exists. In addition, the character “/” in this specification generally represents an “or” relationship between the associated objects.
A person of ordinary skill in the art may be aware that the units and algorithm steps in the examples described with reference to the embodiments disclosed herein may be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are performed by hardware or software depends on particular applications and design constraint conditions of the technical solutions. A person skilled in the art may use different methods to implement the described functions for each particular application, but it should not be considered that the implementation goes beyond the scope of the present disclosure.
It may be clearly understood by a person skilled in the art that, for convenience and brevity of description, for a detailed working process of the foregoing system, apparatus, and unit, refer to a corresponding process in the foregoing method embodiments. Details are not described herein again.
In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the described apparatus embodiment may be merely exemplary. For example, the unit division may be merely a logical function division and there may be other divisions in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not performed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented through some interfaces. The indirect couplings or communication connections between the apparatuses or units may be implemented in electronic, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. A part or all of the units may be selected according to an actual need to achieve the objectives of the solutions in the embodiments of the present disclosure.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each of the units may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in a form of hardware, or may be implemented in a form of a software functional unit.
When the integrated unit may be implemented in a form of a software functional unit and sold or used as an independent product, the integrated unit may be stored in a computer-readable storage medium. Based on such an understanding, the technical solutions of the present disclosure essentially, or the part contributing to the prior art, or all or a part of the technical solutions may be implemented in a form of a software product. The computer software product may be stored in a storage medium and may include several instructions for instructing a computer device (which may be a personal computer, a server, or a network device) to perform all or a part of the steps of the methods described in the embodiments of the present disclosure. The foregoing storage medium may include any medium that may store code, such as a universal serial bus (USB) flash drive, a removable hard disk, a read-only memory (ROM), a random-access memory (RAM), a magnetic disk, or an optical disc.
The foregoing descriptions are merely specific implementations of the present disclosure, but are not intended to limit the protection scope of the present disclosure. Any equivalent variation or replacement readily figured out by a person skilled in the art within the technical scope disclosed in the present disclosure shall fall within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.
This application is a continuation application of International Application No. PCT/CN2017/094289, filed on Jul. 25, 2017, the entire contents of which are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2017/094289 | Jul 2017 | US |
Child | 16728832 | US |