亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? classimageprocessing.cls

?? FaceRec 簡單易懂的神經網絡面部特征識別例子 [VB源碼]
?? CLS
?? 第 1 頁 / 共 3 頁
字號:
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "classImageProcessing"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit

Public width As Integer
Public height As Integer
Dim image() As Byte

Dim edgeTraced() As Boolean
Dim temp() As Boolean
Public TraceEdgesThresh As Integer
Public minEdgeLength As Integer
Dim traceDirection As Single
Dim traceRadius As Integer
Dim traceX As Single
Dim traceY As Single

Dim angleHistogram(18) As Integer

Public edgesWidth As Integer
Public edgesHeight As Integer
Dim Edges() As Byte

Public processType As Integer

Public EdgeThreshold As Single
Dim averageContrast As Double

Const image_raw = 0
Const image_red = 1
Const image_green = 2
Const image_blue = 3
Const image_edges = 4
Const IMAGE_MOVEMENT = 5


Public scanInterval As Integer


'masks used for edge detection
Const NO_OF_EDGE_MASKS = 14
Dim EdgeMask(NO_OF_EDGE_MASKS)
Const NO_OF_EDGE_TYPES = 5
Dim EdgeHistogram(NO_OF_EDGE_TYPES) As Integer

Const EDGE_VECTOR_LENGTH = 200
Dim EdgeVector(5, EDGE_VECTOR_LENGTH) As Single
Dim currEdgeVector As Integer
Dim maxEdgeVectorIntensity As Integer

'colour histogram levels
Dim Histogram_levels As Integer
Dim ColourHistogram() As Double
Dim Hist() As Double


Public Sub showTestCard(pic As PictureBox)
  Dim x As Integer
  Dim maxcol As Long
  Dim col As Long
  
  pic.Cls
  maxcol = RGB(255, 255, 255)
  For x = 0 To pic.ScaleWidth
    col = (maxcol / pic.ScaleWidth) * x
    pic.Line (x, 0)-(x, pic.ScaleHeight), col
  Next
End Sub


Public Function colourSimilarity(pic As PictureBox, topX As Integer, topY As Integer, areaWidth As Integer, areaHeight As Integer) As Single
'compares an area of an image to the colour histogram
  Dim x As Integer
  Dim y As Integer
  Dim RGBvalue As Long
  Dim maxValue As Double
  Dim index As Integer
  Dim max As Double
  Dim similarity As Single
  Dim fract As Single
  Dim i As Integer
  Dim dc As Single
  Dim redValue As Byte
  Dim greenValue As Byte
  Dim blueValue As Byte
  
  'get histogram
  maxValue = RGB(255, 255, 255)
  For x = 0 To areaWidth - 1
    For y = 0 To areaHeight - 1
      RGBvalue = pic.Point(topX + x, topY + y)
      
      If (RGBvalue > 0) Then
        redValue = getRGBvalue(RGBvalue, 0)
        greenValue = getRGBvalue(RGBvalue, 1)
        blueValue = getRGBvalue(RGBvalue, 2)
        index = Int(getSpectrumValue(redValue, greenValue, blueValue) * Histogram_levels)
      
        Hist(index) = Hist(index) + 1
        If (Hist(index) > max) Then
          max = Hist(index)
        End If
      End If
    Next
  Next
  
  'normalize
  If (max > 0.01) Then
    For index = 0 To Histogram_levels - 1
      Hist(index) = Hist(index) / max
    Next
  End If
  
  'compare
  similarity = 0
  i = 0
  For index = 0 To Histogram_levels - 1
    If (ColourHistogram(index) > 0) And (Hist(index) > 0) Then
      dc = Abs(Hist(index) - ColourHistogram(index))
      similarity = similarity + (1 - (dc * dc))
      i = i + 1
    End If
  Next
  If (i > 0) Then
    similarity = similarity / i
  End If
  
  colourSimilarity = similarity
End Function






