Parameter setting method and device of machine vision system and storage medium
By providing an intuitive parameter setting interface in the machine vision system, users can intuitively adjust and confirm parameters, solving the problem of poor user experience in traditional interfaces and achieving more efficient parameter configuration process and development efficiency.
Patent Information
- Application Number
- CN202411822005.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-04-18
AI Technical Summary
The user experience of the parameter setting interface of traditional machine vision systems is poor, and it is difficult for users to configure parameters intuitively. They need to try different parameters repeatedly, which takes a long time.
It provides a parameter setting method for machine vision system, by obtaining the user's parameter adjustment input in the front-end parameter setting interface, updating the content displayed on the interface, and responding to the user's confirmation instruction, sending the parameter value to the back-end update system settings. This method uses QML script to build a parameter setting interface, provides intuitive input methods, such as parameter input boxes and sliders, and realizes efficient communication between the front and back ends through the signal and slot mechanism of the Qt framework.
Users can configure parameters more intuitively, reduce the operation time of repeatedly trying different parameters, improve user experience, and simplify interface development through QML's declarative syntax and improve development efficiency.
Smart Images

Figure CN119847653A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of industrial vision technology, and in particular, relates to a parameter setting method, device and storage medium for a machine vision system. Background Art
[0002] In machine vision systems, the parameter setting interface is a key user interaction component. Operators can use the parameter setting interface to adjust and configure various system parameters to adapt to different detection tasks and environmental conditions.
[0003] The parameter setting interface of traditional machine vision systems is usually built using traditional programming methods. Developers use C++ language or professional GUI (Graphical User Interface) libraries, such as Qt Widgets and Microsoft Foundation Classes, to manually write interface layout and user interaction logic. However, most of the interface elements in the interface developed in this way are static, making it difficult for users to configure parameters intuitively. They need to repeatedly try different parameters, which is time-consuming and leads to a poor user experience. Summary of the invention
[0004] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a parameter setting method, device and storage medium for a machine vision system, so that users can configure parameters more intuitively, reduce the operation time of repeatedly trying different parameters, and thus improve the user experience.
[0005] In a first aspect, the present application provides a method for setting parameters of a machine vision system, comprising:
[0006] Get the parameter adjustment input from the user in the front-end parameter setting interface;
[0007] updating the display content of the parameter setting interface according to the parameter adjustment input; the display content includes the parameter value corresponding to the parameter adjustment input;
[0008] In response to a confirmation instruction triggered by the user, the parameter value is sent to the back end, so that the back end updates the settings of the machine vision system according to the parameter value.
[0009] According to the parameter setting method of the machine vision system of the present application, the parameter adjustment input of the user in the front-end parameter setting interface is obtained; the display content of the parameter setting interface is updated according to the parameter adjustment input; the display content includes the parameter value corresponding to the parameter adjustment input; in response to the confirmation instruction triggered by the user, the parameter value is sent to the back end, so that the back end updates the settings of the machine vision system according to the parameter value. By providing a parameter setting interface, the embodiment of the present application allows the user to directly input or adjust the required parameters on the parameter setting interface, and the interface can immediately update the display content so that the user can instantly see the content of the parameter adjustment. When the user is satisfied and confirms these parameters, these parameter values will be sent to the back end, and the back end will then update the configuration of the machine vision system according to these parameter values, so that the user can configure the parameters more intuitively, reduce the operation time of repeatedly trying different parameters, and improve the user experience.
[0010] According to an embodiment of the present application, before obtaining the parameter adjustment input of the user in the front-end parameter setting interface, the method further includes:
[0011] Determine the layout and style of the interface elements according to the parameter setting requirements of the machine vision system; the interface elements include at least one of a parameter input box, a slider, and a button;
[0012] A QML script is used to construct a parameter setting interface according to the layout and style of the interface elements.
[0013] In this embodiment, by planning the layout and style of interface elements according to parameter setting requirements, developers can quickly customize the parameter setting interface for different scenarios to adapt to various application requirements, thereby improving the flexibility of the parameter setting interface. By using QML declarative syntax, developers can quickly build a parameter setting interface through concise code, eliminating a large amount of cumbersome code in traditional interface development, especially in scenarios where the interface needs to be modified frequently, significantly improving the development efficiency of the parameter setting interface.
[0014] According to an embodiment of the present application, obtaining the parameter adjustment input of the user in the front-end parameter setting interface includes:
[0015] Acquire the input data of the user in the parameter input box and / or the sliding operation of the user on the slider;
[0016] The input data and / or the sliding operation is determined as the parameter adjustment input.
[0017] In this embodiment, by providing an intuitive input method, the user can directly type a value in the parameter input box, or intuitively adjust the parameter value through the slider. These operations can be identified as parameter adjustment inputs, allowing the user to accurately control the changes in parameters, thereby enhancing the interactivity between the user and the machine vision system parameter setting interface.
[0018] According to one embodiment of the present application, in response to a confirmation instruction triggered by a user, sending the parameter value to a backend so that the backend updates the setting of the machine vision system according to the parameter value includes:
[0019] Call the slot function of the backend;
[0020] The parameter value is input into the slot function of the backend to send the parameter value to the backend.
[0021] In this embodiment, through the signal and slot mechanism provided by the Qt framework, when the user submits the parameter value through the confirmation instruction, the back-end slot function will be called, and the parameter value will be directly input into the back-end slot function, thereby realizing efficient communication between the front-end parameter setting interface and the back-end.
[0022] According to one embodiment of the present application, after sending the parameter value to the backend in response to a confirmation instruction triggered by the user, the method further includes:
[0023] Obtaining a feedback signal after the back end updates the settings of the machine vision system according to the parameter value;
[0024] Feedback information is displayed on the parameter setting interface according to the feedback signal.
[0025] In this embodiment, through the signal and slot mechanism of the Qt framework, changes in the front-end parameter setting interface can be efficiently transmitted to the back-end, and the back-end processing results can also be quickly reflected on the interface through feedback signals, realizing real-time feedback and response of parameter settings, allowing users to understand the results of parameter settings in a timely manner, and improving the interactivity of the parameter setting interface.
[0026] According to one embodiment of the present application, the method further includes:
[0027] Determine the target interface elements that need to be encapsulated;
[0028] Encapsulate the target interface element as a QML component.
[0029] In this embodiment, since the parameter setting interface is developed using QML, the interface is decoupled from the business logic, and specific interface elements are encapsulated into independent QML components. These QML components can be reused in different interfaces or systems, thereby reducing repetitive development work and lowering the system development and maintenance costs.
[0030] In a second aspect, the present application provides a parameter setting device for a machine vision system, comprising:
[0031] The acquisition module is used to obtain the parameter adjustment input of the user in the front-end parameter setting interface;
[0032] An updating module, used to update the display content of the parameter setting interface according to the parameter adjustment input; the display content includes the parameter value corresponding to the parameter adjustment input;
[0033] The sending module is used to send the parameter value to the back end in response to a confirmation instruction triggered by the user, so that the back end updates the setting of the machine vision system according to the parameter value.
[0034] According to the parameter setting device of the machine vision system of the present application, the parameter adjustment input of the user in the front-end parameter setting interface is obtained; the display content of the parameter setting interface is updated according to the parameter adjustment input; the display content includes the parameter value corresponding to the parameter adjustment input; in response to the confirmation instruction triggered by the user, the parameter value is sent to the back end, so that the back end updates the settings of the machine vision system according to the parameter value. By providing a parameter setting interface, the embodiment of the present application allows the user to directly input or adjust the required parameters on the parameter setting interface, and the interface can immediately update the display content so that the user can instantly see the content of the parameter adjustment. When the user is satisfied and confirms these parameters, these parameter values will be sent to the back end, and the back end will then update the configuration of the machine vision system according to these parameter values, so that the user can configure the parameters more intuitively, reduce the operation time of repeatedly trying different parameters, and improve the user experience.
[0035] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for setting parameters of a machine vision system as described in the first aspect above is implemented.
[0036] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for setting parameters of a machine vision system as described in the first aspect above is implemented.
[0037] In a fifth aspect, the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the parameter setting method of the machine vision system as described in the first aspect above.
[0038] In a sixth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the parameter setting method for a machine vision system as described in the first aspect above.
[0039] The above one or more technical solutions in the embodiments of the present application have at least one of the following technical effects:
[0040] According to the parameter setting method of the machine vision system of the present application, the parameter adjustment input of the user in the front-end parameter setting interface is obtained; the display content of the parameter setting interface is updated according to the parameter adjustment input; the display content includes the parameter value corresponding to the parameter adjustment input; in response to the confirmation instruction triggered by the user, the parameter value is sent to the back end, so that the back end updates the settings of the machine vision system according to the parameter value. By providing a parameter setting interface, the embodiment of the present application allows the user to directly input or adjust the required parameters on the parameter setting interface, and the interface can immediately update the display content so that the user can instantly see the content of the parameter adjustment. When the user is satisfied and confirms these parameters, these parameter values will be sent to the back end, and the back end will then update the configuration of the machine vision system according to these parameter values, so that the user can configure the parameters more intuitively, reduce the operation time of repeatedly trying different parameters, and improve the user experience.
[0041] Furthermore, in some embodiments, by planning the layout and style of interface elements according to parameter setting requirements, developers can quickly customize the parameter setting interface for different scenarios to adapt to various application requirements, thereby improving the flexibility of the parameter setting interface. By using QML declarative syntax, developers can quickly build a parameter setting interface through concise code, eliminating a large amount of cumbersome code in traditional interface development, and significantly improving the development efficiency of the parameter setting interface, especially in scenarios where the interface needs to be modified frequently.
[0042] Furthermore, in some embodiments, by providing intuitive input methods, users can directly type values in the parameter input box, or intuitively adjust parameter values through sliders. These operations can be identified as parameter adjustment inputs, allowing users to accurately control parameter changes, thereby enhancing the interactivity between users and the machine vision system parameter setting interface.
[0043] Furthermore, in some embodiments, through the signal and slot mechanism provided by the Qt framework, when the user submits the parameter value through the confirmation instruction, the back-end slot function will be called, and the parameter value will be directly input into the back-end slot function, thereby realizing efficient communication between the front-end parameter setting interface and the back-end.
[0044] Furthermore, in some embodiments, through the signal and slot mechanism of the Qt framework, changes in the front-end parameter setting interface can be efficiently transmitted to the back-end, and the back-end processing results can also be quickly reflected in the interface through feedback signals, realizing real-time feedback and response of parameter settings, allowing users to understand the results of parameter settings in a timely manner, and improving the interactivity of the parameter setting interface.
[0045] Furthermore, in some embodiments, since the parameter setting interface is developed using QML, the interface is decoupled from the business logic, and specific interface elements are encapsulated into independent QML components. These QML components can be reused in different interfaces or systems, thereby reducing repetitive development work and lowering the development and maintenance costs of the system.
[0046] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0048] Figure 1 It is a flow chart of a method for setting parameters of a machine vision system provided in an embodiment of the present application;
[0049] Figure 2 is a schematic diagram of the structure of a parameter setting device for a machine vision system provided in an embodiment of the present application;
[0050] Figure 3 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0052] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0053] The following, in conjunction with the accompanying drawings, describes in detail the parameter setting method, device and storage medium of the machine vision system provided by the embodiments of the present application through specific embodiments and their application scenarios.
[0054] Among them, the parameter setting method of the machine vision system can be applied to the terminal, and can be specifically executed by hardware or software in the terminal.
[0055] The terminal includes, but is not limited to, a portable communication device such as a mobile phone or tablet computer with a touch-sensitive surface (e.g., a touch screen display and / or a touch pad). It should also be understood that in some embodiments, the terminal may not be a portable communication device, but a desktop computer with a touch-sensitive surface (e.g., a touch screen display and / or a touch pad).
[0056] In the following various embodiments, a terminal including a display and a touch-sensitive surface is described. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, a mouse and a joystick.
[0057] The parameter setting method for a machine vision system provided in an embodiment of the present application may be executed by an electronic device or a functional module or functional entity in the electronic device that can implement the parameter setting method for the machine vision system. The electronic devices mentioned in the embodiment of the present application include but are not limited to mobile phones, tablet computers, computers, cameras, wearable devices, etc. The parameter setting method for a machine vision system provided in an embodiment of the present application is described below using an electronic device as an example of the execution subject.
[0058] like Figure 1 As shown, the parameter setting method of the machine vision system includes: step 110, step 120 and step 130.
[0059] Step 110: Obtain the parameter adjustment input of the user in the front-end parameter setting interface.
[0060] A machine vision system refers to a system that uses computer vision technology, combined with cameras, image processing software or artificial intelligence algorithms, to automatically acquire, analyze and understand image information. Machine vision systems can be applied to industrial automation, quality control, robot guidance and other fields. For example, in the field of industrial automation, machine vision systems can be used for product quality inspection. In one example, parts on a factory production line can be scanned by a machine vision system, and the system will identify the shape, color and defects (such as dents, cracks, etc.) of the parts. If an abnormality is found, the system will automatically mark and notify manual or automatic removal of defective products.
[0061] The parameter setting interface can be a user graphical interface, through which the user can customize and adjust various parameters in the machine vision system to adapt to different detection tasks and environmental conditions. For example, through the parameter setting interface, the user can adjust image acquisition parameters, such as exposure time, gain, resolution, etc.; can also adjust image processing parameters, such as filter type, threshold, edge detection sensitivity, etc.; can also adjust machine vision algorithm parameters, such as template matching size, shape recognition size range, etc. Of course, other parameters can also be adjusted, and the embodiments of the present application are not limited to this.
[0062] In the embodiment of the present application, the parameter setting interface may include one or more interface elements for adjusting parameters, and the interface elements for adjusting parameters may include input boxes, sliders, drop-down options, buttons, etc. The user may adjust the parameter value by operating the interface elements. The parameter adjustment input of the user in the front-end parameter setting interface is obtained by monitoring the user's operation on the interface elements.
[0063] Step 120: Update the display content of the parameter setting interface according to the parameter adjustment input; the display content includes the parameter value corresponding to the parameter adjustment input.
[0064] In an embodiment of the present application, the parameter setting interface may include one or more interface elements for adjusting parameters, and the interface elements for adjusting parameters may include input boxes, sliders, drop-down options, buttons, etc. The user may adjust the parameter values by operating the interface elements. The parameter setting interface may also include a display area, and the display content of the display area may include parameter values corresponding to the parameter adjustment input. For example, the display area may be one or more. If the display area is one, the display area may be set in a more prominent position in the parameter setting interface, such as the upper middle position of the interface. If the display area is multiple, it may be set next to multiple interface elements for adjusting parameters, and each display area displays the parameter values corresponding to each interface element.
[0065] In one example, assume that a user is adjusting the brightness parameter of a machine vision system used to detect parts. The user finds a slider on the parameter setting interface, which can be used to adjust the brightness parameter. The user moves the slider from the middle position to the left to reduce the brightness. It should be noted that since the slider itself does not display the brightness value, the user cannot know the specific brightness value adjusted during the movement of the slider from the slider. In order to provide the user with immediate visual feedback so that the user can configure the parameters more intuitively, a display area can be set on the parameter setting interface. The display area can be located next to the slider. After detecting the position change of the slider, the new brightness value is determined according to the position offset of the slider (for example, from 50% to 30%), the new brightness value is read and stored, and the display content is updated in the display area to "30%" to reflect the current brightness setting. If the user continues to adjust the slider, the parameter value display in the display area will continue to update to provide the user with immediate visual feedback.
[0066] In one example, dynamic interface updates can be implemented through QML (Qt Modeling Language) scripts, and the display content of the parameter setting interface can be adjusted in real time according to different parameter adjustment inputs:
[0067] qmlCopy code
[0068] Item{
[0069] width:400
[0070] height:300
[0071] ParameterInput{
[0072] id:dynamicInput
[0073] }
[0074] Text{
[0075] visible:dynamicInput.text.length>0
[0076] text:"Current value:"+dynamicInput.text
[0077] }
[0078] }
[0079] Among them, Item is a container element that defines a rectangular area to contain other interface elements. In this example, the width and height of Item are set to 400 and 300 pixels respectively. ParameterInput is a custom component. For example, it can be an interface element used to set parameters in the parameter setting interface. The parameter adjustment input can be obtained through this interface element. Here, an identifier dynamicInput is set for this component through the id attribute to facilitate the reference of the component in other places. Text is a text display element. The visible property of Text is bound to dynamicInput.text.length>0, which means that the Text element will only be displayed when there is input in dynamicInput. The text property defines the text to be displayed by the Text element. Here, "Current value:" plus the parameter value corresponding to the parameter adjustment input is displayed.
[0080] Step 130 , in response to a confirmation instruction triggered by the user, the parameter value is sent to the back end, so that the back end updates the settings of the machine vision system according to the parameter value.
[0081] In an embodiment of the present application, the user can trigger a confirmation instruction in any manner. For example, the interface elements in the parameter setting interface may also include a "Confirm" button or an "Apply" button, etc. After adjusting the parameters, the user can click the "Confirm" button or the "Apply" button to confirm the parameter value. Detecting that the user clicks the "Confirm" button or the "Apply" button indicates that the user has triggered the confirmation instruction; after adjusting the parameters, the user can also press a specific key on the keyboard, such as the Enter key, to submit the confirmation parameter value. Detecting that the user presses a specific key indicates that the user has triggered the confirmation instruction; of course, the confirmation instruction can also be triggered in other ways, and the embodiment of the present application is not limited to this.
[0082] In the embodiment of the present application, the backend may be a software component running on a local computer or embedded device, which is responsible for processing the core functions of the machine vision system, such as image processing, data analysis, and control logic. For example, in the Qt framework, the backend may be a part written in C++, which includes business logic, data processing, and code for interacting with hardware.
[0083] After receiving the parameter value, the backend can verify the parameter value. If the verification is valid, the configuration of the machine vision system can be updated according to the parameter value. For example, the configuration file of the machine vision system can be modified, the parameters in the database can be updated, the machine learning model can be reloaded, or the configuration of the hardware device can be adjusted.
[0084] In one example, suppose a user is adjusting the parameters of a machine vision system used to detect product defects. The user increases the contrast of the image using a slider to better identify tiny cracks in the product. After the user has made the adjustment, he clicks the "Confirm" button, which triggers the confirmation instruction, and the front-end parameter setting interface sends the new contrast value to the back-end. After the back-end receives this parameter value, it can update the contrast parameter in the image processing module of the machine vision system. To improve interactivity, after the back-end confirms that the parameter update is complete, it can send a signal back to the front-end to indicate that the update is successful, so that the user knows that the changes have been applied to the machine vision system.
[0085] According to the parameter setting method of the machine vision system of the present application, the parameter adjustment input of the user in the front-end parameter setting interface is obtained; the display content of the parameter setting interface is updated according to the parameter adjustment input; the display content includes the parameter value corresponding to the parameter adjustment input; in response to the confirmation instruction triggered by the user, the parameter value is sent to the back end, so that the back end updates the settings of the machine vision system according to the parameter value. By providing a parameter setting interface, the embodiment of the present application allows the user to directly input or adjust the required parameters on the parameter setting interface, and the interface can immediately update the display content so that the user can instantly see the content of the parameter adjustment. When the user is satisfied and confirms these parameters, these parameter values will be sent to the back end, and the back end will then update the configuration of the machine vision system according to these parameter values, so that the user can configure the parameters more intuitively, reduce the operation time of repeatedly trying different parameters, and improve the user experience.
[0086] In some embodiments, before obtaining the parameter adjustment input of the user in the front-end parameter setting interface, the method further includes:
[0087] Determine the layout and style of the interface elements according to the parameter setting requirements of the machine vision system; the interface elements include at least one of a parameter input box, a slider, and a button;
[0088] Use QML scripts to build the parameter setting interface according to the layout and style of interface elements.
[0089] In this embodiment, before setting the parameter setting interface, it is necessary to design the layout and style of the interface elements according to the parameter setting requirements of the machine vision system, including determining how to arrange and the appearance style of interface elements such as parameter input boxes, sliders, buttons, etc. For example, for a scene that requires the user to adjust the brightness, a slider can be designed to adjust the brightness parameter, and an intuitive icon and label can be set to prompt that the slider is used to adjust the brightness.
[0090] QML is a declarative programming language that allows developers to quickly create interactive user interfaces. Once the layout and style of the interface elements are determined, the parameter setting interface can be constructed using QML scripts.
[0091] In an example, the parameter setting interface can be constructed according to the following code:
[0092] Item{
[0093] width:400
[0094] height:300
[0095] TextInput{
[0096] id:parameterInput
[0097] placeholderText:"Enter parameter value"
[0098] }
[0099] Slider{
[0100] id:parameterSlider
[0101] minimumValue:0
[0102] maximumValue:100
[0103] }
[0104] Button{
[0105] text:"Apply"
[0106] onClicked:applyParameters()
[0107] }
[0108] }
[0109] Among them, Item is a container element that defines a rectangular area for containing other interface elements. The width and height are set here to 400 and 300 pixels respectively. TextInput is a text input box where users can enter text. The id attribute is used to reference this element in other parts of the script. The placeholderText attribute defines the prompt text displayed when the text box is empty. Slider is a slider control that allows users to select a value within a range by sliding. MinimumValue and maximumValue define the minimum and maximum values of the slider respectively. Button is a button control that users can click to perform an action. The text attribute defines the text displayed on the button. onClicked is an event handler. When the button is clicked, the applyParameters function will be called to handle button click events, such as sending parameter values to the backend.
[0110] In this embodiment, by planning the layout and style of interface elements according to parameter setting requirements, developers can quickly customize the parameter setting interface for different scenarios to adapt to various application requirements, thereby improving the flexibility of the parameter setting interface. By using QML declarative syntax, developers can quickly build a parameter setting interface through concise code, eliminating a large amount of cumbersome code in traditional interface development, especially in scenarios where the interface needs to be modified frequently, significantly improving the development efficiency of the parameter setting interface.
[0111] In some embodiments, obtaining the parameter adjustment input of the user in the front-end parameter setting interface includes:
[0112] Obtaining the user's input data in the parameter input box and / or the user's sliding operation on the slider;
[0113] The input data and / or the sliding operation are determined as parameter adjustment input.
[0114] In this embodiment, the parameter setting interface may include a parameter input box, which may correspond to a parameter, such as image resolution, brightness, or any other parameter. The user may directly input the parameter value in the parameter input box. The input data of the user in the parameter input box may be determined as the parameter adjustment input of the user.
[0115] In this embodiment, the parameter setting interface may also include a slider, which may correspond to a parameter. The user may adjust the parameter value by dragging the slider with a mouse. The user's sliding operation on the slider, such as a sliding offset, may be determined as a parameter adjustment input, and the corresponding parameter value may be calculated based on the sliding offset. For example, when the slider is at the starting position, the corresponding parameter value is the minimum parameter value, and when the slider is at the ending position, the corresponding parameter value is the maximum parameter value.
[0116] In this embodiment, by providing an intuitive input method, the user can directly type a value in the parameter input box, or intuitively adjust the parameter value through the slider. These operations can be identified as parameter adjustment inputs, allowing the user to accurately control the changes in parameters, thereby enhancing the interactivity between the user and the machine vision system parameter setting interface.
[0117] In some embodiments, in response to a confirmation instruction triggered by a user, sending the parameter value to the backend so that the backend updates the settings of the machine vision system according to the parameter value includes:
[0118] Call the backend slot function;
[0119] Input the parameter value into the backend slot function to send the parameter value to the backend.
[0120] In this embodiment, the signal and slot mechanism provided by Qt can be used to achieve efficient communication between QML scripts and C++ backends. Among them, the signal and slot mechanism in the Qt framework is an advanced callback mechanism that provides a powerful way to handle interactions between objects. Signals are messages sent by Qt objects, indicating that an event has occurred or a condition has been met. The signal itself does not perform an operation, but only notifies other objects that an event has occurred. In Qt, signals are declared by class member functions and are usually declared as public member functions after the signals: keyword. Slots are ordinary member functions, and slot functions can respond to signals. Slots can exist in Qt objects and can be called by other objects. Slot functions can perform operations, including modifying the properties of objects, calling other slot functions, or sending new signals. Slot functions can be declared in class definitions using the slots: keyword.
[0121] In this embodiment, after the user triggers the confirmation instruction, a signal may be sent, which is used to indicate that the user has triggered the confirmation instruction. After receiving the signal, the backend slot function may be called, and the parameter value may be input into the backend slot function to send the parameter value to the backend. The following is an example to illustrate the process:
[0122] class VisionSystem:public QObject{
[0123] Q_OBJECT
[0124] public slots:
[0125] void applyParameters(){
[0126] / / Processing parameter application logic
[0127] emit parametersApplied();
[0128] }
[0129] signals:
[0130] void parametersApplied();
[0131] }
[0132] Among them, VisionSystem is a C++ class that inherits from QObject. The Q_OBJECT macro is the key to enable the signal and slot mechanism in the Qt framework. The public slots area defines the backend C++ function that can be called by QML, namely the slot function applyParameters. The slot function applyParameters can be called by the signal triggered by the user trigger confirmation instruction. After calling the slot function applyParameters, the parameter value can be read and passed to the slot function applyParameters. The backend can read the parameter value through the slot function applyParameters and update the settings of the machine vision system according to the parameter value. The signals area defines the signal parametersApplied that can be sent by the backend C++. After the update is completed, this signal can be used to notify the QML parameter setting interface that the update has been completed or the update has failed.
[0133] In this embodiment, through the signal and slot mechanism provided by the Qt framework, when the user submits the parameter value through the confirmation instruction, the back-end slot function will be called, and the parameter value will be directly input into the back-end slot function, thereby realizing efficient communication between the front-end parameter setting interface and the back-end.
[0134] In some embodiments, after sending the parameter value to the backend in response to the confirmation instruction triggered by the user, the method further includes:
[0135] Obtain feedback signals after the backend updates the settings of the machine vision system according to the parameter values;
[0136] Feedback information is displayed on the parameter setting interface according to the feedback signal.
[0137] In this embodiment, after the backend completes updating the settings of the machine vision system according to the parameter values, feedback can be provided through a feedback signal, and the feedback signal can include messages such as update success and update failure based on the update result. The parameter device interface can display corresponding feedback information according to the feedback signal. If the update is successful, the displayed feedback information can be update success, and if the update fails, the displayed feedback information can be update failure.
[0138] The following example illustrates the process:
[0139] Button{
[0140] text:"Apply"
[0141] onClicked:{
[0142] applyParameters()
[0143] statusLabel.text="Parameters applied successfully"
[0144] }
[0145] }
[0146] Label{
[0147] id:statusLabel
[0148] text:""
[0149] }
[0150] Among them, Button is a button control, the user can click it to perform an action, and the text attribute defines the text "Apply" displayed on the button. onClicked is an event handler. When the button is clicked, the code in the brackets will be executed. In this example, the event handler is part of the signal and slot mechanism in QML, which is used to define the operation that should be performed when a specific signal (such as a button click) occurs. applyParameters is the above-mentioned slot function. When the button is clicked, the slot function can be called to pass the parameter value to the backend. statusLabel indicates the feedback information after the backend updates the settings of the machine vision system through the parameter value. text defines the display text on the label. If the update is successful, the displayed text is update successful. Label is a text display element with the id statusLabel.
[0151] In some embodiments, the feedback signal may also include a prompt message indicating that the backend has successfully received the parameter value, and the parameter device interface may display corresponding feedback information, such as successful sending, based on the feedback signal.
[0152] In this embodiment, through the signal and slot mechanism of the Qt framework, changes in the front-end parameter setting interface can be efficiently transmitted to the back-end, and the back-end processing results can also be quickly reflected on the interface through feedback signals, realizing real-time feedback and response of parameter settings, allowing users to understand the results of parameter settings in a timely manner, and improving the interactivity of the parameter setting interface.
[0153] In some embodiments, the method further comprises:
[0154] Determine the target interface elements that need to be encapsulated;
[0155] Encapsulate the target interface element as a QML component.
[0156] In this embodiment, it is possible to determine which interface elements are commonly used, complex or need to be reused, and determine these interface elements as target interface elements. A new component file is created in QML, and the definition and implementation of the encapsulated element are contained in the file.
[0157] For example, you can encapsulate a general parameter input box component:
[0158] / / ParameterInput.qml
[0159] Item{
[0160] width:200
[0161] height:30
[0162] TextInput{
[0163] placeholderText:"Enter parameter value"
[0164] }
[0165] }
[0166] Among them, ParameterInput.qml is the QML file name. The QML file defines a universal parameter input box component. This component can be used in the parameter setting interface of different machine vision systems without rewriting the same code each time. Item is a container element that defines a rectangular area for containing other interface elements. The width and height are set here to 200 and 30 pixels respectively. TextInput is a text input box where users can enter text. The placeholderText attribute defines the prompt text displayed when the text input box is empty.
[0167] In this embodiment, since the parameter setting interface is developed using QML, the interface is decoupled from the business logic, and specific interface elements are encapsulated into independent QML components. These QML components can be reused in different interfaces or systems, thereby reducing repetitive development work and lowering the system development and maintenance costs.
[0168] The parameter setting method of the machine vision system provided in the embodiment of the present application can be executed by a parameter setting device of the machine vision system. In the embodiment of the present application, the parameter setting device of the machine vision system executing the parameter setting method of the machine vision system is used as an example to illustrate the parameter setting device of the machine vision system provided in the embodiment of the present application.
[0169] An embodiment of the present application also provides a parameter setting device for a machine vision system.
[0170] like Figure 2 As shown, the parameter setting device of the machine vision system includes:
[0171] The acquisition module 210 is used to acquire the parameter adjustment input of the user in the front-end parameter setting interface;
[0172] An updating module 220, configured to update the display content of the parameter setting interface according to the parameter adjustment input; the display content includes the parameter value corresponding to the parameter adjustment input;
[0173] The sending module 230 is used to send the parameter value to the back end in response to the confirmation instruction triggered by the user, so that the back end updates the settings of the machine vision system according to the parameter value.
[0174] According to the parameter setting device of the machine vision system of the present application, the parameter adjustment input of the user in the front-end parameter setting interface is obtained; the display content of the parameter setting interface is updated according to the parameter adjustment input; the display content includes the parameter value corresponding to the parameter adjustment input; in response to the confirmation instruction triggered by the user, the parameter value is sent to the back end, so that the back end updates the settings of the machine vision system according to the parameter value. By providing a parameter setting interface, the embodiment of the present application allows the user to directly input or adjust the required parameters on the parameter setting interface, and the interface can immediately update the display content so that the user can instantly see the content of the parameter adjustment. When the user is satisfied and confirms these parameters, these parameter values will be sent to the back end, and the back end will then update the configuration of the machine vision system according to these parameter values, so that the user can configure the parameters more intuitively, reduce the operation time of repeatedly trying different parameters, and improve the user experience.
[0175] In some embodiments, the acquisition module 210 is further configured to:
[0176] Determine the layout and style of the interface elements according to the parameter setting requirements of the machine vision system; the interface elements include at least one of a parameter input box, a slider, and a button;
[0177] Use QML scripts to build the parameter setting interface according to the layout and style of interface elements.
[0178] In some embodiments, the acquisition module 210 is further configured to:
[0179] Obtaining the user's input data in the parameter input box and / or the user's sliding operation on the slider;
[0180] The input data and / or the sliding operation are determined as parameter adjustment input.
[0181] In some embodiments, the sending module 230 is further configured to:
[0182] Call the backend slot function;
[0183] Input the parameter value into the backend slot function to send the parameter value to the backend.
[0184] In some embodiments, the sending module 230 is further configured to:
[0185] Obtain feedback signals after the backend updates the settings of the machine vision system according to the parameter values;
[0186] Feedback information is displayed on the parameter setting interface according to the feedback signal.
[0187] In some embodiments, the parameter setting device of the machine vision system further includes:
[0188] The encapsulation module is used to determine the target interface elements that need to be encapsulated; encapsulate the target interface elements as QML components.
[0189] The parameter setting device of the machine vision system in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than the terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0190] The parameter setting device of the machine vision system in the embodiment of the present application may be a device having an operating system. The operating system may be a Microsoft (Windows) operating system, an Android (Android) operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0191] In some embodiments, Figure 3 As shown, an embodiment of the present application also provides an electronic device 300, including a processor 301, a memory 302, and a computer program stored in the memory 302 and executable on the processor 301. When the program is executed by the processor 301, each process of the parameter setting method embodiment of the above-mentioned machine vision system is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0192] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0193] An embodiment of the present application also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the parameter setting method embodiment of the above-mentioned machine vision system are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0194] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0195] An embodiment of the present application also provides a computer program product, including a computer program, which implements the parameter setting method of the above-mentioned machine vision system when executed by a processor.
[0196] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0197] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned parameter setting method embodiment based on the machine vision system, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0198] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0199] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0200] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0201] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
[0202] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0203] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.
Claims
1. A method for setting parameters of a machine vision system, characterized in that: include: Get the parameter adjustment input from the user in the front-end parameter setting interface; updating the display content of the parameter setting interface according to the parameter adjustment input; The displayed content includes the parameter value corresponding to the parameter adjustment input; In response to a confirmation instruction triggered by the user, the parameter value is sent to the back end, so that the back end updates the settings of the machine vision system according to the parameter value.
2. The method according to claim 1, characterized in that: Before obtaining the parameter adjustment input from the user in the front-end parameter setting interface, it also includes: Determine the layout and style of the interface elements according to the parameter setting requirements of the machine vision system; the interface elements include at least one of a parameter input box, a slider, and a button; A QML script is used to construct a parameter setting interface according to the layout and style of the interface elements.
3. The method according to claim 2, characterized in that The obtaining of the parameter adjustment input of the user in the front-end parameter setting interface includes: Acquire the input data of the user in the parameter input box and / or the sliding operation of the user on the slider; The input data and / or the sliding operation is determined as the parameter adjustment input.
4. The method according to claim 2, characterized in that: The step of sending the parameter value to a backend in response to a confirmation instruction triggered by a user, so that the backend updates the settings of the machine vision system according to the parameter value, comprises: Call the slot function of the backend; The parameter value is input into the slot function of the backend to send the parameter value to the backend.
5. The method according to claim 4, characterized in that After the parameter value is sent to the backend in response to the confirmation instruction triggered by the user, the method further includes: Obtaining a feedback signal after the back end updates the settings of the machine vision system according to the parameter values; Feedback information is displayed on the parameter setting interface according to the feedback signal.
6. The method according to claim 2, characterized in that The method further comprises: Determine the target interface elements that need to be encapsulated; Encapsulate the target interface element as a QML component.
7. A parameter setting device for a machine vision system, characterized in that: include: The acquisition module is used to obtain the parameter adjustment input of the user in the front-end parameter setting interface; An updating module, used to update the display content of the parameter setting interface according to the parameter adjustment input; the display content includes the parameter value corresponding to the parameter adjustment input; The sending module is used to send the parameter value to the back end in response to a confirmation instruction triggered by the user, so that the back end updates the setting of the machine vision system according to the parameter value.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that The method comprises a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.