CN106846320A - A kind of picture segmentation method and system positioned based on three-point fix and straight line - Google Patents

A kind of picture segmentation method and system positioned based on three-point fix and straight line Download PDF

Info

Publication number
CN106846320A
CN106846320A CN201510888787.4A CN201510888787A CN106846320A CN 106846320 A CN106846320 A CN 106846320A CN 201510888787 A CN201510888787 A CN 201510888787A CN 106846320 A CN106846320 A CN 106846320A
Authority
CN
China
Prior art keywords
punctuate
picture
database
answering card
answer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510888787.4A
Other languages
Chinese (zh)
Inventor
任年峰
张伟
陈存跃
侯发毅
谷鹏霄
曹福金
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Digital Shandong Technology Co Ltd
Original Assignee
Shanda Luneng Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanda Luneng Information Technology Co Ltd filed Critical Shanda Luneng Information Technology Co Ltd
Priority to CN201510888787.4A priority Critical patent/CN106846320A/en
Publication of CN106846320A publication Critical patent/CN106846320A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a kind of picture segmentation method and system positioned based on three-point fix and straight line, every answering card being obtained one by one by scan components, answering card being fabricated to corresponding picture, picture is preserved to the position of setting, data-base recording storage location;Each pictures are read by database, the beginning punctuate of whole answering card is recognized and is terminated punctuate, according to punctuate rotating image, it is ensured that level between picture punctuate;Each pictures are read by database, read the position of each punctuate in picture, according to the length and width in the answer region set in database, by calculating whether next punctuate is to terminate punctuate, find end node, using Graphics methods, a small picture is cut into, and corresponding informance be recorded into correspondence database.The method of the present invention can improve the accuracy rate of network scoring answer area's cutting, make teacher when network scoring is carried out, and will not cause the situation that cannot judge achievement because of answer region cutting mistake.

Description

