I'm looking for an alg to know if a pixel is an outline pixel based on the pixels around it.
Public Shared Function isOutLine(ByVal xPos As Integer, ByVal Ypos As Integer, ByVal image As Bitmap, ByVal bias As Integer) As Boolean
Dim result As Boolean = False
Dim change As Byte = 0
If xPos > 0 And xPos < image.Width - 1 And Ypos > 0 And Ypos < image.Height - 1 Then
Dim color1, color2, color3, color4, color5, color6, color7, color8, color9 As Color
color1 = image.GetPixel(xPos - 1, Ypos - 1)
color2 = image.GetPixel(xPos, Ypos - 1)
color3 = image.GetPixel(xPos + 1, Ypos - 1)
color7 = image.GetPixel(xPos - 1, Ypos + 1)
color8 = image.GetPixel(xPos, Ypos + 1)
color9 = image.GetPixel(xPos + 1, Ypos + 1)
color4 = image.GetPixel(xPos - 1, Ypos)
color6 = image.GetPixel(xPos + 1, Ypos)
color5 = image.GetPixel(xPos, Ypos)
If (CType(color5.R, Integer) > CType(color4.R, Integer) - bias) And (CType(color5.R, Integer) < CType(color4.R, Integer) + bias) Then
change += 1
End If
If (CType(color5.G, Integer) > CType(color4.G, Integer) - bias) And (CType(color5.G, Integer) < CType(color4.G, Integer) + bias) Then
change += 1
End If
If (CType(color5.B, Integer) > CType(color4.B, Integer) - bias) And (CType(color5.B, Integer) < CType(color4.B, Integer) + bias) Then
change += 1
End If
End If
'Dim sumR, sumG, sumB As Integer
'sumR = (CType(color1.R, Integer) + CType(color2.R, Integer) + CType(color3.R, Integer))
'sumR -= (CType(color7.R, Integer) + CType(color8.R, Integer) + CType(color9.R, Integer))
''sumG = (CType(color7.R, Integer) + CType(color8.R, Integer) + CType(color9.R, Integer))
''sumG -= (CType(color1.G, Integer) + CType(color2.G, Integer) + CType(color3.G, Integer))
''sumB = (CType(color1.B, Integer) + CType(color2.B, Integer) + CType(color3.B, Integer))
''sumB -= (CType(color7.B, Integer) + CType(color8.B, Integer) + CType(color9.B, Integer))
'sumR = Abs(sumR)
''sumG = Abs(sumG)
''sumB = Abs(sumB)
''Dim sumR2, sumG2, sumB2 As Integer
''sumR2 = (CType(color1.R, Integer) + CType(color4.R, Integer) + CType(color7.R, Integer))
''sumG2 = (CType(color1.G, Integer) + CType(color4.G, Integer) + CType(color7.G, Integer))
''sumB2 = (CType(color1.B, Integer) + CType(color4.B, Integer) + CType(color7.B, Integer))
''sumR2 -= (CType(color3.R, Integer) + CType(color6.R, Integer) + CType(color9.R, Integer))
''sumG2 -= (CType(color3.G, Integer) + CType(color6.G, Integer) + CType(color9.G, Integer))
''sumB2 -= (CType(color3.B, Integer) + CType(color6.B, Integer) + CType(color9.B, Integer))
''sumR2 = Abs(sumR2)
''sumG2 = Abs(sumG2)
''sumB2 = Abs(sumB2)
''sumR2 = color1.R + color4.R + color7.R
''sumG2 = color1.G + color4.G + color7.G
''sumB2 = color1.B + color4.B + color7.B
''sumR2 -= color3.R + color6.R + color9.R
''sumG2 -= color3.G + color6.G + color9.G
''sumB2 -= color3.B + color6.B + color9.B
If change = 3 Then
result = True
End If
Return result
End Function
Imports System.Math
Public Class Form1
Dim eye1 As New Aeye()
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim bmp As New Bitmap("c:\testimage\x1.bmp")
Dim bmp2 As Bitmap = bmp.Clone()
PictureBox1.Image = bmp.Clone()
For i = 1 To bmp.Height - 2
For j = 1 To bmp.Width - 2
If Not Aeye.isOutLine(j, i, bmp, 20) Then
bmp2 = Aeye.mark_dark_pixel(j, i, bmp2, 1)
End If
Next
Next
PictureBox2.Image = bmp2.Clone()
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim bmp As New Bitmap("c:\testimage\x1.bmp")
PictureBox1.Image = bmp.Clone()
End Sub
End Class
Public Shared Function isOutLine(ByVal xPos As Integer, ByVal Ypos As Integer, ByVal image As Bitmap, ByVal bias As Integer) As Boolean
Dim result As Boolean = False
Dim change As Byte = 0
If xPos > 0 And xPos < image.Width - 1 And Ypos > 0 And Ypos < image.Height - 1 Then
Dim color1, color2, color3, color4, color5, color6, color7, color8, color9 As Color
color1 = image.GetPixel(xPos - 1, Ypos - 1)
color2 = image.GetPixel(xPos, Ypos - 1)
color3 = image.GetPixel(xPos + 1, Ypos - 1)
color7 = image.GetPixel(xPos - 1, Ypos + 1)
color8 = image.GetPixel(xPos, Ypos + 1)
color9 = image.GetPixel(xPos + 1, Ypos + 1)
color4 = image.GetPixel(xPos - 1, Ypos)
color6 = image.GetPixel(xPos + 1, Ypos)
color5 = image.GetPixel(xPos, Ypos)
If (CType(color5.R, Integer) > CType(color4.R, Integer) - bias) And (CType(color5.R, Integer) < CType(color4.R, Integer) + bias) Then
change += 1
End If
If (CType(color5.G, Integer) > CType(color4.G, Integer) - bias) And (CType(color5.G, Integer) < CType(color4.G, Integer) + bias) Then
change += 1
End If
If (CType(color5.B, Integer) > CType(color4.B, Integer) - bias) And (CType(color5.B, Integer) < CType(color4.B, Integer) + bias) Then
change += 1
End If
If (CType(color5.R, Integer) > CType(color8.R, Integer) - bias) And (CType(color5.R, Integer) < CType(color8.R, Integer) + bias) Then
change += 1
End If
If (CType(color5.G, Integer) > CType(color8.G, Integer) - bias) And (CType(color5.G, Integer) < CType(color8.G, Integer) + bias) Then
change += 1
End If
If (CType(color5.B, Integer) > CType(color8.B, Integer) - bias) And (CType(color5.B, Integer) < CType(color8.B, Integer) + bias) Then
change += 1
End If
End If
'Dim sumR, sumG, sumB As Integer
'sumR = (CType(color1.R, Integer) + CType(color2.R, Integer) + CType(color3.R, Integer))
'sumR -= (CType(color7.R, Integer) + CType(color8.R, Integer) + CType(color9.R, Integer))
''sumG = (CType(color7.R, Integer) + CType(color8.R, Integer) + CType(color9.R, Integer))
''sumG -= (CType(color1.G, Integer) + CType(color2.G, Integer) + CType(color3.G, Integer))
''sumB = (CType(color1.B, Integer) + CType(color2.B, Integer) + CType(color3.B, Integer))
''sumB -= (CType(color7.B, Integer) + CType(color8.B, Integer) + CType(color9.B, Integer))
'sumR = Abs(sumR)
''sumG = Abs(sumG)
''sumB = Abs(sumB)
''Dim sumR2, sumG2, sumB2 As Integer
''sumR2 = (CType(color1.R, Integer) + CType(color4.R, Integer) + CType(color7.R, Integer))
''sumG2 = (CType(color1.G, Integer) + CType(color4.G, Integer) + CType(color7.G, Integer))
''sumB2 = (CType(color1.B, Integer) + CType(color4.B, Integer) + CType(color7.B, Integer))
''sumR2 -= (CType(color3.R, Integer) + CType(color6.R, Integer) + CType(color9.R, Integer))
''sumG2 -= (CType(color3.G, Integer) + CType(color6.G, Integer) + CType(color9.G, Integer))
''sumB2 -= (CType(color3.B, Integer) + CType(color6.B, Integer) + CType(color9.B, Integer))
''sumR2 = Abs(sumR2)
''sumG2 = Abs(sumG2)
''sumB2 = Abs(sumB2)
''sumR2 = color1.R + color4.R + color7.R
''sumG2 = color1.G + color4.G + color7.G
''sumB2 = color1.B + color4.B + color7.B
''sumR2 -= color3.R + color6.R + color9.R
''sumG2 -= color3.G + color6.G + color9.G
''sumB2 -= color3.B + color6.B + color9.B
If change = 6 Then
result = True
End If
Return result
End Function
Imports System.Math
Imports WindowsApp1.rinegan
Public Class Form1
Dim eye1 As New Aeye()
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim bmp As New Bitmap("c:\testimage\x1.bmp")
Dim bmp2 As Bitmap = bmp.Clone()
PictureBox1.Image = bmp.Clone()
Dim imageMatrix(bmp.Width, bmp.Height) As Boolean
Dim hx As New List(Of Integer)
Dim lx As New List(Of Integer)
Dim hy As New List(Of Integer)
Dim ly As New List(Of Integer)
hx.Add(0)
hy.Add(0)
lx.Add(bmp.Width)
ly.Add(bmp.Height)
Dim bounderArray(3000) As List(Of Point)
Dim bounderArrayindex As Integer = 0
bounderArray(bounderArrayindex) = New List(Of Point)
bounderArray(bounderArrayindex).Add(New Point(0, 0))
For i = 1 To bmp.Height - 2
For j = 1 To bmp.Width - 2
imageMatrix(j, i) = Not Aeye.isOutLine(j, i, bmp, 20)
If imageMatrix(j, i) Then
bmp2 = Aeye.mark_dark_pixel(j, i, bmp2, 1)
If Not imageMatrix(j - 1, i) And Not imageMatrix(j, i - 1) Then 'new outline point
bounderArrayindex += 1
bounderArray(bounderArrayindex) = New List(Of Point)
bounderArray(bounderArrayindex).Add(New Point(j, i))
hx.Add(0)
hy.Add(0)
lx.Add(bmp.Width)
ly.Add(bmp.Height)
Aeye.maxer(j, hx(bounderArrayindex))
Aeye.maxer(i, hy(bounderArrayindex))
Aeye.miner(j, lx(bounderArrayindex))
Aeye.miner(i, ly(bounderArrayindex))
ElseIf imageMatrix(j, i - 1) Then
For index = 0 To bounderArrayindex
If bounderArray(index).Contains(New Point(j, i - 1)) Then
bounderArray(index).Add(New Point(j, i))
Aeye.maxer(j, hx(bounderArrayindex))
Aeye.maxer(i, hy(bounderArrayindex))
Aeye.miner(j, lx(bounderArrayindex))
Aeye.miner(i, ly(bounderArrayindex))
Exit For
End If
Next
Else
For index = 0 To bounderArrayindex
If bounderArray(index).Contains(New Point(j, i - 1)) Then
bounderArray(index).Add(New Point(j, i))
Aeye.maxer(j, hx(bounderArrayindex))
Aeye.maxer(i, hy(bounderArrayindex))
Aeye.miner(j, lx(bounderArrayindex))
Aeye.miner(i, ly(bounderArrayindex))
Exit For
End If
Next
End If
End If
Next
Next
For index = 0 To bounderArrayindex
bmp = Aeye.graphicContour(bmp, lx(index), hx(index), ly(index), hy(index))
Next
PictureBox2.Image = bmp.Clone()
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim bmp As New Bitmap("c:\testimage\x1.bmp")
PictureBox1.Image = bmp.Clone()
End Sub
End Class
Imports System.Math
Public Class Aeye
Public outlinePixel As Integer = 30
Dim Imageslist As New List(Of ImageList)
Dim ImageListCounter As Integer = 0
Dim minX, minY, maxX, maxY As Integer
Dim checkedMatrix(1000, 1000) As Boolean
Dim imageMatrix(1000, 1000) As Boolean
Dim HX(1000) As Integer
Dim LX(1000) As Integer
Dim HY(1000) As Integer
Dim LY(1000) As Integer
Dim Icounter As Integer
Public Shared Function is_pixel_dark_at(ByVal xPos As Integer, ByVal Ypos As Integer, ByVal image As Bitmap, ByVal DarkPixel As Integer) As Boolean
Dim color As Color
Dim r, g, b As Integer
color = image.GetPixel(xPos, Ypos)
r = color.R
g = color.G
b = color.B
If (r < DarkPixel) And (g < DarkPixel) And (b < DarkPixel) Then
Return True
Else
Return False
End If
End Function
Public Shared Function isOutLine(ByVal xPos As Integer, ByVal Ypos As Integer, ByVal image As Bitmap, ByVal bias As Integer) As Boolean
Dim result As Boolean = False
Dim change As Byte = 0
If xPos > 0 And xPos < image.Width - 1 And Ypos > 0 And Ypos < image.Height - 1 Then
Dim color1, color2, color3, color4, color5, color6, color7, color8, color9 As Color
color1 = image.GetPixel(xPos - 1, Ypos - 1)
color2 = image.GetPixel(xPos, Ypos - 1)
color3 = image.GetPixel(xPos + 1, Ypos - 1)
color7 = image.GetPixel(xPos - 1, Ypos + 1)
color8 = image.GetPixel(xPos, Ypos + 1)
color9 = image.GetPixel(xPos + 1, Ypos + 1)
color4 = image.GetPixel(xPos - 1, Ypos)
color6 = image.GetPixel(xPos + 1, Ypos)
color5 = image.GetPixel(xPos, Ypos)
If (CType(color5.R, Integer) > CType(color4.R, Integer) - bias) And (CType(color5.R, Integer) < CType(color4.R, Integer) + bias) Then
change += 1
End If
If (CType(color5.G, Integer) > CType(color4.G, Integer) - bias) And (CType(color5.G, Integer) < CType(color4.G, Integer) + bias) Then
change += 1
End If
If (CType(color5.B, Integer) > CType(color4.B, Integer) - bias) And (CType(color5.B, Integer) < CType(color4.B, Integer) + bias) Then
change += 1
End If
If (CType(color5.R, Integer) > CType(color8.R, Integer) - bias) And (CType(color5.R, Integer) < CType(color8.R, Integer) + bias) Then
change += 1
End If
If (CType(color5.G, Integer) > CType(color8.G, Integer) - bias) And (CType(color5.G, Integer) < CType(color8.G, Integer) + bias) Then
change += 1
End If
If (CType(color5.B, Integer) > CType(color8.B, Integer) - bias) And (CType(color5.B, Integer) < CType(color8.B, Integer) + bias) Then
change += 1
End If
End If
'Dim sumR, sumG, sumB As Integer
'sumR = (CType(color1.R, Integer) + CType(color2.R, Integer) + CType(color3.R, Integer))
'sumR -= (CType(color7.R, Integer) + CType(color8.R, Integer) + CType(color9.R, Integer))
''sumG = (CType(color7.R, Integer) + CType(color8.R, Integer) + CType(color9.R, Integer))
''sumG -= (CType(color1.G, Integer) + CType(color2.G, Integer) + CType(color3.G, Integer))
''sumB = (CType(color1.B, Integer) + CType(color2.B, Integer) + CType(color3.B, Integer))
''sumB -= (CType(color7.B, Integer) + CType(color8.B, Integer) + CType(color9.B, Integer))
'sumR = Abs(sumR)
''sumG = Abs(sumG)
''sumB = Abs(sumB)
''Dim sumR2, sumG2, sumB2 As Integer
''sumR2 = (CType(color1.R, Integer) + CType(color4.R, Integer) + CType(color7.R, Integer))
''sumG2 = (CType(color1.G, Integer) + CType(color4.G, Integer) + CType(color7.G, Integer))
''sumB2 = (CType(color1.B, Integer) + CType(color4.B, Integer) + CType(color7.B, Integer))
''sumR2 -= (CType(color3.R, Integer) + CType(color6.R, Integer) + CType(color9.R, Integer))
''sumG2 -= (CType(color3.G, Integer) + CType(color6.G, Integer) + CType(color9.G, Integer))
''sumB2 -= (CType(color3.B, Integer) + CType(color6.B, Integer) + CType(color9.B, Integer))
''sumR2 = Abs(sumR2)
''sumG2 = Abs(sumG2)
''sumB2 = Abs(sumB2)
''sumR2 = color1.R + color4.R + color7.R
''sumG2 = color1.G + color4.G + color7.G
''sumB2 = color1.B + color4.B + color7.B
''sumR2 -= color3.R + color6.R + color9.R
''sumG2 -= color3.G + color6.G + color9.G
''sumB2 -= color3.B + color6.B + color9.B
If change = 6 Then
result = True
End If
Return result
End Function
Public Shared Function mark_dark_pixel(ByVal x As Integer, ByVal y As Integer, ByVal bmp1 As Bitmap, ByVal marker As Byte)
For i As Integer = 0 To marker
For j As Integer = 0 To marker
Try
bmp1.SetPixel(x + j, y + i, Color.Green)
Catch ex As Exception
End Try
Next
Next
Return bmp1
End Function
Public Function contourImage(ByVal bmp As Bitmap) As Bitmap
For index = 0 To bmp.Height - 1
For j = 0 To bmp.Width - 1
checkedMatrix(j, index) = False
imageMatrix(j, index) = is_pixel_dark_at(j, index, bmp, 30)
'If imageMatrix(j, index) Then
' MsgBox(j, index)
'End If
Next
Next
minX = bmp.Width
minY = bmp.Height
maxX = 0
maxY = 0
Dim jindex As Integer = 0
Icounter = 0
For i = 0 To bmp.Height - 1 Step 5
While jindex < bmp.Width - 1
If Not checkedMatrix(jindex, i) Then
If Not imageMatrix(jindex, i) Then
checkedMatrix(jindex, i) = True
Else
tracer(bmp, bmp.Width, bmp.Height, jindex, i)
HX(Icounter) = maxX
LX(Icounter) = minX
HY(Icounter) = maxY
LY(Icounter) = minY
Icounter += 1
minX = bmp.Width
minY = bmp.Height
maxX = 0
maxY = 0
jindex = jumpImage(jindex, i)
End If
End If
jindex += 5
End While
jindex = 0
Next
For index = 0 To Icounter
bmp = graphicContour(bmp, LX(index), HX(index), LY(index), HY(index))
Next
Return bmp
End Function
Public Function jumpImage(ByVal x, y) As Integer
If Icounter > 999 Then
Icounter = 999
End If
Dim n As Integer = 0
For index = 0 To Icounter
If (LX(index) <= x And HX(index) >= x) And (LY(index) <= y And HY(index) >= y) Then
n = HX(index)
End If
Next
Return n
End Function
Public Shared Function graphicContour(ByVal bmp As Bitmap, ByVal xmin As Integer, ByVal xmax As Integer, ByVal ymin As Integer, ByVal ymax As Integer) As Bitmap
For i = xmin To xmax
bmp = mark_dark_pixel(i, ymin, bmp, 1)
bmp = mark_dark_pixel(i, ymax, bmp, 1)
Next
For i = ymin To ymax
bmp = mark_dark_pixel(xmin, i, bmp, 1)
bmp = mark_dark_pixel(xmax, i, bmp, 1)
Next
Return bmp
End Function
Private Sub tracer(ByVal bmp1 As Bitmap, ByVal w1 As Integer, ByVal h1 As Integer, ByVal x As Integer, ByVal y As Integer)
If (x > 0 And x < w1) And (y > 0 And y < h1) Then
If Not checkedMatrix(x, y) Then
checkedMatrix(x, y) = True
If imageMatrix(x, y) Then 'not black pixel
maxer(x, maxX)
maxer(y, maxY)
miner(x, minX)
miner(y, minY)
tracer(bmp1, w1, h1, x - 5, y - 5)
tracer(bmp1, w1, h1, x, y - 5)
tracer(bmp1, w1, h1, x + 5, y - 5)
tracer(bmp1, w1, h1, x - 5, y)
tracer(bmp1, w1, h1, x + 5, y)
tracer(bmp1, w1, h1, x - 5, y + 5)
tracer(bmp1, w1, h1, x, y + 5)
tracer(bmp1, w1, h1, x + 5, y + 5)
End If
End If
End If
End Sub
Public Sub maxer(ByVal a As Integer, ByRef b As Integer)
If a > b Then
b = a
End If
End Sub
Public Sub miner(ByVal a As Integer, ByRef b As Integer)
If a < b Then
b = a
End If
End Sub
End Class
Public Class ImageList
Public minX As Integer
Public minY As Integer
Public maxX As Integer
Public maxY As Integer
End Class
you put water in to a cup, it becomes the cup
you put water in to a Tcup, it becomes the Tcup
Public Class Form1 ' code amped by .paul
Dim curPixelX As Integer = 0
Dim curPixelY As Integer = 0
Dim r1, g1, b1 As Integer
Dim curColorChar As Char = Nothing
Dim bm As Bitmap
Sub RGB_breakerBuster(ByVal inColor As Color, ByRef red As Integer, ByRef green As Integer, ByRef blue As Integer)
' returns value of red,green,blue in a pixel of a bitmap as integers
red = inColor.R
green = inColor.G
blue = inColor.B
End Sub
Public Function getPixelColor(ByVal r As Integer, ByVal g As Integer, ByVal b As Integer) As Char
' r= red, g = green, b = blue
Dim colorchar As Char
If r > 245 And g > 245 And b > 245 Then
colorchar = "w" ' white
ElseIf r < 20 And g < 20 And b < 20 Then
colorchar = "k" ' black (kuro in japanese)
ElseIf r > g And g > b And g < 100 Then
colorchar = "r" ' red
ElseIf r > g And g > b And g > 200 Then
colorchar = "y" ' yellow
ElseIf r > g And g > b And 100 < g < 200 Then
colorchar = "o" 'orange
ElseIf (g > r And r > b) Or (g > b And b > r) Then
colorchar = "g" 'green
ElseIf b > g And g > r Then
colorchar = "b" 'blue
ElseIf (b > r And r > g) Or (r > b And g < 20) Then
colorchar = "v" ' violet
Else
colorchar = "u" ' yet undefined
End If
Return colorchar
End Function
Sub colorLegend()
' converts color char to the color name
' label2 = getPixelColor(r1, g1, b1) 1st colorchar
' label3 = color represented by colorchar
Select Case Label2.Text
Case "w"
Label3.Text = "white"
Case "k"
Label3.Text = "black"
Case "r"
Label3.Text = "red"
Case "y"
Label3.Text = "yellow"
Case "o"
Label3.Text = "orange"
Case "g"
Label3.Text = "green"
Case "b"
Label3.Text = "blue"
Case "v"
Label3.Text = "violate"
Case Else
End Select
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Try
TextBox1.Text = bm.GetPixel(curPixelX, curPixelY).ToString()
RGB_breakerBuster(bm.GetPixel(curPixelX, curPixelY), r1, g1, b1)
TextBox2.Text = r1 & " " & g1 & " " & b1
bm.SetPixel(curPixelX, curPixelY, Color.Black)
PictureBox1.Image = bm
curPixelX += 1
Label2.Text = getPixelColor(r1, g1, b1)
colorLegend()
Catch ex As Exception
Timer1.Enabled = False
MsgBox("done")
End Try
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = Not Timer1.Enabled
bm = PictureBox1.Image
curPixelY = bm.Height \ 2
End Sub
End Class
the problem with your solution is that it is specific for that image but what if it's a dog in front of yellow autom leafs or a tanned girl in front of pink leafs
a possible solution to this is to process a smaller portion of the image.
indian red,176,23,31
crimson,220,20,60
lightpink,255,182,193
lightpink 1,255,174,185
lightpink 2,238,162,173
lightpink 3,205,140,149
lightpink 4,139,95,101
pink,255,192,203
pink 1,255,181,197
pink 2,238,169,184
pink 3,205,145,158
pink 4,139,99,108
palevioletred,219,112,147
palevioletred 1,255,130,171
palevioletred 2,238,121,159
palevioletred 3,205,104,137
palevioletred 4,139,71,93
lavenderblush 1,255,240,245
lavenderblush 2,238,224,229
lavenderblush 3,205,193,197
lavenderblush 4,139,131,134
violetred 1,255,62,150
violetred 2,238,58,140
violetred 3,205,50,120
violetred 4,139,34,82
hotpink,255,105,180
hotpink 1,255,110,180
hotpink 2,238,106,167
hotpink 3,205,96,144
hotpink 4,139,58,98
raspberry,135,38,87
deeppink 1,255,20,147
deeppink 2,238,18,137
deeppink 3,205,16,118
deeppink 4,139,10,80
maroon 1,255,52,179
maroon 2,238,48,167
maroon 3,205,41,144
maroon 4,139,28,98
mediumvioletred,199,21,133
violetred,208,32,144
orchid,218,112,214
orchid 1,255,131,250
orchid 2,238,122,233
orchid 3,205,105,201
orchid 4,139,71,137
thistle,216,191,216
thistle 1,255,225,255
thistle 2,238,210,238
thistle 3,205,181,205
thistle 4,139,123,139
plum 1,255,187,255
plum 2,238,174,238
plum 3,205,150,205
plum 4,139,102,139
plum,221,160,221
violet,238,130,238
magenta (fuchsia*),255,0,255
magenta 2,238,0,238
magenta 3,205,0,205
magenta 4,139,0,139
purple*,128,0,128
mediumorchid,186,85,211
mediumorchid 1,224,102,255
mediumorchid 2,209,95,238
mediumorchid 3,180,82,205
mediumorchid 4,122,55,139
darkviolet,148,0,211
darkorchid,153,50,204
darkorchid 1,191,62,255
darkorchid 2,178,58,238
darkorchid 3,154,50,205
darkorchid 4,104,34,139
indigo,75,0,130
blueviolet,138,43,226
purple 1,155,48,255
purple 2,145,44,238
purple 3,125,38,205
purple 4,85,26,139
mediumpurple,147,112,219
mediumpurple 1,171,130,255
mediumpurple 2,159,121,238
mediumpurple 3,137,104,205
mediumpurple 4,93,71,139
darkslateblue,72,61,139
lightslateblue,132,112,255
mediumslateblue,123,104,238
slateblue,106,90,205
slateblue 1,131,111,255
slateblue 2,122,103,238
slateblue 3,105,89,205
slateblue 4,71,60,139
ghostwhite,248,248,255
lavender,230,230,250
blue*,0,0,255
blue 2,0,0,238
blue 3 (mediumblue),0,0,205
blue 4 (darkblue),0,0,139
navy*,0,0,128
midnightblue,25,25,112
cobalt,61,89,171
royalblue,65,105,225
royalblue 1,72,118,255
royalblue 2,67,110,238
royalblue 3,58,95,205
royalblue 4,39,64,139
cornflowerblue,100,149,237
lightsteelblue,176,196,222
lightsteelblue 1,202,225,255
lightsteelblue 2,188,210,238
lightsteelblue 3,162,181,205
lightsteelblue 4,110,123,139
lightslategray,119,136,153
slategray,112,128,144
slategray 1,198,226,255
slategray 2,185,211,238
slategray 3,159,182,205
slategray 4,108,123,139
dodgerblue 1,30,144,255
dodgerblue 2,28,134,238
dodgerblue 3,24,116,205
dodgerblue 4,16,78,139
aliceblue,240,248,255
steelblue,70,130,180
steelblue 1,99,184,255
steelblue 2,92,172,238
steelblue 3,79,148,205
steelblue 4,54,100,139
lightskyblue,135,206,250
lightskyblue 1,176,226,255
lightskyblue 2,164,211,238
lightskyblue 3,141,182,205
lightskyblue 4,96,123,139
skyblue 1,135,206,255
skyblue 2,126,192,238
skyblue 3,108,166,205
skyblue 4,74,112,139
skyblue,135,206,235
deepskyblue 1,0,191,255
deepskyblue 2,0,178,238
deepskyblue 3,0,154,205
deepskyblue 4,0,104,139
peacock,51,161,201
lightblue,173,216,230
lightblue 1,191,239,255
lightblue 2,178,223,238
lightblue 3,154,192,205
lightblue 4,104,131,139
powderblue,176,224,230
cadetblue 1,152,245,255
cadetblue 2,142,229,238
cadetblue 3,122,197,205
cadetblue 4,83,134,139
turquoise 1,0,245,255
turquoise 2,0,229,238
turquoise 3,0,197,205
turquoise 4,0,134,139
cadetblue,95,158,160
darkturquoise,0,206,209
azure 1 (azure),240,255,255
azure 2,224,238,238
azure 3,193,205,205
azure 4,131,139,139
lightcyan 1,224,255,255
lightcyan 2,209,238,238
lightcyan 3,180,205,205
lightcyan 4,122,139,139
paleturquoise 1,187,255,255
paleturquoise 2,174,238,238
paleturquoise 3,150,205,205
paleturquoise 4,102,139,139
darkslategray,47,79,79
darkslategray 1,151,255,255
darkslategray 2,141,238,238
darkslategray 3,121,205,205
darkslategray 4,82,139,139
cyan / aqua*,0,255,255
cyan 2,0,238,238
cyan 3,0,205,205
cyan 4 (darkcyan),0,139,139
teal*,0,128,128
mediumturquoise,72,209,204
lightseagreen,32,178,170
manganeseblue,3,168,158
turquoise,64,224,208
coldgrey,128,138,135
turquoiseblue,0,199,140
aquamarine 1,127,255,212
aquamarine 2,118,238,198
aquamarine 3,102,205,170
aquamarine 4,69,139,116
mediumspringgreen,0,250,154
mintcream,245,255,250
springgreen,0,255,127
springgreen 1,0,238,118
springgreen 2,0,205,102
springgreen 3,0,139,69
mediumseagreen,60,179,113
seagreen 1,84,255,159
seagreen 2,78,238,148
seagreen 3,67,205,128
seagreen 4,46,139,87
emeraldgreen,0,201,87
mint,189,252,201
cobaltgreen,61,145,64
honeydew 1,240,255,240
honeydew 2,224,238,224
honeydew 3,193,205,193
honeydew 4,131,139,131
darkseagreen,143,188,143
darkseagreen 1,193,255,193
darkseagreen 2,180,238,180
darkseagreen 3,155,205,155
darkseagreen 4,105,139,105
palegreen,152,251,152
palegreen 1,154,255,154
palegreen 2,144,238,144
palegreen 3,124,205,124
palegreen 4,84,139,84
limegreen,50,205,50
forestgreen,34,139,34
green 1 (lime*),0,255,0
green 2,0,238,0
green 3,0,205,0
green 4,0,139,0
green*,0,128,0
darkgreen,0,100,0
sapgreen,48,128,20
lawngreen,124,252,0
chartreuse 1,127,255,0
chartreuse 2,118,238,0
chartreuse 3,102,205,0
chartreuse 4,69,139,0
greenyellow,173,255,47
darkolivegreen 1,202,255,112
darkolivegreen 2,188,238,104
darkolivegreen 3,162,205,90
darkolivegreen 4,110,139,61
darkolivegreen,85,107,47
olivedrab,107,142,35
olivedrab 1,192,255,62
olivedrab 2,179,238,58
olivedrab 3,154,205,50
olivedrab 4,105,139,34
ivory 1 (ivory),255,255,240
ivory 2,238,238,224
ivory 3,205,205,193
ivory 4,139,139,131
beige,245,245,220
lightyellow 1,255,255,224
lightyellow 2,238,238,209
lightyellow 3,205,205,180
lightyellow 4,139,139,122
lightgoldenrodyellow,250,250,210
yellow 1 (yellow*),255,255,0
yellow 2,238,238,0
yellow 3,205,205,0
yellow 4,139,139,0
warmgrey,128,128,105
olive*,128,128,0
darkkhaki,189,183,107
khaki 1,255,246,143
khaki 2,238,230,133
khaki 3,205,198,115
khaki 4,139,134,78
khaki,240,230,140
palegoldenrod,238,232,170
lemonchiffon 1,255,250,205
lemonchiffon 2,238,233,191
lemonchiffon 3,205,201,165
lemonchiffon 4,139,137,112
lightgoldenrod 1,255,236,139
lightgoldenrod 2,238,220,130
lightgoldenrod 3,205,190,112
lightgoldenrod 4,139,129,76
banana,227,207,87
gold 1 (gold),255,215,0
gold 2,238,201,0
gold 3,205,173,0
gold 4,139,117,0
cornsilk 1 (cornsilk),255,248,220
cornsilk 2,238,232,205
cornsilk 3,205,200,177
cornsilk 4,139,136,120
goldenrod,218,165,32
goldenrod 1,255,193,37
goldenrod 2,238,180,34
goldenrod 3,205,155,29
goldenrod 4,139,105,20
darkgoldenrod,184,134,11
darkgoldenrod 1,255,185,15
darkgoldenrod 2,238,173,14
darkgoldenrod 3,205,149,12
darkgoldenrod 4,139,101,8
orange 1 (orange),255,165,0
orange 2,238,154,0
orange 3,205,133,0
orange 4,139,90,0
floralwhite,255,250,240
oldlace,253,245,230
wheat,245,222,179
wheat 1,255,231,186
wheat 2,238,216,174
wheat 3,205,186,150
wheat 4,139,126,102
moccasin,255,228,181
papayawhip,255,239,213
blanchedalmond,255,235,205
navajowhite 1,255,222,173
navajowhite 2,238,207,161
navajowhite 3,205,179,139
navajowhite 4,139,121,94
eggshell,252,230,201
tan,210,180,140
brick,156,102,31
cadmiumyellow,255,153,18
antiquewhite,250,235,215
antiquewhite 1,255,239,219
antiquewhite 2,238,223,204
antiquewhite 3,205,192,176
antiquewhite 4,139,131,120
burlywood,222,184,135
burlywood 1,255,211,155
burlywood 2,238,197,145
burlywood 3,205,170,125
burlywood 4,139,115,85
bisque 1 (bisque),255,228,196
bisque 2,238,213,183
bisque 3,205,183,158
bisque 4,139,125,107
melon,227,168,105
carrot,237,145,33
darkorange,255,140,0
darkorange 1,255,127,0
darkorange 2,238,118,0
darkorange 3,205,102,0
darkorange 4,139,69,0
orange,255,128,0
tan 1,255,165,79
tan 2,238,154,73
tan 3 (peru),205,133,63
tan 4,139,90,43
linen,250,240,230
peachpuff 1,255,218,185
peachpuff 2,238,203,173
peachpuff 3,205,175,149
peachpuff 4,139,119,101
seashell 1 (seashell),255,245,238
seashell 2,238,229,222
seashell 3,205,197,191
seashell 4,139,134,130
sandybrown,244,164,96
rawsienna,199,97,20
chocolate,210,105,30
chocolate 1,255,127,36
chocolate 2,238,118,33
chocolate 3,205,102,29
chocolate 4,139,69,19
ivoryblack,41,36,33
flesh,255,125,64
cadmiumorange,255,97,3
burntsienna,138,54,15
sienna,160,82,45
sienna 1,255,130,71
sienna 2,238,121,66
sienna 3,205,104,57
sienna 4,139,71,38
lightsalmon 1,255,160,122
lightsalmon 2,238,149,114
lightsalmon 3,205,129,98
lightsalmon 4,139,87,66
coral,255,127,80
orangered 1,255,69,0
orangered 2,238,64,0
orangered 3,205,55,0
orangered 4,139,37,0
sepia,94,38,18
darksalmon,233,150,122
salmon 1,255,140,105
salmon 2,238,130,98
salmon 3,205,112,84
salmon 4,139,76,57
coral 1,255,114,86
coral 2,238,106,80
coral 3,205,91,69
coral 4,139,62,47
burntumber,138,51,36
tomato 1 (tomato),255,99,71
tomato 2,238,92,66
tomato 3,205,79,57
tomato 4,139,54,38
salmon,250,128,114
mistyrose 1,255,228,225
mistyrose 2,238,213,210
mistyrose 3,205,183,181
mistyrose 4,139,125,123
snow 1 (snow),255,250,250
snow 2,238,233,233
snow 3,205,201,201
snow 4,139,137,137
rosybrown,188,143,143
rosybrown 1,255,193,193
rosybrown 2,238,180,180
rosybrown 3,205,155,155
rosybrown 4,139,105,105
lightcoral,240,128,128
indianred,205,92,92
indianred 1,255,106,106
indianred 2,238,99,99
indianred 4,139,58,58
indianred 3,205,85,85
brown,165,42,42
brown 1,255,64,64
brown 2,238,59,59
brown 3,205,51,51
brown 4,139,35,35
firebrick,178,34,34
firebrick 1,255,48,48
firebrick 2,238,44,44
firebrick 3,205,38,38
firebrick 4,139,26,26
red 1 (red*),255,0,0
red 2,238,0,0
red 3,205,0,0
red 4 (darkred),139,0,0
maroon*,128,0,0
sgi beet,142,56,142
sgi slateblue,113,113,198
sgi lightblue,125,158,192
sgi teal,56,142,142
sgi chartreuse,113,198,113
sgi olivedrab,142,142,56
sgi brightgray,197,193,170
sgi salmon,198,113,113
sgi darkgray,85,85,85
sgi gray 12,30,30,30
sgi gray 16,40,40,40
sgi gray 32,81,81,81
sgi gray 36,91,91,91
sgi gray 52,132,132,132
sgi gray 56,142,142,142
sgi lightgray,170,170,170
sgi gray 72,183,183,183
sgi gray 76,193,193,193
sgi gray 92,234,234,234
sgi gray 96,244,244,244
white*,255,255,255
white smoke,245,245,245
gainsboro,220,220,220
lightgrey,211,211,211
silver*,192,192,192
darkgray,169,169,169
gray*,128,128,128
dimgray (gray 42),105,105,105
black*,0,0,0
gray 99,252,252,252
gray 98,250,250,250
gray 97,247,247,247
white smoke,245,245,245
gray 95,242,242,242
gray 94,240,240,240
gray 93,237,237,237
gray 92,235,235,235
gray 91,232,232,232
gray 90,229,229,229
gray 89,227,227,227
gray 88,224,224,224
gray 87,222,222,222
gray 86,219,219,219
gray 85,217,217,217
gray 84,214,214,214
gray 83,212,212,212
gray 82,209,209,209
gray 81,207,207,207
gray 80,204,204,204
gray 79,201,201,201
gray 78,199,199,199
gray 77,196,196,196
gray 76,194,194,194
gray 75,191,191,191
gray 74,189,189,189
gray 73,186,186,186
gray 72,184,184,184
gray 71,181,181,181
gray 70,179,179,179
gray 69,176,176,176
gray 68,173,173,173
gray 67,171,171,171
gray 66,168,168,168
gray 65,166,166,166
gray 64,163,163,163
gray 63,161,161,161
gray 62,158,158,158
gray 61,156,156,156
gray 60,153,153,153
gray 59,150,150,150
gray 58,148,148,148
gray 57,145,145,145
gray 56,143,143,143
gray 55,140,140,140
gray 54,138,138,138
gray 53,135,135,135
gray 52,133,133,133
gray 51,130,130,130
gray 50,127,127,127
gray 49,125,125,125
gray 48,122,122,122
gray 47,120,120,120
gray 46,117,117,117
gray 45,115,115,115
gray 44,112,112,112
gray 43,110,110,110
gray 42,107,107,107
dimgray (gray 42),105,105,105
gray 40,102,102,102
gray 39,99,99,99
gray 38,97,97,97
gray 37,94,94,94
gray 36,92,92,92
gray 35,89,89,89
gray 34,87,87,87
gray 33,84,84,84
gray 32,82,82,82
gray 31,79,79,79
gray 30,77,77,77
gray 29,74,74,74
gray 28,71,71,71
gray 27,69,69,69
gray 26,66,66,66
gray 25,64,64,64
gray 24,61,61,61
gray 23,59,59,59
gray 22,56,56,56
gray 21,54,54,54
gray 20,51,51,51
gray 19,48,48,48
gray 18,46,46,46
gray 17,43,43,43
gray 16,41,41,41
gray 15,38,38,38
gray 14,36,36,36
gray 13,33,33,33
gray 12,31,31,31
gray 11,28,28,28
gray 10,26,26,26
gray 9,23,23,23
gray 8,20,20,20
gray 7,18,18,18
gray 6,15,15,15
gray 5,13,13,13
gray 4,10,10,10
gray 3,8,8,8
gray 2,5,5,5
gray 1,3,3,3
the problem with your solution is that it is specific for that image but what if it's a dog in front of yellow autom leafs or a tanned girl in front of pink leafs
I never understand what those computerphiles try to explain.
is this the list of corner possibilities ? :
code]Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
'Dim i As Integer = 512
'Dim s As String = Convert.ToString(i, 2).PadLeft(9, "0"c) '32 bits
Dim str1 As String = ""
Dim x As Integer = 0
For index = 0 To 255
str1 = Convert.ToString(index, 2).PadLeft(9, "0"c)
x = str1.Substring(4, 1)
If x = 1 Then
TextBox1.Text &= str1.Substring(0, 3) & Environment.NewLine
TextBox1.Text &= str1.Substring(3, 3) & Environment.NewLine
TextBox1.Text &= str1.Substring(6, 3) & Environment.NewLine
TextBox1.Text &= Environment.NewLine
End If
Next
End Sub
End Class
10000000
01000000
11000000
00100000
10100000
01100000
11100000
00010000
10010000
01010000
11010000
00110000
10110000
01110000
11110000
00001000
10001000
01001000
11001000
00101000
10101000
01101000
11101000
00011000
10011000
01011000
11011000
00111000
10111000
01111000
11111000
00000100
10000100
01000100
11000100
00100100
10100100
01100100
11100100
00010100
10010100
01010100
11010100
00110100
10110100
01110100
11110100
00001100
10001100
01001100
11001100
00101100
10101100
01101100
11101100
00011100
10011100
01011100
11011100
00111100
10111100
01111100
11111100
00000010
10000010
01000010
11000010
00100010
10100010
01100010
11100010
00010010
10010010
01010010
11010010
00110010
10110010
01110010
11110010
00001010
10001010
01001010
11001010
00101010
10101010
01101010
11101010
00011010
10011010
01011010
11011010
00111010
10111010
01111010
11111010
00000110
10000110
01000110
11000110
00100110
10100110
01100110
11100110
00010110
10010110
01010110
11010110
00110110
10110110
01110110
11110110
00001110
10001110
01001110
11001110
00101110
10101110
01101110
11101110
00011110
10011110
01011110
11011110
00111110
10111110
01111110
11111110
00000001
10000001
01000001
11000001
00100001
10100001
01100001
11100001
00010001
10010001
01010001
11010001
00110001
10110001
01110001
11110001
00001001
10001001
01001001
11001001
00101001
10101001
01101001
11101001
00011001
10011001
01011001
11011001
00111001
10111001
01111001
11111001
00000101
10000101
01000101
11000101
00100101
10100101
01100101
11100101
00010101
10010101
01010101
11010101
00110101
10110101
01110101
11110101
00001101
10001101
01001101
11001101
00101101
10101101
01101101
11101101
00011101
10011101
01011101
11011101
00111101
10111101
01111101
11111101
00000011
10000011
01000011
11000011
00100011
10100011
01100011
11100011
00010011
10010011
01010011
11010011
00110011
10110011
01110011
11110011
00001011
10001011
01001011
11001011
00101011
10101011
01101011
11101011
00011011
10011011
01011011
11011011
00111011
10111011
01111011
11111011
00000111
10000111
01000111
11000111
00100111
10100111
01100111
11100111
00010111
10010111
01010111
11010111
00110111
10110111
01110111
11110111
00001111
10001111
01001111
11001111
00101111
10101111
01101111
11101111
00011111
10011111
01011111
11011111
00111111
10111111
01111111
11111111
Imports System.Math
Imports WindowsApp1.rinegan
Public Class Form1
Dim eye1 As New Aeye()
Dim checked As New List(Of Point)
Dim b1 As Boolean = False
Dim b2 As Boolean = False
Dim b3 As Boolean = False
Dim b4 As Boolean = False
Dim b5 As Boolean = False
Dim b6 As Boolean = False
Dim b7 As Boolean = False
Dim b8 As Boolean = False
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim bmp As New Bitmap("c:\testimage\x2.bmp")
Dim x As Integer
Dim y As Integer
x = TextBox1.Text
y = TextBox2.Text
If Aeye.isOutLine(x, y, bmp, 20) Then
corn(x, y, bmp)
End If
For Each item As Point In checked
bmp = Aeye.mark_dark_pixel(item.X, item.Y, bmp, 1)
Next
'bmp = Aeye.mark_dark_pixelRED(x, y, bmp, 5)
PictureBox2.Image = bmp.Clone()
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim bmp As New Bitmap("c:\testimage\x1.bmp")
PictureBox1.Image = bmp.Clone()
End Sub
Sub corn(x As Integer, y As Integer, bmp As Bitmap)
If Not checked.Contains(New Point(x, y)) Then
checked.Add(New Point(x, y))
b1 = Aeye.isOutLine(x - 1, y - 1, bmp, 20)
b2 = Aeye.isOutLine(x - 1, y, bmp, 20)
b3 = Aeye.isOutLine(x - 1, y + 1, bmp, 20)
b4 = Aeye.isOutLine(x, y - 1, bmp, 20)
b5 = Aeye.isOutLine(x + 1, y - 1, bmp, 20)
b6 = Aeye.isOutLine(x + 1, y, bmp, 20)
b7 = Aeye.isOutLine(x + 1, y + 1, bmp, 20)
b8 = Aeye.isOutLine(x, y + 1, bmp, 20)
If Not (b1 And b2 And b3 And b4 And b5 And b6 And b7 And b8) Then
If b1 Then
corn(x - 1, y - 1, bmp)
End If
If b2 Then
corn(x - 1, y, bmp)
End If
If b3 Then
corn(x - 1, y + 1, bmp)
End If
If b4 Then
corn(x, y - 1, bmp)
End If
If b5 Then
corn(x + 1, y - 1, bmp)
End If
If b6 Then
corn(x + 1, y, bmp)
End If
If b7 Then
corn(x + 1, y + 1, bmp)
End If
If b8 Then
corn(x - 1, y + 1, bmp)
End If
End If
End If
End Sub
End Class
Imports System.Math
Imports WindowsApp1.rinegan
Public Class Form1
Dim eye1 As New Aeye()
Dim checked As New List(Of Point)
Dim b1 As Boolean = False
Dim b2 As Boolean = False
Dim b3 As Boolean = False
Dim b4 As Boolean = False
Dim b5 As Boolean = False
Dim b6 As Boolean = False
Dim b7 As Boolean = False
Dim b8 As Boolean = False
Dim x As Integer
Dim y As Integer
Dim rList As New List(Of Rectangle)
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim bmp As New Bitmap("c:\testimage\x11.bmp")
'Dim matrix(bmp.Width, bmp.Height) As Boolean
'For i As Integer = 0 To bmp.Height - 1
' For j As Integer = 0 To bmp.Width - 1
' matrix(j, i) = Aeye.is_pixel_dark_at(j, i, bmp, 40)
' bmp = Aeye.mark_dark_pixel(j, i, bmp, 1)
' Next
'Next
Dim x As Integer
Dim y As Integer
x = TextBox1.Text
y = TextBox2.Text
Dim minx, miny, maxx, maxy As Integer
minx = bmp.Width
miny = bmp.Height
maxx = 0
maxy = 0
Dim rec As New Rectangle()
If Aeye.isOutLine(x, y, bmp, 20) Then
corn(x, y, bmp)
' rectangle marker for the pixels of the shape detected by sub corn
For Each item As Point In checked
Aeye.maxer(item.X, maxx)
Aeye.maxer(item.Y, maxy)
Aeye.miner(item.X, minx)
Aeye.miner(item.Y, miny)
Next
If maxx - minx > 10 And maxy - miny > 10 Then
bmp = Aeye.graphicContour(bmp, minx, maxx, miny, maxy)
TextBox3.Text &= minx.ToString & " " & miny.ToString & " " & maxx.ToString() & " " & maxy.ToString & Environment.NewLine
End If
End If
'For Each item As Point In checked
' bmp = Aeye.mark_dark_pixel(item.X, item.Y, bmp, 1)
'Next
Dim bmp2 As New Bitmap(bmp)
PictureBox3.Image = Aeye.mark_dark_pixelRED(x, y, bmp2, 5)
checked.Clear()
PictureBox2.Image = bmp.Clone()
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim bmp As New Bitmap("c:\testimage\x1.bmp")
PictureBox1.Image = bmp.Clone()
End Sub
Sub corn(x As Integer, y As Integer, bmp As Bitmap)
If Not checked.Contains(New Point(x, y)) Then
checked.Add(New Point(x, y))
b1 = Aeye.isOutLine(x - 1, y - 1, bmp, 20)
b2 = Aeye.isOutLine(x - 1, y, bmp, 20)
b3 = Aeye.isOutLine(x - 1, y + 1, bmp, 20)
b4 = Aeye.isOutLine(x, y - 1, bmp, 20)
b5 = Aeye.isOutLine(x + 1, y - 1, bmp, 20)
b6 = Aeye.isOutLine(x + 1, y, bmp, 20)
b7 = Aeye.isOutLine(x + 1, y + 1, bmp, 20)
b8 = Aeye.isOutLine(x, y + 1, bmp, 20)
If Not (b1 And b2 And b3 And b4 And b5 And b6 And b7 And b8) Then
If b1 Then
corn(x - 1, y - 1, bmp)
End If
If b2 Then
corn(x - 1, y, bmp)
End If
If b3 Then
corn(x - 1, y + 1, bmp)
End If
If b4 Then
corn(x, y - 1, bmp)
End If
If b5 Then
corn(x + 1, y - 1, bmp)
End If
If b6 Then
corn(x + 1, y, bmp)
End If
If b7 Then
corn(x + 1, y + 1, bmp)
End If
If b8 Then
corn(x - 1, y + 1, bmp)
End If
End If
End If
End Sub
Function listOfPointsToRectangle(ByVal lst As List(Of Point), ByVal bmp As Bitmap) As Rectangle
Dim minx, miny, maxx, maxy As Integer
minx = bmp.Width
miny = bmp.Height
maxx = 0
maxy = 0
For Each item As Point In lst
Aeye.maxer(item.X, maxx)
Aeye.maxer(item.Y, maxy)
Aeye.miner(item.X, minx)
Aeye.miner(item.Y, miny)
Next
Dim rec As New Rectangle(0, 0, 1000, 1000)
If maxx - minx > 10 And maxy - miny > 10 Then
rec = New Rectangle(minx, miny, maxx - minx, maxy - miny)
End If
End Function
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim bmp As New Bitmap("c:\testimage\x32.bmp")
'x = 100
'y = 112
'xu()
'x = 115
'y = 100
'xu()
x = 2
y = 2
xu()
x = 0
Dim c As Integer = 2
For i As Integer = 3 To bmp.Height - 2
While c < bmp.Width - 5
c += 1
c += jumper(c, i)
x = c
y = i
Try
If Aeye.is_pixel_dark_at(x, y, bmp, 50) Then
xu()
End If
Catch ex As Exception
End Try
'xu()
End While
c = 2
Next
End Sub
Sub xu()
Dim bmp As New Bitmap("c:\testimage\x32.bmp")
Dim minx, miny, maxx, maxy As Integer
minx = bmp.Width
miny = bmp.Height
maxx = 0
maxy = 0
Dim rec As New Rectangle()
If Aeye.isOutLine(x, y, bmp, 20) Then
corn(x, y, bmp)
' rectangle marker for the pixels of the shape detected by sub corn
For Each item As Point In checked
Aeye.maxer(item.X, maxx)
Aeye.maxer(item.Y, maxy)
Aeye.miner(item.X, minx)
Aeye.miner(item.Y, miny)
Next
Dim rTemp As New Rectangle(minx, miny, maxx - minx, maxy - miny)
If maxx - minx > 10 And maxy - miny > 10 And Not rList.Contains(rTemp) Then
'bmp = Aeye.graphicContour(bmp, minx, maxx, miny, maxy)
rList.Add(rTemp)
TextBox3.Text &= minx.ToString & " " & miny.ToString & " " & maxx.ToString() & " " & maxy.ToString & Environment.NewLine
End If
End If
Dim bmp2 As New Bitmap(bmp)
PictureBox3.Image = Aeye.mark_dark_pixelRED(x, y, bmp2, 5)
checked.Clear()
PictureBox2.Image = bmp.Clone()
End Sub
Function jumper(ByVal x As Integer, ByVal y As Integer) As Integer
Dim ret As Integer = 0
For Each item As Rectangle In rList
If (x >= item.X And x <= item.Width + item.X) And (y >= item.Y And y <= item.Height + item.Y) Then
ret = item.Width + item.X + 1
End If
Next
Return ret
End Function
End Class
Imports System.Math
Namespace rinegan
Public Class Aeye
Public outlinePixel As Integer = 30
Dim Imageslist As New List(Of ImageList)
Dim ImageListCounter As Integer = 0
Dim minX, minY, maxX, maxY As Integer
Dim checkedMatrix(2000, 2000) As Boolean
Dim imageMatrix(2000, 2000) As Boolean
Dim HX(1000) As Integer
Dim LX(1000) As Integer
Dim HY(1000) As Integer
Dim LY(1000) As Integer
Dim Icounter As Integer
Public Shared Function is_pixel_dark_at(ByVal xPos As Integer, ByVal Ypos As Integer, ByVal image As Bitmap, ByVal DarkPixel As Integer) As Boolean
Dim color As Color
Dim r, g, b As Integer
color = image.GetPixel(xPos, Ypos)
r = color.R
g = color.G
b = color.B
If (r < DarkPixel) And (g < DarkPixel) And (b < DarkPixel) Then
Return True
Else
Return False
End If
End Function
Public Shared Function isOutLine(ByVal xPos As Integer, ByVal Ypos As Integer, ByVal image As Bitmap, ByVal bias As Integer) As Boolean
Dim result As Boolean = False
Dim change As Byte = 0
If xPos > 0 And xPos < image.Width - 1 And Ypos > 0 And Ypos < image.Height - 1 Then
Dim color4, color5, color8 As Color
'color1 = image.GetPixel(xPos - 1, Ypos - 1)
'color2 = image.GetPixel(xPos, Ypos - 1)
'color3 = image.GetPixel(xPos + 1, Ypos - 1)
'color7 = image.GetPixel(xPos - 1, Ypos + 1)
color8 = image.GetPixel(xPos, Ypos + 1)
'color9 = image.GetPixel(xPos + 1, Ypos + 1)
color4 = image.GetPixel(xPos - 1, Ypos)
'color6 = image.GetPixel(xPos + 1, Ypos)
color5 = image.GetPixel(xPos, Ypos)
If (CType(color5.R, Integer) > CType(color4.R, Integer) - bias) And (CType(color5.R, Integer) < CType(color4.R, Integer) + bias) Then
change += 1
End If
If (CType(color5.G, Integer) > CType(color4.G, Integer) - bias) And (CType(color5.G, Integer) < CType(color4.G, Integer) + bias) Then
change += 1
End If
If (CType(color5.B, Integer) > CType(color4.B, Integer) - bias) And (CType(color5.B, Integer) < CType(color4.B, Integer) + bias) Then
change += 1
End If
If (CType(color5.R, Integer) > CType(color8.R, Integer) - bias) And (CType(color5.R, Integer) < CType(color8.R, Integer) + bias) Then
change += 1
End If
If (CType(color5.G, Integer) > CType(color8.G, Integer) - bias) And (CType(color5.G, Integer) < CType(color8.G, Integer) + bias) Then
change += 1
End If
If (CType(color5.B, Integer) > CType(color8.B, Integer) - bias) And (CType(color5.B, Integer) < CType(color8.B, Integer) + bias) Then
change += 1
End If
End If
If change = 6 Then
result = True
End If
Return result
End Function
Public Shared Function mark_dark_pixel(ByVal x As Integer, ByVal y As Integer, ByVal bmp1 As Bitmap, ByVal marker As Byte)
For i As Integer = 0 To marker
For j As Integer = 0 To marker
Try
bmp1.SetPixel(x + j, y + i, Color.Green)
Catch ex As Exception
End Try
Next
Next
Return bmp1
End Function
Public Shared Function getPixelColor(ByVal r As Integer, ByVal g As Integer, ByVal b As Integer) As Char
' r= red, g = green, b = blue
Dim colorchar As Char
If r > 245 And g > 245 And b > 245 Then
colorchar = "w" ' white
ElseIf r < 20 And g < 20 And b < 20 Then
colorchar = "k" ' black (kuro in japanese)
ElseIf r > g And g > b And g < 100 Then
colorchar = "r" ' red
ElseIf r > g And g > b And g > 200 Then
colorchar = "y" ' yellow
ElseIf r > g And g > b And 100 < g < 200 Then
colorchar = "o" 'orange
ElseIf (g > r And r > b) Or (g > b And b > r) Then
colorchar = "g" 'green
ElseIf b > g And g > r Then
colorchar = "b" 'blue
ElseIf (b > r And r > g) Or (r > b And g < 20) Then
colorchar = "v" ' violet
Else
colorchar = "u" ' yet undefined
End If
Return colorchar
End Function
Public Shared Function mark_dark_pixelRED(ByVal x As Integer, ByVal y As Integer, ByVal bmp1 As Bitmap, ByVal marker As Byte)
For i As Integer = 0 To marker
For j As Integer = 0 To marker
Try
bmp1.SetPixel(x + j, y + i, Color.Red)
Catch ex As Exception
End Try
Next
Next
Return bmp1
End Function
Public Shared Function mark_dark_pixelBlue(ByVal x As Integer, ByVal y As Integer, ByVal bmp1 As Bitmap, ByVal marker As Byte)
For i As Integer = 0 To marker
For j As Integer = 0 To marker
Try
bmp1.SetPixel(x + j, y + i, Color.Blue)
Catch ex As Exception
End Try
Next
Next
Return bmp1
End Function
'Public Function contourImage(ByVal bmp As Bitmap) As Bitmap
' For index = 0 To bmp.Height - 1
' For j = 0 To bmp.Width - 1
' checkedMatrix(j, index) = False
' imageMatrix(j, index) = is_pixel_dark_at(j, index, bmp, 30)
' 'If imageMatrix(j, index) Then
' ' MsgBox(j, index)
' 'End If
' Next
' Next
' minX = bmp.Width
' minY = bmp.Height
' maxX = 0
' maxY = 0
' Dim jindex As Integer = 0
' Icounter = 0
' For i = 0 To bmp.Height - 1 Step 5
' While jindex < bmp.Width - 1
' If Not checkedMatrix(jindex, i) Then
' If Not imageMatrix(jindex, i) Then
' checkedMatrix(jindex, i) = True
' Else
' tracer(bmp, bmp.Width, bmp.Height, jindex, i)
' HX(Icounter) = maxX
' LX(Icounter) = minX
' HY(Icounter) = maxY
' LY(Icounter) = minY
' Icounter += 1
' minX = bmp.Width
' minY = bmp.Height
' maxX = 0
' maxY = 0
' jindex = jumpImage(jindex, i)
' End If
' End If
' jindex += 1
' End While
' jindex = 0
' Next
' For index = 0 To Icounter
' bmp = graphicContour(bmp, LX(index), HX(index), LY(index), HY(index))
' Next
' Return bmp
'End Function
Public Function jumpImage(ByVal x, y) As Integer
If Icounter > 999 Then
Icounter = 999
End If
Dim n As Integer = 0
For index = 0 To Icounter
If (LX(index) <= x And HX(index) >= x) And (LY(index) <= y And HY(index) >= y) Then
n = HX(index)
End If
Next
Return n
End Function
Public Shared Function graphicContour(ByVal bmp As Bitmap, ByVal xmin As Integer, ByVal xmax As Integer, ByVal ymin As Integer, ByVal ymax As Integer) As Bitmap
For i = xmin To xmax
bmp = mark_dark_pixel(i, ymin, bmp, 1)
bmp = mark_dark_pixel(i, ymax, bmp, 1)
Next
For i = ymin To ymax
bmp = mark_dark_pixel(xmin, i, bmp, 1)
bmp = mark_dark_pixel(xmax, i, bmp, 1)
Next
Return bmp
End Function
Public Shared Function graphicContourRed(ByVal bmp As Bitmap, ByVal xmin As Integer, ByVal xmax As Integer, ByVal ymin As Integer, ByVal ymax As Integer) As Bitmap
For i = xmin To xmax
bmp = mark_dark_pixelRED(i, ymin, bmp, 1)
bmp = mark_dark_pixelRED(i, ymax, bmp, 1)
Next
For i = ymin To ymax
bmp = mark_dark_pixelRED(xmin, i, bmp, 1)
bmp = mark_dark_pixelRED(xmax, i, bmp, 1)
Next
Return bmp
End Function
Public Shared Function graphicContourBlue(ByVal bmp As Bitmap, ByVal xmin As Integer, ByVal xmax As Integer, ByVal ymin As Integer, ByVal ymax As Integer) As Bitmap
For i = xmin To xmax
bmp = mark_dark_pixelBlue(i, ymin, bmp, 1)
bmp = mark_dark_pixelBlue(i, ymax, bmp, 1)
Next
For i = ymin To ymax
bmp = mark_dark_pixelBlue(xmin, i, bmp, 1)
bmp = mark_dark_pixelBlue(xmax, i, bmp, 1)
Next
Return bmp
End Function
'Private Sub tracer(ByVal bmp1 As Bitmap, ByVal w1 As Integer, ByVal h1 As Integer, ByVal x As Integer, ByVal y As Integer)
' If (x > 0 And x < w1) And (y > 0 And y < h1) Then
' If Not checkedMatrix(x, y) Then
' checkedMatrix(x, y) = True
' If imageMatrix(x, y) Then 'not black pixel
' maxer(x, maxX)
' maxer(y, maxY)
' miner(x, minX)
' miner(y, minY)
' tracer(bmp1, w1, h1, x - 1, y - 1)
' tracer(bmp1, w1, h1, x, y - 1)
' tracer(bmp1, w1, h1, x + 1, y - 1)
' tracer(bmp1, w1, h1, x - 1, y)
' tracer(bmp1, w1, h1, x + 1, y)
' tracer(bmp1, w1, h1, x - 1, y + 1)
' tracer(bmp1, w1, h1, x, y + 1)
' 'tracer(bmp1, w1, h1, x + 1, y + 1)
' End If
' End If
' End If
'End Sub
Public Shared Sub maxer(ByVal a As Integer, ByRef b As Integer)
If a > b Then
b = a
End If
End Sub
Public Shared Sub miner(ByVal a As Integer, ByRef b As Integer)
If a < b Then
b = a
End If
End Sub
End Class
Public Class ImageList
Public minX As Integer
Public minY As Integer
Public maxX As Integer
Public maxY As Integer
End Class
End Namespace
Public Shared Function mark_dark_pixel(ByVal x As Integer, ByVal y As Integer, ByVal bmp1 As Bitmap, ByVal marker As Byte)
For i As Integer = 0 To marker
yi=y+i <<<<<<<<<
For j As Integer = 0 To marker
Try
bmp1.SetPixel(x + j, yi, Color.Green)
Catch ex As Exception
End Try
Next
Next
Return bmp1
End Function
In fact, this depends on the amount of training data available, the complexity of the decision boundaries, and the type of classifier used.
If the theoretical infinite number of training samples would be available, the curse of dimensionality does not apply and we could simply use an infinite number of features to obtain perfect classification.
Imports System.Math
Imports WindowsApp1.rinegan
Public Class Form1
Dim eye1 As New Aeye()
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim bmp As New Bitmap(imageLocaiton.Text)
TextBox3.Clear()
Dim ImageList As New List(Of Rectangle)
Aeye.ImagesDetecter(bmp, ImageList)
PictureBox1.Image = bmp.Clone()
For Each item As Rectangle In ImageList
bmp = Aeye.graphicContour(bmp, item.X, item.Width + item.X, item.Y, item.Height + item.Y)
Next
TextBox3.Text &= Aeye.DirectionGetter(bmp)
PictureBox2.Image = bmp.Clone()
TextBox3.Text &= " image height : " & bmp.Height.ToString & " image width : " & bmp.Width.ToString
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim bmp As New Bitmap("c:\testimage\x1.bmp")
PictureBox1.Image = bmp.Clone()
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
TextBox3.Clear()
For i As Integer = 300 To 3700 Step 300
TextBox3.Text &= i & " "
Next
TextBox3.Text &= ((4000 - 600) \ 300) + 1
End Sub
End Class
how do you make an A.EYE recognize groups such as :
employees , customers, dolls, bots, Japanese people, palm trees
how did you get from that to boxing the objects so fast ?
I'm very intrigued to see the algorithm walkthrough.
'// Auto define bounding boxes
'// check each pixels x,y to see if its within the bounds of a box
'// if it is then expand the box to include the pixel
'// else start a new box
Dim BOX(10000, 10) As Long
Dim tnb As Long
bias = 2
'// sum colour instances
For Y = 0 To Picture2.ScaleHeight - 1
For X = 0 To Picture2.ScaleWidth - 1
'// get the colour
RR = ImageData(2, X, Y)
GG = ImageData(1, X, Y)
BB = ImageData(0, X, Y)
'// check for colour other than BLACK
cfnd = 0
If RR > 50 Then cfnd = 1
If GG > 50 Then cfnd = 1
If BB > 50 Then cfnd = 1
bfnd = 0
If cfnd Then
'// check if inside existing bounding box
For dd = 1 To tnb
bl = 0
If X > BOX(dd, 1) - bias Then bl = bl + 1
If X < BOX(dd, 3) + bias Then bl = bl + 1
If Y > BOX(dd, 2) - bias Then bl = bl + 1
If Y < BOX(dd, 4) + bias Then bl = bl + 1
If bl = 4 Then bfnd = dd: Exit For
Next
If bfnd Then
'// Adjust existing box
If X < BOX(bfnd, 1) Then BOX(bfnd, 1) = X
If X > BOX(bfnd, 3) Then BOX(bfnd, 3) = X
If Y < BOX(bfnd, 2) Then BOX(bfnd, 2) = Y
If Y > BOX(bfnd, 4) Then BOX(bfnd, 4) = Y
Else
'// Create new box
tnb = tnb + 1
BOX(tnb, 1) = X
BOX(tnb, 2) = Y
BOX(tnb, 3) = X
BOX(tnb, 4) = Y
End If
End If
Next
Next
'// remove small boxes inside larger boxes
For e = 1 To tnb
bx = BOX(e, 1) + ((BOX(e, 3) - BOX(e, 1)) / 2)
By = BOX(e, 2) + ((BOX(e, 4) - BOX(e, 2)) / 2)
For dd = 1 To tnb
bbw = 0
fnd = 0
If BOX(e, 1) >= BOX(dd, 1) Then
If BOX(e, 1) <= BOX(dd, 3) Then
If BOX(e, 2) >= BOX(dd, 2) Then
If BOX(e, 2) <= BOX(dd, 4) Then fnd = 1
End If
End If
End If
If BOX(e, 3) >= BOX(dd, 1) Then
If BOX(e, 3) <= BOX(dd, 3) Then
If BOX(e, 2) >= BOX(dd, 2) Then
If BOX(e, 2) <= BOX(dd, 4) Then fnd = 1
End If
End If
End If
If BOX(e, 1) >= BOX(dd, 1) Then
If BOX(e, 1) <= BOX(dd, 3) Then
If BOX(e, 4) >= BOX(dd, 2) Then
If BOX(e, 4) <= BOX(dd, 4) Then fnd = 1
End If
End If
End If
If BOX(e, 3) >= BOX(dd, 1) Then
If BOX(e, 3) <= BOX(dd, 3) Then
If BOX(e, 4) >= BOX(dd, 2) Then
If BOX(e, 4) <= BOX(dd, 4) Then fnd = 1
End If
End If
End If
'
If fnd = 1 Then
If BOX(e, 1) < BOX(dd, 1) Then BOX(dd, 1) = BOX(e, 1)
If BOX(e, 3) > BOX(dd, 3) Then BOX(dd, 3) = BOX(e, 3)
If BOX(e, 2) < BOX(dd, 2) Then BOX(dd, 2) = BOX(e, 2)
If BOX(e, 4) > BOX(dd, 4) Then BOX(dd, 4) = BOX(e, 4)
BOX(dd, 5) = 1: Exit For
End If
Next
Next
jump3:
'// plot boxes
Picture2.AutoRedraw = False
For dd = 1 To tnb
If BOX(dd, 5) Then
x1 = BOX(dd, 1)
x2 = BOX(dd, 3)
y1 = BOX(dd, 2)
y2 = BOX(dd, 4)
Picture2.Line (x1, y1)-(x2, y2), &HFF0000, B
End If
Next
Picture2.AutoRedraw = True
Private Function markPixelMatrix(ByVal bmp As Bitmap, ByVal objectList As Object) As Bitmap
For i = 0 To bmp.Height - 1
For j = 0 To bmp.Width - 1
If objectList(j, i) Then
bmp = Aeye.mark_dark_pixelRED(j, i, bmp, 1)
End If
Next
Next
Return bmp
End Function
What is a Shiber? Is not in any of my dictionaries. Thanks. Shiver perhaps?
Hy Yotamarker, i want colaborate working in your project, i am study about contour.
please share your Inventor source-code to download and the Yotamarker app source too.
you using only Harris operator? cheers!
indian red,176,23,31
crimson,220,20,60
lightpink,255,182,193
lightpink 1,255,174,185
lightpink 2,238,162,173
lightpink 3,205,140,149
lightpink 4,139,95,101
pink,255,192,203
pink 1,255,181,197
pink 2,238,169,184
pink 3,205,145,158
pink 4,139,99,108
palevioletred,219,112,147
palevioletred 1,255,130,171
palevioletred 2,238,121,159
palevioletred 3,205,104,137
palevioletred 4,139,71,93
lavenderblush 1,255,240,245
lavenderblush 2,238,224,229
lavenderblush 3,205,193,197
lavenderblush 4,139,131,134
violetred 1,255,62,150
violetred 2,238,58,140
violetred 3,205,50,120
violetred 4,139,34,82
hotpink,255,105,180
hotpink 1,255,110,180
hotpink 2,238,106,167
hotpink 3,205,96,144
hotpink 4,139,58,98
raspberry,135,38,87
deeppink 1,255,20,147
deeppink 2,238,18,137
deeppink 3,205,16,118
deeppink 4,139,10,80
maroon 1,255,52,179
maroon 2,238,48,167
maroon 3,205,41,144
maroon 4,139,28,98
mediumvioletred,199,21,133
violetred,208,32,144
orchid,218,112,214
orchid 1,255,131,250
orchid 2,238,122,233
orchid 3,205,105,201
orchid 4,139,71,137
thistle,216,191,216
thistle 1,255,225,255
thistle 2,238,210,238
thistle 3,205,181,205
thistle 4,139,123,139
plum 1,255,187,255
plum 2,238,174,238
plum 3,205,150,205
plum 4,139,102,139
plum,221,160,221
violet,238,130,238
magenta (fuchsia*),255,0,255
magenta 2,238,0,238
magenta 3,205,0,205
magenta 4,139,0,139
purple*,128,0,128
mediumorchid,186,85,211
mediumorchid 1,224,102,255
mediumorchid 2,209,95,238
mediumorchid 3,180,82,205
mediumorchid 4,122,55,139
darkviolet,148,0,211
darkorchid,153,50,204
darkorchid 1,191,62,255
darkorchid 2,178,58,238
darkorchid 3,154,50,205
darkorchid 4,104,34,139
indigo,75,0,130
blueviolet,138,43,226
purple 1,155,48,255
purple 2,145,44,238
purple 3,125,38,205
purple 4,85,26,139
mediumpurple,147,112,219
mediumpurple 1,171,130,255
mediumpurple 2,159,121,238
mediumpurple 3,137,104,205
mediumpurple 4,93,71,139
darkslateblue,72,61,139
lightslateblue,132,112,255
mediumslateblue,123,104,238
slateblue,106,90,205
slateblue 1,131,111,255
slateblue 2,122,103,238
slateblue 3,105,89,205
slateblue 4,71,60,139
ghostwhite,248,248,255
lavender,230,230,250
blue*,0,0,255
blue 2,0,0,238
blue 3 (mediumblue),0,0,205
blue 4 (darkblue),0,0,139
navy*,0,0,128
midnightblue,25,25,112
cobalt,61,89,171
royalblue,65,105,225
royalblue 1,72,118,255
royalblue 2,67,110,238
royalblue 3,58,95,205
royalblue 4,39,64,139
cornflowerblue,100,149,237
lightsteelblue,176,196,222
lightsteelblue 1,202,225,255
lightsteelblue 2,188,210,238
lightsteelblue 3,162,181,205
lightsteelblue 4,110,123,139
lightslategray,119,136,153
slategray,112,128,144
slategray 1,198,226,255
slategray 2,185,211,238
slategray 3,159,182,205
slategray 4,108,123,139
dodgerblue 1,30,144,255
dodgerblue 2,28,134,238
dodgerblue 3,24,116,205
dodgerblue 4,16,78,139
aliceblue,240,248,255
steelblue,70,130,180
steelblue 1,99,184,255
steelblue 2,92,172,238
steelblue 3,79,148,205
steelblue 4,54,100,139
lightskyblue,135,206,250
lightskyblue 1,176,226,255
lightskyblue 2,164,211,238
lightskyblue 3,141,182,205
lightskyblue 4,96,123,139
skyblue 1,135,206,255
skyblue 2,126,192,238
skyblue 3,108,166,205
skyblue 4,74,112,139
skyblue,135,206,235
deepskyblue 1,0,191,255
deepskyblue 2,0,178,238
deepskyblue 3,0,154,205
deepskyblue 4,0,104,139
peacock,51,161,201
lightblue,173,216,230
lightblue 1,191,239,255
lightblue 2,178,223,238
lightblue 3,154,192,205
lightblue 4,104,131,139
powderblue,176,224,230
cadetblue 1,152,245,255
cadetblue 2,142,229,238
cadetblue 3,122,197,205
cadetblue 4,83,134,139
turquoise 1,0,245,255
turquoise 2,0,229,238
turquoise 3,0,197,205
turquoise 4,0,134,139
cadetblue,95,158,160
darkturquoise,0,206,209
azure 1 (azure),240,255,255
azure 2,224,238,238
azure 3,193,205,205
azure 4,131,139,139
lightcyan 1,224,255,255
lightcyan 2,209,238,238
lightcyan 3,180,205,205
lightcyan 4,122,139,139
paleturquoise 1,187,255,255
paleturquoise 2,174,238,238
paleturquoise 3,150,205,205
paleturquoise 4,102,139,139
darkslategray,47,79,79
darkslategray 1,151,255,255
darkslategray 2,141,238,238
darkslategray 3,121,205,205
darkslategray 4,82,139,139
cyan / aqua*,0,255,255
cyan 2,0,238,238
cyan 3,0,205,205
cyan 4 (darkcyan),0,139,139
teal*,0,128,128
mediumturquoise,72,209,204
lightseagreen,32,178,170
manganeseblue,3,168,158
turquoise,64,224,208
coldgrey,128,138,135
turquoiseblue,0,199,140
aquamarine 1,127,255,212
aquamarine 2,118,238,198
aquamarine 3,102,205,170
aquamarine 4,69,139,116
mediumspringgreen,0,250,154
mintcream,245,255,250
springgreen,0,255,127
springgreen 1,0,238,118
springgreen 2,0,205,102
springgreen 3,0,139,69
mediumseagreen,60,179,113
seagreen 1,84,255,159
seagreen 2,78,238,148
seagreen 3,67,205,128
seagreen 4,46,139,87
emeraldgreen,0,201,87
mint,189,252,201
cobaltgreen,61,145,64
honeydew 1,240,255,240
honeydew 2,224,238,224
honeydew 3,193,205,193
honeydew 4,131,139,131
darkseagreen,143,188,143
darkseagreen 1,193,255,193
darkseagreen 2,180,238,180
darkseagreen 3,155,205,155
darkseagreen 4,105,139,105
palegreen,152,251,152
palegreen 1,154,255,154
palegreen 2,144,238,144
palegreen 3,124,205,124
palegreen 4,84,139,84
limegreen,50,205,50
forestgreen,34,139,34
green 1 (lime*),0,255,0
green 2,0,238,0
green 3,0,205,0
green 4,0,139,0
green*,0,128,0
darkgreen,0,100,0
sapgreen,48,128,20
lawngreen,124,252,0
chartreuse 1,127,255,0
chartreuse 2,118,238,0
chartreuse 3,102,205,0
chartreuse 4,69,139,0
greenyellow,173,255,47
darkolivegreen 1,202,255,112
darkolivegreen 2,188,238,104
darkolivegreen 3,162,205,90
darkolivegreen 4,110,139,61
darkolivegreen,85,107,47
olivedrab,107,142,35
olivedrab 1,192,255,62
olivedrab 2,179,238,58
olivedrab 3,154,205,50
olivedrab 4,105,139,34
ivory 1 (ivory),255,255,240
ivory 2,238,238,224
ivory 3,205,205,193
ivory 4,139,139,131
beige,245,245,220
lightyellow 1,255,255,224
lightyellow 2,238,238,209
lightyellow 3,205,205,180
lightyellow 4,139,139,122
lightgoldenrodyellow,250,250,210
yellow 1 (yellow*),255,255,0
yellow 2,238,238,0
yellow 3,205,205,0
yellow 4,139,139,0
warmgrey,128,128,105
olive*,128,128,0
darkkhaki,189,183,107
khaki 1,255,246,143
khaki 2,238,230,133
khaki 3,205,198,115
khaki 4,139,134,78
khaki,240,230,140
palegoldenrod,238,232,170
lemonchiffon 1,255,250,205
lemonchiffon 2,238,233,191
lemonchiffon 3,205,201,165
lemonchiffon 4,139,137,112
lightgoldenrod 1,255,236,139
lightgoldenrod 2,238,220,130
lightgoldenrod 3,205,190,112
lightgoldenrod 4,139,129,76
banana,227,207,87
gold 1 (gold),255,215,0
gold 2,238,201,0
gold 3,205,173,0
gold 4,139,117,0
cornsilk 1 (cornsilk),255,248,220
cornsilk 2,238,232,205
cornsilk 3,205,200,177
cornsilk 4,139,136,120
goldenrod,218,165,32
goldenrod 1,255,193,37
goldenrod 2,238,180,34
goldenrod 3,205,155,29
goldenrod 4,139,105,20
darkgoldenrod,184,134,11
darkgoldenrod 1,255,185,15
darkgoldenrod 2,238,173,14
darkgoldenrod 3,205,149,12
darkgoldenrod 4,139,101,8
orange 1 (orange),255,165,0
orange 2,238,154,0
orange 3,205,133,0
orange 4,139,90,0
floralwhite,255,250,240
oldlace,253,245,230
wheat,245,222,179
wheat 1,255,231,186
wheat 2,238,216,174
wheat 3,205,186,150
wheat 4,139,126,102
moccasin,255,228,181
papayawhip,255,239,213
blanchedalmond,255,235,205
navajowhite 1,255,222,173
navajowhite 2,238,207,161
navajowhite 3,205,179,139
navajowhite 4,139,121,94
eggshell,252,230,201
tan,210,180,140
brick,156,102,31
cadmiumyellow,255,153,18
antiquewhite,250,235,215
antiquewhite 1,255,239,219
antiquewhite 2,238,223,204
antiquewhite 3,205,192,176
antiquewhite 4,139,131,120
burlywood,222,184,135
burlywood 1,255,211,155
burlywood 2,238,197,145
burlywood 3,205,170,125
burlywood 4,139,115,85
bisque 1 (bisque),255,228,196
bisque 2,238,213,183
bisque 3,205,183,158
bisque 4,139,125,107
melon,227,168,105
carrot,237,145,33
darkorange,255,140,0
darkorange 1,255,127,0
darkorange 2,238,118,0
darkorange 3,205,102,0
darkorange 4,139,69,0
orange,255,128,0
tan 1,255,165,79
tan 2,238,154,73
tan 3 (peru),205,133,63
tan 4,139,90,43
linen,250,240,230
peachpuff 1,255,218,185
peachpuff 2,238,203,173
peachpuff 3,205,175,149
peachpuff 4,139,119,101
seashell 1 (seashell),255,245,238
seashell 2,238,229,222
seashell 3,205,197,191
seashell 4,139,134,130
sandybrown,244,164,96
rawsienna,199,97,20
chocolate,210,105,30
chocolate 1,255,127,36
chocolate 2,238,118,33
chocolate 3,205,102,29
chocolate 4,139,69,19
ivoryblack,41,36,33
flesh,255,125,64
cadmiumorange,255,97,3
burntsienna,138,54,15
sienna,160,82,45
sienna 1,255,130,71
sienna 2,238,121,66
sienna 3,205,104,57
sienna 4,139,71,38
lightsalmon 1,255,160,122
lightsalmon 2,238,149,114
lightsalmon 3,205,129,98
lightsalmon 4,139,87,66
coral,255,127,80
orangered 1,255,69,0
orangered 2,238,64,0
orangered 3,205,55,0
orangered 4,139,37,0
sepia,94,38,18
darksalmon,233,150,122
salmon 1,255,140,105
salmon 2,238,130,98
salmon 3,205,112,84
salmon 4,139,76,57
coral 1,255,114,86
coral 2,238,106,80
coral 3,205,91,69
coral 4,139,62,47
burntumber,138,51,36
tomato 1 (tomato),255,99,71
tomato 2,238,92,66
tomato 3,205,79,57
tomato 4,139,54,38
salmon,250,128,114
mistyrose 1,255,228,225
mistyrose 2,238,213,210
mistyrose 3,205,183,181
mistyrose 4,139,125,123
snow 1 (snow),255,250,250
snow 2,238,233,233
snow 3,205,201,201
snow 4,139,137,137
rosybrown,188,143,143
rosybrown 1,255,193,193
rosybrown 2,238,180,180
rosybrown 3,205,155,155
rosybrown 4,139,105,105
lightcoral,240,128,128
indianred,205,92,92
indianred 1,255,106,106
indianred 2,238,99,99
indianred 4,139,58,58
indianred 3,205,85,85
brown,165,42,42
brown 1,255,64,64
brown 2,238,59,59
brown 3,205,51,51
brown 4,139,35,35
firebrick,178,34,34
firebrick 1,255,48,48
firebrick 2,238,44,44
firebrick 3,205,38,38
firebrick 4,139,26,26
red 1 (red*),255,0,0
red 2,238,0,0
red 3,205,0,0
red 4 (darkred),139,0,0
maroon*,128,0,0
sgi beet,142,56,142
sgi slateblue,113,113,198
sgi lightblue,125,158,192
sgi teal,56,142,142
sgi chartreuse,113,198,113
sgi olivedrab,142,142,56
sgi brightgray,197,193,170
sgi salmon,198,113,113
sgi darkgray,85,85,85
sgi gray 12,30,30,30
sgi gray 16,40,40,40
sgi gray 32,81,81,81
sgi gray 36,91,91,91
sgi gray 52,132,132,132
sgi gray 56,142,142,142
sgi lightgray,170,170,170
sgi gray 72,183,183,183
sgi gray 76,193,193,193
sgi gray 92,234,234,234
sgi gray 96,244,244,244
white*,255,255,255
white smoke,245,245,245
gainsboro,220,220,220
lightgrey,211,211,211
silver*,192,192,192
darkgray,169,169,169
gray*,128,128,128
dimgray (gray 42),105,105,105
black*,0,0,0
gray 99,252,252,252
gray 98,250,250,250
gray 97,247,247,247
white smoke,245,245,245
gray 95,242,242,242
gray 94,240,240,240
gray 93,237,237,237
gray 92,235,235,235
gray 91,232,232,232
gray 90,229,229,229
gray 89,227,227,227
gray 88,224,224,224
gray 87,222,222,222
gray 86,219,219,219
gray 85,217,217,217
gray 84,214,214,214
gray 83,212,212,212
gray 82,209,209,209
gray 81,207,207,207
gray 80,204,204,204
gray 79,201,201,201
gray 78,199,199,199
gray 77,196,196,196
gray 76,194,194,194
gray 75,191,191,191
gray 74,189,189,189
gray 73,186,186,186
gray 72,184,184,184
gray 71,181,181,181
gray 70,179,179,179
gray 69,176,176,176
gray 68,173,173,173
gray 67,171,171,171
gray 66,168,168,168
gray 65,166,166,166
gray 64,163,163,163
gray 63,161,161,161
gray 62,158,158,158
gray 61,156,156,156
gray 60,153,153,153
gray 59,150,150,150
gray 58,148,148,148
gray 57,145,145,145
gray 56,143,143,143
gray 55,140,140,140
gray 54,138,138,138
gray 53,135,135,135
gray 52,133,133,133
gray 51,130,130,130
gray 50,127,127,127
gray 49,125,125,125
gray 48,122,122,122
gray 47,120,120,120
gray 46,117,117,117
gray 45,115,115,115
gray 44,112,112,112
gray 43,110,110,110
gray 42,107,107,107
dimgray (gray 42),105,105,105
gray 40,102,102,102
gray 39,99,99,99
gray 38,97,97,97
gray 37,94,94,94
gray 36,92,92,92
gray 35,89,89,89
gray 34,87,87,87
gray 33,84,84,84
gray 32,82,82,82
gray 31,79,79,79
gray 30,77,77,77
gray 29,74,74,74
gray 28,71,71,71
gray 27,69,69,69
gray 26,66,66,66
gray 25,64,64,64
gray 24,61,61,61
gray 23,59,59,59
gray 22,56,56,56
gray 21,54,54,54
gray 20,51,51,51
gray 19,48,48,48
gray 18,46,46,46
gray 17,43,43,43
gray 16,41,41,41
gray 15,38,38,38
gray 14,36,36,36
gray 13,33,33,33
gray 12,31,31,31
gray 11,28,28,28
gray 10,26,26,26
gray 9,23,23,23
gray 8,20,20,20
gray 7,18,18,18
gray 6,15,15,15
gray 5,13,13,13
gray 4,10,10,10
gray 3,8,8,8
gray 2,5,5,5
gray 1,3,3,3
your alg is less than ideal as it requires 256*256*256 lines of code if you go for a select case methode.Codeindian red,176,23,31
crimson,220,20,60
lightpink,255,182,193
lightpink 1,255,174,185
lightpink 2,238,162,173
lightpink 3,205,140,149
lightpink 4,139,95,101
pink,255,192,203
pink 1,255,181,197
pink 2,238,169,184
pink 3,205,145,158
pink 4,139,99,108
palevioletred,219,112,147
palevioletred 1,255,130,171
palevioletred 2,238,121,159
palevioletred 3,205,104,137
palevioletred 4,139,71,93
lavenderblush 1,255,240,245
lavenderblush 2,238,224,229
lavenderblush 3,205,193,197
lavenderblush 4,139,131,134
violetred 1,255,62,150
violetred 2,238,58,140
violetred 3,205,50,120
violetred 4,139,34,82
hotpink,255,105,180
hotpink 1,255,110,180
hotpink 2,238,106,167
hotpink 3,205,96,144
hotpink 4,139,58,98
raspberry,135,38,87
deeppink 1,255,20,147
deeppink 2,238,18,137
deeppink 3,205,16,118
deeppink 4,139,10,80
maroon 1,255,52,179
maroon 2,238,48,167
maroon 3,205,41,144
maroon 4,139,28,98
mediumvioletred,199,21,133
violetred,208,32,144
orchid,218,112,214
orchid 1,255,131,250
orchid 2,238,122,233
orchid 3,205,105,201
orchid 4,139,71,137
thistle,216,191,216
thistle 1,255,225,255
thistle 2,238,210,238
thistle 3,205,181,205
thistle 4,139,123,139
plum 1,255,187,255
plum 2,238,174,238
plum 3,205,150,205
plum 4,139,102,139
plum,221,160,221
violet,238,130,238
magenta (fuchsia*),255,0,255
magenta 2,238,0,238
magenta 3,205,0,205
magenta 4,139,0,139
purple*,128,0,128
mediumorchid,186,85,211
mediumorchid 1,224,102,255
mediumorchid 2,209,95,238
mediumorchid 3,180,82,205
mediumorchid 4,122,55,139
darkviolet,148,0,211
darkorchid,153,50,204
darkorchid 1,191,62,255
darkorchid 2,178,58,238
darkorchid 3,154,50,205
darkorchid 4,104,34,139
indigo,75,0,130
blueviolet,138,43,226
purple 1,155,48,255
purple 2,145,44,238
purple 3,125,38,205
purple 4,85,26,139
mediumpurple,147,112,219
mediumpurple 1,171,130,255
mediumpurple 2,159,121,238
mediumpurple 3,137,104,205
mediumpurple 4,93,71,139
darkslateblue,72,61,139
lightslateblue,132,112,255
mediumslateblue,123,104,238
slateblue,106,90,205
slateblue 1,131,111,255
slateblue 2,122,103,238
slateblue 3,105,89,205
slateblue 4,71,60,139
ghostwhite,248,248,255
lavender,230,230,250
blue*,0,0,255
blue 2,0,0,238
blue 3 (mediumblue),0,0,205
blue 4 (darkblue),0,0,139
navy*,0,0,128
midnightblue,25,25,112
cobalt,61,89,171
royalblue,65,105,225
royalblue 1,72,118,255
royalblue 2,67,110,238
royalblue 3,58,95,205
royalblue 4,39,64,139
cornflowerblue,100,149,237
lightsteelblue,176,196,222
lightsteelblue 1,202,225,255
lightsteelblue 2,188,210,238
lightsteelblue 3,162,181,205
lightsteelblue 4,110,123,139
lightslategray,119,136,153
slategray,112,128,144
slategray 1,198,226,255
slategray 2,185,211,238
slategray 3,159,182,205
slategray 4,108,123,139
dodgerblue 1,30,144,255
dodgerblue 2,28,134,238
dodgerblue 3,24,116,205
dodgerblue 4,16,78,139
aliceblue,240,248,255
steelblue,70,130,180
steelblue 1,99,184,255
steelblue 2,92,172,238
steelblue 3,79,148,205
steelblue 4,54,100,139
lightskyblue,135,206,250
lightskyblue 1,176,226,255
lightskyblue 2,164,211,238
lightskyblue 3,141,182,205
lightskyblue 4,96,123,139
skyblue 1,135,206,255
skyblue 2,126,192,238
skyblue 3,108,166,205
skyblue 4,74,112,139
skyblue,135,206,235
deepskyblue 1,0,191,255
deepskyblue 2,0,178,238
deepskyblue 3,0,154,205
deepskyblue 4,0,104,139
peacock,51,161,201
lightblue,173,216,230
lightblue 1,191,239,255
lightblue 2,178,223,238
lightblue 3,154,192,205
lightblue 4,104,131,139
powderblue,176,224,230
cadetblue 1,152,245,255
cadetblue 2,142,229,238
cadetblue 3,122,197,205
cadetblue 4,83,134,139
turquoise 1,0,245,255
turquoise 2,0,229,238
turquoise 3,0,197,205
turquoise 4,0,134,139
cadetblue,95,158,160
darkturquoise,0,206,209
azure 1 (azure),240,255,255
azure 2,224,238,238
azure 3,193,205,205
azure 4,131,139,139
lightcyan 1,224,255,255
lightcyan 2,209,238,238
lightcyan 3,180,205,205
lightcyan 4,122,139,139
paleturquoise 1,187,255,255
paleturquoise 2,174,238,238
paleturquoise 3,150,205,205
paleturquoise 4,102,139,139
darkslategray,47,79,79
darkslategray 1,151,255,255
darkslategray 2,141,238,238
darkslategray 3,121,205,205
darkslategray 4,82,139,139
cyan / aqua*,0,255,255
cyan 2,0,238,238
cyan 3,0,205,205
cyan 4 (darkcyan),0,139,139
teal*,0,128,128
mediumturquoise,72,209,204
lightseagreen,32,178,170
manganeseblue,3,168,158
turquoise,64,224,208
coldgrey,128,138,135
turquoiseblue,0,199,140
aquamarine 1,127,255,212
aquamarine 2,118,238,198
aquamarine 3,102,205,170
aquamarine 4,69,139,116
mediumspringgreen,0,250,154
mintcream,245,255,250
springgreen,0,255,127
springgreen 1,0,238,118
springgreen 2,0,205,102
springgreen 3,0,139,69
mediumseagreen,60,179,113
seagreen 1,84,255,159
seagreen 2,78,238,148
seagreen 3,67,205,128
seagreen 4,46,139,87
emeraldgreen,0,201,87
mint,189,252,201
cobaltgreen,61,145,64
honeydew 1,240,255,240
honeydew 2,224,238,224
honeydew 3,193,205,193
honeydew 4,131,139,131
darkseagreen,143,188,143
darkseagreen 1,193,255,193
darkseagreen 2,180,238,180
darkseagreen 3,155,205,155
darkseagreen 4,105,139,105
palegreen,152,251,152
palegreen 1,154,255,154
palegreen 2,144,238,144
palegreen 3,124,205,124
palegreen 4,84,139,84
limegreen,50,205,50
forestgreen,34,139,34
green 1 (lime*),0,255,0
green 2,0,238,0
green 3,0,205,0
green 4,0,139,0
green*,0,128,0
darkgreen,0,100,0
sapgreen,48,128,20
lawngreen,124,252,0
chartreuse 1,127,255,0
chartreuse 2,118,238,0
chartreuse 3,102,205,0
chartreuse 4,69,139,0
greenyellow,173,255,47
darkolivegreen 1,202,255,112
darkolivegreen 2,188,238,104
darkolivegreen 3,162,205,90
darkolivegreen 4,110,139,61
darkolivegreen,85,107,47
olivedrab,107,142,35
olivedrab 1,192,255,62
olivedrab 2,179,238,58
olivedrab 3,154,205,50
olivedrab 4,105,139,34
ivory 1 (ivory),255,255,240
ivory 2,238,238,224
ivory 3,205,205,193
ivory 4,139,139,131
beige,245,245,220
lightyellow 1,255,255,224
lightyellow 2,238,238,209
lightyellow 3,205,205,180
lightyellow 4,139,139,122
lightgoldenrodyellow,250,250,210
yellow 1 (yellow*),255,255,0
yellow 2,238,238,0
yellow 3,205,205,0
yellow 4,139,139,0
warmgrey,128,128,105
olive*,128,128,0
darkkhaki,189,183,107
khaki 1,255,246,143
khaki 2,238,230,133
khaki 3,205,198,115
khaki 4,139,134,78
khaki,240,230,140
palegoldenrod,238,232,170
lemonchiffon 1,255,250,205
lemonchiffon 2,238,233,191
lemonchiffon 3,205,201,165
lemonchiffon 4,139,137,112
lightgoldenrod 1,255,236,139
lightgoldenrod 2,238,220,130
lightgoldenrod 3,205,190,112
lightgoldenrod 4,139,129,76
banana,227,207,87
gold 1 (gold),255,215,0
gold 2,238,201,0
gold 3,205,173,0
gold 4,139,117,0
cornsilk 1 (cornsilk),255,248,220
cornsilk 2,238,232,205
cornsilk 3,205,200,177
cornsilk 4,139,136,120
goldenrod,218,165,32
goldenrod 1,255,193,37
goldenrod 2,238,180,34
goldenrod 3,205,155,29
goldenrod 4,139,105,20
darkgoldenrod,184,134,11
darkgoldenrod 1,255,185,15
darkgoldenrod 2,238,173,14
darkgoldenrod 3,205,149,12
darkgoldenrod 4,139,101,8
orange 1 (orange),255,165,0
orange 2,238,154,0
orange 3,205,133,0
orange 4,139,90,0
floralwhite,255,250,240
oldlace,253,245,230
wheat,245,222,179
wheat 1,255,231,186
wheat 2,238,216,174
wheat 3,205,186,150
wheat 4,139,126,102
moccasin,255,228,181
papayawhip,255,239,213
blanchedalmond,255,235,205
navajowhite 1,255,222,173
navajowhite 2,238,207,161
navajowhite 3,205,179,139
navajowhite 4,139,121,94
eggshell,252,230,201
tan,210,180,140
brick,156,102,31
cadmiumyellow,255,153,18
antiquewhite,250,235,215
antiquewhite 1,255,239,219
antiquewhite 2,238,223,204
antiquewhite 3,205,192,176
antiquewhite 4,139,131,120
burlywood,222,184,135
burlywood 1,255,211,155
burlywood 2,238,197,145
burlywood 3,205,170,125
burlywood 4,139,115,85
bisque 1 (bisque),255,228,196
bisque 2,238,213,183
bisque 3,205,183,158
bisque 4,139,125,107
melon,227,168,105
carrot,237,145,33
darkorange,255,140,0
darkorange 1,255,127,0
darkorange 2,238,118,0
darkorange 3,205,102,0
darkorange 4,139,69,0
orange,255,128,0
tan 1,255,165,79
tan 2,238,154,73
tan 3 (peru),205,133,63
tan 4,139,90,43
linen,250,240,230
peachpuff 1,255,218,185
peachpuff 2,238,203,173
peachpuff 3,205,175,149
peachpuff 4,139,119,101
seashell 1 (seashell),255,245,238
seashell 2,238,229,222
seashell 3,205,197,191
seashell 4,139,134,130
sandybrown,244,164,96
rawsienna,199,97,20
chocolate,210,105,30
chocolate 1,255,127,36
chocolate 2,238,118,33
chocolate 3,205,102,29
chocolate 4,139,69,19
ivoryblack,41,36,33
flesh,255,125,64
cadmiumorange,255,97,3
burntsienna,138,54,15
sienna,160,82,45
sienna 1,255,130,71
sienna 2,238,121,66
sienna 3,205,104,57
sienna 4,139,71,38
lightsalmon 1,255,160,122
lightsalmon 2,238,149,114
lightsalmon 3,205,129,98
lightsalmon 4,139,87,66
coral,255,127,80
orangered 1,255,69,0
orangered 2,238,64,0
orangered 3,205,55,0
orangered 4,139,37,0
sepia,94,38,18
darksalmon,233,150,122
salmon 1,255,140,105
salmon 2,238,130,98
salmon 3,205,112,84
salmon 4,139,76,57
coral 1,255,114,86
coral 2,238,106,80
coral 3,205,91,69
coral 4,139,62,47
burntumber,138,51,36
tomato 1 (tomato),255,99,71
tomato 2,238,92,66
tomato 3,205,79,57
tomato 4,139,54,38
salmon,250,128,114
mistyrose 1,255,228,225
mistyrose 2,238,213,210
mistyrose 3,205,183,181
mistyrose 4,139,125,123
snow 1 (snow),255,250,250
snow 2,238,233,233
snow 3,205,201,201
snow 4,139,137,137
rosybrown,188,143,143
rosybrown 1,255,193,193
rosybrown 2,238,180,180
rosybrown 3,205,155,155
rosybrown 4,139,105,105
lightcoral,240,128,128
indianred,205,92,92
indianred 1,255,106,106
indianred 2,238,99,99
indianred 4,139,58,58
indianred 3,205,85,85
brown,165,42,42
brown 1,255,64,64
brown 2,238,59,59
brown 3,205,51,51
brown 4,139,35,35
firebrick,178,34,34
firebrick 1,255,48,48
firebrick 2,238,44,44
firebrick 3,205,38,38
firebrick 4,139,26,26
red 1 (red*),255,0,0
red 2,238,0,0
red 3,205,0,0
red 4 (darkred),139,0,0
maroon*,128,0,0
sgi beet,142,56,142
sgi slateblue,113,113,198
sgi lightblue,125,158,192
sgi teal,56,142,142
sgi chartreuse,113,198,113
sgi olivedrab,142,142,56
sgi brightgray,197,193,170
sgi salmon,198,113,113
sgi darkgray,85,85,85
sgi gray 12,30,30,30
sgi gray 16,40,40,40
sgi gray 32,81,81,81
sgi gray 36,91,91,91
sgi gray 52,132,132,132
sgi gray 56,142,142,142
sgi lightgray,170,170,170
sgi gray 72,183,183,183
sgi gray 76,193,193,193
sgi gray 92,234,234,234
sgi gray 96,244,244,244
white*,255,255,255
white smoke,245,245,245
gainsboro,220,220,220
lightgrey,211,211,211
silver*,192,192,192
darkgray,169,169,169
gray*,128,128,128
dimgray (gray 42),105,105,105
black*,0,0,0
gray 99,252,252,252
gray 98,250,250,250
gray 97,247,247,247
white smoke,245,245,245
gray 95,242,242,242
gray 94,240,240,240
gray 93,237,237,237
gray 92,235,235,235
gray 91,232,232,232
gray 90,229,229,229
gray 89,227,227,227
gray 88,224,224,224
gray 87,222,222,222
gray 86,219,219,219
gray 85,217,217,217
gray 84,214,214,214
gray 83,212,212,212
gray 82,209,209,209
gray 81,207,207,207
gray 80,204,204,204
gray 79,201,201,201
gray 78,199,199,199
gray 77,196,196,196
gray 76,194,194,194
gray 75,191,191,191
gray 74,189,189,189
gray 73,186,186,186
gray 72,184,184,184
gray 71,181,181,181
gray 70,179,179,179
gray 69,176,176,176
gray 68,173,173,173
gray 67,171,171,171
gray 66,168,168,168
gray 65,166,166,166
gray 64,163,163,163
gray 63,161,161,161
gray 62,158,158,158
gray 61,156,156,156
gray 60,153,153,153
gray 59,150,150,150
gray 58,148,148,148
gray 57,145,145,145
gray 56,143,143,143
gray 55,140,140,140
gray 54,138,138,138
gray 53,135,135,135
gray 52,133,133,133
gray 51,130,130,130
gray 50,127,127,127
gray 49,125,125,125
gray 48,122,122,122
gray 47,120,120,120
gray 46,117,117,117
gray 45,115,115,115
gray 44,112,112,112
gray 43,110,110,110
gray 42,107,107,107
dimgray (gray 42),105,105,105
gray 40,102,102,102
gray 39,99,99,99
gray 38,97,97,97
gray 37,94,94,94
gray 36,92,92,92
gray 35,89,89,89
gray 34,87,87,87
gray 33,84,84,84
gray 32,82,82,82
gray 31,79,79,79
gray 30,77,77,77
gray 29,74,74,74
gray 28,71,71,71
gray 27,69,69,69
gray 26,66,66,66
gray 25,64,64,64
gray 24,61,61,61
gray 23,59,59,59
gray 22,56,56,56
gray 21,54,54,54
gray 20,51,51,51
gray 19,48,48,48
gray 18,46,46,46
gray 17,43,43,43
gray 16,41,41,41
gray 15,38,38,38
gray 14,36,36,36
gray 13,33,33,33
gray 12,31,31,31
gray 11,28,28,28
gray 10,26,26,26
gray 9,23,23,23
gray 8,20,20,20
gray 7,18,18,18
gray 6,15,15,15
gray 5,13,13,13
gray 4,10,10,10
gray 3,8,8,8
gray 2,5,5,5
gray 1,3,3,3
:)
Function colour_name (red as long, gre as long, blu as long) as string
Open “colour list.txt†for input as #1
Do
Input #1, name, a, b c
If a=red and b=gre and c=blu then colour_name=name
Loop until eof(1)
Close #1
End function
how would you defing the brown range of colors ?
what do you call movement C ?
public ImageDepictor directionGetter(Bitmap bmp1)
{
ImageDepictor imageDepictor = new ImageDepictor();
Boolean refreshImageA = false;
Boolean exploded = resulTemp.contains("explosion");
Boolean imploded = resulTemp.contains("implosion");
resulTemp="";
Boolean[][] imageB = new Boolean[13][13];
for (int i = 0; i < imageB.length; i++){
Arrays.fill(imageB[i], false);
}
int changeCurMax = -1;
int changeCurMin =9001;
int changeCurMaxY = -1;
int changeCurMinY =9001;
//preloop vars :
int jumpX = bmp1.getWidth()/14;
int jumpY = bmp1.getHeight()/14;
Boolean outlinePxl = false;
for (int i = 1; i <= 13; ++i) {
for (int j = 1; j <= 13; ++j) {
//Boolean outlinePxl = isOutLine(j*jumpX,i*jumpY,bmp1,20);
int pixel = bmp1.getPixel(j*jumpX,i*jumpY);
outlinePxl = isBlackPixel(pixel);
if(outlinePxl){bmp1=mark_dark_pixel_red(j*jumpX,i*jumpY,bmp1,(byte)30);imageB[j-1][i-1]=true;}
if(imageB[j-1][i-1]^imageA[j-1][i-1]){
changeCurMin=miner(j,changeCurMin);changeCurMax=maxer(j,changeCurMax);
changeCurMinY=miner(i,changeCurMinY);changeCurMaxY=maxer(i,changeCurMaxY);
}
// if(!(outlinePxl)){bmp1=mark_dark_pixel_red(j*jumpX,i*jumpY,bmp1,(byte)10);imageB[j][i]=true;
// if(!imageA[j][i]){changeCurMin=miner(j,changeCurMin);changeCurMax=maxer(j,changeCurMax);
// changeCurMinY=miner(j,changeCurMinY);changeCurMaxY=maxer(j,changeCurMaxY);
// }
// }
}
}
Log.i("test", "shiiiiiiiiiiiiiiiit");
//mark movement area :
bmp1=mark_dark_pixel(changePrevMin*jumpX,6*jumpY,bmp1,(byte)50);
bmp1=mark_dark_pixel(changePrevMax*jumpX,6*jumpY,bmp1,(byte)50);
bmp1=mark_dark_pixel_blue(changeCurMax*jumpX,5*jumpY,bmp1,(byte)50);
bmp1=mark_dark_pixel_blue(changeCurMin*jumpX,5*jumpY,bmp1,(byte)50);
imageDepictor.setBmp(bmp1);
//imageDepictor.setBmp(graphicContour(bmp1,(changeCurMin+1)*jumpX,(changeCurMax+1)*jumpX,(changeCurMinY+1)*jumpY,(changeCurMaxY+1)*jumpY,Color.BLUE));
if(imploded){
if(changeCurMax-changePrevMax>changePrevMax-changeCurMin){resulTemp ="right";}
else{resulTemp="left";}
bmp1=mark_dark_pixel_black(changePrevMin*jumpX,6*jumpY,bmp1,(byte)50);
bmp1=mark_dark_pixel_black(changePrevMax*jumpX,6*jumpY,bmp1,(byte)50);
}else{
if(changeCurMax>changePrevMax){resulTemp+="right";}
if(changeCurMin<changePrevMin){resulTemp+="left";}
if(resulTemp.equals("rightleft")){resulTemp="explosion";}
if(changeCurMax<changePrevMax&&changeCurMin>changePrevMin){resulTemp="implosion";}
if(exploded&&changeCurMax<=changePrevMax&&changeCurMin>=changePrevMin){resulTemp="implosion";}
if(!exploded&&changeCurMax==changePrevMax&&changeCurMin==changePrevMin){resulTemp="blink";}
if(resulTemp.isEmpty()){resulTemp="static";}}
for (int i = 1; i <= 13; ++i) {
for (int j = 1; j <= 13; ++j) {
imageA[j-1][i-1]=imageB[j-1][i-1];
}
}
changePrevMax = changeCurMax;
changePrevMin=changeCurMin;
changePrevMaxY = changeCurMax;
changePrevMinY=changeCurMin;
if(resulTemp.equals("implosion")){
changePrevMax = changeCurMin + (changeCurMax-changeCurMin)/2;
changePrevMin=changePrevMax;
}
imageDepictor.setDepiction(resulTemp);
return imageDepictor;
}
bttf 3 : to achieve 88MPH it would have to be hot, I'm talking hotter than the hell fires of hell and damnation !to completely destroy even the memory of openCV and YOLO to make them obsolete, the AEye must work fast !
YOLO resize image randomly from 320*320 to 608*608. This technique can let
model have abilities to handle different size of input images.