outline from gadient mask

  • 226 Replies
  • 75160 Views
*

Korrelan

  • Trusty Member
  • ***********
  • Eve
  • *
  • 1454
  • Look into my eyes! WOAH!
    • YouTube
Re: outline from gadient mask
« Reply #90 on: April 27, 2017, 10:59:07 pm »


Code
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

 :)
It thunk... therefore it is!...    /    Project Page    /    KorrTecx Website

*

yotamarker

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1003
  • battle programmer
    • battle programming
Re: outline from gadient mask
« Reply #91 on: April 28, 2017, 02:32:51 pm »
your eye was so cool I had to copy it
Code
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
it still needs work but It has a "pupil" tell me what you think


*

yotamarker

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1003
  • battle programmer
    • battle programming
Re: outline from gadient mask
« Reply #93 on: April 29, 2017, 03:06:48 am »
I have zero intention to white knight for this Madeleine McCann.
MGTOW MGTOW MGTOW !

*

keghn

  • Trusty Member
  • *********
  • Terminator
  • *
  • 824
Re: outline from gadient mask
« Reply #94 on: April 29, 2017, 03:19:14 pm »
AI Learns Geometric Descriptors From Depth Images | Two Minute Papers: 



*

yotamarker

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1003
  • battle programmer
    • battle programming
Re: outline from gadient mask
« Reply #95 on: April 29, 2017, 06:16:23 pm »
its truly amazing how lame current image processing walkthroughs are, well where are those source codes he's talking about ?

*

keghn

  • Trusty Member
  • *********
  • Terminator
  • *
  • 824
Re: outline from gadient mask
« Reply #96 on: May 01, 2017, 06:42:45 pm »
A friendly introduction to Convolutional Neural Networks and Image Recognition: 


*

yotamarker

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1003
  • battle programmer
    • battle programming
Re: outline from gadient mask
« Reply #97 on: May 01, 2017, 07:47:46 pm »
are u suggesting I use convolution for recognizing the corners ?

*

yotamarker

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1003
  • battle programmer
    • battle programming
Re: outline from gadient mask
« Reply #98 on: May 02, 2017, 08:09:17 am »
this week I have been trying to get all the images not including the encapsulated images in the picture
using the last code I posted , it has been so difficult I name the text files of the code versions hell#
yesterday my vision began to blur after about 7 hours, I think. it looks like I solved another puzzle though I have an idea for speeding it up a bit. after which I will look for a patch to get the inner images like in a picture of the rinegan
or rings of a tree bark.

*

yotamarker

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1003
  • battle programmer
    • battle programming
Re: outline from gadient mask
« Reply #99 on: May 02, 2017, 09:31:55 am »
it works great for the handicap sign but with real world images it gives terrible results with too long process time
and stack over flow err

*

yotamarker

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1003
  • battle programmer
    • battle programming
Re: outline from gadient mask
« Reply #100 on: May 02, 2017, 12:17:01 pm »

Aeye.getPixelColor(bmp.GetPixel(j, i).R, bmp.GetPixel(j, i).G, bmp.GetPixel(j, i).B) = "b"

*

Korrelan

  • Trusty Member
  • ***********
  • Eve
  • *
  • 1454
  • Look into my eyes! WOAH!
    • YouTube
Re: outline from gadient mask
« Reply #101 on: May 03, 2017, 10:17:30 pm »
I’m pretty sure I’ve mentioned before that the image you are using is… crap.

JPG compression anomalies/ artefacts are seriously skewing your results.  Just because you can’t see the compression anomalies doesn't mean the computer can’t. This is your image with the tone balance adjusted to highlight the problem.



Your stack overflow problem is because your arrays aren't big enough. Try checking before you define an area if it’s already been highlighted… or mark the original image with a unique colour when an area is selected/ defined… this can be checked for before you re-define the area again… stopping the looping cascade that’s causing an overflow.

It only takes a 10X100 pixel area to fill a 1000 dim vector array.

The ‘Blue Hadouken’ you’re code is selecting is 179x182 = 32.5K pixels if taken from the original image.



Too select an object against a regular plain background your only interested in the area of pixels that stand out/ are significantly different from the background. You could even use a simple flood fill algorithm to find the area of the object and get its boundaries.

The routine in the above video notes any colour that is close/ similar to the colour under the mouse pointer.  This creates a mask and the pixel bot has been taught to trace the perimeter of the mask.

To help find faces etc with this technique you might also benefit from changing the colour model from RGB to HSL when selecting similar colours.

http://www.niwa.nu/2013/05/math-behind-colorspace-conversions-rgb-hsl/

 :)
It thunk... therefore it is!...    /    Project Page    /    KorrTecx Website

*

keghn

  • Trusty Member
  • *********
  • Terminator
  • *
  • 824
Re: outline from gadient mask
« Reply #102 on: May 03, 2017, 11:32:09 pm »
 Seven hours is quite impressive. Make sure you get enough food and extra sleep and minimal amount of exercise to
stay health at this time. For your brain that is working like a champ.
 Me, talking as brain trainer. Your brain is many parts working together. If one part is in super mode other part may
work against you, like blurring and or unable to remember your train of thought on what your coding. This is to force you to become normal.
 If all brain parts working as one then reward them with extra calories and sleep.
 If all parts are fighting each other than do not give your self extra or calories and
only the minimal amount of sleep that a human needs to say health. And do extra physical exercise.
 When you young it hard to see this going on. But the older you get it can get really bad.

  cheers





*

yotamarker

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1003
  • battle programmer
    • battle programming
Re: outline from gadient mask
« Reply #103 on: May 04, 2017, 06:51:13 am »
yeah with the mouse it works but if you want all the images it glitches like crazy.
Code
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

*

yotamarker

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1003
  • battle programmer
    • battle programming
Re: outline from gadient mask
« Reply #104 on: May 04, 2017, 06:58:17 am »
the glitches are also mostly wrong captured overlapping area in a variety of real world images

 


OpenAI Speech-to-Speech Reasoning Demo
by MikeB (AI News )
March 31, 2024, 01:00:53 pm
Say good-bye to GPUs...
by MikeB (AI News )
March 23, 2024, 09:23:52 am
Google Bard report
by ivan.moony (AI News )
February 14, 2024, 04:42:23 pm
Elon Musk's xAI Grok Chatbot
by MikeB (AI News )
December 11, 2023, 06:26:33 am
Nvidia Hype
by 8pla.net (AI News )
December 06, 2023, 10:04:52 pm
How will the OpenAI CEO being Fired affect ChatGPT?
by 8pla.net (AI News )
December 06, 2023, 09:54:25 pm
Independent AI sovereignties
by WriterOfMinds (AI News )
November 08, 2023, 04:51:21 am
LLaMA2 Meta's chatbot released
by 8pla.net (AI News )
October 18, 2023, 11:41:21 pm

Users Online

197 Guests, 0 Users

Most Online Today: 258. Most Online Ever: 2369 (November 21, 2020, 04:08:13 pm)

Articles