A kind of picture segmentation method and system positioned based on three-point fix and straight line
Technical field
The present invention relates to image positioning analytic technique, Image is applied to, and in particular to one kind is fixed based on three-point fix and straight line The picture segmentation method and system of position.
Background technology
Existing computer marking mode is:Answering card is scanned with high speed scanner first and is uploaded to by network to scanning end Go over examination papers server, objective item part according to the model answer for setting, system can programming count result, it is main without manual intervention The answering card subjective item part surface trimming that sight topic part will upload according to the cutting scheme for providing, net is carried out by the specified person of going over examination papers On go over examination papers, after subjective item part has all been read and made comments, objective item part and subjective item part can be carried out statistical summaries by system, and The statistics of correlation can be derived.As shown in Figure 6.
Computer network is goed over examination papers because it has significant advantage in quality of going over examination papers, efficiency of going over examination papers and to the aspect such as improve the quality of teaching, The today for particularly being improved constantly in the requirement of quality of instruction monitoring and evaluation, it will be increasingly subject to pay attention to and all kinds of be examined as future The main mode of going over examination papers of examination.
Current computer marking when answering card subjective item partial cut-away piece is realized, by the way of three-point fix, answer by foundation Upper pre-printed three anchor points of topic card, define a square frame for standard, realize the cutting of picture.This mode can expire substantially The demand of cutting answering card more than sufficient middle school, but when pupil has coating and drawing at random, there are three anchor points can not be accurately positioned Situation, cutting answer region when, mistake just occurs.
The content of the invention
To solve the deficiency that prior art is present, the invention discloses a kind of picture recognition side positioned based on three-point fix and straight line Method and system, the cutting picture that is positioned based on three-point fix and straight line realize Image, reach the mesh in cutting answer region 's.
To achieve the above object, concrete scheme of the invention is as follows:
A kind of picture segmentation method positioned based on three-point fix and straight line, is comprised the following steps:
The scanning of answering card:Obtain every answering card one by one by scan components, answering card is fabricated to corresponding picture, will scheme Piece is preserved to the position of setting, data-base recording storage location;
Answer sheet picture rotates:Each pictures are read by database, the beginning punctuate of whole answering card are recognized and is terminated punctuate, According to punctuate rotating image, it is ensured that level between picture punctuate;
Answering card is split:Postrotational each pictures are read by database, the position of each punctuate in picture is read, according to According to the length and width in the answer region set in database, by calculating whether next punctuate is to terminate punctuate, judge to terminate punctuation bit Put;Start punctuate in reading picture and terminate to whether there is straight line between punctuate, if it is present the answer region is tried for one Topic, if there is no straight line, selects the end Mistaken punctuations for thinking to choose, and continually looks for next punctuate, judges whether it is correspondence End node;
End node is found, the answer region is made into Graphics methods, be cut into a small picture, and corresponding informance is recorded To in correspondence database.Corresponding informance refers to:Correspondence picture name and question number, examination question numbering in systems etc..Every paper An ID is all corresponded in database, every pictures of cutting have a small ID, are mapped between ID.
Further, the making of answering card was also needed to before answering card is scanned:Subjective item and objective item are separately positioned on same Corresponding answer frame is opened on answering card and be respectively provided with, punctuate is started in the corresponding answer inframe setting original position of objective item, if Put initial punctuate corresponding end punctuate anyhow, initial punctuate and the corresponding straight line of end punctuate are set, answer subjective item is corresponding Topic inframe is respectively provided with to each subjective item and starts over correspondence punctuate and set line between punctuate.
Further, when answering card is made, also needed to obtain answer quantity and each examination question from database before punctuate Answer space size, calculate objective item answer region length and width, obtain examination question quantity, obtain objective item answer number and label, Calculate objective item original position in answering card;Each subjective item individually calculates the position in answering card.
Further, when obtaining every answering card by scan components, the recordable picture information in database, including title and sweep The time is retouched, is scanned and is staggered the time, position occurs in data-base recording.
Further, during rotating image, anglec of rotation calculation:The position for defining rotary shaft is A points, the position under the point of contact Be B points, the position that contact is upspring is C points, and a triangle is constituted by tri- summits of ABC, the angle where each summit be angle A, Angle B, angle C, each summit just to triangle side be a, b, c, calculate angle A the number of degrees.
Further, when calculating the number of degrees of angle A, the coordinate (x, y) of A points is got by the position of picture and the length and width of picture, B The coordinate (x1, y1) of point and C points, (x2, y2) can be obtained from motionEvent, and each side length of side of triangle is:
Double a=Math.sqrt ((x1-x2) * (x1-x2)+(y1-y2) * (y1-y2));
Double b=Math.sqrt ((x-x2) * (x-x2)+(y-y2) * (y-y2));
Double c=Math.sqrt ((x1-x) * (x1-x)+(y1-y) * (y1-y));
The cosine value for obtaining angle A is double cosA=(b*b+c*c-a*a)/(2*b*c);
Then the radian of angle A is double arcA=Math.acos (cosA);
This radian is between 0-PI, to change angle into and use double angleA=arcA*180/Math.PI.
Wherein, motionEvent rotational events Double data types, double precision
Math.sqrt extracts square root
Math.acos cosine
double angleA:Statement variable
Math.PI:Pi, π=3.14159265 ...
Further, also obtained including answering card bar code, inquire about the barcode position of database purchase, barcode position is cut Figure, makes Graphics methods, and relative coordinate is obtained according to the coordinate points correspondence punctuate of database purchase, is stored in acquisition database Length and width, new picture is made, in pictorial information storage to database.Every paper has unique mark, bar shaped in database Code and other examination questions belong to a part for paper.
A kind of picture segmentation method, system positioned based on three-point fix and straight line, including:
The scan module of answering card:Obtain every answering card one by one by scan components, answering card be fabricated to corresponding picture, Picture is preserved to the position of setting, data-base recording storage location;
Answer sheet picture rotary module:Each pictures are read by database, beginning punctuate and the end of whole answering card is recognized Punctuate, according to punctuate rotating image, it is ensured that level between picture punctuate;
Answering card splits module:Postrotational each pictures are read by database, the position of each punctuate in picture is read, According to the length and width in the answer region set in database, by calculating whether next punctuate is to terminate punctuate, judge to terminate punctuate Position;Start punctuate in reading picture and terminate to whether there is straight line between punctuate, if it is present the answer region is one Examination question, if there is no straight line, selects the end Mistaken punctuations for thinking to choose, and continually looks for next punctuate, judges whether it is right The end node answered;End node is found, the answer region is made into Graphics methods, be cut into a small picture, and will be right Information record is answered in correspondence database.
Beneficial effects of the present invention:
The scanning of answering card of the present invention:Paper is scanned into picture, facilitates subsequent processes to carry out, answer sheet picture rotation:Make inclination Picture level, facilitate follow-up cutting picture, answering card segmentation:Paper is divided into the pictures of per pass exercise question one, is conveniently goed over examination papers, The method of the present invention can improve the accuracy rate of network scoring answer area's cutting, evade pupil's paper for causing of scrawling and cut figure It is the inaccurate risk of positioning, makes teacher when network scoring is carried out, will not causing to judge because of answer region cutting mistake The situation of achievement.
Brief description of the drawings
Fig. 1 is answer card manufacturing method flow chart;
Fig. 2 is answering card scanning process figure;
Fig. 3 is that answering card bar code obtains flow chart;
Fig. 4 is answering card answer area flow chart;
Fig. 5 picture rotation schematic diagrames;
The existing online paper-marking system flow charts of Fig. 6.
Specific embodiment:
The present invention is described in detail below in conjunction with the accompanying drawings:
Image positions analytic technique, is applied to Image.If so-called image segmentation is exactly to be divided an image into by certain rule Significant region is done, i.e., the union in each region is whole image, the common factor in each region is 0.
Image by the set that image representation is physically significant connected region, that is, according to the priori of target and background Knowledge, to the target in image, background is marked, positions, and then target is separated from background or other pseudo- targets.
Specific method is:
As shown in figure 1, answer card manufacturing method:Answer quantity and the answer space size of each examination question, meter are obtained from database Calculate objective item answer region length and width (objective item notifies to set answer frame), obtain examination question topic quantity, obtain objective item answer number and Label, calculates objective item original position in answering card, and setting original position starts punctuate, sets original position anyhow right The end punctuate answered.Original position and the corresponding straight line of end position are set.Subjective item is separately provided answer frame, each subjective item The position in answering card is individually calculated, setting starts over correspondence punctuate, sets line between punctuate, terminates answering card and makes.
As shown in Fig. 2 answering card is scanned:By scanner, every paper is obtained one by one, paper is fabricated to corresponding picture, Data-base recording pictorial information (title, sweep time) etc., scans and staggers the time, and position, picture occurs in data-base recording It is saved in the position of setting, data-base recording storage location;
As shown in figure 5, picture rotation:Each pictures are read according to database, according to the beginning punctuate of whole answering card and right side Terminate punctuate, according to punctuate rotating image, it is ensured that level between picture punctuate.Anglec of rotation calculation:Define rotary shaft Position is A points, and the position under the point of contact is B points, and the position that contact is upspring is C points, and a triangle is constituted by tri- summits of ABC Shape, angle where each summit is angle A, angle B, angle C, each summit just to the side of triangle be a, b, c, calculate the degree of angle A Number.
The coordinate (x, y) of A points is got by the position of picture and the length and width of picture, the coordinate (x1, y1) of B points and C points, and (x2, y2) can be from Obtained in motionEvent, each side length of side of triangle is:
Double a=Math.sqrt ((x1-x2) * (x1-x2)+(y1-y2) * (y1-y2));
Double b=Math.sqrt ((x-x2) * (x-x2)+(y-y2) * (y-y2));
Double c=Math.sqrt ((x1-x) * (x1-x)+(y1-y) * (y1-y));
The cosine value for obtaining angle A is double cosA=(b*b+c*c-a*a)/(2*b*c);
Then the radian of angle A is double arcA=Math.acos (cosA);
This radian is between 0-PI, to change angle into and use double angleA=arcA*180/Math.PI
As shown in figure 3, answering card bar code acquisition methods:The barcode position of database purchase is inquired about, barcode position is cut into figure, Make Graphics methods, relative coordinate is obtained according to the coordinate points correspondence punctuate of database purchase, obtain the length stored in database Width, makes new picture, in pictorial information storage to database.
As shown in figure 4, answering card answer area:Each pictures are read according to database, each punctuate in picture is read, read Fetch bit is put, and according to the length and width in the answer region set in database, by calculating whether next punctuate is to terminate punctuate, is judged Terminate punctuate position.Start punctuate in reading picture and terminate to whether there is straight line between punctuate, if it does, select thinking that this is answered Topic region is one examination question, if there is no straight line, selects the end Mistaken punctuations for thinking to choose, and continually looks for next punctuate, Judge whether it is corresponding end node.After finding, the answer region is made into Graphics methods, be cut into a small figure Piece, and corresponding informance be recorded into correspondence database.
Although above-mentioned be described with reference to accompanying drawing to specific embodiment of the invention, not to the limit of the scope of the present invention System, one of ordinary skill in the art should be understood that on the basis of technical scheme those skilled in the art need not pay The various modifications or deformation made by going out creative work are still within protection scope of the present invention.

