http://bbs.csdn.net/topics/391053201![]() 如圖 是學(xué)生沒(méi)有填涂的空?qǐng)D,如果現(xiàn)在有學(xué)生填涂了,想識(shí)別出來(lái),考生填涂的字母及對(duì)應(yīng)的位置。請(qǐng)問(wèn)如何實(shí)現(xiàn),最好有例子或關(guān)鍵程序段。 回復(fù)于: 2015-06-14 11:17:52
vfp 不太適合做這種事情,給一個(gè)簡(jiǎn)單的測(cè)試?yán)?,已提供思?/span> PUBLIC oform1 oform1=NEWOBJECT("form1") oform1.Show RETURN ************************************************** *-- Form: form1 (d:\amp\web\vfp\ocr.scx) *-- 父類(lèi): form *-- 基類(lèi): form * DEFINE CLASS form1 AS form Top = 0 Left = 0 Height = 361 Width = 433 DoCreate = .T. Caption = "Form1" Name = "Form1" ADD OBJECT command1 AS commandbutton WITH ; Top = 336, ; Left = 168, ; Height = 25, ; Width = 48, ; Caption = "加載", ; Name = "Command1" ADD OBJECT label1 AS label WITH ; AutoSize = .T., ; BackStyle = 0, ; Caption = "Label1", ; Height = 16, ; Left = 228, ; Top = 340, ; Width = 38, ; Name = "Label1" PROCEDURE MouseMove LPARAMETERS nButton, nShift, nXCoord, nYCoord Local c,r,g,b c = ThisForm.Point(nXCoord, nYCoord) c = ((c % 256) + (int(c/256)%256) + (int(c/256/256))) /3 *c = IIF(c < 128, 1, 0) ThisForm.Label1.Caption = IIF(c < 64, '有', '無(wú)') *WAIT WINDOW TRANSFORM(nXCoord) +',' + TRANSFORM(nYCoord) + ':' + TRANSFORM(c) NOWAIT ENDPROC PROCEDURE command1.Click thisform.picture="ocr001.bmp" ENDPROC ENDDEFINE * *-- 結(jié)束定義: form1 ************************************************** ![]() 探索左側(cè)和右下角的定位塊并計(jì)算出答題框的坐標(biāo),遍歷就可以 |
|
|
來(lái)自: 昵稱(chēng)10096004 > 《VFP》