Camera-based television screen acquisition method and system and intelligent terminal

文档序号:1326754 发布日期:2020-07-14 浏览:14次 中文

阅读说明:本技术 一种基于摄像头的电视屏幕获取方法、系统及智能终端 (Camera-based television screen acquisition method and system and intelligent terminal ) 是由 毛俊 于 2020-03-19 设计创作,主要内容包括:本发明公开了一种基于摄像头的电视屏幕获取方法、系统及智能终端,所述方法包括:获取摄像头拍摄的包含电视在内的初始图像;将所述初始图像进行识别处理,得到最大矩形图像;将所述最大矩形图像中的内容截取得到待测试图像。本发明通过摄像头获取到包含电视屏幕的图像,还可以通过算法对图像进行处理,直接得到只有电视屏幕的图像,实现了电视屏幕截屏,替代了图像采集设备的功能,节约了成本,也给图像测试带来了方便。(The invention discloses a method, a system and an intelligent terminal for acquiring a television screen based on a camera, wherein the method comprises the following steps: acquiring an initial image including a television shot by a camera; carrying out identification processing on the initial image to obtain a maximum rectangular image; and intercepting the content in the maximum rectangular image to obtain an image to be tested. According to the invention, the image containing the television screen is acquired through the camera, and the image can be processed through the algorithm, so that the image only with the television screen is directly obtained, the screen capture of the television screen is realized, the function of image acquisition equipment is replaced, the cost is saved, and convenience is brought to image test.)

1. A television screen acquisition method based on a camera is characterized by comprising the following steps:

acquiring an initial image including a television shot by a camera;

carrying out identification processing on the initial image to obtain a maximum rectangular image;

and intercepting the content in the maximum rectangular image to obtain an image to be tested.

2. The camera-based television screen acquisition method of claim 1, wherein the intercepting the content in the maximum rectangular image results in an image to be tested, and then further comprises:

and transmitting the image to be tested to an automatic testing system to judge whether the current television picture is normal.

3. The method for acquiring the television screen based on the camera according to claim 1, wherein the acquiring of the initial image including the television shot by the camera specifically comprises:

monitoring whether the camera finishes shooting;

when the situation that the camera finishes shooting is monitored, an initial image which is shot by the camera and contains a television is obtained, and the initial image is stored in a hard disk.

4. The camera-based television screen acquisition method according to claim 1, wherein the identifying the initial image to obtain a maximum rectangular image specifically comprises:

identifying the initial image through an image processing algorithm;

judging whether a rectangle exists in the initial image or not;

and traversing all rectangles according to the area size to obtain a maximum rectangular image when the rectangles exist in the initial image.

5. The camera-based television screen acquisition method of claim 4, wherein the recognition process comprises: median filtering and denoising, extracting different color channels, edge detection processing, contour searching, removing small ripples in polygonal contours, and angle judgment processing.

6. The camera-based television screen acquisition method of claim 4, wherein said determining whether a rectangle exists in the initial image further comprises:

and if the initial image has a rectangle, judging that the current initial image is an invalid image, and continuously acquiring the image shot by the camera or finishing the current operation.

7. The camera-based television screen acquisition method according to claim 1, wherein the intercepting of the content in the maximum rectangular image to obtain an image to be tested specifically comprises:

acquiring the maximum rectangular image;

and intercepting the content in the maximum rectangular image through a screenshot tool to obtain the image to be tested.

8. A camera-based television screen acquisition system, comprising:

the image acquisition module is used for acquiring initial images including a television shot by the camera;

the image processing module is used for identifying the initial image to obtain a maximum rectangular image;

the image output module is used for intercepting the content in the maximum rectangular image to obtain an image to be tested;

and the image detection module is used for transmitting the image to be tested to an automatic test system so as to judge whether the current television picture is normal.

9. An intelligent terminal, characterized in that, intelligent terminal includes: memory, a processor and a camera-based television screen acquisition program stored on the memory and executable on the processor, the camera-based television screen acquisition program when executed by the processor implementing the steps of the camera-based television screen acquisition method of any one of claims 1 to 7.

10. A storage medium storing a camera-based television screen acquisition program which, when executed by a processor, performs the steps of the camera-based television screen acquisition method of any one of claims 1-7.

