Image acquisition methods, devices, computer equipment, and storage media
Patent Information
- Application Number
- CN202310304624.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-27
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2043-03-27
AI Technical Summary
然而,增加缓存设备带宽和图像缓存单元需要进行设备的硬件升级,成本较高,实现难度大;通过大容量存储设备先存储所有待处理帧数的图像再处理增加了测试时间,测试效率较低
[0048]本公开实施例,在图像采集的过程中,获取初始图像帧和累加图像帧,并将初始图像帧合并至累加图像帧,得到一次更新的累加图像帧,当一次更新的累加图像帧的图像帧数和目标帧数的差值在预设范围的情况下,对一次更新的累加图像帧的像素点的像素值进行平均处理,得到二次更新的累加图像帧,直到更新次数符合预设条件,得到采集后的图像;通过本实施例,在采集多图像帧的图像时,能够在采集过程中,累加图像帧到达目标帧数时,进行平均处理,直至完成所有图像帧的处理,降低了采集后图像的数据量,实现了边处理边采集的效果,保证了测试效率,且无需采集全部图像帧后进行平均处理,通过动态平均处理,能够适应高吞吐率的场景,提高了存储空间的带宽利用率,缩短了图像缓存处理时间,占用存储空间小,减小了图像采集过程中所需缓存空间的深度,提高了资源利用率。
Smart Images

