Communication control method for cameras
By establishing a private protocol within the camera and utilizing control commands issued by the host and configured control rules, the third attribute parameters of the camera can be read and set. This solves the control requirements for expanding camera functionality in existing technologies and enables richer attribute control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-07
- Publication Date
- 2026-04-03
AI Technical Summary
Existing cameras can only support reading and setting camera attribute parameters corresponding to standard protocols, which is insufficient to meet users' needs for expanding camera functionality.
By receiving control commands from the host, it determines whether the camera is under the first control process, and based on the configured control rules and settings, it controls the camera's attribute parameters through the first and second control interfaces to form a private protocol, thereby enabling the reading and setting of the third attribute parameters.
The camera's attribute control functions have been expanded to meet users' control needs for the camera, making the reading and setting of third attribute parameters simpler and more convenient.
Smart Images

Figure CN116320722B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of camera technology, and more particularly to a communication control method for a camera. Background Technology
[0002] Currently, many host devices communicate with cameras via USB (Universal Serial Bus) interface based on standard protocols such as UVC (USB VideoClass) to set or read the values of camera attribute parameters that are controllable based on the UVC protocol.
[0003] However, current cameras can only support reading and setting camera attribute parameters corresponding to standard protocols (the number of usable attribute interfaces is limited). As the functions of USB cameras continue to increase, the cameras can only support reading and setting camera attribute parameters corresponding to standard protocols, which is difficult to meet users' control needs for cameras. Summary of the Invention
[0004] In view of this, this application provides a communication control method for a camera, which aims to expand the camera's attribute control functions to meet users' control needs for the camera.
[0005] This application provides a communication control method for a camera, applied to a camera, the method comprising:
[0006] Receive control commands from the host that communicates with the camera, and determine whether the camera is under the first control flow;
[0007] Wherein, the first control process is not a process controlled by a standard protocol;
[0008] When the camera is in the first control flow, the third attribute parameter is controlled according to the configured control rules and the first and second set values in the control command;
[0009] The host controls the camera's first attribute parameters based on a first control interface and controls the camera's second attribute parameters based on a second control interface. The first control interface corresponds to a first set value, and the second control interface corresponds to a second set value. The control formats of the first attribute parameters and the second attribute parameters are the same, and both are controlled through a standard protocol. The control rules are used to associate the first attribute parameters and the second attribute parameters to determine a third attribute parameter, which cannot be controlled through a standard protocol.
[0010] In one possible implementation of this application, the step of controlling the third attribute parameter according to the configured control rules and the first and second set values in the control command includes:
[0011] If it is determined that the first set value is equal to the maximum value of the second attribute parameter, then the second set value is used as the ID to look up the third attribute parameter;
[0012] The current value of the third attribute parameter is read and set as the second set value. The host obtains the current value of the third attribute by reading the second control interface.
[0013] 0 In one possible implementation of this application, the step of controlling the third attribute parameter according to the configured control rules and the first and second set values in the control command includes:
[0014] If it is determined that the first set value is not equal to the maximum value of the second attribute parameter and is not equal to 0, then the first set value is used as the ID to look up the third attribute parameter;
[0015] 5. Set the current value of the third attribute parameter to the second set value;
[0016] Based on the configured third attribute parameters, the camera is run to obtain operating data.
[0017] In one possible implementation of this application, the step of receiving control commands from a host communicating with the camera and determining whether the camera is under the first control flow includes:
[0018] Receive control commands issued by the host communicating with the camera based on the first interface; 0 Determine whether the camera is under the first control process according to the first set value in the control command.
[0019] In one possible implementation of this application, the step of determining whether the camera is under the first control flow includes:
[0020] If the first set value is not equal to 0, and the flag bit corresponding to the first control flow is not 0, then it is determined that the camera is under the first control flow.
[0021] In one possible implementation of this application, the method further includes:
[0022] Receive control commands from a host that communicates with the camera, and when the camera is not in the first control flow, change the current value of the camera's first attribute parameter to the first set value in the control command, and / or change the current value of the camera's second attribute parameter to the second set value of 0 in the control command;
[0023] Run the camera.
[0024] In one possible implementation of this application, the first attribute parameter and the second attribute parameter are both one of the parameters of the camera, including exposure time, focus, zoom / zoom, lens movement, scrolling, tilt, simple focus, brightness, contrast, chroma, saturation, sharpness, gamma, digital magnification, white balance color temperature, backlight compensation, contrast, and gain. The first attribute parameter and the second attribute parameter are different. The third attribute parameter is one of wide dynamic range, image noise reduction, P / N system, image mode, and color gamut range.
[0025] In one possible implementation of this application, when the camera is in the first control flow, the current value of the first attribute parameter and the current value of the second attribute parameter are saved.
[0026] This application also provides a communication control method for a camera, applied to a host computer, the method comprising:
[0027] When the host is in the first control flow, it sends a first control command to the camera based on the first control interface and the second control interface. The control command includes a first set value and a second set value. The first set value is set to the maximum value of a non-second attribute parameter to realize the setting function of a third attribute parameter whose attribute ID is the first set value. The current value of the third attribute parameter is set to the second set value. The first control interface corresponds to the first set value, and the second control interface corresponds to the second set value. When the camera is in the first control flow, it sets the current value of the third attribute parameter whose attribute ID is the first set value to the second set value according to the control command.
[0028] Alternatively, when the host is in the first control flow, it sends a control command to the camera. The control command includes a first set value and a second set value. The first set value is set to the maximum value of the second attribute parameter to enable the reading function of the third attribute parameter whose attribute ID is the second set value. The first control interface corresponds to the first set value, and the second control interface corresponds to the second set value. When the camera is in the first control flow, it reads the current value of the third attribute parameter whose attribute ID is the second set value according to the control command and feeds back the current value to the host.
[0029] In one possible implementation of this application, the host sequentially sets a first preset value to 0 and then sets the first preset value to a non-zero value to enter a first control flow.
[0030] This application also provides a communication control device for a camera. The communication control device for the camera is a physical node device such as a camera and a host. The communication control device for the camera includes: a memory, a processor, and a program for the communication control method of the camera stored in the memory and executable on the processor. When the program for the communication control method of the camera is executed by the processor, it can implement the steps of the communication control method of the camera as described above.
[0031] To achieve the above objectives, a storage medium is also provided, on which a communication control processing program for a camera is stored, wherein when the communication control processing program for the camera is executed by a processor, the steps of any of the above-described communication control methods for the camera are implemented.
[0032] This application provides a communication control method for a camera. Compared with the prior art, where cameras can only support reading and setting camera attribute parameters corresponding to standard protocols, making it difficult to meet users' control needs, this application receives control commands from a host communicating with the camera and determines whether the camera is under a first control flow. This first control flow is not a flow controlled by a standard protocol. When the camera is under the first control flow, a third attribute parameter is controlled according to configured control rules and a first and a second set value in the control command. The host controls the camera's first attribute parameter based on a first control interface and controls the camera's second attribute parameter based on a second control interface. The first control interface corresponds to the first set value, and the second control interface corresponds to the second set value. The control formats of the first and second attribute parameters are the same and both are controlled by a standard protocol. The control rules are used to associate the first and second attribute parameters to determine the third attribute parameter, which cannot be controlled by a standard protocol. It is understood that in this application, when the camera is under non-standard protocol control flow, based on the configured control rules and the first and second set values in the control instructions issued by the host, the camera can associate with the corresponding first and second control interfaces (equivalent to forming a private protocol). This enables the reading and setting of the third attribute parameter (a controllable attribute parameter corresponding to the non-standard protocol) associated with the first and second attribute parameters. In other words, this application expands the attribute control function of the camera, better meeting the user's control needs for the camera. In addition, since the control formats of the first and second attribute parameters are the same and both are controlled through standard protocols, the reading and setting of the third attribute parameter becomes simpler and more convenient. Attached Figure Description
[0033] Figure 1 This is a flowchart illustrating the first embodiment of the communication control method for the camera in this application;
[0034] Figure 2 This is a detailed flowchart of step S20 in the first embodiment of the communication control method for the camera of this application;
[0035] Figure 3 This is a schematic diagram of the device structure of the hardware operating environment involved in this application.
[0036] Figure 4 This is a schematic diagram of the overall process involved in the communication control method of the camera in this application;
[0037] Figure 5 This is a schematic diagram of the first scene involved in the communication control method of the camera in this application;
[0038] Figure 6 This is a schematic diagram of the second scenario involving the communication control method of the camera in this application;
[0039] Figure 7 This is a schematic diagram of a third scenario involving the communication control method of the camera in this application;
[0040] Figure 8 This is a schematic diagram of the fourth scenario involving the communication control method of the camera in this application;
[0041] Figure 9 This is a schematic diagram of the fifth scenario involving the communication control method of the camera in this application;
[0042] Figure 10 This is a schematic diagram of the sixth scenario involving the communication control method of the camera in this application;
[0043] Figure 11 This is a further detailed flowchart of step S20 in the first embodiment of the communication control method for the camera of this application. Detailed Implementation
[0044] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0045] This application provides a communication control method for a camera. In one embodiment of the camera communication control method of this application, refer to... Figure 1 Applied to a camera, the method includes:
[0046] Step S10: Receive control commands from the host that communicates with the camera, and determine whether the camera is under the first control flow;
[0047] Wherein, the first control process is not a process controlled by a standard protocol;
[0048] Step S20: When the camera is in the first control flow, the third attribute parameter is controlled according to the configured control rules and the first and second set values in the control command.
[0049] The host controls the camera's first attribute parameters based on a first control interface and controls the camera's second attribute parameters based on a second control interface. The first control interface corresponds to a first set value, and the second control interface corresponds to a second set value. The control formats of the first attribute parameters and the second attribute parameters are the same, and both are controlled through a standard protocol. The control rules are used to associate the first attribute parameters and the second attribute parameters to determine a third attribute parameter, which cannot be controlled through a standard protocol.
[0050] This embodiment aims to expand the camera's attribute control functions and realize the user's control needs for the camera.
[0051] Specifically, in this application, when the camera is under a non-standard protocol control flow, based on the configured control rules and the first and second set values in the control instructions issued by the host, the camera can associate with the corresponding first and second control interfaces (equivalent to forming a private protocol). This allows for the reading and setting of the third attribute parameter (a controllable attribute parameter corresponding to the non-standard protocol) associated with the first and second attribute parameters. In other words, this application expands the camera's attribute control function, better meeting the user's control needs for the camera. Furthermore, since the control formats of the first and second attribute parameters are the same and both are controlled through standard protocols, reading and setting the third attribute parameter becomes simpler and more convenient.
[0052] Furthermore, in this application, if it is determined that the first set value is equal to the maximum value of the second attribute parameter, then the second set value is used as an ID to look up the third attribute parameter; the current value of the third attribute parameter is read and its current value is fed back to the host. Therefore, this application realizes the function of reading the attribute value corresponding to the third attribute parameter (a controllable attribute parameter corresponding to a non-standard protocol).
[0053] Furthermore, in this application, if it is determined that the first set value is not equal to the maximum value of the second attribute parameter, then the first set value is used as an ID to look up the third attribute parameter (a controllable attribute parameter corresponding to a non-standard protocol); the current value of the third attribute parameter is set to the second set value; based on the set third attribute parameter, the camera is run to obtain running data. Therefore, this application realizes the function of setting the attribute value (a controllable attribute parameter corresponding to a non-standard protocol) of the third attribute parameter.
[0054] Furthermore, in this application, based on the first set value in the control instruction, it is determined whether the camera is under the first control flow (if the first set value is not equal to 0, and the flag bit configured for the first control flow is non-zero), thereby realizing the differentiation of different control flows for the camera.
[0055] Furthermore, in this application, when the camera is not under the first control flow, the reading and setting of the camera attribute parameters controllable by the corresponding UVC protocol will not be affected.
[0056] In this embodiment, it should be noted that:
[0057] The camera is a USB camera;
[0058] Private protocol: refers to a custom communication protocol other than the UVC standard protocol;
[0059] The third attribute parameter is a private attribute parameter, which refers to camera attribute parameters that are not included in the controllable attributes of the UVC protocol, such as wide dynamic range, image noise reduction, P / N mode and other common camera attribute parameters.
[0060] The third attribute parameter also includes: image mode attribute parameters customized by the camera developer, specifically including standard, vivid, soft, and backlight image modes, each corresponding to different image effects to suit different user needs.
[0061] The third attribute parameter also includes camera attribute parameters with color gamut range defined by the camera developer, including six states: warm light, natural light, fluorescent light, narrow color temperature, wide color temperature, and incandescent light. Each state corresponds to a different image effect to adapt to different usage scenarios.
[0062] As an example, the set value refers to the value actually sent down by the host through the (attribute) control interface or the corresponding attribute value read from the camera's internal storage.
[0063] Current value: refers to the actual state value of this attribute parameter stored internally in the camera;
[0064] As an example, after the host sends the set value to the camera based on the control command, the camera will automatically assign the set value to the corresponding control interface and display the attribute effect of the corresponding third attribute parameter according to the assigned set value;
[0065] As an example, the host sends a command to read a certain attribute of the camera based on the control command, and the camera returns the current value to the host according to the sent attribute ID.
[0066] As an example, after the host sends the set value to the camera based on the control command, the camera will obtain the current value of the third attribute parameter corresponding to the set value and feed back the current value to the host.
[0067] As an example, the UVC standard protocol for cameras supports the following attribute parameter controls for CT (Camera Endpoint):
[0068] Scanning Mode (Progressive or Interlaced): Scanning mode (progressive or interlaced scanning);
[0069] Auto-Exposure Mode; Auto-Exposure Priority; Exposure Time; Focus; Auto-Focus; SimpleFocus; Iris; Zoom; Pan; Roll; Tilt; Digital Windowing; Region of Interest.
[0070] The UVC standard protocol supports the following attribute parameter control for the corresponding PU (processing unit): Brightness; Contrast; Hue; Saturation; Sharpness; Gamma; Digital Multiplier (Zoom); White Balance Temperature; White Balance Component; Backlight Compensation; Contrast; Gain; Power Line Frequency; Analog Video Standard; Analog Video Lock Status.
[0071] It should be noted that the control or command formats for the above attribute parameters, such as exposure time, focus, zoom / zoom, lens movement, scroll, tilt, simple focus, brightness, contrast, chroma, saturation, sharpness, gamma, digital magnification, white balance color temperature, backlight compensation, contrast, and gain, are the same.
[0072] As an example, such as Figure 7 The image shows an example of setting the first attribute parameter in a standard protocol;
[0073] As an example, such as Figure 8 The image shows an example of reading the first attribute parameter in a standard protocol;
[0074] As an example, such as Figure 9 The image shows an example of setting the second attribute parameter in a standard protocol;
[0075] As an example, such as Figure 10The image shows an example of reading the second attribute parameter in a standard protocol.
[0076] It should be noted that the current UVC standard protocol only supports the reading and setting of corresponding attribute parameters in the CT and PU units. That is, the number of interfaces supported or usable by the current UVC standard protocol is limited. As the functions of USB cameras continue to increase, it is necessary to support the reading and setting of third attribute parameters such as wide dynamic range, image mode, and color gamut.
[0077] Specifically, in this embodiment, such as Figure 5 The image shows an example of reading the third attribute parameter. In this example, the third attribute parameter ID = 0x0080 is read, and the value read is 0x0000.
[0078] Specifically, in this embodiment, such as Figure 6 The image shows an example of setting the third attribute parameter, where the third attribute parameter ID is set to 0x0080 and the value is set to 0x0001.
[0079] The specific steps are as follows:
[0080] Step S10: Receive control commands from the host that communicates with the camera, and determine whether the camera is under the first control flow;
[0081] Wherein, the first control process is not a process controlled by a standard protocol;
[0082] As an example, the host sends a control command to the camera, and the camera receives the control command.
[0083] As an example, control commands can specifically be setting commands or reading commands.
[0084] As an example, after receiving a control command from a host that is communicating with the camera, the camera determines whether the camera is under a first control flow, wherein the first control flow is not a flow controlled by a standard protocol.
[0085] As an example, the camera can determine whether it is under the first control flow based on the instructions carried in the control command.
[0086] Step S20: When the camera is in the first control flow, the third attribute parameter is controlled according to the configured control rules and the first and second set values in the control command.
[0087] The host controls the camera's first attribute parameters based on a first control interface and controls the camera's second attribute parameters based on a second control interface. The first control interface corresponds to a first set value, and the second control interface corresponds to a second set value. The control formats of the first attribute parameters and the second attribute parameters are the same, and both are controlled through a standard protocol. The control rules are used to associate the first attribute parameters and the second attribute parameters to determine a third attribute parameter, which cannot be controlled through a standard protocol.
[0088] As an example, the configured control rule can specifically control which third attribute parameter through the second control interface and the first control interface;
[0089] As an example, the configured control rules can specifically control wide dynamic parameters through the second control interface and the first control interface;
[0090] As an example, the configured control rules can specifically control the backlight parameters through the second control interface and the first control interface;
[0091] As an example, the configured control rules can specifically control the fluorescent lamp parameters through the second control interface and the first control interface.
[0092] As an example, the configured control rules can be sent from the host to the camera. After the configured control rules are sent from the host to the camera, they need to be pre-stored inside the camera in order to realize the corresponding control functions.
[0093] As an example, the control format of the first attribute parameter and the second attribute parameter is the same. Since the control format of the first attribute parameter and the second attribute parameter is the same, too many control format conversions can be avoided, saving resources.
[0094] As an example, the first and second attribute parameters have the same control format and are both controlled through a standard protocol. Both the first and second attribute parameters are one of the following parameters in the camera: exposure time, focus, zoom / zoom, lens movement, scrolling, tilt, simple focus, brightness, contrast, chroma, saturation, sharpness, gamma, digital magnification, white balance color temperature, backlight compensation, and gain. Since the first and second attribute parameters are different, there are a total of 18 * 17 = 306 possible combinations (306 proprietary protocols or control rules). The specific protocol or control rule that the camera executes when it receives a control command can be preset.
[0095] As an example, when the first control interface and the second control interface of the camera are not associated, the first attribute parameter is controlled based on the first control interface, and the second attribute parameter is controlled based on the second control interface.
[0096] As an example, the first control interface corresponds to the first set value in the control command, and the second control interface corresponds to the second set value in the control command;
[0097] As an example, after the first control interface and the second control interface are associated with the first set value and the second set value, they no longer control the first attribute parameter and the second attribute parameter, but instead control the third attribute parameter.
[0098] As an example, when the camera is in the first control flow, the current value of the first attribute parameter and the current value of the second attribute parameter are saved.
[0099] As an example, when the camera is in the first control flow, the current value of the first attribute parameter and the current value of the second attribute parameter are saved by a preset flag bit.
[0100] Among them, such as Figure 2 As shown, the step of controlling the third attribute parameter according to the configured control rules and the first and second set values in the control command includes:
[0101] Step S21: If it is determined that the first set value is equal to the maximum value of the second attribute parameter, then the second set value is used as the ID to look up the third attribute parameter.
[0102] Step S22: Read the current value of the third attribute parameter and feed it back to the host.
[0103] As an example, the host can read the value range of each attribute parameter in the camera. Therefore, if the host needs to control the corresponding third attribute parameter based on the control rules, the corresponding instruction content has been clearly defined in the control instruction before the host issues the control instruction. For example, the maximum value of the second attribute parameter has been clearly defined in the control instruction, thus providing a basis for comparing the first set value and the maximum value of the second attribute parameter.
[0104] As an example, if it is determined that the first set value is equal to the maximum value of the second attribute parameter, then the second set value is used as the ID to look up the third attribute parameter.
[0105] As an example, if it is determined that the first setting value is CUR_A, which is equal to the maximum value of the second attribute parameter B, then the second setting value CUR_B is used as the lookup ID to obtain the current value of the third attribute parameter with ID = CUR_B, and the current value is fed back to the host.
[0106] As an example, such as Figure 4 As shown, if the first setting value is determined to be CUR_A = 255, which is equal to the maximum value of the second attribute parameter B, i.e., 255, then the second setting value CUR_B = 253 is used as the lookup ID to obtain the current value of the third attribute parameter (image mode) with ID = 253. The current value of the third attribute parameter is read and fed back to the host.
[0107] This application provides a communication control method for a camera. Compared with the prior art, where cameras can only support reading and setting camera attribute parameters corresponding to standard protocols, making it difficult to meet users' control needs, this application receives control commands from a host communicating with the camera and determines whether the camera is under a first control flow. This first control flow is not a flow controlled by a standard protocol. When the camera is under the first control flow, a third attribute parameter is controlled according to configured control rules and a first and a second set value in the control command. The host controls the camera's first attribute parameter based on a first control interface and controls the camera's second attribute parameter based on a second control interface. The first control interface corresponds to the first set value, and the second control interface corresponds to the second set value. The control formats of the first and second attribute parameters are the same and both are controlled by a standard protocol. The control rules are used to associate the first and second attribute parameters to determine the third attribute parameter, which cannot be controlled by a standard protocol. It is understood that in this application, when the camera is under non-standard protocol control flow, based on the configured control rules and the first and second set values in the control instructions issued by the host, the camera can associate with the corresponding first and second control interfaces (equivalent to forming a private protocol). This enables the reading and setting of the third attribute parameter (a controllable attribute parameter corresponding to the non-standard protocol) associated with the first and second attribute parameters. In other words, this application expands the attribute control function of the camera, better meeting the user's control needs for the camera. In addition, since the control formats of the first and second attribute parameters are the same and both are controlled through standard protocols, the reading and setting of the third attribute parameter becomes simpler and more convenient.
[0108] Furthermore, based on the first embodiment of this application, another embodiment of this application is provided, in which, as... Figure 11 As shown, the step of controlling the third attribute parameter according to the configured control rules and the first and second set values in the control command includes:
[0109] Step S23: If it is determined that the first set value is not equal to the maximum value of the second attribute parameter, then the first set value is used as the ID to look up the third attribute parameter.
[0110] Step S24: Set the current value of the third attribute parameter to the second set value;
[0111] Step S25: Based on the set third attribute parameters, run the camera to obtain running data.
[0112] As an example, such as Figure 4 As shown, if it is determined that the first setting value is CUR_A = 2, which is not equal to the maximum value of the second attribute parameter B, 255, then the first setting value CUR_A = 2 is used as the lookup ID to obtain the third attribute parameter with ID = 2. The current value of the third attribute parameter is changed to CUR_B = 253, and the camera is run based on the set third attribute parameter to obtain the running data.
[0113] In this application, if it is determined that the first set value is not equal to the maximum value of the second attribute parameter, then the first set value is used as an ID to look up the third attribute parameter (a controllable attribute parameter corresponding to a non-standard protocol); the current value of the third attribute parameter is set to the second set value; based on the set third attribute parameter, the camera is run to obtain running data. Therefore, this application realizes the function of setting the attribute value corresponding to the third attribute parameter (a controllable attribute parameter corresponding to a non-standard protocol).
[0114] Furthermore, based on the first embodiment of this application, another embodiment of this application is provided. In this embodiment, the step of receiving control commands issued by a host communicating with the camera and determining whether the camera is under the first control flow includes:
[0115] Step S11: Receive control commands issued by the host communicating with the camera based on the first interface;
[0116] Step S12: Determine whether the camera is under the first control flow based on the first set value in the control command.
[0117] As an example, an implementation method for determining whether the camera is under a first control flow is provided.
[0118] As an example, it is determined whether the camera is under the first control flow based on the relationship between the first set value in the control command and the flag bit set in the camera.
[0119] As an example, in one possible implementation of this application, the step of determining whether the camera is under the first control flow includes:
[0120] Step S121: If the first set value is not equal to 0 and the flag bit corresponding to the first control flow is not 0, then it is determined that the camera is under the first control flow.
[0121] As an example, after the camera is powered on, it clears the relevant flag bits, i.e., Flag1 = 0; Flag2 = 0; Flag3 = 0; Flag4 = 0, and waits to receive control commands from the host. Among them, Flag1: records the state of the third attribute parameter (first control flow) (when Flag1 is non-zero, the first control flow is entered), 0 - the third attribute parameter (first control flow) is not in the ready state, 1 - the third attribute parameter (first control flow) is in the ready state; Flag2: records the ID corresponding to the third attribute parameter (the value of Flag2 can be the first set value or the second set value), 0 - the control state of the third attribute parameter, 1 ~ (Max-1) the ID of the third attribute parameter, Max - the reading state of the third attribute parameter; Flag3: records the current value of the first attribute parameter, such as attribute parameter A; Flag4: records the current value of the second attribute parameter, such as attribute parameter B.
[0122] As an example, if the camera receives the first setting value CUR_A from the host, and CUR_A is 0, then the camera control flow enters the "ready state", that is, at this time Flag1=1, Flag2=0, Flag3=M (M is the current value of the first attribute parameter) and Flag4=N (N is the current value of the second attribute parameter).
[0123] As an example, if the camera receives the first setting value of the first attribute parameter corresponding to the first interface sent by the host as CUR_A, and if CUR_A is not 0, then it continues to determine whether Flag1 is equal to 1. If it is equal to 1, then CUR_A is assigned to Flag2. (At this time, if it is determined that the first setting value is equal to the maximum value of the second attribute parameter, then the second setting value is used as the ID to look up the third attribute parameter, and the current value of the third attribute parameter is read; if it is determined that the first setting value is not equal to the maximum value of the second attribute parameter, then the first setting value is used as the ID to look up the third attribute parameter; the current value of the third attribute parameter is set to the second setting value; based on the set third attribute parameter, the camera is run to obtain running data).
[0124] If Flag1 is not equal to 1, then the normal control flow of the first attribute parameter A is executed, and the third attribute parameter or the camera-related flag bits (Flag1=0; Flag2=0; Flag3=0; Flag4=0) are cleared.
[0125] In this embodiment, it is first accurately determined whether the camera is under the first control flow, thus providing a basis for the corresponding communication control.
[0126] Furthermore, based on the first embodiment of this application, another embodiment of this application is provided, in which the method further includes:
[0127] Step A1: Receive a control command from the host that is communicating with the camera. When the camera is not in the first control process, change the current value of the camera's first attribute parameter to the first set value in the control command, and / or change the current value of the camera's second attribute parameter to the second set value in the control command.
[0128] Step A2: Run the camera.
[0129] As an example, when the camera is not under the first control flow, the first control interface and the second control interface are unrelated and respond independently, that is, the current value of the camera's first attribute parameter is changed to the first set value in the control instruction, and / or the current value of the camera's second attribute parameter is changed to the second set value in the control instruction, so as to realize the control of the corresponding attribute parameter based on the standard protocol.
[0130] Furthermore, based on the above embodiments of this application, another embodiment of this application is provided, in which the method is applied to a host and includes:
[0131] When the host is in the first control flow, it sends a first control command to the camera based on the first control interface and the second control interface. The control command includes a first set value and a second set value. The first set value is set to the maximum value of a non-second attribute parameter to realize the setting function of a third attribute parameter whose attribute ID is the first set value. The current value of the third attribute parameter is set to the second set value. The first control interface corresponds to the first set value, and the second control interface corresponds to the second set value. When the camera is in the first control flow, it sets the current value of the third attribute parameter whose attribute ID is the first set value to the second set value according to the control command.
[0132] Alternatively, when the host is in the first control flow, it sends a control command to the camera. The control command includes a first set value and a second set value. The first set value is set to the maximum value of the second attribute parameter to enable the reading function of the third attribute parameter whose attribute ID is the second set value. The first control interface corresponds to the first set value, and the second control interface corresponds to the second set value. When the camera is in the first control flow, it reads the current value of the third attribute parameter whose attribute ID is the second set value according to the control command and feeds back the current value to the host.
[0133] The host sequentially sets a first preset value to 0 and then sets the first preset value to a non-zero value to enter the first control process.
[0134] The specific implementation methods used in the host are basically the same as those described above, and will not be repeated here.
[0135] Reference Figure 3 , Figure 3 This is a schematic diagram of the device structure of the hardware operating environment involved in this application.
[0136] like Figure 3 As shown, the camera may include: a processor 1001, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to realize the connection and communication between the processor 1001 and the memory 1005.
[0137] Optionally, the camera may also include a user interface, a network interface, a camera, RF (Radio Frequency) circuitry, sensors, a WiFi module, etc. The user interface may include a display screen, an input submodule such as a keyboard, and optionally, a standard wired or wireless interface. The network interface may include a standard wired or wireless interface (such as a Wi-Fi interface).
[0138] Those skilled in the art will understand that Figure 3 The camera structure shown does not constitute a limitation on the camera and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0139] like Figure 3As shown, the memory 1005, serving as a storage medium, may include an operating system, a network communication module, and a camera communication control processing program. The operating system is a program that manages and controls the camera's hardware and software resources, supporting the operation of the camera's communication control processing program and other software and / or programs. The network communication module is used to enable communication between the various components within the memory 1005, as well as communication with other hardware and software in the camera's communication control processing system.
[0140] exist Figure 3 In the camera shown, the processor 1001 is used to execute the camera's communication control processing program stored in the memory 1005 to implement the steps of the camera's communication control method described in any of the above claims.
[0141] The specific implementation method of the camera in this application is basically the same as the various embodiments of the communication control method of the camera described above, and will not be repeated here.
[0142] This application also provides a communication control processing device for a camera, applied to a camera, the device comprising:
[0143] The determination module is used to receive control commands from the host that communicates with the camera, and to determine whether the camera is under the first control flow.
[0144] Wherein, the first control process is not a process controlled by a standard protocol;
[0145] The control module is used to control the third attribute parameter according to the configured control rules and the first and second set values in the control command when the camera is in the first control flow.
[0146] The host controls the camera's first attribute parameters based on a first control interface and controls the camera's second attribute parameters based on a second control interface. The first control interface corresponds to a first set value, and the second control interface corresponds to a second set value. The control formats of the first attribute parameters and the second attribute parameters are the same, and both are controlled through a standard protocol. The control rules are used to associate the first attribute parameters and the second attribute parameters to determine a third attribute parameter, which cannot be controlled through a standard protocol.
[0147] In one possible implementation of this application, the control module is used to:
[0148] If it is determined that the first set value is equal to the maximum value of the second attribute parameter, then the second set value is used as the ID to look up the third attribute parameter;
[0149] Read the current value of the third attribute parameter and feed it back to the host.
[0150] In one possible implementation of this application, the control module is further configured to:
[0151] If it is determined that the first set value is not equal to the maximum value of the second attribute parameter, then the first set value is used as the ID to look up the third attribute parameter;
[0152] Set the current value of the third attribute parameter to the second set value;
[0153] Based on the configured third attribute parameters, the camera is run to obtain operating data.
[0154] In one possible implementation of this application, the determining module is used to:
[0155] Receive control commands issued by the host computer communicating with the camera based on the first interface;
[0156] Based on the first set value in the control command, determine whether the camera is under the first control flow.
[0157] In one possible implementation of this application, the determining module is further configured to:
[0158] If the first set value is not equal to 0, and the flag bit corresponding to the first control flow is not 0, then it is determined that the camera is under the first control flow.
[0159] In one possible embodiment of this application, the apparatus further includes:
[0160] The first receiving module is used to receive control commands issued by the host that communicates with the camera, and when the camera is not in the first control process, to change the current value of the camera's first attribute parameter to the first set value in the control command, and / or to change the current value of the camera's second attribute parameter to the second set value in the control command.
[0161] The operation module is used to run the camera.
[0162] In one possible implementation of this application, the first attribute parameter and the second attribute parameter are both one of the parameters of the camera, including exposure time, focus, zoom / zoom, lens movement, scrolling, tilt, simple focus, brightness, contrast, chroma, saturation, sharpness, gamma, digital magnification, white balance color temperature, backlight compensation, contrast, and gain. The first attribute parameter and the second attribute parameter are different. The third attribute parameter is one of wide dynamic range, image noise reduction, P / N system, image mode, and color gamut range.
[0163] In one possible embodiment of this application, the device is further configured to:
[0164] When the camera is in the first control flow, the current value of the first attribute parameter and the current value of the second attribute parameter are saved.
[0165] This application also provides a communication control device for a camera, applied to a host computer, the device comprising:
[0166] The sending module is used to send a first control command to the camera based on a first control interface and a second control interface when the host is in the first control flow. The control command includes a first set value and a second set value. The first set value is set to the maximum value of a non-second attribute parameter to realize the setting function of a third attribute parameter with attribute ID as the first set value, and the current value of the third attribute parameter is set to the second set value. The first control interface corresponds to the first set value, and the second control interface corresponds to the second set value. When the camera is in the first control flow, according to the control command, the current value of the third attribute parameter with attribute ID as the first set value is set to the second set value.
[0167] The second receiving module is used to send control commands to the camera, either directly or when the host is in the first control flow. The control commands include a first set value and a second set value, wherein the first set value is set to the maximum value of the second attribute parameter to enable the reading function of the third attribute parameter whose attribute ID is the second set value. The first control interface corresponds to the first set value, and the second control interface corresponds to the second set value. When the camera is in the first control flow, it reads the current value of the third attribute parameter whose attribute ID is the second set value according to the control command and feeds back the current value to the host.
[0168] In one possible implementation of this application, the host sequentially sets a first preset value to 0 and then sets the first preset value to a non-zero value to enter a first control flow.
[0169] The specific implementation of the communication control processing device for the camera in this application is basically the same as the various embodiments of the communication control method for the camera described above, and will not be repeated here.
[0170] This application provides a storage medium that stores one or more programs, which can be executed by one or more processors to implement the steps of the communication control method for the camera described in any of the above claims.
[0171] The specific implementation of the storage medium in this application is basically the same as the various embodiments of the communication control method for the camera described above, and will not be repeated here.
[0172] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described camera communication control method.
[0173] The specific implementation of the computer program product in this application is basically the same as the various embodiments of the communication control method for the camera described above, and will not be repeated here.
[0174] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0175] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0176] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of a software plus hardware platform, or by hardware, but in many cases the former is a better implementation. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0177] The above are merely preferred embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A communication control method for a camera, characterized in that, Applied to a camera, the method includes: Receive control commands from the host that communicates with the camera, and determine whether the camera is under the first control flow; Wherein, the first control process is not a process controlled by a standard protocol; When the camera is in the first control flow, the third attribute parameter is controlled according to the configured control rules and the first and second set values in the control instructions; The host controls the camera's first attribute parameters based on a first control interface and controls the camera's second attribute parameters based on a second control interface. The first control interface corresponds to a first set value, and the second control interface corresponds to a second set value. The control formats of the first attribute parameters and the second attribute parameters are the same, and both are controlled through a standard protocol. The control rules are used to associate the first attribute parameters and the second attribute parameters to determine a third attribute parameter, which cannot be controlled through a standard protocol. The step of controlling the third attribute parameter according to the configured control rules and the first and second set values in the control instructions includes: If it is determined that the first set value is equal to the maximum value of the second attribute parameter, then the second set value is used as the ID to look up the third attribute parameter; Read the current value of the third attribute parameter and feed it back to the host; If it is determined that the first set value is not equal to the maximum value of the second attribute parameter, then the first set value is used as the ID to look up the third attribute parameter; Set the current value of the third attribute parameter to the second set value; Based on the configured third attribute parameters, the camera is run to obtain operating data.
2. The communication control method for a camera as described in claim 1, characterized in that, The step of receiving control commands from the host that communicates with the camera and determining whether the camera is under the first control flow includes: Receive control commands issued by the host computer communicating with the camera based on the first interface; Based on the first set value in the control command, determine whether the camera is under the first control flow.
3. The communication control method for a camera as described in claim 2, characterized in that, The step of determining whether the camera is under the first control flow includes: If the first set value is not equal to 0, and the flag bit corresponding to the first control flow is not 0, then it is determined that the camera is under the first control flow.
4. The communication control method for a camera as described in claim 1, characterized in that, The method further includes: Receive control commands from a host that communicates with the camera, and when the camera is not in the first control flow, change the current value of the camera's first attribute parameter to the first set value in the control command, and / or change the current value of the camera's second attribute parameter to the second set value in the control command; Run the camera.
5. The communication control method for a camera as described in claim 1, characterized in that, The first and second attribute parameters are both one of the parameters in the camera, including exposure time, focus, zoom / zoom, lens movement, scrolling, tilt, simple focus, brightness, contrast, chroma, saturation, sharpness, gamma, digital magnification, white balance color temperature, backlight compensation, contrast, and gain. The first and second attribute parameters are different. The third attribute parameter is one of the following: wide dynamic range, image noise reduction, P / N system, image mode, and color gamut range.
6. The communication control method for a camera as described in claim 1, characterized in that, When the camera is in the first control flow, the current value of the first attribute parameter and the current value of the second attribute parameter are saved.
7. A communication control method for a camera, characterized in that, Applied to a host, the method includes: When the host is in the first control flow, it sends control commands to the camera based on the first control interface and the second control interface. The control commands include a first set value and a second set value. The first control flow is not a flow controlled by a standard protocol. The first set value is set to the maximum value of a non-second attribute parameter to realize the setting function of a third attribute parameter whose attribute ID is the first set value. The current value of the third attribute parameter is set to the second set value. The third attribute parameter cannot be controlled by a standard protocol. The first control interface corresponds to the first set value, and the second control interface corresponds to the second set value. When the camera is in the first control flow, according to the control commands, the current value of the third attribute parameter whose attribute ID is the first set value is set to the second set value. Alternatively, when the host is in the first control flow, it sends a control command to the camera. The control command includes a first set value and a second set value. The first set value is set to the maximum value of the second attribute parameter to enable the reading function of the third attribute parameter whose attribute ID is the second set value. The third attribute parameter cannot be controlled by the standard protocol. The first control interface corresponds to the first set value, and the second control interface corresponds to the second set value. When the camera is in the first control flow, it reads the current value of the third attribute parameter whose attribute ID is the second set value according to the control command and feeds back the current value to the host.
8. The communication control method for a camera as described in claim 7, characterized in that, The host sequentially sets the first preset value to 0 and then sets the first preset value to a non-zero value to enter the first control process.
Citation Information
Patent Citations
Communication method and device, electronic equipment and storage medium
CN111859361A
Imaging apparatus, control method of the same, and lens unit
JP2018055132A