Thermal infrared imager man-machine interaction method based on FPGA
Technical Field
The invention relates to a thermal infrared imager man-machine interaction method, in particular to a thermal infrared imager man-machine interaction method based on an FPGA.
Background
The infrared refrigeration thermal imager is called a thermal imager for short, and the detector is stable in working state in a low-temperature environment, so that control instructions such as correction and the like need to be sent to the thermal imager before normal working. In addition, according to different use environments and targets, the thermal imager adopts gain parameters, brightness, internal and external synchronization, focal length and a plurality of application functions which need to be manually changed in real time. Therefore, the UI, User Interface, is an integral part of the thermal imager system.
Currently, there are two main methods for implementing UI design: one is to realize interface communication through peripheral interfaces of the computer, such as USB, serial ports and the like, and then send or receive control commands through upper computer software; the second is to realize human-computer interaction by expanding integrated chips, such as ARM, 51 and other series of single-chip microcomputers, in the system and calling interface and interface library functions. Because the first mode carries peripheral hardware more, be unfavorable for working for a long time in the environment that does not have lasting stable power supply condition, the second mode needs to expand resources on the system circuit board, increases system design complexity, is unfavorable for system reliability to increase research and development cost and consumption. The coe file is a common file that can be read by the FPGA.
Disclosure of Invention
The invention aims to provide a human-computer interaction method for a thermal infrared imager based on an FPGA (field programmable gate array), which solves the problems that the traditional method has more carried peripherals, is not favorable for working for a long time in an environment without lasting and stable power supply conditions, needs to expand resources on a system circuit board, increases the complexity of system design, is not favorable for system reliability, and increases the research and development cost and power consumption.
According to a first aspect of the invention, a thermal infrared imager man-machine interaction method based on an FPGA is provided, which comprises the following specific steps:
first step of building a human-computer interaction system
The human-computer interaction system comprises: the device comprises a key control module, a character module generating module and an coe file generating module.
The key control module has the functions as follows: and the movement of the highlight button of the interface is controlled through an external key, so that the man-machine interaction is realized.
The matrix generation module has the functions of: and generating a character font required by the highlighted interface button, and generating a txt file.
coe the file generation module functions as: the. coe file is generated for each line of text using matlab.
The second step is that the key control module controls the movement of the interface keys on the display interface
The key control module has seven key functions, and the key functions are as follows: open menu, close menu, confirm, move up, move down, move left, and move right. After the menu is opened, a corresponding input command is obtained through the key function, and then the selection of menu options is controlled, and the key function confirms that the corresponding control command is sent to the front end. After closing the menu, only the open menu responds. The direction key includes: moving up, moving down, moving left and moving right, and placing the highlight at the menu function key position corresponding to the control menu through the direction key.
Thirdly, generating a matrix file by a matrix generation module
The size of the whole frame image of the control menu is M x N pixels, the number of pixels occupied by a single word is a x b pixels, one frame image is divided into x y areas, each area displays one word, and the word module generation module generates 1 txt file from 1 area word.
M, N are the row and column of the whole frame image of the control menu; a. b is the row and column of the pixel occupied by the single word; x and y are the row number and column number of the region respectively. a x M, b y N.
The fourth step coe File Generation Module generates coe files
The. coe file for each line of text of the control menu is generated using matlab. The coe file generation module keeps the header format of the first coe file, concatenates all the district characters in a coe file, and finally generates a coe file for reading by the FPGA. The coe file is stored in the ROM, and the FPGA calls the data in the ROM after being electrified.
Therefore, the man-machine interaction of the thermal infrared imager based on the FPGA is completed.
Preferably, the size of the whole frame image of the control menu is: 640 x 512, 640 x 320, 512 x 240 or 512 x 512.
Preferably, when the size of the whole frame image of the control menu is 640 × 512 pixels, the number of pixels occupied by a single word is 16 × 32 pixels, and one frame image is divided into 40 × 16 zones.
According to a second aspect of the present invention, there is provided a human-computer interaction system comprising: the device comprises a key control module, a character module generating module and an coe file generating module.
The key control module has the functions as follows: and the movement of the highlight button of the interface is controlled through an external key, so that the man-machine interaction is realized.
The matrix generation module has the functions of: and generating a character font required by the highlighted interface button, and generating a txt file.
coe the file generation module functions as: the. coe file is generated for each line of text using matlab.
Because the real-time requirement of the thermal imager is high, the acquired image data is subjected to FPGA image preprocessing, then is transmitted to the communication interface in real time, is transmitted to the display or the upper computer, and is further processed according to subsequent requirements. Therefore, the creation of the human-computer interface is added to the data stream. The invention adopts the low-gray-scale value pixels to construct the graph, the graph is stored in the ROM of the FPGA, the reading is controlled according to the time sequence signal, the partial pixel values of the collected image are replaced, and then the gray difference is formed between the collected image and the peripheral high-gray-scale image, thereby completing the manufacture of the graphical interface. The invention utilizes the existing FPGA chip of the thermal imager system, writes the selectable operation interface on the output gray level image, utilizes 7 buttons to realize man-machine interaction, saves cost, reduces power consumption and does not increase the peripheral equipment of the system. The problem that more peripherals are needed or resources on a system circuit board are increased when the thermal imager is controlled is successfully solved. The verification proves that the method has the advantages of stable work, concise interface and convenient operation.
Detailed Description
Example 1
The thermal infrared imager man-machine interaction method based on the FPGA comprises the following specific steps:
first step of building a human-computer interaction system
The human-computer interaction system comprises: the device comprises a key control module, a character module generating module and an coe file generating module.
The key control module has the functions as follows: and the movement of the highlight button of the interface is controlled through an external key, so that the man-machine interaction is realized.
The matrix generation module has the functions of: and generating a character font required by the highlighted interface button, and generating a txt file.
coe the file generation module functions as: the. coe file is generated for each line of text using matlab.
The second step is that the key control module controls the movement of the interface keys on the display interface
The key control module has seven key functions, and the key functions are as follows: open menu, close menu, confirm, move up, move down, move left, and move right. After the menu is opened, a corresponding input command is obtained through the key function, and then the selection of menu options is controlled, and the key function confirms that the corresponding control command is sent to the front end. After closing the menu, only the open menu responds. The direction key includes: moving up, moving down, moving left and moving right, and placing the highlight at the menu function key position corresponding to the control menu through the direction key.
Thirdly, generating a matrix file by a matrix generation module
The size of the whole frame image of the control menu is M x N pixels, the number of pixels occupied by a single word is a x b pixels, one frame image is divided into x y areas, each area displays one word, and the word module generation module generates 1 txt file from 1 area word.
M, N are the row and column of the whole frame image of the control menu; a. b is the row and column of the pixel occupied by the single word; x and y are the row number and column number of the region respectively. a x M, b y N.
The size of the whole frame image of the control menu is as follows: 640 x 512, 640 x 320, 512 x 240 or 512 x 512.
When the size of the whole frame image of the control menu is 640 × 512 pixels, the number of pixels occupied by a single word is 16 × 32 pixels, and one frame image is divided into 40 × 16 areas.
The fourth step coe File Generation Module generates coe files
The. coe file for each line of text of the control menu is generated using matlab. The coe file generation module keeps the header format of the first coe file, concatenates all the district characters in a coe file, and finally generates a coe file for reading by the FPGA. The coe file is stored in the ROM, and the FPGA calls the data in the ROM after being electrified.
Therefore, the man-machine interaction of the thermal infrared imager based on the FPGA is completed.
Example 2
A human-computer interaction system includes: the device comprises a key control module, a character module generating module and an coe file generating module.
The key control module has the functions as follows: and the movement of the highlight button of the interface is controlled through an external key, so that the man-machine interaction is realized.
The matrix generation module has the functions of: and generating a character font required by the highlighted interface button, and generating a txt file.
coe the file generation module functions as: the matlab software was used to generate the coe file for each line of text.