Private Function traceSearch(Optional beginSearch As Boolean) As Boolean
'move the trace point in a curcular motion until a new feature is found
'returns TRUE when a new feature is located
  
  Dim tx As Integer
  Dim ty As Integer
  
  traceSearch = False
  
  If (beginSearch) Then
    traceDirection = 0
    traceRadius = 90
  End If
  
  traceX = traceX + Cos((traceDirection / 180) * 3.14)
  traceY = traceY + Sin((traceDirection / 180) * 3.14)
  traceDirection = traceDirection + traceRadius
  If (traceDirection > 360) Then
    traceDirection = 0
    traceRadius = traceRadius - 1
    If (traceRadius < 0) Then
      traceRadius = 0
    End If
  End If
  
  If (traceX < 0) Then
    traceX = 0
  End If
  If (traceX >= width) Then
    traceX = width - 1
  End If
  If (traceY < 0) Then
    traceY = 0
  End If
  If (traceY >= height) Then
    traceY = height - 1
  End If
  
  tx = Int(traceX)
  ty = Int(traceY)
  
  If ((image(tx, ty) > TraceEdgesThresh) And (Not edgeTraced(tx, ty))) Then
    traceSearch = True
  End If
End Function


Public Sub showColourHistogram(pic As PictureBox)
  Dim i As Integer
  Dim x As Integer
  Dim y As Integer
  Dim prev_x As Integer
  Dim prev_y As Integer
  Dim c As Long
  
  pic.Cls
  c = RGB(255, 255, 255)
  pic.DrawWidth = 1
  For i = 0 To Histogram_levels
    If (ColourHistogram(i) <= 1) And (ColourHistogram(i) >= 0) Then
      x = (pic.ScaleWidth / Histogram_levels) * i
      y = pic.ScaleHeight - (pic.ScaleHeight * ColourHistogram(i))
      If (i > 0) Then
        pic.Line (prev_x, prev_y)-(x, y), c
      End If
      prev_x = x
      prev_y = y
    End If
  Next
  
End Sub


Private Sub calcAngleHistogram()
'calculates a histogram from the angles of edge traces
  Dim i As Integer
  Dim dx As Integer
  Dim dy As Integer
  Dim length As Integer
  Dim angle As Single
  Dim intensity As Single
  
  
  For i = 0 To 17
    angleHistogram(i) = 0
  Next
    
  For i = 0 To currEdgeVector - 1
    dx = EdgeVector(0, i) - EdgeVector(2, i)
    dy = Abs(EdgeVector(1, i) - EdgeVector(3, i))
    length = Sqr((dx * dx) + (dy * dy))
    If (length > 0) Then
      angle = (Acos(dy / length) / 3.14) * 180
      If (dx < 0) Then
        angle = 180 - angle
      End If
      angle = Int(angle / 10)
      intensity = 1 'EdgeVector(4, i) / 255
      angleHistogram(angle) = angleHistogram(angle) + (length * intensity)
    End If
  Next
  
End Sub


Public Sub applyThreshold(value As Byte)
'applies a threshold to the image
  Dim x As Integer
  Dim y As Integer
  
  For x = 0 To width - 1
    For y = 0 To height - 1
      If (image(x, y) < value) Then
        image(x, y) = 0
      End If
    Next
  Next
End Sub