Claims (8)

1. a kind of picture segmentation method positioned based on three-point fix and straight line, it is characterized in that, comprise the following steps:
The scanning of answering card:Obtain every answering card one by one by scan components, answering card is fabricated to corresponding picture, will scheme Piece is preserved to the position of setting, data-base recording storage location;
Answer sheet picture rotates:Each pictures are read by database, the beginning punctuate of whole answering card are recognized and is terminated punctuate, According to punctuate rotating image, it is ensured that level between picture punctuate;
Answering card is split:Postrotational each pictures are read by database, the position of each punctuate in picture is read, according to According to the length and width in the answer region set in database, by calculating whether next punctuate is to terminate punctuate, judge to terminate punctuation bit Put;Start punctuate in reading picture and terminate to whether there is straight line between punctuate, if it is present the answer region is tried for one Topic, if there is no straight line, selects the end Mistaken punctuations for thinking to choose, and continually looks for next punctuate, judges whether it is correspondence End node;
End node is found, the answer region is made into Graphics methods, be cut into a small picture, and corresponding informance is recorded To in correspondence database.Corresponding informance refers to:Correspondence picture name and question number, examination question numbering in systems etc..Every paper An ID is all corresponded in database, every pictures of cutting have a small ID, are mapped between ID.
2. a kind of picture segmentation method positioned based on three-point fix and straight line as claimed in claim 1, it is characterized in that, sweeping The making of answering card is also needed to before retouching answering card:Subjective item and objective item are separately positioned on same answering card and are set respectively Corresponding answer frame is put, punctuate is started in the corresponding answer inframe setting original position of objective item, initial punctuate is set and is corresponded to anyhow End punctuate, initial punctuate and the corresponding straight line of end punctuate are set, in the corresponding answer inframe of subjective item to each subjective item It is respectively provided with and starts over correspondence punctuate and line between punctuate is set.
3. a kind of picture segmentation method positioned based on three-point fix and straight line as claimed in claim 2, it is characterized in that, in system When making answering card, also needed to obtain answer quantity and the answer space size of each examination question from database before punctuate, calculate Objective item answer region length and width, obtain examination question quantity, obtain objective item answer number and label, calculate objective item in answer Original position in card;Each subjective item individually calculates the position in answering card.
4. a kind of picture segmentation method positioned based on three-point fix and straight line as claimed in claim 1, it is characterized in that, pass through When scan components obtain every answering card, the recordable picture information in database, including title and sweep time, scan and stagger the time, There is position in data-base recording.
5. a kind of picture segmentation method positioned based on three-point fix and straight line as claimed in claim 1, it is characterized in that, rotation During picture, anglec of rotation calculation:The position for defining rotary shaft is A points, and the position under the point of contact is B points, what contact was upspring Position is C points, and a triangle is constituted by tri- summits of ABC, and the angle where each summit is angle A, angle B, angle C, each summit Just to triangle side be a, b, c, calculate angle A the number of degrees.
6. a kind of picture segmentation method positioned based on three-point fix and straight line as claimed in claim 5, it is characterized in that, calculate During the number of degrees of angle A, the coordinate (x, y) of A points is got by the position of picture and the length and width of picture, the coordinate of B points and C points (x1, y1), (x2, y2) can be obtained from motionEvent, and each side length of side of triangle is:
Double a=Math.sqrt ((x1-x2) * (x1-x2)+(y1-y2) * (y1-y2));
Double b=Math.sqrt ((x-x2) * (x-x2)+(y-y2) * (y-y2));
Double c=Math.sqrt ((x1-x) * (x1-x)+(y1-y) * (y1-y));
The cosine value for obtaining angle A is double cosA=(b*b+c*c-a*a)/(2*b*c);
Then the radian of angle A is double arcA=Math.acos (cosA);
This radian is between 0-PI, to change angle into and use double angleA=arcA*180/Math.PI;
Wherein, motionEvent rotational events, Double data types, double precision, Math.sqrt extraction of square roots, Math.acos Cosine, double angleA:Statement variable, Math.PI:Pi, π=3.14159265 ....
7. a kind of picture segmentation method positioned based on three-point fix and straight line as claimed in claim 1, it is characterized in that, also wrap The acquisition of answering card bar code is included, the barcode position of database purchase is inquired about, barcode position is cut into figure, make Graphics methods, Relative coordinate is obtained according to the coordinate points correspondence punctuate of database purchase, the length and width stored in database are obtained, new picture is made, Pictorial information is stored in database.Every paper has unique mark in database, and bar code and other examination questions belong to paper A part.
8. a kind of picture segmentation method, system positioned based on three-point fix and straight line, it is characterized in that, including:
The scan module of answering card:Obtain every answering card one by one by scan components, answering card be fabricated to corresponding picture, Picture is preserved to the position of setting, data-base recording storage location;
Answer sheet picture rotary module:Each pictures are read by database, beginning punctuate and the end of whole answering card is recognized Punctuate, according to punctuate rotating image, it is ensured that level between picture punctuate;
Answering card splits module:Postrotational each pictures are read by database, the position of each punctuate in picture is read, According to the length and width in the answer region set in database, by calculating whether next punctuate is to terminate punctuate, judge to terminate punctuate Position;Start punctuate in reading picture and terminate to whether there is straight line between punctuate, if it is present the answer region is one Examination question, if there is no straight line, selects the end Mistaken punctuations for thinking to choose, and continually looks for next punctuate, judges whether it is right The end node answered;End node is found, the answer region is made into Graphics methods, be cut into a small picture, and will be right Information record is answered in correspondence database.
CN201510888787.4A 2015-12-03 2015-12-03 A kind of picture segmentation method and system positioned based on three-point fix and straight line Pending CN106846320A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510888787.4A CN106846320A (en) 2015-12-03 2015-12-03 A kind of picture segmentation method and system positioned based on three-point fix and straight line

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510888787.4A CN106846320A (en) 2015-12-03 2015-12-03 A kind of picture segmentation method and system positioned based on three-point fix and straight line