Technical Field

The invention relates to the technical field of intelligent pushing, in particular to a method and a system for acquiring a television screen based on a camera and an intelligent terminal.

Background

With the increasing of the types and forms of the audio and video equipment and the increasing of the market popularity, the requirements of users on the functions, the system stability, the performance and the like of the audio and video equipment are higher and higher, the test requirement of the product in the research stage is also increased, in order to improve the test efficiency, a plurality of intelligent terminal manufacturers introduce automatic tests, therefore, an automatic system for continuously collecting television screen contents and transmitting the television screen contents to a computer end by using image collecting equipment is needed, however, the intelligent terminal belongs to a signal input device, and is difficult to buy an applicable image collecting equipment through each large shopping platform (most image collecting equipment on the market is only applicable to equipment with signal output performance at present), even if the acquisition equipment which is suitable for the customization of the supplier can be found, the cost is quite high, and the time is consumed, which undoubtedly brings some difficulties to the automatic test of the intelligent terminal.

For example, the content of a television screen is obtained through a camera, a television picture is difficult to obtain, and objects around the television can be obtained certainly, so that great interference is brought to the automatic test of the television, and a set of image acquisition equipment is purchased, so that the time and the labor are wasted continuously, and the cost is also high.

Accordingly, the prior art is yet to be improved and developed.

Disclosure of Invention

The invention mainly aims to provide a method and a system for acquiring a television screen based on a camera and an intelligent terminal, and aims to solve the problems of long time consumption and low efficiency in acquiring television screen contents in the prior art.

In order to achieve the above object, the present invention provides a method for acquiring a tv screen based on a camera, which comprises the following steps:

acquiring an initial image including a television shot by a camera;

carrying out identification processing on the initial image to obtain a maximum rectangular image;

and intercepting the content in the maximum rectangular image to obtain an image to be tested.

Optionally, the method for acquiring a television screen based on a camera, where the capturing the content in the maximum rectangular image to obtain an image to be tested, further includes:

and transmitting the image to be tested to an automatic testing system to judge whether the current television picture is normal.

Optionally, the method for acquiring a television screen based on a camera, where the acquiring an initial image including a television shot by the camera specifically includes:

monitoring whether the camera finishes shooting;

when the situation that the camera finishes shooting is monitored, an initial image which is shot by the camera and contains a television is obtained, and the initial image is stored in a hard disk.

Optionally, the method for acquiring a television screen based on a camera, where the identifying processing is performed on the initial image to obtain a maximum rectangular image specifically includes:

identifying the initial image through an image processing algorithm;

judging whether a rectangle exists in the initial image or not;

and traversing all rectangles according to the area size to obtain a maximum rectangular image when the rectangles exist in the initial image.

Optionally, the method for acquiring a television screen based on a camera includes: median filtering and denoising, extracting different color channels, edge detection processing, contour searching, removing small ripples in polygonal contours, and angle judgment processing.

Optionally, the method for acquiring a television screen based on a camera, where the determining whether a rectangle exists in the initial image further includes:

and if the initial image has a rectangle, judging that the current initial image is an invalid image, and continuously acquiring the image shot by the camera or finishing the current operation.

Optionally, the method for acquiring a television screen based on a camera, where the capturing the content in the maximum rectangular image to obtain an image to be tested specifically includes:

acquiring the maximum rectangular image;

and intercepting the content in the maximum rectangular image through a screenshot tool to obtain the image to be tested.

In addition, in order to achieve the above object, the present invention further provides a system for acquiring a tv screen based on a camera, wherein the system for acquiring a tv screen based on a camera includes:

the image acquisition module is used for acquiring initial images including a television shot by the camera;

the image processing module is used for identifying the initial image to obtain a maximum rectangular image;

the image output module is used for intercepting the content in the maximum rectangular image to obtain an image to be tested;

and the image detection module is used for transmitting the image to be tested to an automatic test system so as to judge whether the current television picture is normal.

In addition, to achieve the above object, the present invention further provides an intelligent terminal, wherein the intelligent terminal includes: the camera-based television screen acquisition program comprises a memory, a processor and a camera-based television screen acquisition program stored on the memory and capable of running on the processor, wherein the camera-based television screen acquisition program realizes the steps of the camera-based television screen acquisition method when being executed by the processor.

