A clock frequency determination method, device, acquisition card and system
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING LUSTER LIGHTTECH
- Filing Date
- 2023-06-15
- Publication Date
- 2026-08-07
AI Technical Summary
[0005]本申请提供一种时钟频率确定方法、装置、采集卡及系统,用于确定成像装置的时钟频率,以解决通过现有技术确定成像装置的时钟频率时,存在的操作繁琐及耗时较长的问题
[0040] The clock frequency determination method of this application embodiment can determine the clock frequency of the imaging device. Furthermore, the method can be implemented by a data acquisition card without connecting the imaging device and the host computer. Therefore, compared with the prior art, it reduces the manual operation of connecting the imaging device and the host computer, and the implementation method is simpler. Correspondingly, it reduces the time required to determine the clock frequency of the imaging device and improves the efficiency of determining the clock frequency of the imaging device.
Smart Images

Figure CN116743890B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of machine vision technology, and in particular to a clock frequency determination method, apparatus, acquisition card and system. Background Technology
[0002] An image acquisition card, often simply called an acquisition card, is used to acquire images captured by an imaging device and transmit them to a computer for storage, processing, and display. With the development of machine vision technology, the application of image acquisition cards is becoming increasingly widespread. For example, in some application scenarios, an imaging device can capture an image of a workpiece to be inspected. After acquiring this image from the imaging device, the acquisition card transmits it to a host computer, which then processes the image to determine whether the workpiece has defects.
[0003] When acquiring images from an imaging device, the acquisition card typically uses the clock frequency of the imaging device to acquire and upload image data. Therefore, the acquisition card needs to determine the clock frequency of the imaging device. See also Figure 1 The scenario diagram shown illustrates that, currently, when the acquisition card determines the clock frequency of the imaging device, technicians typically first connect the imaging device and the host computer via a serial port. Then, the host computer reads the clock frequency of the imaging device via the serial port and transmits the read clock frequency to the acquisition card, thereby enabling the acquisition card to obtain the clock frequency of the imaging device.
[0004] However, in this method, the operation of connecting the imaging device and the host computer via serial port needs to be done manually, which is cumbersome and time-consuming, resulting in low efficiency in determining the clock frequency of the imaging device. Summary of the Invention
[0005] This application provides a clock frequency determination method, apparatus, acquisition card, and system for determining the clock frequency of an imaging device, thereby solving the problems of cumbersome operation and long time consumption when determining the clock frequency of an imaging device using existing technologies.
[0006] In a first aspect, embodiments of this application provide a clock frequency determination method applied to a data acquisition card, the data acquisition card including a first clock and a second clock, the method comprising:
[0007] During the process of the acquisition card acquiring first image data from the first imaging device, the first clock and the second clock are simultaneously triggered to start timing. The first clock starts timing at a preset first frequency, and the second clock starts timing at a second frequency, which is the frequency at which the acquisition card acquires the first image data from the first imaging device.
[0008] Determine the quantitative relationship between the first timing cycle of the first clock and the second timing cycle of the second clock within the same timing duration;
[0009] Based on the quantitative relationship between the first timing period and the second timing period and the first frequency, the second frequency is determined, and the second frequency is the clock frequency of the first imaging device.
[0010] In an optional design, determining the quantitative relationship between the first timing cycle of the first clock and the second timing cycle of the second clock within the same timing duration includes:
[0011] During the timing of the first clock and the second clock, draw the first timing signal corresponding to the first clock and the second timing signal corresponding to the second clock;
[0012] Determine a first quantity and a second quantity within the same timing duration, wherein the first quantity is the number of the first timing cycles included in the first timing signal, and the second quantity is the number of the second timing cycles included in the second timing signal;
[0013] Calculate the ratio of the first quantity to the second quantity within the same timing duration, the ratio being used to characterize the quantitative relationship between the first timing period and the second timing period.
[0014] In one optional design, determining the second frequency of the second clock includes:
[0015] Based on the quantitative relationship between the first timing period and the second timing period, the correspondence between the first frequency and the second frequency is determined;
[0016] Based on the correspondence and the first frequency, the second frequency of the second clock is determined.
[0017] An alternative design also includes:
[0018] Before determining the second frequency of the second clock, the first image data is transmitted to the host computer through the preset transmission frequency of the acquisition card;
[0019] After determining the second frequency of the second clock, the first image data is transmitted to the host computer via the second frequency.
[0020] In one optional design, if the second frequency of the second clock is determined periodically, during the first period in which the second frequency is determined, the preset transmission frequency of the acquisition card is the frequency determined according to the preset setting operation received in advance.
[0021] During other cycles in which the second frequency is determined, the preset transmission frequency of the acquisition card is the second frequency of the second clock determined in the previous cycle.
[0022] In an optional design, before determining the quantitative relationship between the first timing period of the first clock and the second timing period of the second clock, the method further includes:
[0023] During the process of the acquisition card acquiring second image data from the second imaging device, the first clock and the second clock are simultaneously triggered to start timing. The first clock is timed using the first frequency, and the second clock is timed using the frequency at which the acquisition card acquires the second image data.
[0024] After the first clock and the second clock have been timed multiple times, the quantitative relationship between the third timing cycle of the first clock and the fourth timing cycle of the second clock obtained in each timing is determined, wherein the timing duration is different for each timing.
[0025] Based on the quantitative relationship between the third timing cycle and the fourth timing cycle obtained in each timing and the first frequency, the third frequency at which the second clock acquires the second image data in each timing is determined;
[0026] Calculate the difference between the third frequency obtained at each timing interval and the clock frequency of the second imaging device;
[0027] The target duration is determined based on the difference, wherein the target duration is the shortest duration among the timing durations corresponding to the differences within a preset range.
[0028] In an optional design, determining the quantitative relationship between the first timing period of the first clock and the second timing period of the second clock includes:
[0029] When the timing duration of the first clock and the second clock reaches the target duration, the quantitative relationship between the first timing cycle of the first clock and the second timing cycle of the second clock is determined within the target duration.
[0030] Secondly, embodiments of this application provide a clock frequency determination device applied to a data acquisition card, the data acquisition card including a first clock and a second clock, the device comprising:
[0031] The trigger module is used to simultaneously trigger the first clock and the second clock to start timing during the process of the acquisition card acquiring the first image data from the first imaging device. The first clock is timed at a preset first frequency, and the second clock is timed at a second frequency, which is the frequency at which the acquisition card acquires the first image data from the first imaging device.
[0032] The relationship determination module is used to determine the quantitative relationship between the first timing cycle of the first clock and the second timing cycle of the second clock within the same timing duration.
[0033] The frequency determination module is used to determine the second frequency based on the quantitative relationship between the first timing period and the second timing period and the first frequency, wherein the second frequency is the clock frequency of the first imaging device.
[0034] Thirdly, embodiments of this application provide a data acquisition card, the data acquisition card comprising:
[0035] First clock and second clock;
[0036] A memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect.
[0037] Fourthly, embodiments of this application provide a clock frequency determination system, including:
[0038] A first imaging device, the first imaging device being used to capture first image data;
[0039] As described in the third aspect, the acquisition card.
[0040] The clock frequency determination method of this application embodiment can determine the clock frequency of the imaging device. Furthermore, the method can be implemented by a data acquisition card without connecting the imaging device and the host computer. Therefore, compared with the prior art, it reduces the manual operation of connecting the imaging device and the host computer, and the implementation method is simpler. Correspondingly, it reduces the time required to determine the clock frequency of the imaging device and improves the efficiency of determining the clock frequency of the imaging device.
[0041] Furthermore, since the method provided in this application embodiment can improve the efficiency of the acquisition card in determining the clock frequency of the imaging device, and the acquisition card can ensure the imaging effect of the host computer when transmitting image data to the host computer through the clock frequency of the imaging device, the method provided in this application embodiment also helps to improve the imaging effect of the host computer. Attached Figure Description
[0042] Figure 1 A schematic diagram illustrating an application scenario for determining the clock frequency of an imaging device;
[0043] Figure 2 This is a schematic diagram illustrating an application scenario for determining the clock frequency of an imaging device, as disclosed in an embodiment of this application.
[0044] Figure 3 This is a schematic diagram illustrating the workflow of determining the clock frequency of an imaging device as disclosed in an embodiment of this application;
[0045] Figure 4 This is a schematic diagram of timing signals in a method for determining the clock frequency of an imaging device disclosed in an embodiment of this application;
[0046] Figure 5 This is a schematic diagram illustrating the workflow of determining the clock frequency of an imaging device according to an embodiment of this application.
[0047] Figure 6 This is a schematic diagram illustrating the workflow of determining the clock frequency of an imaging device according to an embodiment of this application.
[0048] Figure 7 This is a schematic diagram of a structure for determining the clock frequency of an imaging device as disclosed in an embodiment of this application;
[0049] Figure 8 This is a schematic diagram of the structure of a data acquisition card disclosed in an embodiment of this application. Detailed Implementation
[0050] To make the objectives, implementation methods and advantages of this application clearer, the exemplary implementation methods of this application will be clearly and completely described below with reference to the accompanying drawings of the exemplary embodiments of this application. Obviously, the described exemplary embodiments are only some embodiments of this application, and not all embodiments.
[0051] It should be noted that the brief descriptions of terms in this application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise stated, these terms should be understood in their ordinary and common meaning.
[0052] The terms "first," "second," "third," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar or related objects or entities, and do not necessarily imply a specific order or sequence, unless otherwise specified. It should be understood that such terms are interchangeable where appropriate.
[0053] The terms “comprising” and “having”, and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device that includes a range of components is not necessarily limited to all of the components that are clearly listed, but may include other components that are not clearly listed or that are inherent to such product or device.
[0054] During image capture, the imaging device generates image data according to its own clock frequency. Meanwhile, the acquisition card collects image data from the imaging device and transmits it to a host computer, allowing the host computer to obtain the corresponding image based on the received data. In this process, if the acquisition card collects and uploads image data according to the imaging device's clock frequency, the host computer will obtain an image with better imaging quality. However, if the acquisition card uploads image data at a different frequency than the imaging device's clock frequency, the image obtained by the host computer will typically have poorer imaging quality.
[0055] For example, if the frequency of image data upload by the acquisition card is greater than the clock frequency of the imaging device, there may be overlapping areas of different image data in the image obtained by the host computer; if the frequency of image data upload by the acquisition card is less than the clock frequency of the imaging device, there may be blank areas in the image obtained by the host computer where no image data exists.
[0056] Therefore, in order to ensure the imaging effect, the acquisition card usually needs to determine the clock frequency of the imaging device and transmit image data to the host computer according to the clock frequency of the imaging device.
[0057] In response to this situation, this application provides a clock frequency determination method, apparatus, acquisition card, and system for determining the clock frequency of an imaging device, and can solve the problems of cumbersome operation and long time consumption in the prior art.
[0058] See Figure 2 The schematic diagram shows that the clock frequency determination method provided in this application is applied to a data acquisition card, which is connected to an imaging device. The data acquisition card acquires image data within the imaging device through the connection between the data acquisition card and the imaging device, which can be a CamerLink connection.
[0059] In addition, the acquisition card includes a first clock and a second clock, which can be used to keep time at different frequencies.
[0060] See Figure 3 The flowchart shown illustrates the clock frequency determination method disclosed in this application, which includes the following steps:
[0061] Step S11: During the process of the acquisition card acquiring the first image data from the first imaging device, the first clock and the second clock are triggered simultaneously for timing.
[0062] The first clock is timed at a preset first frequency, and the second clock is timed at a second frequency, which is the frequency at which the acquisition card acquires the first image data from the first imaging device.
[0063] Step S12: Determine the quantitative relationship between the first timing cycle of the first clock and the second timing cycle of the second clock within the same timing duration.
[0064] This quantitative relationship can be represented by the ratio between the number of the first timing cycles and the number of the second timing cycles of the first clock within the timing duration.
[0065] Step S13: Based on the quantitative relationship between the first timing cycle and the second timing cycle and the first frequency, determine the second frequency, which is the clock frequency of the first imaging device.
[0066] Within the same timing duration, the quantitative relationship between the first and second timing cycles reflects the magnitude relationship between the first and second frequencies. Furthermore, in this embodiment, the first frequency is a pre-set frequency, i.e., a known frequency. Therefore, in this embodiment, the second frequency can be determined based on this quantitative relationship and the first frequency; this second frequency is the clock frequency of the first imaging device.
[0067] This application provides a clock frequency determination method, executed by a data acquisition card, which includes a first clock and a second clock. In this method, while the data acquisition card is acquiring first image data from a first imaging device, the first clock and the second clock are simultaneously triggered to start timing. The timing frequency of the first clock is a preset first frequency, and the timing frequency of the second clock is a second frequency, which is the frequency at which the data acquisition card acquires the first image data from the first imaging device. Therefore, the second frequency can be used as the clock frequency of the first imaging device. Then, the quantitative relationship between the first timing cycle of the first clock and the second timing cycle of the second clock within the same timing duration is determined. Based on this quantitative relationship and the known first frequency, the second frequency is determined, thereby determining the clock frequency of the first imaging device.
[0068] The method described in this application embodiment can determine the clock frequency of the imaging device. Furthermore, this method can be implemented using a data acquisition card without connecting the imaging device and the host computer. Therefore, compared with the prior art, it reduces the manual operation of connecting the imaging device and the host computer, and the implementation method is simpler. Consequently, it reduces the time required to determine the clock frequency of the imaging device and improves the efficiency of determining the clock frequency of the imaging device.
[0069] Furthermore, since the method provided in this application embodiment can improve the efficiency of the acquisition card in determining the clock frequency of the imaging device, and the acquisition card can ensure the imaging effect of the host computer when transmitting image data to the host computer through the clock frequency of the imaging device, the method provided in this application embodiment also helps to improve the imaging effect of the host computer.
[0070] In step S12 of this application, an operation is provided to determine the quantitative relationship between the first timing cycle of the first clock and the second timing cycle of the second clock within the same timing duration. This operation can be achieved through the following steps:
[0071] First, during the timing of the first clock and the second clock, the first timing signal corresponding to the first clock and the second timing signal corresponding to the second clock are plotted.
[0072] During the first timing signal plotting process, a corresponding signal cycle is added to the first timing signal after each first timing cycle; during the second timing signal plotting process, a corresponding signal cycle is added to the second timing signal after each second timing cycle.
[0073] Then, determine the first quantity and the second quantity within the same timing duration. The first quantity is the number of the first timing cycles included in the first timing signal, and the second quantity is the number of the second timing cycles included in the second timing signal.
[0074] To clarify the solution provided in this application, an example diagram of a timing signal is provided below. See also... Figure 4 In the example diagram of this timing signal, the upper timing signal is the first timing signal, and the lower timing signal is the second timing signal. Specifically, on the first timing signal, x represents the first timing cycle, where x = 0 indicates the 0th first timing cycle, x = 1 indicates the 1st first timing cycle, and x = n indicates the nth first timing cycle. On the second timing signal, y represents the second timing cycle, where y = 0 indicates the 0th second timing cycle, y = 1 indicates the 1st second timing cycle, and y = m indicates the mth second timing cycle.
[0075] Finally, calculate the ratio of the first quantity to the second quantity within the same timing duration.
[0076] For example, see Figure 4 If, within the same timing duration, the number of the first timing cycle is n and the number of the second timing cycle is m, then the ratio of the number of the first timing cycle to the number of the second timing cycle is n / m. Accordingly, the quantity relationship between the first timing cycle and the second timing cycle is n / m.
[0077] Through the operation of the embodiments of this application, during the timing of the first clock and the second clock, a corresponding first timing signal can be drawn for the first clock and a corresponding second timing signal can be drawn for the second clock. Then, the quantitative relationship between the first timing cycle and the second timing cycle can be determined according to the ratio of the number of first timing cycles contained in the first timing signal to the number of second timing cycles contained in the second timing signal.
[0078] In addition, in the solution provided in the embodiments of this application, the second frequency is determined based on the first frequency and the quantitative relationship between the first timing period of the first clock and the second timing period of the second clock. Therefore, it is usually easier to determine the second frequency when the first frequency is N times the second frequency, where N is a positive number greater than 1.
[0079] In this case, in this application, the clock frequencies of multiple imaging devices can be pre-collected, the range of the clock frequencies of the multiple imaging devices can be determined, and then a first frequency can be set according to the range. For example, if the range of the collected clock frequencies of the imaging devices is 80M to 90M, then the first frequency can be set to 200M.
[0080] In step S13, the operation of determining the second frequency of the second clock is disclosed, which can be achieved through the following steps:
[0081] First, based on the quantitative relationship between the first timing cycle and the second timing cycle, the correspondence between the first frequency and the second frequency is determined;
[0082] Then, based on the correspondence between the first frequency and the second frequency, and the first frequency, the second frequency of the second clock is determined.
[0083] If the quantitative relationship between the first and second timing cycles is n / m, then the corresponding relationship between the first and second frequencies is: the ratio of the first frequency to the second frequency is m / n. In this case, let the first frequency be f1 and the second frequency be f2, then f2 = f1 * n / m.
[0084] The clock frequency of the imaging device can be determined using the solution provided in this application. To clarify the role of this clock frequency, another embodiment is disclosed below. This embodiment also includes the following steps:
[0085] Before determining the second frequency of the second clock, the first image data is transmitted to the host computer through the preset transmission frequency of the acquisition card;
[0086] After determining the second frequency of the second clock, the first image data is transmitted to the host computer via the second frequency.
[0087] Based on the above steps, after determining the second frequency, the acquisition card can transmit the first image data to the host computer through the second frequency, thereby ensuring the imaging effect of the host computer.
[0088] In the solution provided in this application embodiment, during the process of acquiring first image data from the first imaging device, the acquisition card can periodically execute steps S11 to S13, that is, periodically determine the clock frequency of the first imaging device. In this case, if the second frequency of the second clock is periodically determined, in the first period of determining the second frequency, the preset transmission frequency of the acquisition card is the frequency determined according to the preset setting operation; in other periods of determining the second frequency, the preset transmission frequency of the acquisition card is the second frequency of the second clock determined in the previous period.
[0089] In other words, during the periodic determination of the second frequency, in the first cycle, the preset transmission frequency of the acquisition card can be determined based on the pre-received setting operation, and the first image data is transmitted to the host computer according to the preset transmission frequency. Furthermore, after determining the second frequency through a certain cycle, the first image data is transmitted to the host computer through the determined second frequency, and until the end of the next cycle for determining the second frequency, the first image data is transmitted to the host computer through the second frequency determined in that cycle.
[0090] Through the operation of the embodiments of this application, the clock frequency of the first imaging device can be determined periodically, thereby enabling the periodic adjustment of the frequency at which the acquisition card transmits the first image data to the host computer, further improving the imaging effect of the image.
[0091] In addition, if the second frequency of the second clock is determined non-periodically, the preset transmission frequency of the acquisition card can be the frequency determined according to the preset setting operation received in advance.
[0092] To clarify the application of the acquisition card to the second frequency, this application discloses another embodiment. See also... Figure 5 The clock frequency determination method provided in this application includes the following steps:
[0093] Step S21: During the process of the acquisition card acquiring the first image data from the first imaging device, the first image data is transmitted to the host computer through the preset transmission frequency of the acquisition card.
[0094] In other words, in this embodiment of the application, before determining the clock frequency of the first imaging device, the acquisition card transmits the first image data to the host computer through a preset transmission frequency.
[0095] Specifically, if the second frequency is determined periodically, then in the first period in which the second frequency is determined, the preset transmission frequency of the acquisition card is the frequency determined according to the previously received setting operation; in other periods in which the second frequency is determined, the preset transmission frequency of the acquisition card is the second frequency of the second clock determined in the previous period.
[0096] Step S22: Simultaneously trigger the first clock and the second clock to start timing.
[0097] The first clock is timed at a preset first frequency, and the second clock is timed at a second frequency, which is the frequency at which the acquisition card acquires the first image data from the first imaging device.
[0098] Step S23: Determine the quantitative relationship between the first timing cycle of the first clock and the second timing cycle of the second clock within the same timing duration.
[0099] Step S24: Based on the quantitative relationship between the first timing period and the second timing period and the first frequency, determine the second frequency, which is the clock frequency of the first imaging device.
[0100] Step S25: After determining the second frequency of the second clock, transmit the first image data to the host computer via the second frequency.
[0101] Through this embodiment, the acquisition card can transmit the first image data to the host computer via the second frequency after determining the second frequency, thereby ensuring the imaging effect of the host computer.
[0102] In the above embodiments, it is necessary to determine the quantitative relationship between the first timing cycle of the first clock and the second timing cycle of the second clock within the same timing duration. In one feasible design, this timing duration can be preset; alternatively, in another feasible design, this application provides another embodiment. See also Figure 6 This embodiment includes the following steps:
[0103] Step S31: Before determining the quantitative relationship between the first timing cycle of the first clock and the second timing cycle of the second clock, during the process of the acquisition card acquiring second image data from the second imaging device, the first clock and the second clock are simultaneously triggered to start timing.
[0104] The first clock is used to keep time at a preset first frequency, and the second clock is used to keep time at the frequency at which the acquisition card acquires the second image data.
[0105] In addition, in this embodiment, the clock frequency of the second imaging device is a known frequency.
[0106] Step S32: After the first clock and the second clock have been timed multiple times, determine the quantitative relationship between the third timing cycle of the first clock and the fourth timing cycle of the second clock obtained from each timing, wherein the timing duration is different for each timing.
[0107] In other words, in this embodiment, the first clock and the second clock are timed multiple times, and the duration of each timekeeping is different. Based on the multiple timekeepings, the quantitative relationship between the third timekeeping cycle and the fourth timekeeping cycle obtained after each timekeeping is determined.
[0108] Step S33: Based on the quantitative relationship between the third and fourth timing cycles obtained each time and the first frequency, determine the third frequency for acquiring the second image data by the second clock obtained each time.
[0109] For example, if the first frequency is set to f1 and the third frequency is f3, and the quantitative relationship between the third timing period and the fourth timing period after one timing is s / t, then the third frequency can be determined by the following formula: f3=f1*s / t.
[0110] Step S34: Calculate the difference between the third frequency obtained in each timing and the clock frequency of the second imaging device.
[0111] In this embodiment of the application, the clock frequency of the second imaging device is known. In this case, the third frequency calculated by steps S31 to S34 can be compared with the clock frequency of the second imaging device. If the two are closer, it indicates that the third frequency is closer to the clock frequency of the second imaging device. If the third frequency calculated by the timing duration is used as the clock frequency of the second imaging device, the error is smaller.
[0112] Step S35: Determine the target duration based on the difference. The target duration is the shortest duration among the timing durations corresponding to the differences within a preset range.
[0113] In other words, in this step, the duration of each time interval corresponding to each difference within the preset range can be determined, and the shortest duration among them can be used as the target duration.
[0114] Since the difference corresponding to the target duration is within a preset range, the third frequency determined based on the target duration is closer to the clock frequency of the second imaging device. Therefore, the third frequency can be used as the clock frequency of the second imaging device. In addition, since the target duration is the shortest duration among the timing durations corresponding to the differences within the preset range, the third frequency can be determined more quickly when using this target duration, thus improving the efficiency of determining the third frequency.
[0115] In this case, determining the quantitative relationship between the first timing period of the first clock and the second timing period of the second clock, as provided in the embodiments of this application, may include the following steps:
[0116] When the timing duration of the first clock and the second clock reaches the target duration, the quantitative relationship between the first timing cycle of the first clock and the second timing cycle of the second clock is determined within the target duration.
[0117] In this embodiment, timing stops each time the timing duration of the first clock and the second clock reaches the target duration, and the quantitative relationship between the first timing cycle of the first clock and the second timing cycle of the second clock within the target duration is determined. This improves the efficiency of determining the second frequency while ensuring that the determined second frequency is close to the clock frequency of the first imaging device, and further improves the efficiency of determining the clock frequency of the first imaging device.
[0118] Corresponding to the aforementioned clock frequency determination method embodiments, this application also provides a clock frequency determination apparatus. The following are embodiments of the clock frequency determination apparatus, which can be used to execute the method embodiments of this application. For details not disclosed in these apparatus embodiments, please refer to the method embodiments of this application.
[0119] This application provides a clock frequency determination device, which is applied to a data acquisition card. The data acquisition card includes a first clock and a second clock. See [link to application details]. Figure 7 The device includes: a trigger module 110, a relationship determination module 120, and a frequency determination module 130.
[0120] The trigger module 110 is used to simultaneously trigger the first clock and the second clock to start timing during the process of the acquisition card acquiring the first image data from the first imaging device. The first clock is timed at a preset first frequency, and the second clock is timed at a second frequency, which is the frequency at which the acquisition card acquires the first image data from the first imaging device.
[0121] The relationship determination module 120 is used to determine the quantitative relationship between the first timing cycle of the first clock and the second timing cycle of the second clock within the same timing duration.
[0122] The frequency determination module 130 is used to determine the second frequency based on the quantitative relationship between the first timing period and the second timing period and the first frequency, wherein the second frequency is the clock frequency of the first imaging device.
[0123] The device according to the embodiments of this application can determine the clock frequency of the imaging device. Furthermore, the device is installed in the acquisition card, meaning that the acquisition card can determine the clock frequency without connecting the imaging device and the host computer. Therefore, compared with the prior art, it reduces the manual operation of connecting the imaging device and the host computer, and the implementation method is simpler. Correspondingly, it reduces the time for determining the clock frequency of the imaging device and improves the efficiency of determining the clock frequency of the imaging device.
[0124] Furthermore, since the device provided in this application embodiment can improve the efficiency of the acquisition card in determining the clock frequency of the imaging device, and the acquisition card can ensure the imaging effect of the host computer when transmitting image data to the host computer through the clock frequency of the imaging device, the device provided in this application embodiment also helps to improve the imaging effect of the host computer.
[0125] In a feasible design, the relationship determination module 120 can determine the quantitative relationship between the first timing cycle of the first clock and the second timing cycle of the second clock through the following steps:
[0126] During the timing of the first clock and the second clock, draw the first timing signal corresponding to the first clock and the second timing signal corresponding to the second clock;
[0127] Determine a first quantity and a second quantity within the same timing duration, wherein the first quantity is the number of the first timing cycles included in the first timing signal, and the second quantity is the number of the second timing cycles included in the second timing signal;
[0128] Calculate the ratio of the first quantity to the second quantity within the same timing duration, the ratio being used to characterize the quantitative relationship between the first timing period and the second timing period.
[0129] In a feasible design, the frequency determination module 130 can determine the second frequency of the second clock through the following steps:
[0130] Based on the quantitative relationship between the first timing period and the second timing period, the correspondence between the first frequency and the second frequency is determined;
[0131] Based on the correspondence between the first frequency and the second frequency, and the first frequency, the second frequency of the second clock is determined.
[0132] In one feasible design, the clock frequency determining device is further configured to transmit the first image data to the host computer via a preset transmission frequency of the acquisition card before determining the second frequency of the second clock; and to transmit the first image data to the host computer via the second frequency after determining the second frequency of the second clock.
[0133] For example, if the second frequency of the second clock is determined periodically, during the first period in which the second frequency is determined, the preset transmission frequency of the acquisition card is the frequency determined according to the preset setting operation received in advance.
[0134] During other cycles in which the second frequency is determined, the preset transmission frequency of the acquisition card is the second frequency of the second clock determined in the previous cycle.
[0135] In one feasible design, before determining the quantitative relationship between the first timing period of the first clock and the second timing period of the second clock, the clock frequency determining device is further configured to perform the following steps:
[0136] During the process of the acquisition card acquiring second image data from the second imaging device, the first clock and the second clock are simultaneously triggered to start timing. The first clock is timed using a first frequency, and the second clock is timed using the frequency at which the acquisition card acquires the second image data.
[0137] After the first clock and the second clock have been timed multiple times, the quantitative relationship between the third timing cycle of the first clock and the fourth timing cycle of the second clock obtained in each timing is determined, wherein the timing duration is different for each timing.
[0138] Based on the quantitative relationship between the third timing cycle and the fourth timing cycle obtained in each timing and the first frequency, the third frequency at which the second clock acquires the second image data in each timing is determined;
[0139] Calculate the difference between the third frequency obtained at each timing interval and the clock frequency of the second imaging device;
[0140] The target duration is determined based on the difference, wherein the target duration is the shortest duration among the timing durations corresponding to the differences within a preset range.
[0141] Accordingly, the frequency determination module 130 can be specifically used to determine the quantitative relationship between the first timing cycle of the first clock and the second timing cycle of the second clock within the target duration when the timing duration of the first clock and the second clock reaches the target duration.
[0142] Accordingly, this application discloses a data acquisition card, see [link to relevant documentation]. Figure 8 The structural diagram shown indicates that the data acquisition card includes:
[0143] Processor 1101 and memory 1102,
[0144] Furthermore, the acquisition card also includes a first clock 1103 and a second clock 1104.
[0145] The first clock 1103 can be timed at a preset first frequency, and the second clock can be timed at a second frequency 1104. During the process of the acquisition card acquiring first image data from the first imaging device, the second frequency can be the frequency at which the acquisition card acquires the first image data from the first imaging device.
[0146] The memory 1102 is used to store computer programs;
[0147] The processor 1101 is used to call and execute the computer program stored in the memory. When the computer program stored in the memory is executed by the processor 1101, the host computer performs... Figure 3 , Figure 5 and Figure 6 All or part of the steps in the corresponding embodiments.
[0148] The acquisition card in this application embodiment can correspond to the above-mentioned... Figure 3 , Figure 5 and Figure 6 The acquisition card in the corresponding embodiment, and the processor and storage in the acquisition card can realize... Figure 3 , Figure 5 and Figure 6 For the sake of brevity, the functions of the acquisition card in the corresponding embodiments and / or the various steps and methods implemented will not be described in detail here.
[0149] The acquisition card in this application embodiment can determine the clock frequency of the imaging device without connecting the imaging device and the host computer. Therefore, compared with the prior art, it reduces the manual operation of connecting the imaging device and the host computer, and the implementation method is simpler. It also reduces the time for determining the clock frequency of the imaging device and improves the efficiency of determining the clock frequency of the imaging device.
[0150] Furthermore, since the acquisition card provided in this application embodiment can improve the efficiency of determining the clock frequency of the imaging device, and the acquisition card can ensure the imaging effect of the host computer when transmitting image data to the host computer through the clock frequency of the imaging device, the acquisition card provided in this application embodiment also helps to improve the imaging effect of the host computer.
[0151] Accordingly, this application provides a clock frequency determination system, which includes: a first imaging device and a data acquisition card as described in the above embodiments of this application.
[0152] The first imaging device is used to capture first image data. The first imaging device is connected to a data acquisition card, which can acquire the first image data from the first imaging device based on this connection. Furthermore, during the acquisition of the first image data, the data acquisition card can determine the clock frequency of the first imaging device based on the method provided in the above embodiments of this application, and transmit the first image data to the host computer based on that clock frequency.
[0153] The system of this application embodiment can determine the clock frequency of the imaging device without connecting the imaging device and the host computer. Therefore, compared with the prior art, it can reduce the manual operation of connecting the imaging device and the host computer, and the implementation method is simpler. It also reduces the time for determining the clock frequency of the imaging device and improves the efficiency of determining the clock frequency of the imaging device.
[0154] Furthermore, since the system provided in this application embodiment can improve the efficiency of the acquisition card in determining the clock frequency of the imaging device, and the acquisition card can ensure the imaging effect of the host computer when transmitting image data to the host computer through the clock frequency of the imaging device, the device provided in this application embodiment also helps to improve the imaging effect of the host computer.
[0155] The various illustrative logic units and circuits described in the embodiments of this application can be implemented or operate the described functions using a general-purpose processor, digital information processor, application-specific integrated circuit (ASIC), field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof. The general-purpose processor can be a microprocessor; alternatively, it can be any conventional processor, controller, microcontroller, or state machine. The processor can also be implemented using a combination of computing devices, such as a digital information processor and a microprocessor, multiple microprocessors, one or more microprocessors combined with a digital information processor core, or any other similar configuration.
[0156] The steps of the methods or algorithms described in the embodiments of this application can be directly embedded in hardware, software units executed by a processor, or a combination of both. The software unit can be stored in random access memory (RAM), flash memory, read-only memory (ROM), erasable programmable read-only memory (EPROM), registers, hard disks, removable disks, compact disc read-only memory (CD-ROM), or any other form of storage medium in the art. Exemplarily, the storage medium can be connected to the processor so that the processor can read information from the storage medium and write information to the storage medium. Optionally, the storage medium can also be integrated into the processor. The processor and storage medium can be disposed in an ASIC, which can be disposed in a user equipment (UE). Optionally, the processor and storage medium can also be disposed in different components within the UE.
[0157] It should be understood that in the various embodiments of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0158] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium, or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0159] The same or similar parts between the various embodiments in this specification can be referred to interchangeably. Each embodiment focuses on the differences from other embodiments. In particular, the device and system embodiments are basically similar to the method embodiments, so the description is relatively simple, and the relevant parts can be referred to in the description of the method embodiments section.
[0160] Those skilled in the art will clearly understand that the techniques in the embodiments of the present invention can be implemented using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions in the embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or certain parts of the embodiments of the present invention.
[0161] The same or similar parts between the various embodiments in this specification can be referred to mutually. In particular, the embodiments of the road constraint determination device disclosed in this application are basically similar to the method embodiments, so the description is relatively simple, and the relevant parts can be referred to the description in the method embodiments.
[0162] The embodiments of the present invention described above do not constitute a limitation on the scope of protection of the present invention.
Claims
1. A method for determining clock frequency, characterized in that, Applied to a data acquisition card, the data acquisition card including a first clock and a second clock, the method includes: During the process of the acquisition card acquiring first image data from the first imaging device, the first clock and the second clock are simultaneously triggered to start timing. The first clock starts timing at a preset first frequency, and the second clock starts timing at a second frequency, which is the frequency at which the acquisition card acquires the first image data from the first imaging device. Determine the quantitative relationship between the first timing cycle of the first clock and the second timing cycle of the second clock within the same timing duration; Based on the quantitative relationship between the first timing period and the second timing period and the first frequency, the second frequency is determined, and the second frequency is the clock frequency of the first imaging device; Before determining the quantitative relationship between the first timing cycle of the first clock and the second timing cycle of the second clock, the method further includes: During the process of the acquisition card acquiring second image data from the second imaging device, the first clock and the second clock are simultaneously triggered to start timing. The first clock is timed using the first frequency, and the second clock is timed using the frequency at which the acquisition card acquires the second image data. After the first clock and the second clock have been timed multiple times, the quantitative relationship between the third timing cycle of the first clock and the fourth timing cycle of the second clock obtained in each timing is determined, wherein the timing duration is different for each timing. Based on the quantitative relationship between the third timing cycle and the fourth timing cycle obtained in each timing and the first frequency, the third frequency at which the second clock acquires the second image data in each timing is determined; Calculate the difference between the third frequency obtained at each timing interval and the clock frequency of the second imaging device; The target duration is determined based on the difference, wherein the target duration is the shortest duration among the timing durations corresponding to the differences within a preset range; Determining the quantitative relationship between the first timing period of the first clock and the second timing period of the second clock includes: When the timing duration of the first clock and the second clock reaches the target duration, the quantitative relationship between the first timing cycle of the first clock and the second timing cycle of the second clock is determined within the target duration.
2. The method according to claim 1, characterized in that, Determining the quantitative relationship between the first timing cycle of the first clock and the second timing cycle of the second clock within the same timing duration includes: During the timing of the first clock and the second clock, draw the first timing signal corresponding to the first clock and the second timing signal corresponding to the second clock; Determine a first quantity and a second quantity within the same timing duration, wherein the first quantity is the number of the first timing cycles included in the first timing signal, and the second quantity is the number of the second timing cycles included in the second timing signal; Calculate the ratio of the first quantity to the second quantity within the same timing duration, the ratio being used to characterize the quantitative relationship between the first timing period and the second timing period.
3. The method according to claim 1 or 2, characterized in that, Determining the second frequency of the second clock includes: Based on the quantitative relationship between the first timing period and the second timing period, the correspondence between the first frequency and the second frequency is determined; Based on the correspondence and the first frequency, the second frequency of the second clock is determined.
4. The method according to claim 1, characterized in that, Also includes: Before determining the second frequency of the second clock, the first image data is transmitted to the host computer through the preset transmission frequency of the acquisition card; After determining the second frequency of the second clock, the first image data is transmitted to the host computer via the second frequency.
5. The method according to claim 4, characterized in that, If the second frequency of the second clock is determined periodically, during the first period in which the second frequency is determined, the preset transmission frequency of the acquisition card is the frequency determined according to the preset setting operation received in advance. During other cycles in which the second frequency is determined, the preset transmission frequency of the acquisition card is the second frequency of the second clock determined in the previous cycle.
6. A clock frequency determining device, characterized in that, Applied to a data acquisition card, the data acquisition card including a first clock and a second clock, the device is configured with the method of claim 1, the device comprising: The trigger module is used to simultaneously trigger the first clock and the second clock to start timing during the process of the acquisition card acquiring the first image data from the first imaging device. The first clock is timed at a preset first frequency, and the second clock is timed at a second frequency, which is the frequency at which the acquisition card acquires the first image data from the first imaging device. The relationship determination module is used to determine the quantitative relationship between the first timing cycle of the first clock and the second timing cycle of the second clock within the same timing duration. The frequency determination module is used to determine the second frequency based on the quantitative relationship between the first timing period and the second timing period and the first frequency, wherein the second frequency is the clock frequency of the first imaging device.
7. A data acquisition card, characterized in that, The acquisition card includes: First clock and second clock; A memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the method of any one of claims 1 to 5.
8. A clock frequency determination system, characterized in that, include: A first imaging device, the first imaging device being used to capture first image data; The acquisition card as described in claim 7.
Citation Information
Patent Citations
RTC clock calibration method and industrial field calibration device
CN113391539A