Private Sub initEdgeMasks()
'defines edge masks
' 1 = horizontal
' 2 = vertical
' 3 = diagonal left
' 4 = diagonal right
' 5 = cross
  
  Dim mask
  Dim i As Integer
  Dim mstr As String
    
  'Lines -
  EdgeMask(0) = Array(1, 1, 1, _
                      0, 0, 0, _
                      0, 0, 0, _
                      1)
  EdgeMask(1) = Array(0, 0, 0, _
                      1, 1, 1, _
                      0, 0, 0, _
                      1)
  EdgeMask(2) = Array(0, 0, 0, _
                      0, 0, 0, _
                      1, 1, 1, _
                      1)
  'Lines |
  EdgeMask(3) = Array(1, 0, 0, _
                      1, 0, 0, _
                      1, 0, 0, _
                      2)
  EdgeMask(4) = Array(0, 1, 0, _
                      0, 1, 0, _
                      0, 1, 0, _
                      2)
  EdgeMask(5) = Array(0, 0, 1, _
                      0, 0, 1, _
                      0, 0, 1, _
                      2)
  'Diagonals
  EdgeMask(6) = Array(0, 0, 1, _
                      0, 1, 0, _
                      1, 0, 0, _
                      3)
  EdgeMask(7) = Array(0, 1, 0, _
                      1, 0, 0, _
                      0, 0, 0, _
                      3)
  EdgeMask(8) = Array(0, 0, 0, _
                      0, 0, 1, _
                      0, 1, 0, _
                      3)
  EdgeMask(9) = Array(1, 0, 0, _
                      0, 1, 0, _
                      0, 0, 1, _
                      4)
  EdgeMask(10) = Array(0, 1, 0, _
                      0, 0, 1, _
                      0, 0, 0, _
                      4)
  EdgeMask(11) = Array(0, 0, 0, _
                      1, 0, 0, _
                      0, 1, 0, _
                      4)
  'Crosses
  EdgeMask(12) = Array(1, 0, 1, _
                      0, 1, 0, _
                      1, 0, 1, _
                      5)
  EdgeMask(13) = Array(0, 1, 0, _
                      1, 1, 1, _
                      0, 1, 0, _
                      5)
  'nothing
  'EdgeMask(14) = Array(0, 0, 0, _
  '                     0, 0, 0, _
  '                     0, 0, 0, _
  '                     0) 'last number indicates edge type
  'EdgeMask(15) = Array(1, 1, 1, _
  '                     1, 1, 1, _
  '                     1, 1, 1, _
  '                     0)
End Sub




Public Sub traceEdges()
'traces edges within the image
  Dim finished As Boolean
  Dim x As Integer
  Dim y As Integer
  Dim traced As Boolean
  
  finished = False
  traced = False
  x = 0
  y = 0
  While (Not finished)
    x = x + 1
    If (x = width) Then
      y = y + 1
      x = 0
    End If
    If (y < height) Then
      If ((edgeTraced(x, y) = False) And (image(x, y) > TraceEdgesThresh)) Then
        traced = traceEdgesFromPoint(x, y, 0)
      End If
      Else
      x = 0
      y = 0
      If (Not traced) Then
        finished = True
      End If
      traced = False
    End If
  Wend
  
  Call sortEdgeVector
  Call calcAngleHistogram
  
End Sub




Private Sub diffuseEdges()
'diffuses edges information
'this allows edge tracing to be more noise tollerant
  Dim x As Integer
  Dim y As Integer
  Dim i As Integer
  Dim value As Integer
  
  For i = 0 To 1
    For x = 1 To width - 2
      For y = 1 To height - 2
        If (image(x, y) > TraceEdgesThresh) Then
          image(x, y) = 255
          
          'value = image(x - 1, y - 1)
          'value = value + image(x - 1, y)
          'value = value + image(x - 1, y + 1)
          'value = value + image(x + 1, y - 1)
          'value = value + image(x + 1, y)
          'value = value + image(x + 1, y + 1)
          'value = value + image(x, y + 1)
          'value = value + image(x, y - 1)
          'value = value / 8
          'image(x, y) = value
        End If
      Next
    Next
  Next
  
End Sub