Publications (1)

Publication Number Publication Date
CN106846320A true CN106846320A (en) 2017-06-13

Family

ID=59151955

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510888787.4A Pending CN106846320A (en) 2015-12-03 2015-12-03 A kind of picture segmentation method and system positioned based on three-point fix and straight line

Country Status (1)

Country Link
CN (1) CN106846320A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107451581A (en) * 2017-07-11 2017-12-08 济宁九点连线信息技术有限公司 A kind of method of batch Automatic Read Overmarginalia answering card

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101334814A (en) * 2008-04-28 2008-12-31 华北电力大学 Automatic scanning and reading system and reading method
CN103400124A (en) * 2013-07-03 2013-11-20 北京鸿合盛视数字媒体技术有限公司 Method and device for identifying test paper
CN103996022A (en) * 2014-05-12 2014-08-20 山东山大鸥玛软件有限公司 Boundary positioning method for scanned answer sheet image
JP2014219949A (en) * 2013-04-30 2014-11-20 良信 小村 Test scoring system
CN104820835A (en) * 2015-04-29 2015-08-05 岭南师范学院 Automatic examination paper marking method for examination papers

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101334814A (en) * 2008-04-28 2008-12-31 华北电力大学 Automatic scanning and reading system and reading method
JP2014219949A (en) * 2013-04-30 2014-11-20 良信 小村 Test scoring system
CN103400124A (en) * 2013-07-03 2013-11-20 北京鸿合盛视数字媒体技术有限公司 Method and device for identifying test paper
CN103996022A (en) * 2014-05-12 2014-08-20 山东山大鸥玛软件有限公司 Boundary positioning method for scanned answer sheet image
CN104820835A (en) * 2015-04-29 2015-08-05 岭南师范学院 Automatic examination paper marking method for examination papers

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107451581A (en) * 2017-07-11 2017-12-08 济宁九点连线信息技术有限公司 A kind of method of batch Automatic Read Overmarginalia answering card

