WO2017084358A1 - 相机参数读写方法、装置和终端设备 - Google Patents

相机参数读写方法、装置和终端设备 Download PDF

Info

Publication number
WO2017084358A1
WO2017084358A1 PCT/CN2016/089027 CN2016089027W WO2017084358A1 WO 2017084358 A1 WO2017084358 A1 WO 2017084358A1 CN 2016089027 W CN2016089027 W CN 2016089027W WO 2017084358 A1 WO2017084358 A1 WO 2017084358A1
Authority
WO
WIPO (PCT)
Prior art keywords
camera parameter
type
group
string
strings
Prior art date
Application number
PCT/CN2016/089027
Other languages
English (en)
French (fr)
Inventor
索金鹏
Original Assignee
乐视控股(北京)有限公司
乐视移动智能信息技术(北京)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 乐视控股(北京)有限公司, 乐视移动智能信息技术(北京)有限公司 filed Critical 乐视控股(北京)有限公司
Publication of WO2017084358A1 publication Critical patent/WO2017084358A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/102Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/64Computer-aided capture of images, e.g. transfer from script file into camera, check of taken image quality, advice or proposal for image composition or decision on when to take image

Definitions

  • the embodiments of the present invention relate to electronic technologies, and in particular, to a camera parameter reading and writing method, device, and terminal device.
  • the user can read and write camera parameters through menus or icons in the interface of the camera application, thereby setting camera parameters.
  • the user can read and write parameters such as sharpness, saturation, and resolution after starting the camera application, and then apply these parameters after the camera is restarted.
  • the embodiment of the present application provides a method, a device, and a terminal device for reading and writing camera parameters, which are used to solve the technical problem that the unique camera parameters of each hardware platform cannot be read and written in the prior art.
  • a method for reading and writing camera parameters including:
  • Each group of strings in each group of strings is used as a node, and each node is linked to obtain a data source queue;
  • a camera parameter reading and writing device including:
  • a reading module configured to read a camera parameter class of the hardware platform by using a software system interface, to obtain a character string, wherein the character string includes a key for describing a camera parameter and a key value for describing a value of the camera parameter;
  • a parsing module configured to parse the string to obtain each group of strings; wherein the keys of the same group of strings are used to describe the same camera parameter;
  • a link module configured to use each group of the string in each group of strings as a node, and link the nodes to obtain a data source queue
  • An initialization module configured to initialize an interface menu by using the data source queue, so that the interface menu displays an option including a camera parameter and a camera parameter value;
  • An input module configured to acquire a camera parameter read/write instruction input on the option
  • a reading and writing module configured to read and write a value of a camera parameter included in the option according to the camera parameter read/write instruction.
  • a terminal device comprising the camera parameter reading and writing device as described above.
  • an embodiment of the present application provides a camera parameter reading and writing device, including a memory, one or more processors, and one or more programs, wherein the one or more programs are in the one or more programs.
  • the processor performs the following operations: reading a camera parameter class of the hardware platform by using a software system interface to obtain a string, wherein the string includes a key for describing a camera parameter and a key value for describing a camera parameter value. ; for the character
  • the string is parsed to obtain each group of strings; wherein the keys of the same group of strings are used to describe the same camera parameters; each group of strings in each group of strings is used as a node, and the nodes are linked to obtain data.
  • Source queue initializing an interface menu by using the data source queue to cause the interface menu to display an option including camera parameter and camera parameter value; acquiring a camera parameter read/write instruction input on the option; according to the camera The parameter read/write instruction reads and writes the value of the camera parameter included in the option.
  • an embodiment of the present application provides a computer readable storage medium, where the computer readable storage medium stores computer executable instructions that, in response to execution, cause a camera parameter reading and writing device to perform an operation,
  • the operations include: reading a camera parameter class of the hardware platform using a software system interface to obtain a character string, wherein the character string includes a key for describing a camera parameter and a key value for describing a value of the camera parameter; Strings are parsed to obtain each group of strings; wherein the keys of the same group of strings are used to describe the same camera parameters; each group of strings in each group of strings is used as a node, and the nodes are linked to obtain a data source queue; initializing an interface menu by using the data source queue to cause the interface menu to display an option including camera parameter and camera parameter value; acquiring a camera parameter read/write instruction input on the option; The camera parameter read/write command reads and writes the value of the camera parameter included in the option.
  • the camera parameter class of the hardware platform is read by using a software system interface, and after the string is obtained, the string is parsed to obtain each group of strings, and then each group of strings in each group of strings is taken as one Nodes, link each node, obtain a data source queue, use the data source queue to initialize the interface menu, so that the interface menu displays options including camera parameters and camera parameter values, so that the user can read and write camera parameters through the interface menu.
  • FIG. 1 is a schematic flowchart of a camera parameter reading and writing method according to Embodiment 1 of the present application;
  • FIG. 2 is a class diagram for implementing a camera parameter reading and writing method
  • FIG. 3 is a logic diagram of a method for reading and reading camera parameters
  • FIG. 4 is a schematic structural diagram of a camera parameter reading and writing device according to Embodiment 2 of the present application.
  • FIG. 5 is a schematic structural diagram of another camera parameter reading and writing device provided in Embodiment 2;
  • FIG. 5 is a schematic structural diagram of another camera parameter reading and writing device provided in Embodiment 2;
  • FIG. 6 is a schematic structural diagram of still another camera parameter reading and writing device provided in Embodiment 2;
  • FIG. 7 is a schematic structural diagram of a camera parameter reading and writing device provided in Embodiment 4.
  • FIG. 8 is a schematic structural diagram of a computer program product for reading and writing camera parameters provided in Embodiment 5.
  • FIG. 1 is a schematic flowchart of a camera parameter reading and writing method according to Embodiment 1 of the present application.
  • the method provided in this embodiment may be implemented by a camera application running on a terminal device, where the terminal device is configured with a software system and hardware.
  • the platform, as shown in Figure 1, includes:
  • Step 101 Read a camera parameter class of the hardware platform by using a software system interface to obtain a character string.
  • the string includes a key for describing camera parameters and a key value for describing the value of the camera parameter.
  • Step 102 Parse the character string to obtain each group of character strings.
  • the keys of the same group string are used to describe the same camera parameters.
  • the type of the current string is confirmed, where the type is an enumerated type or a range type or a single value type. And determining whether the current string belongs to a group of each group of strings under the corresponding type that has been created; if the current string belongs to a group of each group of strings under the corresponding type that has been created, inserting the current string into the group In a set of strings; if the current string does not belong to each set of strings under the corresponding type created, create a set of strings containing the current string.
  • the key of the current string contains at least the suffix "-values”, it determines that the type of the current string is an enumerated type; the key of the current string contains at least the suffix "-min”, the suffix "-step”, and the prefix "max". -” and / or "min-”, then determine the current string
  • the type is a range type; if the type of the current string is not one of the enumerated type and the range type, then the type of the string is determined to be a single value type.
  • Step 103 Each group of the string in each group of strings is used as a node, and each node is linked to obtain a data source queue.
  • Step 104 Initialize an interface menu by using a data source queue, so that the interface menu displays an option including camera parameter and camera parameter value.
  • Step 105 Acquire a camera parameter read/write instruction input on the option.
  • the camera parameter read/write instructions include camera parameters that need to be read, and/or values of camera parameters that need to be modified.
  • the user can click the option of the camera parameter to be modified on the interface menu of the camera application to display the camera parameters included in the option and the corresponding camera parameter values.
  • the user can modify the camera parameters by entering a new camera parameter value in this option.
  • Step 106 Read and write the value of the camera parameter included in the option according to the camera parameter read/write instruction.
  • FIG. 2 is a class diagram for implementing a camera parameter reading and writing method, as shown in FIG. Classes include:
  • Figure 3 is a logic diagram for implementing the camera parameter reading and writing method. When the above code is run in the system, the logic shown in Figure 3 can be implemented:
  • determining whether a pair of parameters in the string that is, a key and a key value, can be read, and if so, sequentially traversing all types of subclasses ParamNode, and when the isNodeType(key) is true, determining that the nCurType class is the current type; otherwise, Traversing the linked list node calls the prepareValueList class.
  • nCurType is the current type
  • traversing the linked list node to determine whether there is a node with a contentKey(key) being true, and if so, inserting the node, and then, if the node being queried is a single-valued type, the node is converted to nCurType ParamNode, if otherwise call nCurType class createNode (key), link the node to the linked list.
  • the assignment is made by the code setData(value), and a step is performed to determine whether a pair of parameters in the string can be read.
  • the node links are sequentially read and added to the interface menu of the application.
  • the main menu display list displays the character string getDisplayItem for all the nodes found in the traversal list, and sets the main menu onItemClicked response event to display
  • the secondary menu list is the getValues of the main menu list item node. Set the secondary menu onItemClicked response event to call the node's setDeviceParam.
  • the camera parameter class of the hardware platform is read by using a software system interface, and after the string is obtained, the string is parsed, each group of strings is obtained, and then each group is obtained.
  • Each group of strings in the string acts as a node, and links each node to obtain a data source queue to initialize the interface menu with the data source queue, so that the interface menu displays options including camera parameters and camera parameter values, thereby
  • the camera parameters can be read and written through the interface menu, which solves the technical problem that the unique camera parameters of each hardware platform cannot be read and written in the prior art.
  • FIG. 4 is a schematic structural diagram of a camera parameter reading and writing device according to Embodiment 2 of the present application.
  • the device provided in this embodiment may be disposed in a terminal device, as shown in FIG. 4, and includes: a reading module 41 and a parsing module. 42. Link module 43, initialization module 44, input module 45, and read/write module 46.
  • the reading module 41 is configured to read a camera parameter class of the hardware platform by using a software system interface to obtain a character string.
  • the character string includes a key for describing a camera parameter and a key value for describing a value of the camera parameter.
  • the parsing module 42 is configured to parse the character string read by the reading module 41 to obtain each group of character strings.
  • the keys of the same group string are used to describe the same camera parameters.
  • the linking module 43 is configured to link each of the group of character strings obtained by the parsing module 42 as a node, and link the nodes to obtain a data source queue.
  • the initialization module 44 is configured to initialize the interface menu by using the data source queue obtained by the link module 43 to cause the interface menu to display an option including camera parameter and camera parameter value.
  • the input module 45 is configured to acquire a camera parameter read/write instruction input on the option.
  • the reading and writing module 46 is configured to read and write the value of the camera parameter included in the option according to the camera parameter read and write command acquired by the input module 45.
  • FIG. 5 is a schematic structural diagram of another camera parameter reading and writing device provided in the second embodiment, as shown in FIG.
  • the parsing module 42 includes a confirming unit 421, a judging unit 422, an inserting unit 423, and a creating unit 424.
  • the confirmation unit 421 is configured to confirm the type of the current character string.
  • the determining unit 422 is configured to determine whether the current string belongs to a group of each group of strings under the corresponding type that has been created.
  • the inserting unit 423 is configured to insert the current character string into the group of the character string to be belonged if the determining unit 422 determines that the current character string belongs to one of the group of character strings under the corresponding type that has been created.
  • the creating unit 424 is configured to: if the determining unit 422 determines that the current character string does not belong to each group of the string under the corresponding type that has been created, create a group of character strings including the current character string.
  • FIG. 6 is a schematic structural diagram of still another camera parameter reading and writing device provided in the second embodiment.
  • the confirmation unit 421 includes an enumeration subunit 4211, a range subunit 4212, and a single value subunit 4213.
  • the enumeration sub-unit 4211 when the key for the current string contains at least the suffix "-values", determines that the type of the current string is an enumerated type.
  • the range sub-unit 4212 when the key for the current string contains at least the suffix "-min”, the suffix "-step”, the prefix "max-”, and/or "min-”, determines that the current string type is the range type. .
  • the single value subunit 4213 is configured to determine that the type of the string is a single value type if the type of the current string is not one of an enumerated type and a range type.
  • the camera parameter class of the hardware platform is read by using a software system interface, and after the string is obtained, the string is parsed to obtain each group of strings, and then each group of strings in each group of strings is taken as one Nodes, link each node, obtain a data source queue, use the data source queue to initialize the interface menu, so that the interface menu displays options including camera parameters and camera parameter values, so that the user can read and write camera parameters through the interface menu.
  • the embodiment provides a terminal device, including the camera parameter reading and writing device provided in the second embodiment.
  • the terminal device is configured with a software system and a hardware platform.
  • a terminal device that reads a camera parameter class of the hardware platform by using a software system interface to obtain a character string, wherein the character string includes a key for describing a camera parameter and a key value for describing a value of the camera parameter; Performing parsing to obtain each group of strings; wherein the keys of the same group string are used to describe the same camera parameter; each group of strings in each group of strings is used as a node, and each node is linked to obtain a data source. Queue; initializing an interface menu with the data source queue to cause the interface menu to display an option including camera parameter and camera parameter values; acquiring camera parameter read/write instructions input on the option; according to the camera parameter Read and write instructions to read and write the values of camera parameters included in the options.
  • the terminal device parses the character string to obtain each group of character strings, including: the terminal device confirms the type of the current character string; the type is an enumerated type or a range type or a single value type; determining whether the current string belongs to A group of each group of strings in the corresponding type that has been created; if the current string belongs to a group of each group of strings under the corresponding type that has been created, the current string is inserted into the group of strings to which it belongs; If the current string does not belong to each group of strings under the corresponding type created, create a set of strings containing the current string.
  • the terminal device confirms the type of the current string, including: when the key of the current string includes at least the suffix "-values", the terminal device determines that the type of the current string is an enumerated type; the key of the current string includes at least the suffix " -min”, the suffix "-step”, the prefix "max-” and/or "min-”, the terminal device determines that the type of the current string is a range type; if the current string type is not an enumerated type and range One of the types, the terminal device determines that the type of the string is a single value type.
  • the camera parameter class of the hardware platform is read by using a software system interface, and after the string is obtained, the string is parsed to obtain each group of strings, and then each group of strings in each group of strings is taken as one Node, link each node, get the number
  • the interface menu is initialized by using the data source queue, so that the interface menu displays the options including the camera parameters and the camera parameter values, so that the user can read and write the camera parameters through the interface menu, and the existing hardware cannot be solved in the prior art.
  • FIG. 7 is a schematic structural diagram of a camera parameter reading and writing device provided in Embodiment 4.
  • the camera parameter reading and writing device of the embodiment of the present application includes a memory 61, one or more processors 62, and one or more programs 63.
  • the one or more programs 63 when executed by one or more processors 62, perform any of the above-described embodiments.
  • the camera parameter reading and writing device of the embodiment of the present application reads a camera parameter class of the hardware platform by using a software system interface, obtains a character string, parses the character string, obtains each group of character strings, and further sets each group of character strings.
  • a set of strings is used as a node to link each node to obtain a data source queue to initialize the interface menu with the data source queue, so that the interface menu displays options including camera parameters and camera parameter values, so that the user can access the interface menu.
  • the camera parameters are read and written to solve the technical problem that the unique camera parameters of each hardware platform cannot be read and written in the prior art.
  • FIG. 8 is a schematic structural diagram of a computer program product for reading and writing camera parameters provided in Embodiment 5.
  • the computer program product 71 for reading and writing camera parameters of the embodiment of the present application may include a signal bearing medium 72.
  • Signal bearing medium 72 may include one or more instructions 73 that, when executed by, for example, a processor, may provide the functionality described above with respect to Figures 1-6.
  • the instructions 73 can include: a camera parameter class for reading a hardware platform using a software system interface, obtaining a string, wherein the string includes a key for describing camera parameters and a key value for describing camera parameter values One or more instructions for parsing the string to obtain a set of strings; wherein the keys of the same set of strings are used to describe one or more instructions of the same camera parameter; Each set of strings in the group acts as a node, and the nodes are chained And obtaining one or more instructions of the data source queue; for initializing an interface menu with the data source queue to cause the interface menu to display one or more instructions including options for camera parameters and camera parameter values; And one or more instructions for acquiring a camera parameter read/write instruction input on the option; and reading or writing one or more of the camera parameter values included in the option according to the camera parameter read/write instruction Multiple instructions.
  • the camera parameter reading and writing device can perform one or more of the steps shown in FIG. 1 in response to the instruction 73.
  • signal bearing medium 72 can include computer readable media 74 such as, but not limited to, a hard disk drive, a compact disk (CD), a digital versatile disk (DVD), a digital tape, a memory, and the like.
  • the signal bearing medium 72 can include a recordable medium 75 such as, but not limited to, a memory, a read/write (R/W) CD, an R/W DVD, and the like.
  • the signal bearing medium 72 can include a communication medium 76 such as, but not limited to, a digital and/or analog communication medium (eg, fiber optic cable, waveguide, wired communication link, wireless communication link, etc.).
  • the computer program product 71 can be transmitted by the RF signal bearing medium 72 to one or more modules of the identification device of the multi-finger swipe gesture, wherein the signal bearing medium 72 is comprised of a wireless communication medium (eg, wireless compliant with the IEEE 802.11 standard) Communication medium) transmission.
  • a wireless communication medium eg, wireless compliant with the IEEE 802.11 standard
  • the computer program product of the embodiment of the present application reads a camera parameter class of the hardware platform by using a software system interface, obtains a character string, parses the character string, obtains each group of character strings, and further sets each group of each group of character strings.
  • the string is linked to each node to obtain a data source queue to initialize the interface menu with the data source queue, so that the interface menu displays options including camera parameters and camera parameter values, so that the user can access the camera parameters through the interface menu.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)

