Automatic operation exercise right and wrong indication method and systemTechnical Field
The invention belongs to the field of auxiliary learning tools for students, and particularly relates to an automatic operation exercise right and wrong indication method and system.
Background
In the prior art, the operation correction mostly adopts the manual correction of parents, which wastes time and energy; or realize that the operation judges the mistake through cell-phone APP procedure PP, need open the cell-phone earlier and correspond the APP and shoot, then see answer instruction on the APP picture, manual operation step is many, and is inconvenient, and is slow.
Disclosure of Invention
In view of the above, the main objective of the present invention is to provide a method and a system for indicating the alignment and error of an automatic job problem.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
the embodiment of the invention provides an automatic operation exercise right and wrong indication method, which comprises the following steps:
collecting images to be judged of workbooks waiting for correction or test paper sheets in the color reference line frame;
comparing the image to be judged with a standard problem set to find out a standard problem image with the highest matching degree; each standard exercise image comprises standard answer characters, positions and sizes of all the small exercise answer blocks;
acquiring a small answer sub-image of each small answer block in the image to be judged, identifying answer characters from the small answer sub-image through a standard function, comparing the answer characters with standard answer characters of the corresponding small answer block in a standard exercise image, and determining that the answer of each small answer block in the image to be judged is wrong;
and projecting and outputting a color check number or a wrong number according to the corresponding position of the wrong answer block of each small question in the image to be judged on the corresponding workbook or the test paper so as to indicate whether the answer is correct or not.
In the above scheme, the image to be determined is compared with the standard problem set to find out the standard problem image with the highest matching degree, and then the method includes determining the image deformation coefficient.
In the above scheme, the method comprises: converting the image to be judged according to the image deformation coefficient to obtain a new image to be judged, acquiring a small answer sub-image of each small answer block from the new image to be judged, and identifying answer characters from the small answer sub-images through a standard function; and re-determining the position and the size of the projection output color pair or error according to the image deformation coefficient.
In the scheme, the standard problem set is a standard image group pre-stored in each page of problems and is defined as S [ ], and standard answer characters, positions and sizes of answer blocks of each small problem corresponding to each page of problems.
In the above solution, in the color reference wire frame, the color of the wire frame is defined as c0, the rectangle of the wire frame in the projection screen is defined as r0, the position of r0 is defined as r0.x and r0.y, and the size of r0 is defined as r0.width and r 0.height.
In the above scheme, the step of comparing the image to be determined with the standard problem set to find out the standard problem image with the highest matching degree specifically includes: defining the image to be judged containing the color reference wire frame as p0, extracting an outline rectangle r1 of the color reference wire frame pattern with the color of c0 from the image p0 through a standard function, and extracting a graph included by a rectangle r1 from the image p0, and defining the graph as p 1; extracting a feature vector Vp1 of the image p1 through a standard image feature extraction function, and extracting a feature vector of each standard problem image Si in the image group S [ ] using the same image feature extraction function, defined as Vs [ ]; calculating a matcher object of each feature vector Vs [ i ] in the feature vectors Vp1 and Vs [ i ] by using a standard feature matching function, defining the matcher object as mc [ i ], and defining the number of key matching points of each matcher object in mc [ i ] as mc [ i ] k; the subscript defining the maximum value of the number mc [ i ]. k of key matching points of each matcher object in mc [ ]isj, that is, mc [ j ]. k ═ max (mc [ ]. k), the prestored system standard image with the highest matching degree with the image p1 is S [ j ], the corresponding feature vector is Vs [ j ], and the corresponding matcher object is mc [ j ].
In the foregoing scheme, the determining the image deformation coefficient specifically includes: calculating a function through a standard homography perspective transformation matrix, wherein a perspective transformation matrix from p1 to S [ j ] is H0 according to Vp1, Vs [ j ] and mc [ j ], and a perspective transformation matrix from S [ j ] to p1 is H1; the method for converting the image to be judged according to the image deformation coefficient to obtain a new image to be judged specifically comprises the following steps: a perspective transformed image of p1, defined as p2, was computed from h0 by a standard perspective transformation function.
In the scheme, a small answer sub-image of each small answer block is obtained from the new image to be judged, and answer characters are identified from the small answer sub-image through a standard function; re-determining the position and size of the projection output color registration or error according to the image deformation coefficient, specifically: defining all small question answer blocks corresponding to a pre-stored standard question set S [ n ] as A [ ], defining characters of each small question answer block as A [ i ]. daan, and defining a position and size matrix A [ i ]. rect0 of each small question answer block in S [ n ]; obtaining answer sub-images at the position of A [ i ] rect0 in p2 through a standard image processing function, and defining the answer sub-images as A [ i ] p; obtaining the answer characters of the answer image A [ i ] p through a standard Ono ocr character recognition function, and defining A [ i ] datati; 2) defining an answer indication image of ai as ai, result, if ai, dat and ai, daan are equal, then ai, result being a check √ image; otherwise, a [ i ]. result ═ gamma image; a perspective transformation matrix of A [ i ]. rect0 is calculated according to h1 through a standard perspective transformation function and defined as A [ i ]. rect1, and a hook or cross indication image A [ i ]. result is displayed at the position of (r0.x + A [ i ]. rect1.x, r0.y + A [ i ]. rect1.y) in a projection picture, and the pattern is displayed on the position of a problem surface corresponding to a small answer.
In the scheme, the method also comprises the steps of displaying relevant learning auxiliary pictures and texts such as pre-stored question type explanation texts, key labeling patterns, correct answers and the like at the positions (r0.x + ai. rect1.x, r0.y + ai. rect1.y) in the projection picture, and simultaneously playing pre-recorded corresponding tutoring explanation voices; and uploading the answer data to the Internet of things cloud platform, and then storing the answer data on a server.
The embodiment of the invention also provides an automatic operation problem alignment and error indication system, which comprises a video acquisition camera unit, a projection unit and a data processing unit;
the video acquisition camera unit is used for acquiring an image to be judged of a workbook or test paper to be corrected, which is positioned in a color reference wire frame below the video acquisition camera unit and waits for correction;
the data processing unit is used for comparing the image to be judged with the standard problem set to find out the standard problem image with the highest matching degree; each standard exercise image comprises standard answer characters, positions and sizes of all the small exercise answer blocks; the answer recognition module is also used for obtaining a small answer sub-image of each small answer block in the image to be judged, recognizing answer characters from the small answer sub-image through a standard function, comparing the answer characters with standard answer characters of the corresponding small answer block in a standard exercise image, and determining that the answer of each small answer block in the image to be judged is wrong;
the projection unit is used for projecting a color reference wire frame on a workbook or test paper to be corrected; and the system is also used for projecting and outputting a color check number or a wrong number according to the corresponding position of each small question answer block in the image to be judged on the corresponding workbook or the test paper so as to indicate whether the answer is correct or not.
Compared with the prior art, the invention can realize automatic and high-speed answer right and wrong indication, overcomes the problems in the prior art, can bring better learning experience for students, help the students to better master knowledge, and provide quantitative basis for parents, teachers and schools to master the learning condition of the students, evaluate the teaching effect and individualize targeted education.
Drawings
FIG. 1 is a flowchart illustrating an automated practice problem alignment error indication method according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the invention provides an automatic operation problem right and wrong indication method, which is realized by the following steps as shown in figure 1:
step 101: collecting images to be judged of workbooks waiting for correction or test paper sheets in the color reference line frame;
specifically, in the color reference wire frame, the color of the wire frame is defined as c0, the rectangle of the wire frame in the projection picture is defined as r0, the position of r0 is defined as r0.x and r0.y, and the size of r0 is defined as r0.width and r 0.height.
Step 102: comparing the image to be judged with a standard problem set to find out a standard problem image with the highest matching degree; each standard exercise image comprises standard answer characters, positions and sizes of all the small exercise answer blocks;
further, the method then includes determining an image deformation coefficient.
Converting the image to be judged according to the image deformation coefficient to obtain a new image to be judged, acquiring a small answer sub-image of each small answer block from the new image to be judged, and identifying answer characters from the small answer sub-images through a standard function; and re-determining the position and the size of the projection output color pair or error according to the image deformation coefficient.
The standard problem set is a standard image group pre-stored in each page of problem, and is defined as S [ ], and standard answer characters, positions and sizes of answer blocks of each small problem corresponding to each page of problem.
Defining the image to be judged containing the color reference wire frame as p0, extracting an outline rectangle r1 of the color reference wire frame pattern with the color of c0 from the image p0 through a standard function, and extracting a graph included by a rectangle r1 from the image p0, and defining the graph as p 1; extracting a feature vector Vp1 of the image p1 through a standard image feature extraction function, and extracting a feature vector of each standard problem image Si in the image group S [ ] using the same image feature extraction function, defined as Vs [ ]; calculating a matcher object of each feature vector Vs [ i ] in the feature vectors Vp1 and Vs [ i ] by using a standard feature matching function, defining the matcher object as mc [ i ], and defining the number of key matching points of each matcher object in mc [ i ] as mc [ i ] k; the subscript defining the maximum value of the number mc [ i ]. k of key matching points of each matcher object in mc [ ]isj, that is, mc [ j ]. k ═ max (mc [ ]. k), the prestored system standard image with the highest matching degree with the image p1 is S [ j ], the corresponding feature vector is Vs [ j ], and the corresponding matcher object is mc [ j ].
The determining the image deformation coefficient specifically includes: calculating a function through a standard homography perspective transformation matrix, wherein a perspective transformation matrix from p1 to S [ j ] is H0 according to Vp1, Vs [ j ] and mc [ j ], and a perspective transformation matrix from S [ j ] to p1 is H1; the method for converting the image to be judged according to the image deformation coefficient to obtain a new image to be judged specifically comprises the following steps: a perspective transformed image of p1, defined as p2, was computed from h0 by a standard perspective transformation function.
Step 103: acquiring a small answer sub-image of each small answer block in the image to be judged, identifying answer characters from the small answer sub-image through a standard function, comparing the answer characters with standard answer characters of the corresponding small answer block in a standard exercise image, and determining that the answer of each small answer block in the image to be judged is wrong;
specifically, the method comprises the following steps: defining all small question answer blocks corresponding to a pre-stored standard question set S [ n ] as A [ ], defining characters of each small question answer block as A [ i ]. daan, and defining a position and size matrix A [ i ]. rect0 of each small question answer block in S [ n ]; obtaining answer sub-images at the position of A [ i ] rect0 in p2 through a standard image processing function, and defining the answer sub-images as A [ i ] p; obtaining the answer characters of the answer image A [ i ] p through a standard Ono ocr character recognition function, and defining A [ i ] datati; 2) defining an answer indication image of ai as ai, result, if ai, dat and ai, daan are equal, then ai, result being a check √ image; otherwise, a [ i ]. result ═ gamma image; a perspective transformation matrix of A [ i ]. rect0 is calculated according to h1 through a standard perspective transformation function and is defined as A [ i ]. rect1, a hook or cross indication image A [ i ]. result is displayed at the position of (r0.x + A [ i ]. rect1.x, r0.y + A [ i ]. rect1.y) in a projection picture, and the pattern is displayed at the position of a corresponding small answer on the surface of an exercise question, so that automatic and high-speed indication of wrong answers is realized.
Step 104: and projecting and outputting a color check number or a wrong number according to the corresponding position of the wrong answer block of each small question in the image to be judged on the corresponding workbook or the test paper so as to indicate whether the answer is correct or not.
In the position of (r0.x + ai. rect1.x, r0.y + ai. rect1.y) in the projection picture, the pre-stored question type explanation words, key marked patterns, correct answers and other relevant learning auxiliary pictures and texts are displayed, and simultaneously the pre-recorded corresponding tutoring explanation voice is played, so that students can intuitively and excellently master knowledge.
The answer data is uploaded to the Internet of things cloud platform and then stored on the server, so that a user can check information such as scores, error prone question types and error prone knowledge points of the homework in real time through a mobile terminal or a network device such as a PC, and the learning state of the student is evaluated.
The color reference frame and the color gamma or gamma indicating pattern are each selected to be red.
The embodiment of the invention also provides an automatic operation problem alignment and error indication system, which comprises a video acquisition camera unit, a projection unit and a data processing unit;
the video acquisition camera unit is used for acquiring an image to be judged of a workbook or test paper to be corrected, which is positioned in a color reference wire frame below the video acquisition camera unit and waits for correction;
the data processing unit is used for comparing the image to be judged with the standard problem set to find out the standard problem image with the highest matching degree; each standard exercise image comprises standard answer characters, positions and sizes of all the small exercise answer blocks; the answer recognition module is also used for obtaining a small answer sub-image of each small answer block in the image to be judged, recognizing answer characters from the small answer sub-image through a standard function, comparing the answer characters with standard answer characters of the corresponding small answer block in a standard exercise image, and determining that the answer of each small answer block in the image to be judged is wrong;
the projection unit is used for projecting a color reference wire frame on a workbook or test paper to be corrected; and the system is also used for projecting and outputting a color check number or a wrong number according to the corresponding position of each small question answer block in the image to be judged on the corresponding workbook or the test paper so as to indicate whether the answer is correct or not.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention.