Imaging method and device, electronic equipment and storage medium
By adjusting the region of interest and pixel offset of the area scan camera, the problem of increased cost and space caused by the joint use of area scan and line scan cameras in complex visual inspection scenarios is solved, realizing multi-functional imaging with a single camera and efficient defect detection.
Patent Information
- Application Number
- CN202511811827.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-03
- Publication Date
- 2026-02-27
AI Technical Summary
In existing technologies, area scan cameras and line scan cameras need to be used together in complex visual inspection scenarios, which leads to increased space and cost.
By determining the region of interest (ROI) of the area array camera, and adjusting the pixel offset and imaging area according to the detection type, a single camera can simulate the imaging effect of multiple cameras, including ROI stitching and defect detection.
It enables an area scan camera to simulate the function of a line scan camera without increasing costs or space requirements, adapting to complex visual inspection scenarios and improving imaging uniformity and defect detection accuracy.
Smart Images

Figure CN121585918A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of visual detection, and in particular to an imaging method and device, an electronic device, and a storage medium. BACKGROUND
[0002] Common imaging components in machine vision detection scenarios are area array cameras and line array cameras, each of which has advantages and disadvantages and a matching use scenario. When facing complex visual detection scenarios, area array cameras and line array cameras are often used together to achieve imaging. However, multiple cameras and multiple stations often require more space and higher costs. SUMMARY
[0003] The present application provides an imaging method and device, an electronic device, and a storage medium to at least solve the above technical problems in the prior art.
[0004] According to a first aspect of the present application, an imaging method is provided, which is applied to an area array camera, and the method comprises: determining a detection type for a target to be imaged; determining a region of interest of the area array camera based on the detection type for the target to be imaged; imaging the target to be imaged based on the region of interest to obtain a to-be-tested image; the to-be-tested image is used for visual detection of the target to be imaged.
[0005] In an implementation, the determining of the region of interest of the area array camera based on the detection type for the target to be imaged comprises: when the detection type is a first type, obtaining size information of the target to be imaged; determining a pixel offset of the area array camera based on illumination information for the target to be imaged; determining a first region of interest of the area array camera based on the size information of the target to be imaged and the pixel offset of the area array camera.
[0006] In an implementation, the method further comprises: when the detection type is a second type, determining a second region of interest of the area array camera based on the size information of the target to be imaged; the second region of interest is larger than the first region of interest.
[0007] In an implementation, the determining of the first region of interest of the area array camera based on the size information of the target to be imaged and the pixel offset of the area array camera comprises: determining a starting position of pixels of the area array camera for the target to be imaged; determine a pixel offset position of the area array camera for the target to be imaged based on the pixel offset amount for the area array camera and the pixel start position; determine a first region of interest of the area array camera based on the size information of the target to be imaged and the pixel offset position.
[0008] In an implementation, the number of the first regions of interest is multiple; when the detection type is a first type, the imaging the target to be imaged based on the region of interest to obtain a test image comprises: respectively acquire pixel data of each of the first regions of interest; for each of the first regions of interest, image the target to be imaged based on the pixel data of the first region of interest to obtain a test sub-image; splicing process the test sub-images of each of the first regions of interest to obtain a first test image.
[0009] In an implementation, when the detection type is a second type, the imaging the target to be imaged based on the region of interest to obtain a test image comprises: acquire pixel data of a second region of interest; image the target to be imaged based on the pixel data of the second region of interest to obtain a second test image.
[0010] In an implementation, the first test image has a higher illumination uniformity than the second test image.
[0011] In an implementation, the first type comprises a first contrast type, and the second type comprises a second contrast type; wherein the first contrast type supports a first contrast lower than a second contrast supported by the second contrast type.
[0012] In an implementation, after the test image is obtained, the method further comprises: perform defect detection on the target to be imaged based on the test image to obtain a defect detection result for the target to be imaged; the defect detection result is used to represent whether the target to be imaged has a defect.
[0013] According to a second aspect of the present application, an imaging device is provided, which is applied to an area array camera, and the device comprises: a first determination unit configured to determine a detection type for a target to be imaged; a second determination unit configured to determine a region of interest of the area array camera based on the detection type for the target to be imaged; The first acquisition unit is used to image the target to be imaged based on the region of interest to obtain a test image; the test image is used to perform visual detection on the target to be imaged.
[0014] In one possible implementation, the second determining unit is configured to: acquire size information of the target to be imaged when the detection type is a first type; determine a pixel offset for the area scan camera based on the illumination information of the target to be imaged; and determine a first region of interest of the area scan camera based on the size information of the target to be imaged and the pixel offset for the area scan camera.
[0015] In one possible implementation, the second determining unit is used to determine a second region of interest of the area array camera based on the size information of the target to be imaged when the detection type is the second type; wherein the second region of interest is larger than the first region of interest.
[0016] In one possible implementation, the second determining unit is configured to determine the starting position of a pixel of the area scan camera relative to the target to be imaged; determine the offset position of a pixel of the area scan camera relative to the target to be imaged based on the pixel offset of the area scan camera and the starting position of the pixel; and determine the first region of interest of the area scan camera based on the size information of the target to be imaged and the offset position of the pixel.
[0017] In one possible implementation, the number of first regions of interest is multiple; when the detection type is a first type, the first acquisition unit is used to acquire pixel data of each first region of interest; for each first region of interest, based on the pixel data of the first region of interest, the target to be imaged is imaged to obtain a sub-image to be tested; the sub-images to be tested of each first region of interest are stitched together to obtain a first image to be tested.
[0018] In one possible implementation, when the detection type is the second type, the first acquisition unit is used to acquire pixel data of the second region of interest; based on the pixel data of the second region of interest, the target to be imaged is imaged to obtain the second image to be tested.
[0019] In one possible implementation, the illumination uniformity of the first image under test is stronger than that of the second image under test.
[0020] In one possible implementation, the first type includes a first contrast type, and the second type includes a second contrast type; wherein the first contrast type supports a first contrast ratio that is lower than the second contrast ratio supported by the second contrast type.
[0021] In one possible embodiment, the device further includes: The detection unit is used to perform defect detection on the target to be imaged based on the image to be tested, and obtain the defect detection result for the target to be imaged; the defect detection result is used to characterize whether there is a defect in the target to be imaged.
[0022] According to a third aspect of this application, an electronic device is provided, comprising: At least one processor; and a memory communicatively connected to said at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method described in this application.
[0023] According to a fourth aspect of this application, a non-transitory computer-readable storage medium is provided storing computer instructions for causing a computer to perform the methods described in this application.
[0024] In this application, a detection type for the target to be imaged is determined; based on the detection type, the region of interest (ROI) of the area scan camera is determined; based on the ROI, the target is imaged to obtain a test image; the test image is used for visual inspection of the target. This application, by determining different ROIs for the area scan camera according to different detection types, enables the area scan camera to perform the functions of a line scan camera, thus achieving the imaging effects of two cameras with a single camera, providing technical support for complex visual inspection scenarios.
[0025] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description
[0026] The above and other objects, features, and advantages of exemplary embodiments of this application will become readily apparent from the following detailed description taken in conjunction with the accompanying drawings. Several embodiments of this application are illustrated in the drawings by way of example and not limitation, in which: In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
[0027] Figure 1 A schematic diagram illustrating the implementation flow of the imaging method according to an embodiment of this application is shown; Figure 2 A schematic diagram of the first region of interest in an embodiment of this application is shown; Figure 3 A schematic diagram of the second region of interest in an embodiment of this application is shown; Figure 4A schematic diagram of the composition structure of the imaging device according to an embodiment of this application is shown; Figure 5 A schematic diagram of the composition structure of an electronic device according to an embodiment of this application is shown. Detailed Implementation
[0028] To make the objectives, features, and advantages of this application more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0029] This application provides an imaging method applied to an area scan camera, as shown in the figure, the method includes: S101: Determine the detection type for the target to be imaged; It's understandable that the commonly used imaging devices in visual inspection scenarios are area scan cameras and line scan cameras. Area scan cameras have a large field of view, capturing a complete image in a single exposure, making them suitable for static or dynamic instantaneous imaging scenarios, such as size inspection and barcode reading. However, the illumination within their field of view is uneven. Line scan cameras have a narrow imaging area, with only a single line or a few linear pixels in their field of view. They require coordination with object movement (scanning imaging) and are suitable for high-speed, high-resolution continuous inspection scenarios, such as edge detection and fine defect detection.
[0030] In this step, the detection type for the target to be imaged includes two types: one is the detection type applicable to area scan cameras, and the other is the detection type applicable to line scan cameras. This application can determine the detection type for the target to be imaged by reading the instruction code. The instruction is issued by the user and carries a user-defined instruction code, such as code 00 representing the detection type applicable to area scan cameras, and code 01 representing the detection type applicable to line scan cameras.
[0031] S102: Based on the detection type for the target to be imaged, determine the region of interest of the area array camera.
[0032] In this step, the region of interest (ROI) of the area scan camera differs depending on the detection type. When the detection type is the aforementioned applicable area scan camera type, the ROI can be the entire area of the target to be imaged. When the detection type is the aforementioned applicable line scan camera type, the ROI can be a row or several rows of the target to be imaged. For details on how the ROI of the area scan camera is determined for different detection types, please refer to the detailed explanations in the relevant sections below; these will not be repeated here.
[0033] S103: Based on the region of interest, image the target to be imaged to obtain a test image; the test image is used for visual detection of the target to be imaged.
[0034] In this step, after determining the region of interest (ROI), imaging is performed by reading pixel data within the ROI. When the ROI is the entire area of the target to be imaged, the area scan camera can obtain the test image of the target in a single exposure. When the ROI is a single row or several rows of pixels of the target to be imaged, the area scan camera can work with a motion mechanism to perform multiple scans of the target to obtain the final test image. Thus, this application, using an area scan camera, can achieve both the large field-of-view exposure of an area scan camera and the uniform imaging of a line scan camera, enabling the handling of more complex visual inspection scenarios without increasing cost or space requirements.
[0035] The scheme shown in steps S101-S103 involves determining the detection type for the target to be imaged; determining the region of interest (ROI) of the area scan camera based on the detection type; imaging the target based on the ROI to obtain a test image; and using the test image for visual inspection of the target. This application, by determining different ROIs of the area scan camera according to different detection types, enables the area scan camera to perform the functions of a line scan camera, thus achieving the imaging effects of two cameras with a single camera, providing technical support for complex visual inspection scenarios.
[0036] In some alternative solutions, determining the region of interest (ROI) of the area array camera based on the detection type for the target to be imaged includes: When the detection type is the first type, the size information of the target to be imaged is obtained; Based on the illumination information of the target to be imaged, determine the pixel offset for the area scan camera; Based on the size information of the target to be imaged and the pixel offset for the area scan camera, the first region of interest of the area scan camera is determined.
[0037] In this application, the first type is the detection type of the aforementioned applicable line scan camera. When the detection type is the first type, the size information of the target to be imaged is read. The size information of the target to be imaged includes length, width, and height information, which can be directly read from the product specifications of the target. The pixel offset of the area scan camera is used to indicate which row or rows of the target to be imaged, and can be determined by combining the illumination information (light source illumination) of the target. (Reference) Figure 2As shown, general light source illumination is a range, with the central area being the brightest and gradually darkening towards the edges. This can be simply understood as the bright central area being the bright field, the surrounding areas being the dark field, and the intermediate transition area being the half-bright field. Users can set the pixel offset to allow the area scan camera to capture bright, dark, or half-bright field images at corresponding locations. In other words, based on the pixel offset of the area scan camera and the size information of the target object, the location of the area to be imaged by the area scan camera on the target object can be determined. That is, the first region of interest can be the aforementioned bright field, dark field, or half-bright field. This application, based on the pixel offset, can accurately locate the first region of interest, thereby enabling the image of the first region of interest to achieve the same or even higher illumination consistency as that of a line scan camera, reducing the dependence on additional compensation light sources or complex lighting schemes.
[0038] In some alternative solutions, the method further includes: When the detection type is the second type, the second region of interest of the area array camera is determined based on the size information of the target to be imaged; wherein the second region of interest is larger than the first region of interest.
[0039] In this application, the second type is the aforementioned detection type applicable to area scan cameras. When the detection type is the second type, the size information of the target to be imaged is read. Since the single-shot field of view of an area scan camera is large, when the detection type is the applicable area scan camera detection type, the size information of the target to be imaged can be converted into the field of view coverage information of the area scan camera. That is, the second region of interest of the area scan camera can be the entire area of the target to be imaged, in addition to... Figure 3 As shown, the second region of interest for an area scan camera can also be larger than the entire area to be imaged. It can obtain a complete 2D image of the target in one go, while preserving spatial context information, facilitating subsequent localization, measurement, classification, and other detection functions.
[0040] In some alternative solutions, determining the first region of interest for the area scan camera based on the size information of the target to be imaged and the pixel offset for the area scan camera includes: Determine the starting position of the pixels of the area scan camera relative to the target to be imaged; Based on the pixel offset for the area scan camera and the starting position of the pixel, the pixel offset position of the area scan pin camera relative to the imaging target is determined; Based on the size information of the target to be imaged and the pixel offset position, the first region of interest of the area array camera is determined.
[0041] In this application, based on the position information of the area scan camera and the position information of the target to be imaged, the starting pixel position of the area scan camera relative to the target can be obtained. The starting pixel position may be the upper left, upper right, lower left, or lower right corner of the target, or it may be the center of the target. After determining the starting pixel position of the area scan camera, the position of the pixel offset of the area scan camera relative to the target can be determined according to the pixel offset (pixel offset position). The pixel offset can be negative or positive (the negative and positive signs are used to indicate the offset direction), and can be a range or a specific value. According to the size information of the target, the coverage area of the pixel offset position on the target is located, and this area is taken as the first region of interest of the area scan camera. No changes to the equipment are required. The user only needs to update the pixel offset each time to quickly locate the first region of interest. Under the same light source illumination, since the first region of interest determined each time is only one or a few rows of pixels of the target, the difference in physical light flux within the sufficiently narrow first region of interest is small, and the pixel grayscale within the first region of interest is uniform, which is no different from the imaging effect of a traditional line scan camera.
[0042] In some alternative schemes, the number of first regions of interest is multiple; when the detection type is the first type, the step of imaging the target to be imaged based on the regions of interest to obtain the image to be tested includes: Pixel data for each of the first regions of interest are acquired respectively; For each first region of interest, the target to be imaged is imaged based on the pixel data of the first region of interest to obtain a sub-image to be tested; The test sub-images of each region of interest are stitched together to obtain the first test image.
[0043] In this application, it can be understood that when the detection type is type one, the area scan camera divides the overall region of the target to be imaged into multiple narrow regions of interest (ROIs) for imaging by compressing the field of view. Specifically, after determining a ROI each time by pixel offset, only the pixel data of that ROI is acquired for imaging, resulting in a test sub-image for each ROI. By stitching the test sub-images according to their context, a uniformly bright overall image of the target can be obtained. No additional hardware is required, enabling single-camera, single-station, low-cost, large-field-of-view, high-uniformity imaging.
[0044] In some alternative schemes, when the detection type is the second type, the process of imaging the target based on the region of interest to obtain the image to be tested includes: Obtain pixel data for the second region of interest; Based on the pixel data of the second region of interest, the target to be imaged is imaged to obtain a second image to be tested.
[0045] In this application, when the detection type is type two, since the second region of interest is the entire area of the target to be imaged, this embodiment directly images all pixel data of the entire target area to obtain a large-field-of-view second image. This allows for obtaining a large-field-of-view full-pixel image in a single exposure, which is simple, fast, and easy to implement.
[0046] In some alternative approaches, the illumination uniformity of the first image under test is stronger than that of the second image under test.
[0047] In this application, the first image to be tested is stitched together from images of multiple relatively narrow regions of interest (ROIs). As mentioned above, when the ROIs are narrow, the pixels within each ROI have small positional gradients, resulting in smaller brightness differences under the same light source. Therefore, the illumination of each ROI is relatively uniform, and naturally, the illumination uniformity of the stitched first image to be tested is also high. However, the second image to be tested is obtained by a single exposure of the entire target. Under the same light source, because the target has a large overall area, it is easy for the brightness to be highest in the center and gradually decrease from the center to the edges. Due to this uneven brightness, the final second image to be tested has poor illumination uniformity.
[0048] In some alternative solutions, the first type includes a first contrast type, and the second type includes a second contrast type; wherein the first contrast type supports a first contrast ratio lower than the second contrast ratio supported by the second contrast type.
[0049] In this application, the first type is a low-contrast type, and the second type is a high-contrast type (a contrast threshold can be preset; images above the threshold are considered high-contrast, and those below the threshold are considered low-contrast). The high-contrast type supports image detection with inconspicuous contrast, while the low-contrast type supports image detection with significant contrast. For example, image detection with inconspicuous contrast includes detection scenarios where slight scratches or dents on the surface of aluminum foil or copper foil, or slight looseness or tightness in the weft yarn of textiles, are difficult to detect with the naked eye. Image detection with significant contrast includes detection scenarios where the grayscale difference between the target and the background is large, such as barcode reading, label misalignment, wrinkle inspection, part presence / absence detection, and size detection.
[0050] In some alternative embodiments, after obtaining the image to be tested, the method further includes: Based on the image to be tested, defect detection is performed on the target to be imaged to obtain the defect detection result for the target to be imaged; the defect detection result is used to characterize whether there is a defect in the target to be imaged.
[0051] In this application, after obtaining the image to be tested, defect detection can be performed based on the image, such as detecting minor scratches or dents based on the first image to be tested, and detecting the presence or absence of parts (whether any parts are missing) based on the second image to be tested. The obtained defect detection results can indicate whether the target to be imaged has defects. When the target to be imaged has defects, the factory can perform quality inspection or rework on the target to be imaged. When the target to be imaged does not have defects, the factory can proceed with the subsequent delivery process.
[0052] This application also provides an imaging device, which is applied to an area scan camera, such as... Figure 4 As shown, the device includes: The first determining unit 401 is used to determine the detection type for the target to be imaged; The second determining unit 402 is used to determine the region of interest of the area array camera based on the detection type of the target to be imaged; The first acquisition unit 403 is used to image the target to be imaged based on the region of interest to obtain a test image; the test image is used to perform visual detection on the target to be imaged.
[0053] In some alternative solutions, the second determining unit 402 is used to acquire the size information of the target to be imaged when the detection type is the first type; determine the pixel offset for the area scan camera based on the illumination information of the target to be imaged; and determine the first region of interest of the area scan camera based on the size information of the target to be imaged and the pixel offset for the area scan camera.
[0054] In some alternative solutions, the second determining unit 402 is used to determine the second region of interest of the area array camera based on the size information of the target to be imaged when the detection type is the second type; wherein the second region of interest is larger than the first region of interest.
[0055] In some alternative solutions, the second determining unit 402 is used to determine the starting position of the pixels of the area scan camera relative to the target to be imaged; determine the pixel offset position of the area scan camera relative to the target to be imaged based on the pixel offset of the area scan camera and the starting position of the pixels; and determine the first region of interest of the area scan camera based on the size information of the target to be imaged and the pixel offset position.
[0056] In some optional schemes, there are multiple first regions of interest; when the detection type is the first type, the first acquisition unit 403 is used to acquire pixel data of each first region of interest; for each first region of interest, based on the pixel data of the first region of interest, the target to be imaged is imaged to obtain a sub-image to be tested; the sub-images to be tested of each first region of interest are stitched together to obtain a first image to be tested.
[0057] In some alternative schemes, when the detection type is the second type, the first acquisition unit 403 is used to acquire pixel data of the second region of interest; based on the pixel data of the second region of interest, the target to be imaged is imaged to obtain the second image to be tested.
[0058] In some alternative approaches, the illumination uniformity of the first image under test is stronger than that of the second image under test.
[0059] In some alternative solutions, the first type includes a first contrast type, and the second type includes a second contrast type; wherein the first contrast type supports a first contrast ratio lower than the second contrast ratio supported by the second contrast type.
[0060] In some alternative embodiments, the device further includes: The detection unit is used to perform defect detection on the target to be imaged based on the image to be tested, and obtain the defect detection result for the target to be imaged; the defect detection result is used to characterize whether there is a defect in the target to be imaged.
[0061] It should be noted that the imaging device in this application embodiment solves the problem in a similar way to the aforementioned imaging method. Therefore, the implementation process, implementation principle, and beneficial effects of the imaging device can be found in the description of the implementation process, implementation principle, and beneficial effects of the aforementioned method. Repeated descriptions will not be repeated.
[0062] According to embodiments of this application, this application also provides an electronic device and a readable storage medium.
[0063] Figure 5A schematic block diagram of an example electronic device 500 that can be used to implement embodiments of this application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the application described and / or claimed herein.
[0064] like Figure 5 As shown, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. The RAM 503 may also store various programs and data required for the operation of the electronic device 500. The computing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0065] Multiple components in electronic device 500 are connected to I / O interface 505, including: input unit 506, such as keyboard, mouse, etc.; output unit 507, such as various types of monitors, speakers, etc.; storage unit 508, such as disk, optical disk, etc.; and communication unit 509, such as network card, modem, wireless transceiver, etc. Communication unit 509 allows electronic device 500 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0066] The computing unit 501 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as imaging methods. For example, in some embodiments, the imaging method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of the imaging method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the imaging method by any other suitable means (e.g., by means of firmware).
[0067] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transferring data and instructions to the storage system, the at least one input device, and the at least one output device.
[0068] The program code used to implement the methods of this application may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0069] In the context of this application, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0070] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0071] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0072] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0073] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this application can be achieved, and this is not limited herein.
[0074] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.
[0075] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. An imaging method, characterized in that, The method is applied to an area scan camera, and the method includes: Determine the detection type for the target to be imaged; Based on the detection type of the target to be imaged, the region of interest of the area array camera is determined; Based on the region of interest, the target to be imaged is imaged to obtain a test image; the test image is used for visual detection of the target to be imaged.
2. The method according to claim 1, characterized in that, Determining the region of interest (ROI) of the area array camera based on the detection type of the target to be imaged includes: When the detection type is the first type, the size information of the target to be imaged is obtained; Based on the illumination information of the target to be imaged, determine the pixel offset for the area scan camera; Based on the size information of the target to be imaged and the pixel offset for the area scan camera, the first region of interest of the area scan camera is determined.
3. The method according to claim 2, characterized in that, The method further includes: When the detection type is the second type, the second region of interest of the area array camera is determined based on the size information of the target to be imaged; wherein the second region of interest is larger than the first region of interest.
4. The method according to claim 2, characterized in that, The step of determining the first region of interest for the area scan camera based on the size information of the target to be imaged and the pixel offset for the area scan camera includes: Determine the starting position of the pixels of the area scan camera relative to the target to be imaged; Based on the pixel offset for the area scan camera and the pixel starting position, the pixel offset position of the area scan camera for the target to be imaged is determined. Based on the size information of the target to be imaged and the pixel offset position, the first region of interest of the area array camera is determined.
5. The method according to claim 3 or 4, characterized in that, The number of first regions of interest is multiple; when the detection type is the first type, the process of imaging the target to be imaged based on the regions of interest to obtain the image to be tested includes: Pixel data for each of the first regions of interest are acquired respectively; For each first region of interest, the target to be imaged is imaged based on the pixel data of the first region of interest to obtain a sub-image to be tested; The test sub-images of each region of interest are stitched together to obtain the first test image.
6. The method according to claim 5, characterized in that, When the detection type is the second type, the process of imaging the target based on the region of interest to obtain the image to be tested includes: Obtain pixel data for the second region of interest; Based on the pixel data of the second region of interest, the target to be imaged is imaged to obtain a second image to be tested.
7. The method according to claim 5, characterized in that, The illumination uniformity of the first image under test is stronger than that of the second image under test.
8. An imaging device, characterized in that, The device is applied to an area scan camera, and the device includes: The first determining unit is used to determine the detection type for the target to be imaged; The second determining unit is used to determine the region of interest of the area array camera based on the detection type of the target to be imaged; The first acquisition unit is used to image the target to be imaged based on the region of interest to obtain a test image; the test image is used to perform visual detection on the target to be imaged.
9. An electronic device, characterized in that, include: At least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-7.
Citation Information
Patent Citations
Device and method for detecting train bottom and storage medium
CN112492137A
Method for registering images acquired by area-array camera and structured light camera
CN114359358A
Dynamic imaging planning method of two-degree-of-freedom aviation area-array camera
CN118762045A
Blast furnace tapping detection method, system and equipment based on machine vision and medium
CN120182182A
Image acquisition control method and device, equipment, storage medium and product
CN121007906A