Abstract

一种相机参数的读写方法、装置和终端设备,利用软件系统接口读取硬件平台的相机参数类,获得字符串(101),对字符串进行解析,获得各组字符串(102),将各组字符串中的每一组字符串作为一个节点,对各节点进行链接,获得数据源队列(103),利用数据源队列初始化界面菜单,使得界面菜单显示包含相机参数和相机参数取值的选项(104),从而用户可以通过界面菜单对相机参数进行读写,解决现有技术中无法对各个硬件平台的特有相机参数进行读写的技术问题。

Description

相机参数读写方法、装置和终端设备
本专利申请要求申请日为2015年11月20日、申请号为2015108123409的中国专利申请的优先权,并将上述专利申请以引用的方式全文引入本文中。
技术领域
本申请实施例涉及电子技术,尤其涉及一种相机参数读写方法、装置和终端设备。
背景技术
目前,在基于安卓等软件系统的相机应用中,用户可以通过相机应用的界面中的菜单或图标等对相机参数进行读写,从而设置相机参数。例如:用户可以通过在启动相机应用后,对锐度、饱和度和分辨率等参数进行读写,从而在相机重启后,应用这些参数。
现有的相机应用仅能够对软件系统的标准相机参数进行读写,这是由于包括三星、因特尔和高通等在内的各硬件平台虽各自提供了一些特有相机参数,但是这些硬件平台各自提供的特有相机参数,相互之间不能兼容,导致现有的相机应用,无法对各个硬件平台的特有相机参数直接进行读写。
发明内容
本申请实施例提供一种相机参数读写方法、装置和终端设备,用于解决现有技术中无法对各个硬件平台的特有相机参数进行读写的技术问题。
为达到上述目的,本申请的实施例采用如下技术方案:
第一方面,提供了一种相机参数读写方法,包括:
利用软件系统接口读取硬件平台的相机参数类,获得字符串,其中所述字符串包括用于描述相机参数的键和用于描述相机参数取值的键值;
对所述字符串进行解析,获得各组字符串;其中同组字符串的键用于描述相同相机参数;
将各组字符串中的每一组字符串作为一个节点,对所述各节点进行链接,获得数据源队列;
利用所述数据源队列初始化界面菜单,以使所述界面菜单显示包含相机参数和相机参数取值的选项;
获取在所述选项上所输入的相机参数读写指令;
根据所述相机参数读写指令,对所述选项中所包含的相机参数取值进行读写。
第二方面,提供了一种相机参数读写装置,包括:
读取模块,用于利用软件系统接口读取硬件平台的相机参数类,获得字符串,其中所述字符串包括用于描述相机参数的键和用于描述相机参数取值的键值;
解析模块,用于对所述字符串进行解析,获得各组字符串;其中同组字符串的键用于描述相同相机参数;
链接模块,用于将各组字符串中的每一组字符串作为一个节点,对所述各节点进行链接,获得数据源队列;
初始化模块,用于利用所述数据源队列初始化界面菜单,以使所述界面菜单显示包含相机参数和相机参数取值的选项;
输入模块,用于获取在所述选项上所输入的相机参数读写指令;
读写模块,用于根据所述相机参数读写指令,对所述选项中所包含的相机参数取值进行读写。
第三方面,提供了一种终端设备,其特征在于,包括如上所述的相机参数读写装置。
第四方面,本申请实施例提供一种相机参数读写装置,包括存储器、一个或多个处理器以及一个或多个程序,其中,所述一个或多个程序在由所述一个或多个处理器执行时执行下述操作:利用软件系统接口读取硬件平台的相机参数类,获得字符串,其中所述字符串包括用于描述相机参数的键和用于描述相机参数取值的键值;对所述字符 串进行解析,获得各组字符串;其中同组字符串的键用于描述相同相机参数;将各组字符串中的每一组字符串作为一个节点,对所述各节点进行链接,获得数据源队列;利用所述数据源队列初始化界面菜单,以使所述界面菜单显示包含相机参数和相机参数取值的选项;获取在所述选项上所输入的相机参数读写指令;根据所述相机参数读写指令,对所述选项中所包含的相机参数取值进行读写。
第五方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机可执行指令,所述计算机可执行指令响应于执行使得相机参数读写装置执行操作,所述操作包括:利用软件系统接口读取硬件平台的相机参数类,获得字符串,其中所述字符串包括用于描述相机参数的键和用于描述相机参数取值的键值;对所述字符串进行解析,获得各组字符串;其中同组字符串的键用于描述相同相机参数;将各组字符串中的每一组字符串作为一个节点,对所述各节点进行链接,获得数据源队列;利用所述数据源队列初始化界面菜单,以使所述界面菜单显示包含相机参数和相机参数取值的选项;获取在所述选项上所输入的相机参数读写指令;根据所述相机参数读写指令,对所述选项中所包含的相机参数取值进行读写。
本申请实施例,利用软件系统接口读取硬件平台的相机参数类,获得字符串之后,对字符串进行解析,获得各组字符串,进而将各组字符串中的每一组字符串作为一个节点,对各节点进行链接,获得数据源队列,以利用数据源队列初始化界面菜单,使得界面菜单显示包含相机参数和相机参数取值的选项,从而用户可以通过界面菜单对相机参数进行读写,解决现有技术中无法对各个硬件平台的特有相机参数进行读写的技术问题。
附图说明
图1为本申请实施例一提供的一种相机参数读写方法的流程示意图;
图2为实现相机参数读写方法的类图;
图3为实现相机参数读写方法的逻辑图;
图4为本申请实施例二提供的一种相机参数读写装置的结构示意图;
图5为实施例二提供的另一种相机参数读写装置的结构示意图;
图6为实施例二提供的又一种相机参数读写装置的结构示意图;
图7为实施例四提供的相机参数读写装置的结构示意图;
图8为实施例五提供的用于相机参数读写的计算机程序产品的结构示意图。
具体实施方式
下面结合附图对本申请实施例提供的相机参数读写方法、装置和终端设备进行详细描述。
实施例一
图1为本申请实施例一提供的一种相机参数读写方法的流程示意图,本实施例所提供的方法可以由运行在终端设备上的相机应用实施,该终端设备配置有软件系统,以及硬件平台,如图1所示,方法包括:
步骤101、利用软件系统接口读取硬件平台的相机参数类,获得字符串。
其中,字符串包括用于描述相机参数的键和用于描述相机参数取值的键值。
步骤102、对字符串进行解析,获得各组字符串。
其中,同组字符串的键用于描述相同相机参数。
具体的,确认当前字符串的类型,其中,类型为枚举类型或范围类型或单值类型。进而判断当前字符串是否属于已创建的对应类型下各组字符串中的一组;若当前字符串属于已创建的对应类型下各组字符串中的一组,则将当前字符串插入到所属的一组字符串中;若当前字符串不属于已创建的对应类型下各组字符串,则创建包含当前字符串的一组字符串。
例如:当前字符串的键至少包含后缀“-values”时,则确定当前字符串的类型为枚举类型;当前字符串的键至少包含后缀“-min”、后缀“-step”、前缀“max-”和/或“min-”时,则确定当前字符串的 类型为范围类型;若当前字符串的类型不为枚举类型和范围类型中的一种,则确定字符串的类型为单值类型。
步骤103、将各组字符串中的每一组字符串作为一个节点,对各节点进行链接,获得数据源队列。
步骤104、利用数据源队列初始化界面菜单,以使界面菜单显示包含相机参数和相机参数取值的选项。
步骤105、获取在选项上所输入的相机参数读写指令。
其中,相机参数读写指令包括所需读取的相机参数,和/或所需修改的相机参数取值。
具体的,用户可以在相机应用的界面菜单上点击所需修改的相机参数的选项,从而显示该选项所包含的相机参数以及对应的相机参数取值。用户可以通过在该选项中输入新的相机参数取值对相机参数进行修改。
步骤106、根据相机参数读写指令,对选项中所包含的相机参数取值进行读写。
为了清楚说明本实施例,本实施例还提供了一种具体的软件实现方法,通过新建一参数类实现接口,图2为实现相机参数读写方法的类图,如图2所示,其中基类包括:
IParamNode
:static bool isNodeType(String)  //是否此类型
:static void createNode(String)  //创建ParamNode,设置key
:void setData(String)          //设置value
:void prepareValueList()       //根据value预处理list
:List<String>getValues()      //读取list
:int getType()                //读取类型
:bool contentKey(String)      /判断key是否相同
:String getDisplayItem()       //返回显示字符串
:String setDeviceParam(int)    //输入list下标,设置真实key和value到设备中
另外,三个子类ParamNode分别用于确定枚举类型或范围类型或单值类型,包括:
枚举类型ParamNode,后缀为“-values”…;
范围类型ParamNode,后缀为“-min”,“-step”…,前缀为“max-”,“min-”…;
单值类型ParamNode,isNodeType永远返回true。
图3为实现相机参数读写方法的逻辑图,在系统中运行上述代码,则可以实现如图3所示的逻辑:
首先,通过代码mDevice=Camera.open实现相机初始化,通过代码Parameters p=Camera.getParameters();
String str=p.flatten();
读取相机参数类,获得字符串。
进而,判断是否可以读取字符串中的一对参数,即键和键值,若是,则顺序遍历所有类型的子类ParamNode,isNodeType(key)为真时,确定nCurType类为当前类型,否则,遍历链表节点调用prepareValueList类。
其中,在确定nCurType为当前类型之后,遍历链表节点,判断是否有contentKey(key)为真的节点,若是,则插入该节点,进而在查询到的该节点为单值类型,则将节点转为nCurType的ParamNode,若否则调用nCurType类createNode(key),链接节点到链表中。然后,通过代码setData(value)进行赋值,并返回执行判断是否可以读取字符串中的一对参数的步骤。
从而,执行图3所示的逻辑之后,顺序读取节点链接,添加到应用的界面菜单中,主菜单显示列表为遍历链表查到的所有节点显示字符串getDisplayItem,设置主菜单onItemClicked响应事件,显示二级菜单列表为选中主菜单列表项节点的getValues。设置二级菜单onItemClicked响应事件,调用节点的setDeviceParam。
本申请实施例,利用软件系统接口读取硬件平台的相机参数类,获得字符串之后,对字符串进行解析,获得各组字符串,进而将各组 字符串中的每一组字符串作为一个节点,对各节点进行链接,获得数据源队列,以利用数据源队列初始化界面菜单,使得界面菜单显示包含相机参数和相机参数取值的选项,从而用户可以通过界面菜单对相机参数进行读写,解决现有技术中无法对各个硬件平台的特有相机参数进行读写的技术问题。
实施例二
图4为本申请实施例二提供的一种相机参数读写装置的结构示意图,本实施例所提供的装置可以设置于终端设备中,如图4所示,包括:读取模块41、解析模块42、链接模块43、初始化模块44、输入模块45和读写模块46。
读取模块41,用于利用软件系统接口读取硬件平台的相机参数类,获得字符串。
其中,所述字符串包括用于描述相机参数的键和用于描述相机参数取值的键值。
解析模块42,用于对读取模块41所读取的字符串进行解析,获得各组字符串。
其中,同组字符串的键用于描述相同相机参数。
链接模块43,用于将解析模块42所获得的各组字符串中的每一组字符串作为一个节点,对所述各节点进行链接,获得数据源队列。
初始化模块44,用于利用链接模块43所获得的数据源队列初始化界面菜单,以使所述界面菜单显示包含相机参数和相机参数取值的选项。
输入模块45,用于获取在所述选项上所输入的相机参数读写指令。
读写模块46,用于根据输入模块45所获取的相机参数读写指令,对所述选项中所包含的相机参数取值进行读写。
进一步,本实施例还提供了另一种相机参数读写装置,图5为实施例二提供的另一种相机参数读写装置的结构示意图,如图5所示, 在图4所示的相机参数读写装置的基础上,解析模块42,包括:确认单元421、判断单元422、插入单元423和创建单元424。
确认单元421,用于确认当前字符串的类型。
其中,类型为枚举类型或范围类型或单值类型。
判断单元422,用于判断当前字符串是否属于已创建的对应类型下各组字符串中的一组。
插入单元423,用于若判断单元422判断出当前字符串属于已创建的对应类型下各组字符串中的一组,则将当前字符串插入到所属的一组字符串中。
创建单元424,用于若判断单元422判断出当前字符串不属于已创建的对应类型下各组字符串,则创建包含当前字符串的一组字符串。
进一步,本实施例还提供了另一种相机参数读写装置,图6为实施例二提供的又一种相机参数读写装置的结构示意图,如图6所示,在图5所示的相机参数读写装置的基础上,确认单元421,包括:枚举子单元4211、范围子单元4212和单值子单元4213。
枚举子单元4211,用于当前字符串的键至少包含后缀“-values”时,则确定当前字符串的类型为枚举类型。
范围子单元4212,用于当前字符串的键至少包含后缀“-min”、后缀“-step”、前缀“max-”和/或“min-”时,则确定当前字符串的类型为范围类型。
单值子单元4213,用于若当前字符串的类型不为枚举类型和范围类型中的一种,则确定字符串的类型为单值类型。
本申请实施例,利用软件系统接口读取硬件平台的相机参数类,获得字符串之后,对字符串进行解析,获得各组字符串,进而将各组字符串中的每一组字符串作为一个节点,对各节点进行链接,获得数据源队列,以利用数据源队列初始化界面菜单,使得界面菜单显示包含相机参数和相机参数取值的选项,从而用户可以通过界面菜单对相机参数进行读写,解决现有技术中无法对各个硬件平台的特有相机参数进行读写的技术问题。
实施例三
本实施例提供了一种终端设备,包括实施例二中所提供的相机参数读写装置。终端设备配置有软件系统,以及硬件平台。
终端设备,利用软件系统接口读取硬件平台的相机参数类,获得字符串,其中所述字符串包括用于描述相机参数的键和用于描述相机参数取值的键值;对所述字符串进行解析,获得各组字符串;其中同组字符串的键用于描述相同相机参数;将各组字符串中的每一组字符串作为一个节点,对所述各节点进行链接,获得数据源队列;利用所述数据源队列初始化界面菜单,以使所述界面菜单显示包含相机参数和相机参数取值的选项;获取在所述选项上所输入的相机参数读写指令;根据所述相机参数读写指令,对所述选项中所包含的相机参数取值进行读写。
其中,终端设备对所述字符串进行解析,获得各组字符串,包括:终端设备确认当前字符串的类型;所述类型为枚举类型或范围类型或单值类型;判断当前字符串是否属于已创建的对应类型下各组字符串中的一组;若当前字符串属于已创建的对应类型下各组字符串中的一组,则将当前字符串插入到所属的一组字符串中;若当前字符串不属于已创建的对应类型下各组字符串,则创建包含当前字符串的一组字符串。
进一步,终端设备确认当前字符串的类型,包括:当前字符串的键至少包含后缀“-values”时,则终端设备确定当前字符串的类型为枚举类型;当前字符串的键至少包含后缀“-min”、后缀“-step”、前缀“max-”和/或“min-”时,则终端设备确定当前字符串的类型为范围类型;若当前字符串的类型不为枚举类型和范围类型中的一种,则终端设备确定字符串的类型为单值类型。
本申请实施例,利用软件系统接口读取硬件平台的相机参数类,获得字符串之后,对字符串进行解析,获得各组字符串,进而将各组字符串中的每一组字符串作为一个节点,对各节点进行链接,获得数 据源队列,以利用数据源队列初始化界面菜单,使得界面菜单显示包含相机参数和相机参数取值的选项,从而用户可以通过界面菜单对相机参数进行读写,解决现有技术中无法对各个硬件平台的特有相机参数进行读写的技术问题。
实施例四
图7为实施例四提供的相机参数读写装置的结构示意图。如图7所示,本申请实施例的相机参数读写装置包括:存储器61、一个或多个处理器62以及一个或多个程序63。
其中,所述一个或多个程序63在由一个或多个处理器62执行时执行上述实施例中的任意一种方法。
本申请实施例的相机参数读写装置,利用软件系统接口读取硬件平台的相机参数类,获得字符串之后,对字符串进行解析,获得各组字符串,进而将各组字符串中的每一组字符串作为一个节点,对各节点进行链接,获得数据源队列,以利用数据源队列初始化界面菜单,使得界面菜单显示包含相机参数和相机参数取值的选项,从而用户可以通过界面菜单对相机参数进行读写,解决现有技术中无法对各个硬件平台的特有相机参数进行读写的技术问题。
实施例五
图8为实施例五提供的用于相机参数读写的计算机程序产品的结构示意图。如图8所示,本申请实施例的用于相机参数读写的计算机程序产品71,可以包括信号承载介质72。信号承载介质72可以包括一个或更多个指令73,该指令73在由例如处理器执行时,处理器可以提供以上针对图1-6描述的功能。例如,指令73可以包括:用于利用软件系统接口读取硬件平台的相机参数类,获得字符串,其中所述字符串包括用于描述相机参数的键和用于描述相机参数取值的键值的一个或多个指令;用于对所述字符串进行解析,获得各组字符串;其中同组字符串的键用于描述相同相机参数的一个或多个指令;用于将各组字符串中的每一组字符串作为一个节点,对所述各节点进行链 接,获得数据源队列的一个或多个指令;用于利用所述数据源队列初始化界面菜单,以使所述界面菜单显示包含相机参数和相机参数取值的选项的一个或多个指令;用于获取在所述选项上所输入的相机参数读写指令的一个或多个指令;以及根据所述相机参数读写指令,对所述选项中所包含的相机参数取值进行读写的一个或多个指令。因此,例如,参照图4,相机参数读写装置可以响应于指令73来进行图1中所示的步骤中的一个或更多个。
在一些实现中,信号承载介质72可以包括计算机可读介质74,诸如但不限于硬盘驱动器、压缩盘(CD)、数字通用盘(DVD)、数字带、存储器等。在一些实现中,信号承载介质72可以包括可记录介质75,诸如但不限于存储器、读/写(R/W)CD、R/W DVD等。在一些实现中,信号承载介质72可以包括通信介质76,诸如但不限于数字和/或模拟通信介质(例如,光纤线缆、波导、有线通信链路、无线通信链路等)。因此,例如,计算机程序产品71可以通过RF信号承载介质72传送给多指滑动手势的识别装置的一个或多个模块,其中,信号承载介质72由无线通信介质(例如,符合IEEE 802.11标准的无线通信介质)传送。
本申请实施例的计算机程序产品,利用软件系统接口读取硬件平台的相机参数类,获得字符串之后,对字符串进行解析,获得各组字符串,进而将各组字符串中的每一组字符串作为一个节点,对各节点进行链接,获得数据源队列,以利用数据源队列初始化界面菜单,使得界面菜单显示包含相机参数和相机参数取值的选项,从而用户可以通过界面菜单对相机参数进行读写,解决现有技术中无法对各个硬件平台的特有相机参数进行读写的技术问题。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、 磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。
最后应说明的是:以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。

