用VB怎么读取一张图然后识别出图上唯一红点的位置并以坐标形式保存下来?图是摄像头拍出来的,VB代码或软
展开全部
先将图片加载 将鼠标指向红点 从text1里面获取这个点的颜色值
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Text1.Text = Picture1.Point(X, Y)
End Sub
然后
Private Sub Command2_Click()
For Y = 0 To Picture1.Height
For X = 0 To Picture1.Width
DoEvents
Me.Caption = X & ":" & Y
If Picture1.Point(X, Y) = 3355596 Then '‘‘其中3355596这个数值改为刚刚获取的值
MsgBox X & ":" & Y
find = True
Exit For
End If
Next X
If fine = ture Then
Exit For
End If
Next Y
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Text1.Text = Picture1.Point(X, Y)
End Sub
然后
Private Sub Command2_Click()
For Y = 0 To Picture1.Height
For X = 0 To Picture1.Width
DoEvents
Me.Caption = X & ":" & Y
If Picture1.Point(X, Y) = 3355596 Then '‘‘其中3355596这个数值改为刚刚获取的值
MsgBox X & ":" & Y
find = True
Exit For
End If
Next X
If fine = ture Then
Exit For
End If
Next Y
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询