In addition, in order to achieve the above object, the present invention further provides a storage medium, wherein the storage medium stores a camera-based television screen acquisition program, and the camera-based television screen acquisition program realizes the steps of the camera-based television screen acquisition method as described above when executed by a processor.

The method includes the steps that initial images including a television shot by a camera are obtained; carrying out identification processing on the initial image to obtain a maximum rectangular image; and intercepting the content in the maximum rectangular image to obtain an image to be tested. According to the invention, the image containing the television screen is acquired through the camera, and the image can be processed through the algorithm, so that the image only with the television screen is directly obtained, the screen capture of the television screen is realized, the function of image acquisition equipment is replaced, the cost is saved, and convenience is brought to image test.

Drawings

FIG. 1 is a flow chart of a preferred embodiment of the camera-based television screen acquisition method of the present invention;

FIG. 2 is a flowchart of step S10 in the preferred embodiment of the method for acquiring a television screen based on a camera according to the present invention;

FIG. 3 is a flowchart of step S20 in the preferred embodiment of the method for acquiring a television screen based on a camera according to the present invention;

FIG. 4 is a flowchart of step S30 in the preferred embodiment of the method for acquiring a television screen based on a camera according to the present invention;

FIG. 5 is a flow chart of the whole process of image processing in the preferred embodiment of the camera-based TV screen acquisition method of the present invention;

FIG. 6 is a functional schematic diagram of a preferred embodiment of the camera-based television screen acquisition system of the present invention;

fig. 7 is a schematic operating environment diagram of an intelligent terminal according to a preferred embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

As shown in fig. 1, the method for acquiring a television screen based on a camera according to a preferred embodiment of the present invention includes the following steps:

and step S10, acquiring an initial image including a television shot by the camera.

Please refer to fig. 2, which is a flowchart of step S10 in the method for acquiring a tv screen based on a camera according to the present invention.

As shown in fig. 2, the step S10 includes:

s11, monitoring whether the camera completes shooting;

and S12, when it is monitored that the camera finishes shooting, acquiring an initial image which is shot by the camera and contains a television, and storing the initial image in a hard disk.

Specifically, a camera (which may be an independent camera or may be implemented by a camera of a mobile phone) is aligned with a television screen in advance, the camera is connected with an intelligent terminal (for example, a computer) through a USB interface, a system of the intelligent terminal calls the camera through a code, an initial image shot by the camera is read, the initial image is stored in a hard disk, and then image data is transmitted to an image processing algorithm.

And step S20, carrying out identification processing on the initial image to obtain a maximum rectangular image.

Please refer to fig. 3, which is a flowchart of step S20 in the method for acquiring a tv screen based on a camera according to the present invention.

As shown in fig. 3, the step S20 includes:

s21, identifying the initial image through an image processing algorithm;

s22, judging whether a rectangle exists in the initial image or not;

and S23, when the initial image has a rectangle, traversing all rectangles according to the area size to obtain a maximum rectangle image.

Specifically, after the initial image is transferred to an image processing algorithm, the initial image is identified by the image processing algorithm, wherein the identification process includes: median filtering and denoising, extracting different color channels, edge detection processing, contour searching, removing small ripples in polygonal contours, and angle judgment processing.

The main principle of median filtering is to replace a certain point in a digital image with the median of each pixel value in the neighborhood of the point, so that the periphery of a target pixel can be better close to a real value, for example, when a black point exists on a piece of white paper, the pixel value of the black point is larger, and after median filtering, the pixel value near the black point can possibly become smaller; after median filtering, some relatively isolated noise points are easy to remove, so that the quality of the image can be improved; the median filter denoising method has the advantages that the median filter denoising method has a good effect on removing salt and pepper noise, and specifically comprises the steps of selecting a central neighborhood, sorting the gray values of all pixels in the neighborhood according to the size, and selecting a median in a sorting sequence as the gray value of the pixel value of the central point of the neighborhood. The median filtering denoising effectively removes impulse noise in the image and retains image details; when the noise density is higher, windowing filtering is selected, so that not only is too much image blurring not caused, but also noise is filtered more thoroughly, and a higher output signal-to-noise ratio is kept.