Claims (7)

  1. 一种相机参数读写方法,其特征在于,包括:
    利用软件系统接口读取硬件平台的相机参数类,获得字符串,其中所述字符串包括用于描述相机参数的键和用于描述相机参数取值的键值;
    对所述字符串进行解析,获得各组字符串;其中同组字符串的键用于描述相同相机参数;
    将各组字符串中的每一组字符串作为一个节点,对所述各节点进行链接,获得数据源队列;
    利用所述数据源队列初始化界面菜单,以使所述界面菜单显示包含相机参数和相机参数取值的选项;
    获取在所述选项上所输入的相机参数读写指令;
    根据所述相机参数读写指令,对所述选项中所包含的相机参数取值进行读写。
  2. 根据权利要求1所述的相机参数读写方法,其特征在于,所述对所述字符串进行解析,获得各组字符串,包括:
    确认当前字符串的类型;所述类型为枚举类型或范围类型或单值类型;
    判断当前字符串是否属于已创建的对应类型下各组字符串中的一组;
    若当前字符串属于已创建的对应类型下各组字符串中的一组,则将当前字符串插入到所属的一组字符串中;
    若当前字符串不属于已创建的对应类型下各组字符串,则创建包含当前字符串的一组字符串。
  3. 根据权利要求2所述的相机参数读写方法,其特征在于,所述确认当前字符串的类型,包括:
    当前字符串的键至少包含后缀“-values”时,则确定当前字符串的类型为枚举类型;
    当前字符串的键至少包含后缀“-min”、后缀“-step”、前缀“max-” 和/或“min-”时,则确定当前字符串的类型为范围类型;
    若当前字符串的类型不为枚举类型和范围类型中的一种,则确定字符串的类型为单值类型。
  4. 一种相机参数读写装置,其特征在于,包括:
    读取模块,用于利用软件系统接口读取硬件平台的相机参数类,获得字符串,其中所述字符串包括用于描述相机参数的键和用于描述相机参数取值的键值;
    解析模块,用于对所述字符串进行解析,获得各组字符串;其中同组字符串的键用于描述相同相机参数;
    链接模块,用于将各组字符串中的每一组字符串作为一个节点,对所述各节点进行链接,获得数据源队列;
    初始化模块,用于利用所述数据源队列初始化界面菜单,以使所述界面菜单显示包含相机参数和相机参数取值的选项;
    输入模块,用于获取在所述选项上所输入的相机参数读写指令;
    读写模块,用于根据所述相机参数读写指令,对所述选项中所包含的相机参数取值进行读写。
  5. 根据权利要求4所述的相机参数读写装置,其特征在于,所述解析模块,包括:
    确认单元,用于确认当前字符串的类型;所述类型为枚举类型或范围类型或单值类型;
    判断单元,用于判断当前字符串是否属于已创建的对应类型下各组字符串中的一组;
    插入单元,用于若当前字符串属于已创建的对应类型下各组字符串中的一组,则将当前字符串插入到所属的一组字符串中;
    创建单元,用于若当前字符串不属于已创建的对应类型下各组字符串,则创建包含当前字符串的一组字符串。
  6. 根据权利要求5所述的相机参数读写装置,其特征在于,所述确认单元,包括:
    枚举子单元,用于当前字符串的键至少包含后缀“-values”时, 则确定当前字符串的类型为枚举类型;
    范围子单元,用于当前字符串的键至少包含后缀“-min”、后缀“-step”、前缀“max-”和/或“min-”时,则确定当前字符串的类型为范围类型;
    单值子单元,用于若当前字符串的类型不为枚举类型和范围类型中的一种,则确定字符串的类型为单值类型。
  7. 一种终端设备,其特征在于,包括权利要求4-6任一项所述的相机参数读写装置。
