This application claims the priority benefit of Taiwan application serial no. 107125354, filed on Jul. 23, 2018. The entirety of the above-mentioned patent application is hereby incorporated by reference herein and made a part of this specification.
The invention relates to a data transmission technique, and particularly relates to an image data transmission system and an image data transmission method.
Generally, an image sensor usually has parallel transmission pins for connecting other devices through a parallel transmission bus. After the image sensor completes an exposure operation and generates image data, the image sensor generally actively transmits the generated image data to the other device through the parallel transmission bus. Since the number of the parallel transmission pins is quite large, the cost of hardware design is increased.
Moreover, the aforementioned other device may only passively wait to receive the image data transmitted by the image sensor, and cannot decide when to start the image data transmission. Therefore, the aforementioned other device has to be in a standby state waiting to receive the image data at any time.
The invention is directed to an image data transmission system and an image data transmission method, which are adapted to greatly reduce the number of pins of a transmission interface of an image sensor to decrease hardware cost of the image data transmission system, and let a master device in the image data transmission system grasps a time point at which the image sensor transmits image data.
The invention provides an image data transmission system. The image data transmission system includes an image sensing device, a master device, and a serial transmission bus. The serial transmission bus electrically connects the image sensing device and the master device. The master device transmits a read command to the image sensing device through the serial transmission bus, and the image sensing device transmits a first data sequence to the master device through the serial transmission bus in response to the read command.
The invention provides an image data transmission method, which is adapted to an image data transmission system. The image data transmission system includes an image sensing device, a master device, and a serial transmission bus. The image data transmission method includes following steps: transmitting a read command to the image sensing device by the master device through the serial transmission bus; and transmitting a first data sequence to the master device by the image sensing device through the serial transmission bus in response to the read command.
Based on the above, the image data transmission system and the image data transmission method adopt the serial transmission bus to serve as a transmission interface between the image sensing device and the master device, so as to greatly reduce the number of pins of the image sensing device. Besides, the master device is adapted to actively send the read command to the image sensing device, so as to grasp a time point for image data transmission.
To make the aforementioned more comprehensible, several embodiments accompanied with drawings are described in detail as follows.
The accompanying drawings are included to provide a further understanding of the invention, and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.
In order to fully convey the spirit of the invention, exemplary embodiments are described in detail below with reference of the accompanying drawings. It will be apparent to those skilled in the art that various modifications and variations may be made to the structure of the present invention without departing from the scope or spirit of the invention after learning the exemplary embodiments of the invention. On the other hand, well-known components and steps are not described in the embodiments to avoid unnecessary limitations to the invention.
An image data transmission system of the invention includes a master device, an image sensing device and a serial transmission bus. The master device and the image sensing device performs image data transmission there between through the serial transmission bus, where the image sensing device serves as a slave device of the master device. The image sensing device may perform exposure to generate image data. Only when the mater device transmits a read command to the image sensing device, the image sensing device transmits the image data to the master device. In an embodiment of the invention, the master device may actively transmit commands to the image sensing device to set exposure related parameters of the image sensing device and a start time point when the image sensing device performs exposure, and instruct the image sensing device to provide image data, etc., and the image sensing device serving as the slave device completely passively receives commands from the master device, and performs corresponding operations according to the commands of the master device.
In an embodiment of the invention, the image sensing device 1 is a Charge Coupled Device (CCD), a Complementary Metal-Oxide Semiconductor (CMOS) or other similar device or a combination of the above devices. The master device 2 may be a Central Processing Unit (CPU) or other programmable general use or special use microprocessor, a Digital Signal Processor (DSP), a programmable controller, an Application Specific Integrated Circuit (ASIC) or other similar device or a combination of the above devices. The serial transmission bus 3 may be a Serial Peripheral Interface (SPI) bus, an Inter-Integrated Circuit (I2C) bus, a System Management Bus (SMBus) or other similar serial bus.
In an embodiment of the invention, before the master device 2 transmits the read command CMD_RD to the image sensing device 1, the master device 2 may first transmit a setting command CMD_SET to the image sensing device 1 through the serial transmission bus 3 to set exposure related parameters (for example, an exposure time, an aperture value, a luminance value, an ISO index, a correction constant, etc.) of the image sensing device 1, though the invention is not limited thereto. In another embodiment of the invention, the aforementioned exposure related parameters may also be pre-stored in the image sensing device 1, so that the master device 2 may omit transmitting the setting command CMD_SET to the image sensing device 1.
As described above, a start time point when the image sensing device 1 performs exposure is determined by the master device 2. Therefore, the master device 2 may transmit an exposure command CMD_EXP to the image sensing device 1 through the serial transmission bus 3, and the image sensing device 1 performs exposure to generate the image data in response to the exposure command CMD_EXP, though the invention is not limited thereto.
When the master device 2 wants to read the image data generated by the image sensing device 1, the master device 2 may transmit the read command CMD_RD to the image sensing device 1 through the serial transmission bus 3. The image sensing device 1 may embed the image data in the first data sequence DS_1 in response to the read command CMD_RD, and transmit the first data sequence DS_1 to the master device 2 through the serial transmission bus 3. Since the data transmitted through the serial transmission bus 3 is data in a unit of bit, the first data sequence DS_1 is a data sequence in a unit of bit.
It should be noted that the setting command CMD_SET, the exposure command CMD_EXP and the read command CMD_RD transmitted by the master device 2 are determined according to a type of the serial transmission bus 3. For example, if the serial transmission bus 3 is implemented by a SPI bus, the setting command CMD_SET, the exposure command CMD_EXP and the read command CMD_RD transmitted by the master device 2 are compiled in form of SPI instructions.
Since the image sensing device 1 still requires to perform a conversion operation in order to obtain the integral image data and prepare the first data sequence DS_1 after executing exposure, a plurality of embodiments are provided below to allow the master device 2 to effectively determine whether the image sensing device 1 has prepared the first data sequence DS_1.
In an embodiment of the invention, the image sensing device 1 may provide a state of the first data sequence DS_1 for the master device 2 to inquire. Once the image sensing device 1 has obtained the image data and prepared the first data sequence DS_1, the master device 2 may learn that the first data sequence DS_1 has been prepared by inquiring the state of the first data sequence DS_1, and then the master device 2 may transmit the read command CMD_RD to the image sensing device 1 through the serial transmission bus 3. The prepared first data sequence DS_1 may include an integral image frame or a plurality of image frames, and may only include a part of row images in one image frame, which is determined according to an actual application or design requirement.
In an embodiment of the invention, the image sensing device 1 may have a storage (not shown), where the image sensing device 1 may store the states of the first data sequence DS_1 in the storage by using different codes, and the master device 2 may determine whether the first data sequence DS_1 is ready by inquiring the code in the storage of the image sensing device 1. For example, when the first data sequence DS_1 is ready, the image sensing device 1 may write a first code into the storage to represent that the first data sequence DS_1 is ready, otherwise, the image sensing device 1 may write a second code into the storage to represent that the first data sequence DS_1 is not ready, where the first code and the second code are different. Therefore, the master device 2 may read the content of the storage through the serial transmission bus 3, and determine whether the first data sequence DS_1 is ready according to the content of the storage. In an embodiment of the invention, the first code and the second code are, for example, different bit values.
In an embodiment of the invention, the aforementioned storage may be a register, any type of static or dynamic Random Access Memory (RAM), a flash memory, a Hard Disk Drive (HDD), a Solid State Drive (SSD) or a similar device or a combination of the above devices.
In another embodiment of the invention, when the image sensing device 1 receives the check command transmitted by the master device 2 through the serial transmission bus 3, the image sensing device 1 may transmit the state of the first data sequence DS_1 to the master device 2 through the serial transmission bus 3 in response to the check command.
Further, when the first data sequence DS_1 is ready, the image sensing device 1 sets the state of the first data sequence DS_1 to be valid, otherwise, the image sensing device 1 sets the state of the first data sequence DS_1 to be invalid. The master device 2 determines whether the state of the first data sequence DS_1 is valid through inquiring, shown as a step S105. If the state of the first data sequence DS_1 is invalid, the flow returns to the step S103. If the state of the first data sequence DS_1 is valid, the master device 2 transmits the read command CMD_RD to the image sensing device 1 through the serial transmission bus 3, shown as a step S107.
When the image sensing device 1 receives the read command CMD_RD transmitted by the master device 2, the image sensing device 1 outputs the first data sequence DS_1 in response to the read command CMD_RD, and the master device 2 may receive the first data sequence DS_1 through the serial transmission bus 3, shown as a step S109.
According to the above method, the master device 2 first checks whether the image sensing device 1 prepares the first data sequence DS_1, and then transmits the read command CMD_RD to the image sensing device 1, in this way, it is guaranteed that the image data in the first data sequence DS_1 received by the master device 2 is valid.
In another embodiment of the invention, the image sensing device 1 does not provide the state of the first data sequence DS_1 in advance, but embed the state of the first data sequence DS_1 in the first data sequence DS_1. The master device 2 may continuously transmit the read command CMD_RD to the image sensing device 1 through the serial transmission bus 3 at any time. When the image sensing device 1 transmits the first data sequence DS_1 to the master device 2 through the serial transmission bus 3 in response to the read command CMD_RD, the master device 2 may determine the state of the first data sequence DS_1 only according to the received first data sequence DS_1.
In an embodiment of the invention, the first data sequence DS_1 includes an image data sequence and a first state sequence, where the first state sequence is used for representing a state of the image data sequence. When the image sensing device 1 generates the first data sequence DS_1, the image sensing device 1 additionally embeds the first state sequence associated with the state of the image data sequence into the first data sequence DS_1.
The master device 2 may determine whether the image data sequence DS_IMG is a valid image or invalid image according to at least one of the first state sequence SS_1a and the first state sequence SS_1a′. Moreover, the exposure related parameters may also be set to at least one of the first state sequence SS_1a and the first state sequence SS_1a′. It should be noted that a data length (i.e. bit number) of the first state sequences SS_1a, SS_1a′ may be determined according to an actual application or design requirement of the image sensing device 1 and the master device 2, as long as the master device 2 may interpret the first state sequences SS_1a, SS_1a′.
Referring to
In step S207, the master device 2 determines whether the state of the image data sequence DS_IMG in the first data sequence DS_1 is valid according to the first state sequence SS_1a. If the state of the image data sequence DS_IMG in the first data sequence DS_1 is invalid, in step S209, the master device 2 abandons the image data sequence DS_IMG in the first data sequence DS_1; if the state of the image data sequence DS_IMG in the first data sequence DS_1 is valid, in step S211, the master device 2 retains the image data sequence DS_IMG in the first data sequence DS_1.
When the image sensing device 1 generates the first data sequence DS_1, the image sensing device 1 additionally embeds the aforementioned header bits HD_1, HD_2, . . . , HD_L and/or the footer bits FT_1, FT_2, . . . , FT_M in the first data sequence DS_1, and an advantage thereof is that the master device 2 may determine the state of the first data sequence DS_1 according to the received first data sequence DS_1. However, such method may increase a data amount of the first data sequence DS_1, and increase a burden of image data transmission.
When the master device 2 wants to process the image data sequence DS_IMG, the master device 2 may replace the image bits P_1, P_2, P_3, P_N-1, P_N substituted by the header bits HD_1, HD_2 and HD_3 and the footer bits FT_1 and FT_2 by black margins, or use an algorithm to process the image bits P_1, P_2, P_3, P_N-1, P_N substituted by the header bits HD_1, HD_2 and HD_3 and the footer bits FT_1 and FT_2. In this way, not only almost complete image data is maintained, the data amount of the first data sequence DS_1 may be maintained the same to the data mount of the original data sequence.
When the image sensing device 1 does not prepare the first data sequence DS_1 but receives the read command CMD_RD transmitted by the master device 2, the image sensing device 1 transmits the first data sequence DS_1 with the invalid image to the master device 2. Since a transmission amount of the first data sequence DS_1 with the invalid image is probably rather large, not only a considerable amount of transmission time is consumed, during the process of transmitting the first data sequence DS_1 with the invalid image, the subsequent first data sequence DS_1 with the valid image probably has been prepared, but it is still required to wait for transmission of the first data sequence DS_1 with the invalid image before transmitting the subsequent first data sequence DS_1. In order to save the time consumed for transmitting the aforementioned invalid image, in another embodiment of the invention, when the image sensing device 1 does not prepare the first data sequence DS_1 but receives the read command CMD_RD transmitted by the master device 2, the image sensing device 1 embeds a specific amount of dummy data in the data sequence. After the master device 2 receives the data sequence, the master device 2 may directly abandons the specific amount of dummy data.
When the first data sequence DS_1 is ready, the image sensing device 1 transmits the first data sequence DS_1 to the master device 2 in response to the read command CMD_RD. The first data sequence DS_1 includes a first state sequence SS_1c and an image data sequence DS_IMG, where the first state sequence SS_1c has a header bit HD_OK, and the image data sequence DS_IMG has image bits P_1, P_2, . . . , P_N, and the first state sequence SS_1c is used for representing that the image data sequence DS_IMG is valid.
In an embodiment of the invention, the image sensing device 1 may always embed a fixed number of dummy bits DM_1, DM_2, . . . , DM_X in the second data sequence DS_2, for example, the image sensing device 1 fixedly embeds 1024 dummy bits in the second data sequence DS_2. In this way, the master device 2 may directly abandon the received fixed number of dummy bits DM_1, DM_2, . . . , DM_X.
In another embodiment of the invention, the master device 2 may set the image sensing device 1 to decide the number of the dummy bits DM_1, DM_2, . . . , DM_X embedded in the second data sequence DS_2 by the image sensing device 1.
Comparatively, when the first data sequence DS_1 is ready, the image sensing device 1 transmits the first data sequence DS_1 to the master device 2 in response to the read command CMD_RD. The first data sequence DS_1 includes a first state sequence SS_1d and an image data sequence DS_IMG, where the first state sequence SS_1d has the header bit HD_OK, and the image data sequence DS_IMG has the image bits P_1, P_2, . . . , P_N, and the first state sequence SS_1d is used for representing that the image data sequence DS_IMG is valid.
After the image sensing device 1 performs exposure, the image sensing device 1 first generates a corresponding analog signal, and then converts the analog signal into a digital signal through an Analog-Digital Converter (ADC), so as to generate the first data sequence DS_1. During the process of converting the analog signal into the digital signal, if a pixel value of each pixel is recorded in 8 bits, a pixel value of the strongest light is, for example, 00, and a pixel value of the weakest light is, for example, FF. Generally, the pixel values of 00 and FF are hardly appeared on application of the master device 2, so that the image sensing device 1 may set the pixel value of 00 or FF as a reserved value, or set the pixel value that is not appeared on the application of the master device 2 or an insensitive value as the reserved value.
When the first data sequence DS_1 is ready, the image sensing device 1 transmits the first data sequence DS_1 to the master device 2 in response to the read command CMD_RD, where the first data sequence DS_1 includes an image data sequence having the image bits P_1, P_2, . . . , P_N.
In other words, the master device 2 may take the reserved value RS_FF as a feature value from a series of data sequences transmitted by the image sensing device 1 through the serial transmission bus 3, and the first data sequence DS_1 entrained between the feature values has the valid image data. The master device 2 may directly abandon the second data sequence DS_2 having the reserved value RS_FF, and only retain image data other than the second data sequence DS_2 having the reserved value RS_FF.
In still another embodiment of the invention, when the image sensing device 1 has prepared the first data sequence DS_1, the image sensing device 1 may notify the master device 2 that the first data sequence DS_1 is ready by triggering an interrupt notification.
When the master device 2 receives the interrupt signal transmitted by the image sensing device 1 through the serial transmission bus 3, in step S303, the master device 2 transmits the read command CMD_RD to the image sensing device 1 through the serial transmission bus 3 in response to the interrupt signal. The image sensing device 1 transmits the first data sequence DS_1 to the master device 2 through the serial transmission bus 3 in response to the read command CMD_RD. In step S305, the master device 2 receives the first data sequence DS_1.
In step S401, the master device 2 transmits the exposure command CMD_EXP to the image sensing device 1 through the serial transmission bus 3. The image sensing device 1 performs exposure in response to the exposure command CMD_EXP and generates the first data sequence DS_1. When the first data sequence DS_1 is ready, the image sensing device 1 sets the state of the first data sequence DS_1 to be valid.
When the image sensing device 1 has prepared the first data sequence DS_1, the image sensing device 1 drives a potential of the determination pin 11 to a specific potential. In step S403, after the master device 2 detects that the potential of the determination pin 11 is the specific potential through the wire 4 and the detection pin 21, the master device 2 transmits the read command CMD_RD to the image sensing device 1 through the serial transmission bus 3. The image sensing device 1 transmits the first data sequence DS_1 to the master device 2 through the serial transmission bus 3 in response to the read command CMD_RD. In step S405, the master device 2 receives the first data sequence DS_1.
In another embodiment of the invention, the image sensing device 1 may also transmit the interrupt signal to the master device 2 through the determination pin 11 via the wire 4. Implementation detail of triggering the interruption may refer to related description of the embodiment of
In summary, since the image data transmission system and the image data transmission method of the embodiments of the invention adopt the serial transmitting interface, the number of pins of the image sensing device used for transmitting image data is greatly reduced. Moreover, the master device is adapted to actively send the read command to the image sensing device, so as to grasp a time point for image data transmission, and effectively determine whether the image data is valid.
It will be apparent to those skilled in the art that various modifications and variations can be made to the disclosed embodiments without departing from the scope or spirit of the invention. In view of the foregoing, it is intended that the invention covers modifications and variations provided they fall within the scope of the following claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
107125354 | Jul 2018 | TW | national |