The features of some image materials can be better observed by extracting different color channels, and sometimes, components of three color channels of RGB need to be respectively displayed and adjusted.

Among them, the edge detection process is a technique for extracting useful structural information from an image, for example, a wall filled with patterns has a much larger amount of information than a white wall, and a pattern-filled image is richer than monochrome image information, and canny edge detection is used in the present invention.

The contour searching is a method for searching the contour of an object based on the basis of image edge extraction, and can be realized based on an RDP algorithm, for example, the method aims to reduce the number of points of a polygonal contour, firstly changes an image into a binary image, finds the contour of the image, uses a polygon to continuously approximate the contour, and finds a rectangle on the contour point through a related API.

After the initial image is identified and processed through the image processing algorithm, whether a rectangle exists in the initial image is judged, if a rectangular frame is not detected after the initial image is processed through the process, the camera is considered not to fetch the content containing the television screen, and no processing is performed on the image; if the image has rectangles, the largest rectangle is the largest rectangle image by traversing all the rectangle areas.

And step S30, intercepting the content in the maximum rectangular image to obtain an image to be tested.

Please refer to fig. 4, which is a flowchart of step S30 in the method for acquiring a tv screen based on a camera according to the present invention.

As shown in fig. 4, the step S30 includes:

s31, acquiring the maximum rectangular image;

and S32, intercepting the content in the maximum rectangular image through a screenshot tool to obtain the image to be tested.

Specifically, the content in the maximum rectangular frame is intercepted to obtain the maximum rectangular image, namely, after the function of intercepting the television screen is realized, the intercepted maximum rectangular image is transmitted to the automatic test system to judge whether the current television picture is normal, so that the television picture tested by the automatic test system is free of other sundries, the accuracy of the automatic test is improved, and the whole process can be circularly carried out until the test is finished.

According to the invention, the image including the television screen is obtained through the camera, the intelligent terminal reads the image by calling the camera, then the image is processed by utilizing an algorithm, and the content in the maximum rectangular frame (namely the content of the television screen) is intercepted and stored, so that a set of simple image acquisition equipment is realized, the cost is saved, and the trouble brought by searching for proper image acquisition equipment is also reduced. As shown in fig. 5, the overall method includes the following steps:

s0: starting;

s1: the camera is over against the television, and the intelligent terminal (computer) acquires image data by calling the camera;

s2: the intelligent terminal stores the image data into the hard disk;

s3: the intelligent terminal judges whether the image has a rectangle, if so, the step S5 is carried out, otherwise, the step S4 is carried out;

s4: judging whether the condition of exiting the loop image capturing is reached, if so, entering the step S6, otherwise, entering the step S1;

s5: intercepting and storing the image in the maximum rectangular frame;

s6: and (6) ending.

The key point of the invention is to provide a method for circularly intercepting a television screen by using a camera, which can not only acquire an image containing the television screen by using the camera, but also process the image by using an algorithm to directly acquire the image only with the television screen, replaces the function of image acquisition equipment, realizes the screen interception function of the television screen, saves the cost and reduces the trouble brought by purchasing proper image acquisition equipment.

Further, as shown in fig. 6, the present invention also provides a system for acquiring a tv screen based on a camera, including:

the image acquisition module 11 is used for acquiring an initial image which is shot by a camera and contains a television; the image processing module 12 is configured to perform recognition processing on the initial image to obtain a maximum rectangular image; the image output module 13 is configured to intercept content in the maximum rectangular image to obtain an image to be tested; and the image detection module 14 is configured to transmit the image to be tested to an automatic test system to determine whether the current television picture is normal.

Specifically, the image acquisition module 11 is configured to acquire an image including a television captured by a camera; the image processing module 12 is configured to process the picture obtained by the camera to obtain a maximum rectangular frame (the rectangle with the largest area is the maximum rectangular frame by calculating the area of each rectangle and comparing the areas one by one); the image output module 13 is used for capturing and storing the image in the maximum rectangular frame, and then transmitting the stored image to the image detection module 14, and the image detection module 14 is used for judging whether the current television picture is normal through an automatic test system.

According to the invention, the image containing the television screen is obtained through the camera, the computer reads the image by calling the camera, and then the image is processed by utilizing an algorithm, so that the content in the maximum rectangular frame (namely the content of the television screen) is intercepted, a set of simple image acquisition equipment is realized, the cost is saved, and the trouble brought for searching for proper image acquisition equipment is also reduced.