Public Function traceEdgesFromPoint(ByRef x As Integer, ByRef y As Integer, ByRef edgeLength As Integer) As Boolean
'traces along edges starting at the given point
  Dim i As Integer
  Dim j As Integer
  Dim sx As Integer
  Dim sy As Integer
  Dim xx As Integer
  Dim yy As Integer
  Dim pathFound As Boolean
  Dim initialEdgeLength As Integer
  Dim mindirection As Single
  Dim maxdirection As Single
  Dim initialX As Integer
  Dim initialY As Integer
  Dim max As Integer
  Dim value As Integer
  Dim intensity As Single
  Dim direction As Integer
  Static averagedirection As Single
  Dim directionDifference As Integer
  Dim thresh As Integer
    
  initialX = x
  initialY = y
  xx = initialX
  yy = initialY
  initialEdgeLength = edgeLength
  intensity = 0
  thresh = 0 ' TraceEdgesThresh / 2
  
  If (initialEdgeLength = 0) Then
    For i = 0 To width - 1
      For j = 0 To height - 1
        temp(i, j) = False
      Next
    Next
  End If
  
  averagedirection = 0
  traceEdgesFromPoint = False
  While ((image(xx, yy) > thresh) And (temp(xx, yy) = False))
    sx = xx
    sy = yy
    temp(xx, yy) = True
    edgeLength = edgeLength + 1
    If (edgeTraced(xx, yy) = False) And (edgeLength > minEdgeLength) Then
      traceEdgesFromPoint = True
    End If
    pathFound = False
    max = 0
    
    If (sy > 0) Then
      value = image(sx, sy - 1)
      If ((value > thresh) And (temp(sx, sy - 1) = False)) Then
        If (value > max) And ((averagedirection > 270) Or (averagedirection < 90)) Then
          max = value
          xx = sx
          yy = sy - 1
          direction = 0
        End If
      End If
    End If
    
    If (sx < width - 1) Then
      
      If (sy > 0) Then
        value = image(sx + 1, sy - 1)
        If ((value > thresh) And (temp(sx + 1, sy - 1) = False)) Then
          If (value > max) And ((averagedirection > 315) And (averagedirection < 135)) Then
            max = value
            xx = sx
            yy = sy - 1
            direction = 45
          End If
        End If
      End If
      
      value = image(sx + 1, sy)
      If ((value > thresh) And (temp(sx + 1, sy) = False)) Then
        If (value > max) And ((averagedirection > 0) And (averagedirection < 180)) Then
          max = value
          xx = sx + 1
          yy = sy
          direction = 90
        End If
      End If
    
    
      If (sy < height - 1) Then
        value = image(sx + 1, sy + 1)
        If ((value > thresh) And (temp(sx + 1, sy + 1) = False)) Then
          If (value > max) And ((averagedirection > 45) And (averagedirection < 225)) Then
            max = value
            xx = sx

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美日韩综合| 国产精品视频一区二区三区不卡| 97se亚洲国产综合自在线| 国产乱对白刺激视频不卡| 麻豆久久久久久| 国产麻豆精品在线| 国产盗摄视频一区二区三区| 国产成人日日夜夜| 99久久婷婷国产综合精品电影| 成人av免费网站| 91蝌蚪porny| 欧美手机在线视频| 日韩写真欧美这视频| 2020国产精品| 欧美高清在线一区二区| 捆绑调教美女网站视频一区| 日韩av中文字幕一区二区| 美日韩一区二区三区| 国产一区二区三区| 9人人澡人人爽人人精品| 92国产精品观看| 欧美一三区三区四区免费在线看| 777午夜精品免费视频| 日韩欧美国产午夜精品| 国产精品狼人久久影院观看方式| 一区二区三区资源| 久久99热99| 97精品久久久午夜一区二区三区| 欧美日韩国产一区| 国产片一区二区| 午夜精品久久久久| 成人手机在线视频| 欧美日韩国产首页| 中文字幕精品三区| 日韩成人精品视频| 99这里都是精品| 日韩区在线观看| 亚洲视频免费看| 狠狠色丁香久久婷婷综| 色琪琪一区二区三区亚洲区| 日韩欧美在线123| 亚洲视频图片小说| 国产成人欧美日韩在线电影| 欧美婷婷六月丁香综合色| 国产亚洲精品aa| 水蜜桃久久夜色精品一区的特点| 从欧美一区二区三区| 日韩欧美中文一区二区| 亚洲精品乱码久久久久久| 国产99久久久久久免费看农村| 欧美日本国产视频| 亚洲色图制服诱惑| 成人网页在线观看| www国产精品av| 美女视频一区在线观看| 欧美日韩一区久久| 一区二区三区四区不卡在线 | 成人免费视频免费观看| 欧美一二三四区在线| 亚洲午夜久久久久久久久电影网| 国产99一区视频免费| 国产亚洲精品超碰| 国产原创一区二区| 26uuu久久天堂性欧美| 日韩av一区二区在线影视| 欧美日本乱大交xxxxx| 亚洲国产色一区| 欧美视频三区在线播放| 亚洲综合视频在线观看| 色偷偷88欧美精品久久久 | 97精品国产露脸对白| 久久精品人人做| 国产成人在线免费观看| 国产亚洲精品精华液| 成人激情免费网站| 亚洲人妖av一区二区| av在线综合网| 一区二区在线观看av| 91福利国产成人精品照片| 一区二区三区在线视频免费观看| 一本色道a无线码一区v| 亚洲一区二区三区四区在线免费观看 | 91久久香蕉国产日韩欧美9色| 国产精品国产三级国产普通话99| 风间由美性色一区二区三区| 国产精品美女www爽爽爽| 9i在线看片成人免费| 亚洲综合一区二区精品导航| 欧美色偷偷大香| 另类小说色综合网站| 国产午夜亚洲精品理论片色戒| 国产成人精品免费网站| 亚洲欧美另类久久久精品| 欧美日韩一二三| 激情亚洲综合在线| 国产精品乱人伦一区二区| 日本高清不卡一区| 精品一区二区免费| 中文字幕中文字幕一区二区 | 青青国产91久久久久久| 久久久精品国产免费观看同学| 国产69精品久久99不卡| 亚洲国产一二三| 精品久久久久久久久久久久包黑料 | 国产精品免费网站在线观看| 色一区在线观看| 蜜臀久久99精品久久久画质超高清| 久久婷婷一区二区三区| 在线精品观看国产| 国产盗摄视频一区二区三区| 亚洲综合丁香婷婷六月香| 久久综合av免费| 欧美性高清videossexo| 国产一区二区免费看| 亚洲永久免费av| 国产欧美1区2区3区| 在线不卡的av| 99久久免费视频.com| 国产综合色在线视频区| 亚洲一区二区三区三| 国产精品美女久久福利网站| 日韩一区二区精品| 欧美亚洲国产一区二区三区va| 国产在线不卡一区| 日本亚洲一区二区| 亚洲激情图片一区| 国产欧美精品一区| 欧美精品一区二区三区视频 | 国产在线精品免费av| 亚洲国产美国国产综合一区二区| 中文一区二区完整视频在线观看| 欧美日韩日日骚| 91视频观看视频| 国产二区国产一区在线观看| 美脚の诱脚舐め脚责91| 午夜精品久久久久久久久| 自拍偷拍国产精品| 日本一区二区视频在线观看| 日韩三级在线免费观看| 欧美精品乱码久久久久久| 91国内精品野花午夜精品| 不卡欧美aaaaa| 国产麻豆91精品| 国产美女久久久久| 国内精品久久久久影院色| 精品一区免费av| 麻豆免费看一区二区三区| 日本特黄久久久高潮| 日本怡春院一区二区| 日韩1区2区日韩1区2区| 免费成人在线播放| 久久99久久99| 韩国视频一区二区| 国产高清久久久| 成人一区在线看| 成人免费黄色在线| 91在线视频观看| 91麻豆蜜桃一区二区三区| 91亚洲午夜精品久久久久久| 在线一区二区三区四区五区| 欧洲一区二区三区在线| 欧美乱妇20p| 日韩一区二区视频| 国产亚洲精品资源在线26u| 中文字幕视频一区| 亚洲午夜免费视频| 老司机精品视频导航| 激情综合网激情| 成人理论电影网| 91国偷自产一区二区使用方法| 欧美剧情片在线观看| 3atv一区二区三区| 久久精品水蜜桃av综合天堂| 日本一区二区三区四区| 亚洲欧美日韩一区| 秋霞成人午夜伦在线观看| 国产做a爰片久久毛片| www.日韩精品| 538在线一区二区精品国产| 亚洲精品一区在线观看| 亚洲人成网站影音先锋播放| 水蜜桃久久夜色精品一区的特点 | 亚洲成人免费av| 国产一区二区三区最好精华液| 国产成人夜色高潮福利影视| 在线观看网站黄不卡| 亚洲精品一区二区三区香蕉| ●精品国产综合乱码久久久久| 亚洲成人综合网站| 成熟亚洲日本毛茸茸凸凹| 欧美日韩高清一区二区| 国产区在线观看成人精品| 亚洲电影一区二区三区| 国产精华液一区二区三区| 欧美日韩成人一区二区| 国产精品天干天干在观线| 日韩avvvv在线播放| 色吧成人激情小说| 国产三区在线成人av| 水蜜桃久久夜色精品一区的特点|