PCT/CN2016/089027 2015-11-20 2016-07-07 相机参数读写方法、装置和终端设备 WO2017084358A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510812340.9A CN105893283A (zh) 2015-11-20 2015-11-20 相机参数读写方法、装置和终端设备
CN201510812340.9 2015-11-20

Publications (1)

Publication Number Publication Date
WO2017084358A1 true WO2017084358A1 (zh) 2017-05-26

Family

ID=57002886

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/089027 WO2017084358A1 (zh) 2015-11-20 2016-07-07 相机参数读写方法、装置和终端设备

Country Status (2)

Country Link
CN (1) CN105893283A (zh)
WO (1) WO2017084358A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112631476A (zh) * 2020-12-29 2021-04-09 杭州晨安科技股份有限公司 一种基于sdl库的摄像机功能菜单显示方法

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107872668A (zh) * 2017-10-27 2018-04-03 深圳天珑无线科技有限公司 获取移动终端中相机像素值的方法、移动终端及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060061665A1 (en) * 2004-09-17 2006-03-23 Ortery Technologies, Inc. Method of remote capture with user interface providing separate inside-and outside-light-box modes
CN102662683A (zh) * 2011-12-30 2012-09-12 广东东研网络科技有限公司 基于键-值对格式的通信设备配置文件的生成和导入方法
CN103353835A (zh) * 2013-01-17 2013-10-16 珠海全志科技股份有限公司 Android系统Sensor HAL层兼容多种同种Sensor设备的移植处理方法及装置
CN103546689A (zh) * 2013-10-11 2014-01-29 Tcl集团股份有限公司 android系统外接摄像头的分辨率获取方法及装置
CN104252342A (zh) * 2013-06-27 2014-12-31 中兴通讯股份有限公司 一种可配置参数的嵌入式应用实现方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060061665A1 (en) * 2004-09-17 2006-03-23 Ortery Technologies, Inc. Method of remote capture with user interface providing separate inside-and outside-light-box modes
CN102662683A (zh) * 2011-12-30 2012-09-12 广东东研网络科技有限公司 基于键-值对格式的通信设备配置文件的生成和导入方法
CN103353835A (zh) * 2013-01-17 2013-10-16 珠海全志科技股份有限公司 Android系统Sensor HAL层兼容多种同种Sensor设备的移植处理方法及装置
CN104252342A (zh) * 2013-06-27 2014-12-31 中兴通讯股份有限公司 一种可配置参数的嵌入式应用实现方法及装置
CN103546689A (zh) * 2013-10-11 2014-01-29 Tcl集团股份有限公司 android系统外接摄像头的分辨率获取方法及装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112631476A (zh) * 2020-12-29 2021-04-09 杭州晨安科技股份有限公司 一种基于sdl库的摄像机功能菜单显示方法