Further, as shown in fig. 7, based on the above method for acquiring a tv screen based on a camera, the present invention also provides an intelligent terminal, which includes a processor 10, a memory 20 and a display 30. Fig. 7 shows only some of the components of the smart terminal, but it should be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.

The memory 20 may be an internal storage unit of the intelligent terminal in some embodiments, such as a hard disk or a memory of the intelligent terminal. The memory 20 may also be an external storage device of the Smart terminal in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the Smart terminal. Further, the memory 20 may also include both an internal storage unit and an external storage device of the smart terminal. The memory 20 is used for storing application software installed in the intelligent terminal and various data, such as program codes of the installed intelligent terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, the memory 20 stores a camera-based tv screen acquiring program 40, and the camera-based tv screen acquiring program 40 can be executed by the processor 10, so as to implement the camera-based tv screen acquiring method in the present application.

The processor 10 may be, in some embodiments, a Central Processing Unit (CPU), a microprocessor or other data Processing chip, and is configured to run program codes stored in the memory 20 or process data, such as executing the camera-based tv screen capturing method.

The display 30 may in some embodiments be an L ED display, a liquid crystal display, a touch-sensitive liquid crystal display, an O L ED (Organic light-Emitting Diode) touch-sensitive display, etc. the display 30 is used for displaying information at the smart terminal and for displaying a visual user interface, the components 10-30 of the smart terminal communicate with each other over a system bus.

In one embodiment, the following steps are implemented when the processor 10 executes the camera-based television screen capture program 40 in the memory 20:

acquiring an initial image including a television shot by a camera;

carrying out identification processing on the initial image to obtain a maximum rectangular image;

and intercepting the content in the maximum rectangular image to obtain an image to be tested.

The method for intercepting the content in the maximum rectangular image to obtain the image to be tested further comprises the following steps:

and transmitting the image to be tested to an automatic testing system to judge whether the current television picture is normal.

The acquiring of the initial image including the television shot by the camera specifically includes:

monitoring whether the camera finishes shooting;

when the situation that the camera finishes shooting is monitored, an initial image which is shot by the camera and contains a television is obtained, and the initial image is stored in a hard disk.

The identifying the initial image to obtain a maximum rectangular image specifically includes:

identifying the initial image through an image processing algorithm;

judging whether a rectangle exists in the initial image or not;

and traversing all rectangles according to the area size to obtain a maximum rectangular image when the rectangles exist in the initial image.

The identification process includes: median filtering and denoising, extracting different color channels, edge detection processing, contour searching, removing small ripples in polygonal contours, and angle judgment processing.

The judging whether the initial image has a rectangle or not further comprises:

and if the initial image has a rectangle, judging that the current initial image is an invalid image, and continuously acquiring the image shot by the camera or finishing the current operation.

The intercepting the content in the maximum rectangular image to obtain an image to be tested specifically comprises:

acquiring the maximum rectangular image;

and intercepting the content in the maximum rectangular image through a screenshot tool to obtain the image to be tested.

The present invention also provides a storage medium, wherein the storage medium stores a camera-based tv screen acquisition program, and the camera-based tv screen acquisition program implements the steps of the camera-based tv screen acquisition method when executed by a processor.

In summary, the present invention provides a method, a system and an intelligent terminal for acquiring a tv screen based on a camera, wherein the method comprises: acquiring an initial image including a television shot by a camera; carrying out identification processing on the initial image to obtain a maximum rectangular image; and intercepting the content in the maximum rectangular image to obtain an image to be tested. According to the invention, the image containing the television screen is acquired through the camera, and the image can be processed through the algorithm, so that the image only with the television screen is directly obtained, the screen capture of the television screen is realized, the function of image acquisition equipment is replaced, the cost is saved, and convenience is brought to image test.

Of course, it will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by a computer program instructing relevant hardware (such as a processor, a controller, etc.), and the program may be stored in a computer readable storage medium, and when executed, the program may include the processes of the above method embodiments. The storage medium may be a memory, a magnetic disk, an optical disk, etc.

It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:预测模式确定方法和装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!