请帮忙翻译一下这段VB程序
我做人脸识别,希望大家给点资料,关于人脸中比如眼角和嘴角的距离怎么测.谢谢了!PrivateSubEZHH_Click()Picture1.ClsText4.Text="...
我做人脸识别,希望大家给点资料,关于人脸中比如眼角和嘴角的距离怎么测.谢谢了!
Private Sub EZHH_Click()
Picture1.Cls
Text4.Text = "二值化中"
For x0 = 0 To Picture3.Width
For y0 = 0 To Picture3.Height
c = Picture3.Point(x0, y0)
Red = (c And &HFF)
Green = (c And 65280) / 256
Blue = (c And &HFF0000) / 65536
graycolor = (Red + Green + Blue) / 3
If graycolor < 147 Then
T = 0
Else
T = 255
End If
Picture4.PSet (x0, y0), RGB(T, T, T)
DoEvents
Next
Next
Text4.Text = "二值化完毕"
End Sub
Private Sub GYH_Click()
Picture2.Width = 1695
Picture2.Height = 1935
Picture2.PaintPicture Picture1.Picture, 0, 0, Picture5.Width, Picture5.Height, 0, 0, Picture1.Width, Picture1.Height
Text2.Text = "归一化完毕"
End Sub
Private Sub HDH_Click()
Text3.Text = "灰度化中"
Dim Red As Integer
Dim Green As Integer
Dim Blue As Integer
Dim c As Long
Dim graycolor As Long
Dim x0 As Integer
Dim y0 As Integer
For x0 = 0 To Picture2.Width
For y0 = 0 To Picture2.Height
c = Picture2.Point(x0, y0)
Red = (c And &HFF)
Green = (c And 65280) / 256
Blue = (c And &HFF0000) / 65536
graycolor = (Red + Green + Blue) / 3
Picture3.PSet (x0, y0), RGB(graycolor, graycolor, graycolor)
DoEvents
Next
Next
Text3.Text = "灰度化完毕"
End Sub
Private Sub Open_Click()
Text2.Text = "归一窗口"
Text3.Text = "灰度窗口"
Text4.Text = "二值窗口"
Text5.Text = "识别窗口"
On Error Resume Next
CommonDialog1.DialogTitle = "打开文件"
CommonDialog1.Filter = "所有支持的格式" + "(*.jpg;*.bmp;*.gif;*.pcx;*.ico)|"
CommonDialog1.ShowOpen
If CommonDialog1.FileName <> "" Then
If Err <> 32755 Then
Dim openfilename As String
openfilename = CommonDialog1.FileName
Picture1.Picture = LoadPicture(openfilename)
End If
End If
Text1.Text = "打开图片"
If Image.Height <> 1935 Then
Image.Height = 1935
End If
If Image.Width <> 1695 Then
Image.Width = 1695
End If
End Sub 展开
Private Sub EZHH_Click()
Picture1.Cls
Text4.Text = "二值化中"
For x0 = 0 To Picture3.Width
For y0 = 0 To Picture3.Height
c = Picture3.Point(x0, y0)
Red = (c And &HFF)
Green = (c And 65280) / 256
Blue = (c And &HFF0000) / 65536
graycolor = (Red + Green + Blue) / 3
If graycolor < 147 Then
T = 0
Else
T = 255
End If
Picture4.PSet (x0, y0), RGB(T, T, T)
DoEvents
Next
Next
Text4.Text = "二值化完毕"
End Sub
Private Sub GYH_Click()
Picture2.Width = 1695
Picture2.Height = 1935
Picture2.PaintPicture Picture1.Picture, 0, 0, Picture5.Width, Picture5.Height, 0, 0, Picture1.Width, Picture1.Height
Text2.Text = "归一化完毕"
End Sub
Private Sub HDH_Click()
Text3.Text = "灰度化中"
Dim Red As Integer
Dim Green As Integer
Dim Blue As Integer
Dim c As Long
Dim graycolor As Long
Dim x0 As Integer
Dim y0 As Integer
For x0 = 0 To Picture2.Width
For y0 = 0 To Picture2.Height
c = Picture2.Point(x0, y0)
Red = (c And &HFF)
Green = (c And 65280) / 256
Blue = (c And &HFF0000) / 65536
graycolor = (Red + Green + Blue) / 3
Picture3.PSet (x0, y0), RGB(graycolor, graycolor, graycolor)
DoEvents
Next
Next
Text3.Text = "灰度化完毕"
End Sub
Private Sub Open_Click()
Text2.Text = "归一窗口"
Text3.Text = "灰度窗口"
Text4.Text = "二值窗口"
Text5.Text = "识别窗口"
On Error Resume Next
CommonDialog1.DialogTitle = "打开文件"
CommonDialog1.Filter = "所有支持的格式" + "(*.jpg;*.bmp;*.gif;*.pcx;*.ico)|"
CommonDialog1.ShowOpen
If CommonDialog1.FileName <> "" Then
If Err <> 32755 Then
Dim openfilename As String
openfilename = CommonDialog1.FileName
Picture1.Picture = LoadPicture(openfilename)
End If
End If
Text1.Text = "打开图片"
If Image.Height <> 1935 Then
Image.Height = 1935
End If
If Image.Width <> 1695 Then
Image.Width = 1695
End If
End Sub 展开
2个回答
展开全部
私有次级EZHH_Click ()
Picture1.Cls
Text4.Text = “二值化中”
For x0 = 0对Picture3.Width
For y0 = 0对Picture3.Height
c = Picture3.Point (x0, y0)
Red = (c和&HFF)
Green = (c和65280)/256
Blue = (c和&HFF0000)/65536
graycolor = (红色+绿色+蓝色)/3
If graycolor < 147然后
T = 0
Else
T = 255
End,如果
Picture4.PSet (x0, y0), RGB (T, T, T)
DoEvents
Next
Next
Text4.Text = “二值化完毕”
End潜水艇
Private次级GYH_Click ()
Picture2.Width = 1695年
Picture2.Height = 1935年
Picture2.PaintPicture Picture1.Picture, 0, 0, Picture5.Width, Picture5.Height, 0, 0, Picture1.Width, Picture1.Height
Text2.Text = “归一化完毕”
End潜水艇
Private次级HDH_Click ()
Text3.Text = “灰度化中” 作为整数的Dim红色 作为整数的Dim绿色 作为整数的Dim蓝色
Dim c作为长期
Dim graycolor作为长期 作为整数的Dim x0 作为整数的Dim y0
For x0 = 0对Picture2.Width
For y0 = 0对Picture2.Height
c = Picture2.Point (x0, y0)
Red = (c和&HFF)
Green = (c和65280)/256
Blue = (c和&HFF0000)/65536
graycolor = (红色+绿色+蓝色)/3
Picture3.PSet (x0, y0), RGB (graycolor、graycolor, graycolor)
DoEvents
Next
Next
Text3.Text = “灰度化完毕”
End潜水艇
Private次级Open_Click ()
Text2.Text = “归一窗口”
Text3.Text = “灰度窗口”
Text4.Text = “二值窗口”
Text5.Text = “识别窗口”
On其次错误简历
CommonDialog1.DialogTitle = “打开文件”
CommonDialog1.Filter = “所有支持的格式” +” (*.jpg; *.bmp; *.gif; *.pcx; *.ico)|"
CommonDialog1.ShowOpen 然后If CommonDialog1.FileName ""
If然后犯错32755 作为串的Dim openfilename
openfilename = CommonDialog1.FileName
Picture1.Picture = LoadPicture (openfilename)
End,如果
End,如果
Text1.Text = “打开图片”
If Image.Height 1935然后
Image.Height = 1935年
End,如果
If Image.Width 1695然后
Image.Width = 1695年
End,如果
End潜水艇
Picture1.Cls
Text4.Text = “二值化中”
For x0 = 0对Picture3.Width
For y0 = 0对Picture3.Height
c = Picture3.Point (x0, y0)
Red = (c和&HFF)
Green = (c和65280)/256
Blue = (c和&HFF0000)/65536
graycolor = (红色+绿色+蓝色)/3
If graycolor < 147然后
T = 0
Else
T = 255
End,如果
Picture4.PSet (x0, y0), RGB (T, T, T)
DoEvents
Next
Next
Text4.Text = “二值化完毕”
End潜水艇
Private次级GYH_Click ()
Picture2.Width = 1695年
Picture2.Height = 1935年
Picture2.PaintPicture Picture1.Picture, 0, 0, Picture5.Width, Picture5.Height, 0, 0, Picture1.Width, Picture1.Height
Text2.Text = “归一化完毕”
End潜水艇
Private次级HDH_Click ()
Text3.Text = “灰度化中” 作为整数的Dim红色 作为整数的Dim绿色 作为整数的Dim蓝色
Dim c作为长期
Dim graycolor作为长期 作为整数的Dim x0 作为整数的Dim y0
For x0 = 0对Picture2.Width
For y0 = 0对Picture2.Height
c = Picture2.Point (x0, y0)
Red = (c和&HFF)
Green = (c和65280)/256
Blue = (c和&HFF0000)/65536
graycolor = (红色+绿色+蓝色)/3
Picture3.PSet (x0, y0), RGB (graycolor、graycolor, graycolor)
DoEvents
Next
Next
Text3.Text = “灰度化完毕”
End潜水艇
Private次级Open_Click ()
Text2.Text = “归一窗口”
Text3.Text = “灰度窗口”
Text4.Text = “二值窗口”
Text5.Text = “识别窗口”
On其次错误简历
CommonDialog1.DialogTitle = “打开文件”
CommonDialog1.Filter = “所有支持的格式” +” (*.jpg; *.bmp; *.gif; *.pcx; *.ico)|"
CommonDialog1.ShowOpen 然后If CommonDialog1.FileName ""
If然后犯错32755 作为串的Dim openfilename
openfilename = CommonDialog1.FileName
Picture1.Picture = LoadPicture (openfilename)
End,如果
End,如果
Text1.Text = “打开图片”
If Image.Height 1935然后
Image.Height = 1935年
End,如果
If Image.Width 1695然后
Image.Width = 1695年
End,如果
End潜水艇
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询