Also Published As

Publication number Publication date
CN105893283A (zh) 2016-08-24

Similar Documents

Publication Publication Date Title
US11656859B2 (en) Data model API for live applications in a cloud collaboration platform
WO2018228211A1 (zh) 应用转换方法、装置及设备
US20190102201A1 (en) Component invoking method and apparatus, and component data processing method and apparatus
WO2021184725A1 (zh) 用户界面测试方法、装置、存储介质及计算机设备
US9614931B2 (en) Identifying a resource set require for a requested application and launching the resource set in a container for execution in a host operating system
EP2613259A1 (en) Method and computation node for processing application data
WO2013090476A1 (en) Lightweight framework for web applications
US10630399B2 (en) Testing distributed applications that have an established exchange in an advanced message queuing protocol (AMQP) message broker
US9207913B2 (en) API publication on a gateway using a developer portal
CN109145055A (zh) 一种基于Flink的数据同步方法和系统
US10216553B2 (en) Message oriented middleware with integrated rules engine
CN108595331B (zh) 异步接口的测试方法、介质、装置和计算设备
WO2017084358A1 (zh) 相机参数读写方法、装置和终端设备
CN116360735A (zh) 一种表单生成方法、装置、设备和介质
CN104737128A (zh) 用于多用户账户的二进制的重新使用
WO2009033424A1 (fr) Procédé et système d&#39;obtention d&#39;information de commandes d&#39;utilisateur et dispositif pour enregistrer les commandes d&#39;utilisateur
CN105389180B (zh) 一种基于Android平台的USB端口可配置化方法
CN114048415A (zh) 表单生成方法及装置、电子设备和计算机可读存储介质
CN109218338B (zh) 信息处理系统、方法和装置
CN113377770A (zh) 一种数据处理方法和装置
CN109144586A (zh) 一种驱动适配方法、装置、计算机设备及存储介质
WO2017020460A1 (zh) 一种集成插件的方法和装置
CN111666068B (zh) 一种平台开发框架、构建方法、设备及介质
CN113094086B (zh) 组件集成方法、装置、计算机可读存储介质及电子设备
CA2878759A1 (en) Methods and systems for providing software applications

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16865538

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16865538

Country of ref document: EP

Kind code of ref document: A1