Similar Documents

Publication Publication Date Title
CN202939608U (en) Test paper inspecting system
US10964060B2 (en) Neural network-based camera calibration
CN101477696B (en) Human character cartoon image generating method and apparatus
CN104794948A (en) Automatic scoring system and method for applying same
US9665759B2 (en) Decoding method for matrix two-dimensional code
CN105426844B (en) A kind of answer card identification method
CN111507251A (en) Method and device for positioning answer area in test question image and electronic equipment
CN110287854B (en) Table extraction method and device, computer equipment and storage medium
CN102360419A (en) Method and system for computer scanning reading management
CN110689013A (en) Automatic marking method and system based on feature recognition
CN105868759A (en) Method and apparatus for segmenting image characters
CN104463066B (en) Method for rapidly positioning and recognizing one-dimensional barcode of outer commodity package
CN111860527A (en) Image correction method, image correction device, computer device, and storage medium
CN107679442A (en) Method, apparatus, computer equipment and the storage medium of document Data Enter
CN115457565A (en) OCR character recognition method, electronic equipment and storage medium
CN110909743A (en) Book checking method and book checking system
CN103488965A (en) Freight note information inputting and colored color-lump encoding-decoding system
CN106846320A (en) A kind of picture segmentation method and system positioned based on three-point fix and straight line
CN204537507U (en) Automatic marking papers system
CN108764248B (en) Image feature point extraction method and device
CN204641116U (en) A kind of orientation film
CN110334647A (en) A kind of parameter format method based on image recognition
CN116129126A (en) Construction method of segmentation prediction model, picture semantic segmentation labeling method and device
CN115625435A (en) Intelligent recognition cutting method, device and system
CN111563407B (en) Model training method, picture direction correcting method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20170613