Figure CN116347252B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of semiconductor testing technology, and in particular to an image acquisition method, apparatus, computer device, and storage medium. Background Technology
[0002] During the testing of image sensor chips, the image sensor outputs images. These images need to be acquired and analyzed to obtain data such as the performance indicators of the image sensor chip. With the improvement of image sensor design and manufacturing processes, the resolution, frame rate, and data throughput of image sensor output images have all increased significantly. Therefore, there are higher requirements for the image acquisition and processing during the testing of image sensor chips.
[0003] Traditional techniques can cache test images by increasing the bandwidth of the caching device and the image caching unit; alternatively, all frames to be processed can be stored in a large-capacity storage device first, and then each frame can be processed one by one. However, increasing the bandwidth of the caching device and the image caching unit requires hardware upgrades, which are costly and difficult to implement; storing all frames to be processed in a large-capacity storage device first increases the testing time and reduces testing efficiency. Summary of the Invention
[0004] Therefore, it is necessary to provide an image acquisition method, device, computer equipment, storage medium, and computer program product that can adapt to high throughput and ensure testing efficiency in order to address the above-mentioned technical problems.
[0005] In a first aspect, embodiments of this disclosure provide an image acquisition method. The method includes:
[0006] Obtain the initial image frame and the accumulated image frames from the buffer;
[0007] The initial image frame is merged into the accumulated image frame to obtain an updated accumulated image frame, and the updated accumulated image frame is stored in the buffer area.
[0008] If the difference between the number of image frames corresponding to the first updated cumulative image frame and the target number of frames is within a preset range, the average pixel value of the corresponding pixel in the multiple image frames of the first updated cumulative image frame is determined as the pixel value of the second updated cumulative image frame. The second updated cumulative image frame is stored in the buffer until the number of updates meets the preset condition, and the acquired image is obtained.
[0009] In one embodiment, obtaining the initial image frame includes:
[0010] Get the initial pixel;
[0011] The initial pixels are spliced together according to the number of bits of the initial pixels and the preset number of bits of the cache to obtain multiple sets of pixels;
[0012] Based on the correlation between the initial pixels, the multiple groups of pixels are merged to obtain the initial image frame.
[0013] In one embodiment, obtaining the initial pixel point includes:
[0014] Obtain the original pixels and preset pixel compression parameters, wherein the preset pixel compression parameters are related to the cache bit width of the cache area;
[0015] The original pixels are compressed according to the preset pixel compression parameters to obtain the initial pixels.
[0016] In one embodiment, obtaining the initial image frame and obtaining the accumulated image frames from the buffer includes:
[0017] Obtain the image cache category, wherein the image cache category is determined based on preset acquisition parameters;
[0018] When the cache category is the average processing image cache category, the initial image frame is obtained and the accumulated image frames are obtained from the cache area.
[0019] In one embodiment, acquiring the accumulated image frames includes:
[0020] Retrieve multiple sets of accumulated image pixels corresponding to the accumulated image frames sequentially from the buffer;
[0021] The multiple sets of accumulated image pixels are merged according to the correlation between the accumulated image pixels to obtain an accumulated image frame.
[0022] In one embodiment, the method for determining the target number of frames includes:
[0023] The number of corresponding cache addresses and the number of image frames in the initial image frame are determined according to the preset acquisition parameters.
[0024] The target number of frames is determined based on the number of cache addresses and the number of image frames in the initial image frame.
[0025] Secondly, embodiments of this disclosure also provide an image acquisition device. The device includes:
[0026] The acquisition module is used to acquire the initial image frame and the accumulated image frames from the buffer.
[0027] The merging module is used to merge the initial image frame into the accumulated image frame to obtain an updated accumulated image frame, and store the updated accumulated image frame into the buffer area;
[0028] The averaging module is used to determine the average pixel value of corresponding pixels in multiple frames of the first-updated accumulated image frame as the pixel value of the second-updated accumulated image frame when the difference between the number of image frames corresponding to the first-updated accumulated image frame and the target number of frames is within a preset range. The second-updated accumulated image frame is then stored in the buffer until the number of updates meets the preset conditions, and the acquired image is obtained.
[0029] In one embodiment, the acquisition module includes:
[0030] The first acquisition submodule is used to acquire the initial pixel point;
[0031] The splicing module is used to splice the initial pixels according to the number of bits of the initial pixels and the preset number of bits of the cache to obtain multiple sets of pixels;
[0032] The first merging submodule is used to merge the multiple groups of pixels according to the correlation between the initial pixels to obtain an initial image frame.
[0033] In one embodiment, the first acquisition submodule includes:
[0034] An acquisition unit is used to acquire the original pixel points and preset pixel compression parameters, wherein the preset pixel compression parameters are related to the cache bit size of the cache area;
[0035] The compression module is used to compress the original pixels according to the preset pixel compression parameters to obtain the initial pixels.
[0036] In one embodiment, the acquisition module includes:
[0037] The second acquisition submodule is used to acquire the image cache category, wherein the image cache category is determined according to preset acquisition parameters;
[0038] The third acquisition submodule is used to acquire the initial image frame and the accumulated image frame from the cache when the cache category is the average processing image cache category.
[0039] In one embodiment, the acquisition module includes:
[0040] The fourth acquisition submodule is used to sequentially acquire multiple sets of accumulated image pixels corresponding to the accumulated image frames from the buffer.
[0041] The second merging submodule is used to merge the multiple groups of accumulated image pixels according to the correlation between the accumulated image pixels to obtain an accumulated image frame.
[0042] In one embodiment, the target frame number determination module includes:
[0043] The first determining submodule is used to determine the number of corresponding cache addresses and the number of image frames of the initial image frame in the cache area according to preset acquisition parameters;
[0044] The second determining submodule is used to determine the target number of frames based on the number of cache addresses and the number of image frames in the initial image frame.
[0045] Thirdly, embodiments of this disclosure also provide a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method described in any one of the embodiments of this disclosure.
[0046] Fourthly, embodiments of this disclosure also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the method described in any one of the embodiments of this disclosure.
[0047] Fifthly, embodiments of this disclosure also provide a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the method described in any one of the embodiments of this disclosure.
[0048] In this embodiment, during image acquisition, an initial image frame and an accumulated image frame are obtained. The initial image frame is merged into the accumulated image frame to obtain an updated accumulated image frame. When the difference between the number of image frames in the updated accumulated image frame and the target number of frames is within a preset range, the pixel values of the pixels in the updated accumulated image frame are averaged to obtain a second updated accumulated image frame. This process continues until the number of updates meets a preset condition, resulting in the acquired image. Through this embodiment, when acquiring images with multiple image frames, averaging can be performed when the accumulated image frame reaches the target number of frames during the acquisition process, until all image frames are processed. This reduces the amount of data in the acquired image, achieves the effect of processing while acquiring, ensures testing efficiency, and eliminates the need to perform averaging after acquiring all image frames. Through dynamic averaging, it can adapt to high-throughput scenarios, improves the bandwidth utilization of storage space, shortens the image cache processing time, occupies less storage space, reduces the depth of the cache space required during image acquisition, and improves resource utilization. Attached Figure Description
[0049] Figure 1 This is a flowchart illustrating an image acquisition method in one embodiment;
[0050] Figure 2 This is a flowchart illustrating an image acquisition method in one embodiment;
[0051] Figure 3 This is a flowchart illustrating an image acquisition method in one embodiment;
[0052] Figure 4 This is a flowchart illustrating an image acquisition method in one embodiment;
[0053] Figure 5 This is a schematic diagram of the structure of an image acquisition system in one embodiment;
[0054] Figure 6 This is a flowchart illustrating an image acquisition method in one embodiment;
[0055] Figure 7 This is a structural block diagram of an image acquisition device in one embodiment;
[0056] Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0057] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the embodiments of this disclosure will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the embodiments of this disclosure and are not intended to limit the embodiments of this disclosure.
[0058] In one embodiment, such as Figure 1 As shown, an image acquisition method is provided, the method comprising:
[0059] Step S110: Obtain the initial image frame and the accumulated image frame from the buffer.
[0060] In this embodiment, the image to be acquired may include multiple image frames. During processing, image frames are acquired and processed, and the acquired image is obtained after all processing is completed. In this embodiment, an initial image frame is acquired, wherein there is a correlation between the initial image frame and the acquired image. In one example, when the image to be acquired includes multiple image frames, multiple image frames can be acquired sequentially as the initial image frame for image processing. Taking the method of this embodiment applied to the image sensor chip testing process as an example, during the image sensor chip testing process, image data is output, and the image frame corresponding to the test image is determined based on the output image data, which is then determined as the initial image frame. In this embodiment, accumulated image frames are acquired from a buffer area, wherein the buffer area can be a buffer region set according to the actual application scenario, used to store the image data corresponding to the accumulated image frames. In one example, there is a corresponding correlation between the accumulated image frames and the initial image frames; for example, during the image sensor chip testing process, the initial image frames and accumulated image frames correspond to the image data output by the chip. In one example, the size of the buffer space in the buffer area can be determined according to the actual application scenario.
[0061] Step S120: Merge the initial image frame into the accumulated image frame to obtain an updated accumulated image frame, and store the updated accumulated image frame in the buffer area;
[0062] In this embodiment, the initial image frame is merged into the accumulated image frame to obtain an updated accumulated image frame, which is then stored in the buffer. After merging the initial and accumulated image frames, the accumulated image frame is updated, resulting in an updated accumulated image frame. This updated accumulated image frame is then stored in the buffer. The data size of the updated accumulated image frame differs from the original accumulated image frame, and the corresponding cache address in the buffer can be either a new address or the original address of the accumulated image frame. The original accumulated image frame is overwritten during the storage process. In one example, the cache address can be pre-allocated in the buffer to store the accumulated image frame according to the actual application scenario.
[0063] Step S130: If the difference between the number of image frames corresponding to the first updated accumulated image frame and the target number of frames is within a preset range, determine the average pixel value of the corresponding pixel points in the multiple image frames of the first updated accumulated image frame as the pixel value of the second updated accumulated image frame, store the second updated accumulated image frame in the buffer area, and continue until the number of updates meets the preset conditions to obtain the acquired image.
[0064] In this embodiment, when the difference between the number of image frames corresponding to a single updated accumulated image frame and the target number of frames is within a preset range, the accumulated image frames are averaged. Specifically, the accumulated image frame corresponds to multiple image frames. The average pixel value of the corresponding pixel in the multiple image frames of the single updated accumulated image frame is determined to obtain the accumulated image frame of the second update, which is then stored in a buffer. The target number of frames and the preset range can be determined in advance based on the actual application scenario. The preset range can be a small range of error allowed based on the target number of frames. For example, when the target number of frames is 8, the preset range can be set to 8±1. When the number of image frames corresponding to a single updated accumulated image frame is within this preset range, the average pixel value of the corresponding pixel in the multiple image frames of the single updated accumulated image frame is calculated as the accumulated image frame of the second update. When the number of updates meets the preset condition, the acquired image is obtained. The preset condition is determined based on the actual application scenario, and the update count increases by one for each update of the accumulated image frame. In one example, the preset conditions can be determined based on the number of image frames corresponding to the image to be acquired. For example, based on the total number of image frames and the target number of frames corresponding to the image to be acquired, the number of updates required for the corresponding accumulated image frames can be determined. When the number of updates for the accumulated image frames reaches the required number of updates, the number of updates can be considered to meet the preset conditions, and the accumulated image frames obtained at this time correspond to the acquired image. In one example, the target number of frames can be determined by preset image acquisition parameters, which may include, but are not limited to, the resolution information of the image to be acquired, the number of acquisition frames, the image storage type, the bit width of the image to be acquired, and the bit width of the preset buffer. In one example, the cache address of the corresponding buffer is also updated each time the accumulated image frames are updated. In some possible implementations, after obtaining the acquired image, the acquired image is stored in a preset storage location, and the image acquisition status is updated. After obtaining the acquired image, the image acquisition can be ended or the image acquisition of the next cycle can continue according to actual needs.
[0065] In this embodiment, during image acquisition, an initial image frame and an accumulated image frame are obtained. The initial image frame is merged into the accumulated image frame to obtain an updated accumulated image frame. When the difference between the number of image frames in the updated accumulated image frame and the target number of frames is within a preset range, the pixel values of the pixels in the updated accumulated image frame are averaged to obtain a second updated accumulated image frame. This process continues until the number of updates meets a preset condition, resulting in the acquired image. Through this embodiment, when acquiring images with multiple image frames, averaging can be performed when the accumulated image frame reaches the target number of frames during the acquisition process, until all image frames are processed. This reduces the amount of data in the acquired image, achieves the effect of processing while acquiring, ensures testing efficiency, and eliminates the need to perform averaging after acquiring all image frames. Through dynamic averaging, it can adapt to high-throughput scenarios, improves the bandwidth utilization of storage space, shortens the image cache processing time, occupies less storage space, reduces the depth of the cache space required during image acquisition, and improves resource utilization.
[0066] In one embodiment, such as Figure 2 As shown, obtaining the initial image frame includes:
[0067] Step S111: Obtain the initial pixel point;
[0068] Step S112: The initial pixels are spliced together according to the number of bits of the initial pixels and the preset number of bits of the cache to obtain multiple sets of pixels;
[0069] Step S113: Based on the correlation between the initial pixels, merge the multiple groups of pixels to obtain the initial image frame.
[0070] In this embodiment, initial pixels are obtained, where each initial pixel is an image unit capable of forming an initial image frame. The initial pixels are then concatenated based on the number of bits in the initial pixels and a preset cache bit length to obtain multiple sets of pixels. The preset cache bit length can be determined in advance based on the actual application scenario and parameters of the preset cache area. After obtaining multiple sets of pixels, since the initial pixels are image units capable of forming an initial image frame, there are relationships between them. These relationships are then used to merge multiple sets of pixels to obtain the initial image frame. In one example, after pixel concatenation, the resulting multiple sets of pixels are arranged in rows, i.e., multiple rows of pixels. These multiple rows of pixels are then merged and accumulated to obtain the initial image frame. During the merging and accumulation process, a ping-pong caching method is used to ensure processing efficiency, with caching and accumulation occurring simultaneously. In some possible implementations, the initial pixels can be directly obtained pixels or obtained by processing the original obtained pixels; this disclosure does not impose any limitations on this.
[0071] In this embodiment of the disclosure, when acquiring the initial image frame, pixels are stitched together based on the acquired initial pixels and the preset number of cache bits, which enables the processing from pixels to image frames. This is applicable to more application scenarios. Furthermore, during the processing from pixels to image frames, the initial image frame is obtained by merging and caching simultaneously, thus ensuring the efficiency of data processing.
[0072] In one embodiment, such as Figure 3 As shown, obtaining the initial pixel point includes:
[0073] Step S1111: Obtain the original pixels and preset pixel compression parameters, wherein the preset pixel compression parameters are related to the cache bit width of the cache area;
[0074] Step S1112: Compress the original pixels according to the preset pixel compression parameters to obtain the initial pixels.
[0075] In this embodiment, the initial pixel is obtained by processing the original pixel. Specifically, the original pixel and preset pixel compression parameters are acquired. These pixel compression parameters can be determined beforehand based on the actual application scenario. There is a correlation between the preset pixel compression parameters and the cache bit width of the buffer. Specifically, the preset pixel compression parameters can be determined based on the cache bit width of the buffer and the number of frames corresponding to the image to be acquired. Different image acquisition scenarios and buffer settings can correspond to different pixel compression parameters. The original pixel is compressed according to the preset pixel compression parameters to obtain the initial pixel. In one example, compression can be achieved through compression encoding or by dividing the pixels and then averaging the results. The number of bits in the compressed initial pixel is less than the number of bits in the original pixel.
[0076] In this embodiment of the disclosure, when obtaining the initial pixel points, the pixel points are compressed according to the original pixel points and pixel compression parameters, which further reduces the space occupied by the cache during image processing, improves the bandwidth utilization of storage space, can be applied to more application scenarios, and can process images according to actual needs. The amount of data that can be processed is greatly increased, and the data processing efficiency is improved.
[0077] In one embodiment, obtaining the initial image frame and obtaining the accumulated image frames from the buffer includes:
[0078] Obtain the image cache category, wherein the image cache category is determined based on preset acquisition parameters;
[0079] When the cache category is the average processing image cache category, the initial image frame is obtained and the accumulated image frames are obtained from the cache area.
[0080] In this embodiment, an image cache category is determined based on preset acquisition parameters. When the cache category is the average processing cache category, an initial image frame is acquired, and accumulated image frames are acquired from the cache area. The preset acquisition parameters can be determined in advance based on the actual application scenario. In one example, the requirements for different image acquisition scenarios may differ, therefore, the requirements for the acquired images will also differ. The preset acquisition parameters may correspond to a cache category, which may include, but is not limited to, the average processing image cache category, the original image cache category, etc. In this embodiment, when the cache category is the average processing cache category, the acquired image corresponds to the average-processed image. Therefore, the image data is processed according to the method described in this embodiment to acquire the initial image frame and acquire accumulated image frames from the cache area.
[0081] In this embodiment, when the image cache category is determined to be the average processing cache category according to the preset acquisition parameters, the initial image frame and the accumulated image frame are acquired for subsequent image frame processing. This enables the image acquisition method to be executed according to the actual application scenario, making it applicable to more application scenarios. While ensuring image processing efficiency, it can perform image processing for different needs, making the acquired images more accurate and effective.
[0082] In one embodiment, such as Figure 4 As shown, the process of acquiring accumulated image frames includes:
[0083] Step S114: Sequentially retrieve multiple sets of accumulated image pixels corresponding to the accumulated image frames from the buffer.
[0084] Step S115: Merge the multiple groups of accumulated image pixels according to the correlation between the accumulated image pixels to obtain an accumulated image frame.
[0085] In this embodiment, multiple sets of accumulated image pixels corresponding to accumulated image frames are sequentially obtained from the buffer. Since accumulated image pixels are image units that can form accumulated image frames, there are correlations between them. Multiple sets of accumulated image pixels are merged based on these correlations to obtain an accumulated image frame. In one example, to ensure processing efficiency, a ping-pong caching method is used during the merging and accumulation process, with caching and accumulation occurring simultaneously. Furthermore, the accumulated image frames are continuously updated at different stages of image acquisition and processing; therefore, an accumulated image frame can correspond to multiple image frames.
[0086] In this embodiment of the present disclosure, when retrieving the accumulated image frame from the cache, the accumulated image frame is obtained by merging multiple sets of accumulated image pixels corresponding to the accumulated image frame. This enables the processing from accumulated image pixels to accumulated image frames, making it suitable for more application scenarios. Furthermore, the process of merging and caching simultaneously during the pixel-to-image-frame processing ensures the efficiency of data processing.
[0087] In one embodiment, the method for determining the target number of frames includes:
[0088] The number of corresponding cache addresses and the number of image frames in the initial image frame are determined according to the preset acquisition parameters.
[0089] The target number of frames is determined based on the number of cache addresses and the number of image frames in the initial image frame.
[0090] In this embodiment, the number of cache addresses and the number of initial image frames in the cache area are determined according to preset acquisition parameters. These preset acquisition parameters can be determined based on the actual application scenario, and different application scenarios may have different image acquisition requirements, thus potentially corresponding to different preset acquisition parameters. In this embodiment, preset acquisition parameters correspond to different numbers of frames in the image to be acquired and different numbers of cache addresses. In this embodiment, there is a correlation between the initial image frames and the image to be acquired; the image to be acquired consists of multiple initial image frames. Therefore, the number of initial image frames corresponds to the number of image frames in the image to be acquired, i.e., the number of image frames to be processed. The target number of frames is determined based on the number of cache addresses and the number of initial image frames. In one example, one cache address can store the data of one image frame, and the maximum number of image frames that the cache area can store can be determined based on the number of cache addresses. In one possible implementation, when the number of cache addresses is greater than the number of initial image frames, the target number of frames can be directly determined based on the number of cache addresses, which can improve the accuracy of the acquired image while ensuring processing efficiency and bandwidth utilization.
[0091] In this embodiment of the disclosure, the target number of frames is determined based on the number of cache addresses and the number of image frames in the initial image frame. This approach can balance bandwidth utilization and image acquisition requirements, making it suitable for more application scenarios. It improves the accuracy of the acquired images while ensuring processing efficiency and bandwidth utilization.
[0092] Figure 5 This is a schematic diagram illustrating the structure of an image acquisition system according to an exemplary embodiment, with reference to... Figure 5As shown, taking the method described in this embodiment as an example applied to the acquisition process of test images of an image sensor, the structure of the image acquisition system shown in this disclosure includes a host computer 510, a core processing unit 511 of the test system, a test chip, and a carrier board 501. The host computer 510 is used to initiate image testing and judge the test data to generate test logs; except for the high-speed storage unit 512, all other components in the core processing unit 511 of the test system are implemented in a programmable logic device (FPGA); the test chip and carrier board 501 are used to place the chip under test, and after the test system is configured, it can output test signals for the test system to acquire and test. Among them, the core processing unit 511 of the test system includes an image preprocessing unit 502, a row ping-pong buffer accumulation unit 503, an image division operation unit 504, an image DMA (Direct Memory Access) data stream buffer unit 505, an image DMA control unit 506, a processor 507, a bus interconnect 508, a high-speed interface bus 509, a host computer 510, a high-speed storage unit 512, an image parameter control and monitoring unit 513, and an interrupt controller unit 514.
[0093] During the image sensor chip testing process, when acquiring images, the processor 507 initializes the core processing unit 511 of the test system, which may include, but is not limited to, interrupt type, image resolution, etc.; the host computer 510 dynamically configures image test parameters (image resolution and image average, etc.) and sends instructions to the image parameter control and monitoring unit 513 according to the test requirements; after receiving the configuration parameters, the image parameter control and monitoring unit 513 configures the image preprocessing unit 502 and triggers the image data caching and processing flow; the processor 507 dynamically configures the image DMA control unit 506 according to the configuration parameters and the acquisition situation. After the image DMA control unit 506 is configured, the image DMA data stream buffer unit 505 receives the image data stream processed by the preceding units 502, 503, and 504. The image data stream may include, but is not limited to, video data streams, multi-frame image data streams, and dynamic image data streams. After receiving a complete video frame, the image DMA data stream buffer unit 505 generates an interrupt to the interrupt controller unit 514 and updates the parameters of the image DMA control unit 506 for the next frame image acquisition. This process of receiving and updating the data stream is repeated until image storage and calculation are completed, resulting in the acquired image. In some possible implementations, the image parameter control and monitoring unit 513 reports the image acquisition status and image storage information. In this embodiment, the image preprocessing unit 502 can perform pixel stitching, pixel compression, and other preprocessing on the image frames based on the image parameters of the image parameter control and monitoring unit 513. The row ping-pong buffer accumulation unit 503 performs pixel ping-pong buffering processing based on the resolution output by the image parameter control and monitoring unit 513. In one example, the row ping-pong buffer accumulation unit 503 can correspond to two RAMs to implement ping-pong processing for pixel buffering and output. For example, if one RAM is used to receive pixel data, the other is used to output pixel data.
[0094] Figure 6 This is a flowchart illustrating an image acquisition method according to an exemplary embodiment, with reference to... Figure 6 As shown, the method described in this embodiment is applied to Figure 5The structure shown is described in detail below. Typically, in CIS (Image Sensor) image testing, the image formats output by each CIS under test are diverse, and their data throughput varies considerably. Therefore, during image sensor testing, the testing system needs to be compatible with these different image formats and process and store the data in real time. In this embodiment, as in steps 600 / 601, the testing system performs system initialization at the start. This initialization process includes: configuring the interrupt controller and enabling interrupts so that the processor 507 can correctly receive interrupts and respond promptly in subsequent operations; resetting image processing parameters and clearing relevant signals and parameters. As in steps 602 / 603, the host computer 510 configures image processing initialization information and issues image processing start interrupt 1, triggering the start of the test. As in step 604, after receiving interrupt 1, the processor 507 configures the initial image cache address and image resolution size via the image DMA control unit 506. As in step 605, the image storage type is determined; if the original image is to be stored, it is processed according to the original image method; otherwise, it is stored according to the average image method. As in steps 606 / 607, when storing the original image, it is stitched together according to the pixel width of the image and the cache width of the image DMA, and output to the next level through ping-pong buffer. As in steps 608 / 609 / 610, when storing the average image, in addition to pixel stitching, the image preprocessing unit 502 can also determine whether pixel compression is needed according to the image acquisition parameters. If so, pixel compression is performed. The row ping-pong buffer accumulation unit needs to cache and accumulate the data of the current input image frame and the image readback data of the previous frame to obtain the updated accumulated image frame. The image readback data of the previous frame includes the accumulated image frame data read from the corresponding cache address in the cache area. The image division operation unit performs division processing on the multiple frames of the updated accumulated image frame according to the image acquisition parameters of the image parameter control and monitoring unit to obtain the updated accumulated image frame, i.e., the effective data stream, and sends the effective data stream to the next level. In one example, the image acquisition parameters include the division coefficient. The division operation is performed according to the division coefficient. The division operation includes averaging the pixel values. As in step 611, during image DMA data stream buffering, the previously processed data stream is sent to the DMA controller stream interface. The DMA controller correctly stores the data stream to the high-speed memory according to the buffer address configured by the DMA control unit. When the complete frame data storage is complete, frame interrupt 2 is issued. As in step 612, after receiving frame interrupt 2, the processor 507 updates the image buffer address for the next frame. As in steps 613 / 614, it is determined whether a single image processing is complete. If it is complete, the processor 507 writes the address of the image read back from the host computer to the image parameter control and monitoring unit 513 and updates the completion status. As in steps 615-618, the host computer obtains the image processing status and test image through polling or interrupt mode and generates a test log.After a single image processing cycle is completed, the host computer 510 needs to determine whether to proceed with the next test based on the testing requirements. If continued testing is required, it will jump to 602 to initiate the next test; otherwise, the entire test will end.
[0095] Through the embodiments of this disclosure, image caching and processing can be completed within an effective image frame time, enabling image acquisition without prior caching and processing, thus significantly saving image processing time. This embodiment, combined with the characteristics of CIS image testing, reduces the pixel byte size of the image during and after acquisition through image pixel compression, intra-frame pixel stitching, inter-frame pixel accumulation, and dynamic division of accumulated frames, thereby reducing the storage bandwidth requirements of image caching. Dynamic image caching technology allows images to be stored in cyclic frames, greatly reducing the depth requirements for image storage; and by utilizing a Field-Programmable Gate Array (FPGA) to implement intra-frame image pixel stitching, inter-frame pixel accumulation, original frame pixel compression, dynamic division of accumulated frames, and dynamic image caching technology, bandwidth utilization is improved and image caching processing time is shortened.
[0096] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the accompanying drawings may include multiple steps or stages, which are not necessarily completed at the same time, but may be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but may be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0097] Based on the same inventive concept, this disclosure also provides an image acquisition device for implementing the image acquisition method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations of one or more image acquisition device embodiments provided below can be found in the limitations of the image acquisition method described above, and will not be repeated here.
[0098] In one embodiment, such as Figure 7 As shown, an image acquisition device 700 is provided, comprising:
[0099] The acquisition module 710 is used to acquire the initial image frame and the accumulated image frame from the buffer.
[0100] The merging module 720 is used to merge the initial image frame into the accumulated image frame to obtain an updated accumulated image frame, and store the updated accumulated image frame into the buffer area;
[0101] The averaging module 730 is used to determine the average pixel value of corresponding pixels in multiple frames of the first-updated accumulated image frame as the pixel value of the second-updated accumulated image frame when the difference between the number of image frames corresponding to the first-updated accumulated image frame and the target number of frames is within a preset range, and to store the second-updated accumulated image frame in the buffer area until the number of updates meets the preset conditions, thereby obtaining the acquired image.
[0102] In one embodiment, the acquisition module includes:
[0103] The first acquisition submodule is used to acquire the initial pixel point;
[0104] The splicing module is used to splice the initial pixels according to the number of bits of the initial pixels and the preset number of bits of the cache to obtain multiple sets of pixels;
[0105] The first merging submodule is used to merge the multiple groups of pixels according to the correlation between the initial pixels to obtain an initial image frame.
[0106] In one embodiment, the first acquisition submodule includes:
[0107] An acquisition unit is used to acquire the original pixel points and preset pixel compression parameters, wherein the preset pixel compression parameters are related to the cache bit size of the cache area;
[0108] The compression module is used to compress the original pixels according to the preset pixel compression parameters to obtain the initial pixels.
[0109] In one embodiment, the acquisition module includes:
[0110] The second acquisition submodule is used to acquire the image cache category, wherein the image cache category is determined according to preset acquisition parameters;
[0111] The third acquisition submodule is used to acquire the initial image frame and the accumulated image frame from the cache when the cache category is the average processing image cache category.
[0112] In one embodiment, the acquisition module includes:
[0113] The fourth acquisition submodule is used to sequentially acquire multiple sets of accumulated image pixels corresponding to the accumulated image frames from the buffer.
[0114] The second merging submodule is used to merge the multiple groups of accumulated image pixels according to the correlation between the accumulated image pixels to obtain an accumulated image frame.
[0115] In one embodiment, the module for determining the target frame number includes:
[0116] The first determining submodule is used to determine the number of corresponding cache addresses and the number of image frames of the initial image frame in the cache area according to preset acquisition parameters;
[0117] The second determining submodule is used to determine the target number of frames based on the number of cache addresses and the number of image frames in the initial image frame.
[0118] Each module in the aforementioned image acquisition device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0119] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 8 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The database stores image data, such as image frame data, used in the image acquisition method. The network interface allows communication with external terminals via a network connection. When the computer program is executed by the processor, it implements an image acquisition method.
[0120] Those skilled in the art will understand that Figure 8 The structures shown are merely block diagrams of some structures related to the embodiments of this disclosure and do not constitute a limitation on the computer devices on which the embodiments of this disclosure are applied. Specific computer devices may include more or fewer components than those shown in the figures, or combine certain components, or have different component arrangements.
[0121] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0122] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0123] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0124] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0125] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this disclosure can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this disclosure may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this disclosure may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0126] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0127] The above-described embodiments are merely illustrative of several implementation methods of the present disclosure, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the patent for the embodiments of the present disclosure. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the embodiments of the present disclosure, and these all fall within the protection scope of the embodiments of the present disclosure. Therefore, the protection scope of the embodiments of the present disclosure should be determined by the appended claims.
Claims
1. An image acquisition method, characterized in that, The method includes: Acquire initial image frames and accumulate image frames from the buffer; wherein, when the image to be acquired includes multiple image frames, multiple image frames are acquired sequentially as initial image frames for image processing; The initial image frame is merged into the accumulated image frame to obtain an updated accumulated image frame, and the updated accumulated image frame is stored in the buffer area. If the difference between the number of image frames corresponding to the first updated cumulative image frame and the target number of frames is within a preset range, the average pixel value of the corresponding pixel in the multiple image frames of the first updated cumulative image frame is determined as the pixel value of the second updated cumulative image frame. The second updated cumulative image frame is stored in the buffer until the number of updates meets the preset condition, and the acquired image is obtained.
2. The method according to claim 1, characterized in that, The process of obtaining the initial image frame includes: Get the initial pixel; The initial pixels are spliced together according to the number of bits of the initial pixels and the preset number of bits of the cache to obtain multiple sets of pixels; Based on the correlation between the initial pixels, the multiple groups of pixels are merged to obtain the initial image frame.
3. The method according to claim 2, characterized in that, The process of obtaining the initial pixel points includes: Obtain the original pixels and preset pixel compression parameters, wherein the preset pixel compression parameters are related to the cache bit width of the cache area; The original pixels are compressed according to the preset pixel compression parameters to obtain the initial pixels.
4. The method according to claim 1, characterized in that, The steps of obtaining the initial image frame and obtaining the accumulated image frames from the buffer include: Obtain the image cache category, wherein the image cache category is determined based on preset acquisition parameters; When the cache category is the average processing image cache category, the initial image frame is obtained and the accumulated image frames are obtained from the cache area.
5. The method according to claim 1, characterized in that, The acquisition of accumulated image frames includes: Retrieve multiple sets of accumulated image pixels corresponding to the accumulated image frames sequentially from the buffer; The multiple sets of accumulated image pixels are merged according to the correlation between the accumulated image pixels to obtain an accumulated image frame.
6. The method according to claim 1, characterized in that, The method for determining the target number of frames includes: The number of corresponding cache addresses and the number of image frames in the initial image frame are determined according to the preset acquisition parameters. The target number of frames is determined based on the number of cache addresses and the number of image frames in the initial image frame.
7. An image acquisition device, characterized in that, The device includes: The acquisition module is used to acquire initial image frames and accumulate image frames from the buffer; wherein, when the image to be acquired includes multiple image frames, multiple image frames are acquired sequentially as initial image frames for image processing. The merging module is used to merge the initial image frame into the accumulated image frame to obtain an updated accumulated image frame, and store the updated accumulated image frame into the buffer area; The averaging module is used to determine the average pixel value of corresponding pixels in multiple frames of the first-updated accumulated image frame as the pixel value of the second-updated accumulated image frame when the difference between the number of image frames corresponding to the first-updated accumulated image frame and the target number of frames is within a preset range. The second-updated accumulated image frame is then stored in the buffer until the number of updates meets the preset conditions, and the acquired image is obtained.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the image acquisition method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the image acquisition method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the image acquisition method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Image processing
CN111885281A
Method for acquiring image frame with improved noise characteristic
KR100799834B1
Graphic pieces for a border image
US20040119726A1