Ai Dreams Forum

Artificial Intelligence => General AI Discussion => Topic started by: yotamarker on March 31, 2017, 03:03:38 AM

Title: outline from gadient mask
Post by: yotamarker on March 31, 2017, 03:03:38 AM
I'm looking for an alg to know if a pixel is an outline pixel based on the pixels around it.
Title: Re: outline from gadient mask
Post by: korrelan on March 31, 2017, 09:59:06 AM
Quote
I'm looking for an alg to know if a pixel is an outline pixel based on the pixels around it.

So… a image convolution filter?

There are several methods of obtaining a shape outline from an image and loads of pre-written libraries available.

https://en.wikipedia.org/wiki/Outline_of_object_recognition (https://en.wikipedia.org/wiki/Outline_of_object_recognition)

I wrote my own adaptive convolution routines for extracting object boundaries from images.  The main idea is to use colour contrast NOT pixel brightness.  Simply break the image into its RGB components and detect the colour boundaries. 

(http://i.imgur.com/Zl5G18U.jpg)

The image in the center is using brightness as the bias; as you can see the light/ brightness variation causes contours.  Bottom left is the same routine using colour contrast… much better.

Check each pixel with its adjacent RGB values.  If there is a difference within a set bias mark as an outline point/ pixel.

.bias=20
.red = red value of pixel your checking
.ored = red value of adjacent pixel
.If red > ored –bias and red < ored+bias then change=change+1
.do same for green & blue
.if change=3 then draw outline pixel else don’t

I’m not preaching but the best way to understand/ learn this kind of simple stuff is to experiment with your own code. Using someone else’s pre-written routines rarely gives the desired results.


 :)
Title: Re: outline from gadient mask
Post by: yotamarker on March 31, 2017, 01:08:33 PM
that's exactly what i'm talking about but I don't understand what you mean by adjacent pixel
each pixel is surrounded by 8 other pixels
Title: Re: outline from gadient mask
Post by: yotamarker on March 31, 2017, 01:45:47 PM
so I implemented your alg but something is missing.

method in aeye class :
Code: [Select]
  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

button click event main code :
Code: [Select]
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

result :
(https://i.imgflip.com/1mfvv2.jpg) (https://imgflip.com/i/1mfvv2) (https://imgflip.com/memegenerator)
Title: Re: outline from gadient mask
Post by: keghn on March 31, 2017, 01:59:38 PM
https://en.wikipedia.org/wiki/Canny_edge_detector


 Or:

https://en.wikipedia.org/wiki/Sobel_operator
Title: Re: outline from gadient mask
Post by: korrelan on March 31, 2017, 02:04:10 PM
That was just meant to give you the basic idea lol.

If you are reading the RGB value left to right, bottom to top you need to check the pixel either above or below also.

So check color8.r against the target color5.r pixel also. (rgb)

.if change=6 then draw outline pixel else don’t

Also you are not checking between bias…

.If red > ored –bias and red < ored+bias then change=change+1

Also make sure your working in pixel scales not twips etc.

Also you don’t really need the rest of the pixel variables if your not going to use them.

 :)
Title: Re: outline from gadient mask
Post by: yotamarker on March 31, 2017, 02:32:56 PM
it is working thank you very much.
Code: [Select]
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

I'll delete the unused variables also.
Title: Re: outline from gadient mask
Post by: korrelan on March 31, 2017, 09:04:48 PM
@yot

You are welcome.

@keghn

I agree both are very good algorithms and well worth exploring/ learning.

I presumed yot was new to this type of coding, and I’m sure you’ll agree… programming should be fun… and I think it’s important to understand exactly what the code does and how it does it.  Using someone else’s library doesn't quite achieve that.

Now I need to read the top of the thread to figure out why yot needs to find the perimeter of a triangle lol.

 :)
Title: Re: outline from gadient mask
Post by: keghn on March 31, 2017, 11:09:17 PM
 I do not use the common edge detectors to find lines. I use XNOR logic: 

https://techcrunch.com/2017/01/19/xnor-ai-frees-ai-from-the-prison-of-the-supercomputer/
Title: Re: outline from gadient mask
Post by: yotamarker on April 01, 2017, 08:38:17 AM
now I need to get the images objects bounds
https://www.youtube.com/watch?v=5m3_2C8xrFI&t=204s (https://www.youtube.com/watch?v=5m3_2C8xrFI&t=204s)

I used a recursive function to trace the objects, but it just glitches a lot with stack
overflows and out of range exceptions. so I'm looking for another algorithm.
Title: Re: outline from gadient mask
Post by: korrelan on April 01, 2017, 11:27:28 AM
Oh! Now I understand what you’re trying to do. 

You are trying to follow the objects perimeter to define a bounding box around each object in the image; I presume you are then going to try and recognise the objects within the boxes… nah! That isn’t going to work on complex scenes.

Your program is crashing because of your array limits; you only allowed 1000 bounding boxes.  There are loads of problems with this approach to object recognition; besides your routine detecting the JPG compression anomalies in your selected image (bad image choice) defining the outline of a single object is practically impossible.  Without extra information from stereo cameras or depth sensors you will never find the perimeter of an object in a video feed for example.

(http://i.imgur.com/olwtosa.jpg)

There are other methods like blobbing that can find the center of ‘mass’ of a block of colour but most objects are composed of more than one colour. You can blob and then run an outline routine etc… there are so many options/ methods. 

https://en.wikipedia.org/wiki/Blob_detection (https://en.wikipedia.org/wiki/Blob_detection)

Then you have to consider things like scale and rotational invariance of objects. 

https://en.wikipedia.org/wiki/Scale_invariance (https://en.wikipedia.org/wiki/Scale_invariance)

As usual this is a huge complex topic that often requires a custom solution.

A better method/ approach is to use feature detection. 

At its simplest this could mean selecting a ten pixel square section of the image you are wanting to recognise and storing it with a name.  Then scan any selected image for the saved section; chances of finding the exact same block in another image are pretty slim; especially if you select a feature unique to the image.  This technique is used for finding smiling faces in pictures etc; using eigenface templates.

https://en.wikipedia.org/wiki/Eigenface (https://en.wikipedia.org/wiki/Eigenface)

This of course is the main technique used in convolutional networks, the image is searched with millions of smaller images of known features… both the image to be searched and the feature image set are run through a convolutional filter to highlight a specific property, lines, contrast gradients etc.

The list of methods and techniques is endless… enjoy learning.

 :)
Title: Re: outline from gadient mask
Post by: yotamarker on April 01, 2017, 01:11:22 PM
why isn’t it going to work on complex scenes ? I wont be chekin each pixel in the range
just about 8x8 and the corners before that.
Title: Re: outline from gadient mask
Post by: yotamarker on April 01, 2017, 01:14:08 PM
@keghn  that xnor ai link, no doubt they created something cool but, it is useless to me cause it has no algorithms or walkthroughs
Title: Re: outline from gadient mask
Post by: korrelan on April 01, 2017, 01:25:29 PM
http://cvgl.stanford.edu/projects/3DVP/ (http://cvgl.stanford.edu/projects/3DVP/)

 :)
Title: Re: outline from gadient mask
Post by: yotamarker on April 01, 2017, 01:34:54 PM
they should use videos for the recognition not analyze the juice out of images
Title: Re: outline from gadient mask
Post by: keghn on April 01, 2017, 01:47:19 PM
 @YotomMaker. XNor is about breaking a image up into a grid of squares, in a quad tree fashion is ok. Then compare
average color or grey scale to each other square. Using XOR logic to compare adjacent  squares.  If they are not equal then there is a line between them.
 If not they are the same blob. Once you change a image to lines then you can convert them into chain code,

 Finding the contours: 

http://answers.opencv.org/question/88501/how-to-classify-chain-codes/ (http://answers.opencv.org/question/88501/how-to-classify-chain-codes/)

https://pdfs.semanticscholar.org/eb33/e3215bf023d4e8b1dbcaae37bbfb7ae5e3cc.pdf (https://pdfs.semanticscholar.org/eb33/e3215bf023d4e8b1dbcaae37bbfb7ae5e3cc.pdf)

https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm (https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm)

https://www.youtube.com/watch?v=TS_WFAVeHuI (https://www.youtube.com/watch?v=TS_WFAVeHuI)
Title: Re: outline from gadient mask
Post by: yotamarker on April 01, 2017, 03:52:28 PM
maybe you can figure it out
Code: [Select]
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
Title: Re: outline from gadient mask
Post by: yotamarker on April 01, 2017, 05:06:05 PM
here is the class with the tracer how come it only works 4 simple shapes is beyond me

Code: [Select]
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
Title: Re: outline from gadient mask
Post by: keghn on April 01, 2017, 06:53:29 PM
 I thought it is working the way you wanted?
 I only work in C/C++ and bash.
Title: Re: outline from gadient mask
Post by: yotamarker on April 01, 2017, 07:15:25 PM
the traces errors for complex images.
stack overflow, app gets stuck, out of range exceptions, just a leaf in the image
is enough to give it a seizure.
Title: Re: outline from gadient mask
Post by: yotamarker on April 01, 2017, 08:15:10 PM
https://youtu.be/ynZY961YYMg
Title: Re: outline from gadient mask
Post by: korrelan on April 02, 2017, 09:23:08 AM
It’s really hard too see what’s happening in the vid lol.

As I explained earlier one of the main problems you’re going to encounter is JPG compression artifacts.  Try to use BMP or TIF images for your trace experiments.

https://en.wikipedia.org/wiki/Compression_artifact

If the program is working on simple images then it’s probably a complexity explosion problem.

Also change the program so you can see just the outline in the right picture box.  Then superimpose your boundaries on it so you can better see the problems.  Adapt the visual output of the code so you can visually debug it.

 :)
Title: Re: outline from gadient mask
Post by: yotamarker on April 02, 2017, 02:38:16 PM
phase 1 getting the horizontal bounds.
the problem is with the picture with that little Russian girl with leafs behind her and the ryu pic
Title: Re: outline from gadient mask
Post by: korrelan on April 02, 2017, 04:38:36 PM
OK I've been out for a steak and a few pints... And I really don't mean to sound sarcastic but... Could it be the outlines of the four million, billion, trillion leaves that's overwhelming your array bounds?

 :)
Title: Re: outline from gadient mask
Post by: yotamarker on April 02, 2017, 05:16:02 PM
yes, originally I thought separating the objects by "not out line pixel line"
would work for all cases. I think to solve this I'll have to consider also
lines with consecutive clusters of none outline as "not out line pixel line" may solve it.

what do you think ?

also I never drank alcohol what does it feel like ?
Title: Re: outline from gadient mask
Post by: yotamarker on April 03, 2017, 03:30:05 PM
it pretty much works now, I"ll need also to address the special cases
I need to make 3 videos :
1 sweet it is solved video
3 explaining the algorithm
2 ranting about the hell I went through
Title: Re: outline from gadient mask
Post by: yotamarker on April 04, 2017, 07:16:10 PM
https://www.youtube.com/watch?v=7wGYwg7dTJI (https://www.youtube.com/watch?v=7wGYwg7dTJI)

(https://i.imgflip.com/1mofgj.jpg) (https://imgflip.com/i/1mofgj) (https://imgflip.com/memegenerator)
Title: Re: outline from gadient mask
Post by: yotamarker on April 06, 2017, 05:13:22 PM
now it is needed to get each of the overlapping image in the rectangle separately
in the example below it needs a rectangle for the chair and a rectangle for the guy.

(https://i.imgflip.com/1msskq.jpg) (https://imgflip.com/i/1msskq) (https://imgflip.com/memegenerator)

any algorithm suggestions ?
Title: Re: outline from gadient mask
Post by: keghn on April 06, 2017, 11:01:15 PM
 A trained Neural Network can do that. Or a video tracking algorithm that tracks the person getting in and out of the wheel chair.
 It would pull information from other frames.
 Tracks two objects to their collision or merging.
Title: Re: outline from gadient mask
Post by: yotamarker on April 07, 2017, 12:20:05 AM
he isn't getting out of the chair because it is a sign.
Title: Re: outline from gadient mask
Post by: Freddy on April 07, 2017, 12:29:49 AM
Hilarious  ;D
Title: Re: outline from gadient mask
Post by: keghn on April 07, 2017, 01:54:51 PM
  My statement sill stands. The human in the sigh could be a cartoon video character. Still, A CNN could detect human real or
in a sign or in a cartoon video in a static image. They are that good. And they are pretrained on may examples before they work.

 A hand crafted program could do it but would only work with that program and that sign only. It would not be machine learning.
Title: Re: outline from gadient mask
Post by: yotamarker on April 07, 2017, 03:34:03 PM
@batman I haven't a clue what your talking about show me the step by step algorithm.
Title: Re: outline from gadient mask
Post by: keghn on April 07, 2017, 03:45:19 PM
Here it is. But it is in C programing language:

https://pjreddie.com/darknet/imagenet/

https://pjreddie.com/darknet/yolo/

https://pjreddie.com/darknet/
Title: Re: outline from gadient mask
Post by: yotamarker on April 07, 2017, 05:12:00 PM
there is no algorithm there it is simply a brag link, "hey look at our cool software".
Title: Re: outline from gadient mask
Post by: korrelan on April 08, 2017, 01:21:11 PM
I’m pleased you got the basic outline routine working.

I presume your idea is that once you have the bounding limits of your object you are going to search against a dataset to find the object?  As I stated earlier in the thread you are going to hit limitations to this technique at every stage. 

Consider shadows for example.  Shadows obviously exist in any ‘real world’ scene. They are going to give you false outlines and throw your recognition routines off (middle image).  Also using black and white images or objects on a white/ mono colour background is giving you a false sense of accuracy for your routines.

(http://i.imgur.com/o8Sp4WQ.jpg)

But if you are still intent on following this technique then I will suggest a few other methods/ thoughts along similar lines that might help you; but we are now crossing the line into convolution territory.

The first thing I would do is to segment the image/ lower the images resolution by reading the RGB stepped x,y points into an array.  This will both speed up processing and allow any derived templates to be scaled at a later date to help negate scale invariance.

As show in the above image (on right) using a similar routine to the colour contrast outline I suggested you can posterize the colour palette of the image points in the array. 

.red_bias=60
.red=red*red_bias
.if red>255 then red=255
.do above for RGB

This will have the effect of highlighting the blocks of similar colours. You can adjust the individual colour biases depending on the image you are processing.

(http://i.imgur.com/ZvwlyNU.jpg)

Section A in image.

Once you have the low resolution image posterized you could check each x,y array location against a object stack. 

Check the RGB of each block in turn against an array list of RGB values already read from the image.  If the RGB of the block being checked is similar (using another bias) to the block on its left then give it the same number value.  If there is a large difference search your list of already known colours and if found get the number from there or if not found add it to the list and start a number.  You could build a dataset of know hues for faces etc.

You should end up with an array of x,y points where each colour block/ object part has a different number.  You can then easily take your boundaries from this or combine/ average the results with the outline routine boundaries.

Section B in image.

Another method to find the outline of objects could be to use a simple trig routine that checks for a line/ colour change in a clockwise direction at a set diameter from a known point.  If used correctly with convolution filters this would trace the perimeter of a objects colour/ line boundaries.  As the point you are checking is rotated and hits a similar value use that as the centre for the next rotation/ search.  When the start vector is close in proximity to the end vector the loop/ boundary can be closed and logged.  Branches of lines, colour changes will need to be tracked and followed individually of course.

 :)
Title: Re: outline from gadient mask
Post by: yotamarker on April 08, 2017, 02:26:36 PM
you put water in to a cup, it becomes the cup
you put water in to a Tcup, it becomes the Tcup

the key to the recognition would be:
1 linking chronological variations of the image as long as the image is in the frame.
2 giving more importance to the attributes of the image that manifest the A.Is goals :
markers, colors, corners, size.

first though I need to separate the guy in the sign from his wheel chair.

I encountered another time consuming problem : visual studio xamarin compiler doesn't work, the hello
world apk I made doesn't appear on the emulator, so I learned c# for nothing, and I need to learn android studio
so that the A.I would use a phone which weights less than a laptop.
Title: Re: outline from gadient mask
Post by: Freddy on April 08, 2017, 03:52:58 PM
Quote
you put water in to a cup, it becomes the cup
you put water in to a Tcup, it becomes the Tcup

I don't think so. Otherwise how are you going to differentiate between a cup of tea and a cup of coffee.
Title: Re: outline from gadient mask
Post by: yotamarker on April 08, 2017, 05:03:23 PM
I meant the shape of
Title: Re: outline from gadient mask
Post by: keghn on April 09, 2017, 09:12:10 PM
i see three objects. The head. the body. the large letter "C"

All three can be turned to chain code.

 Relative chain code are the list of angle values to the next dot. like 10 degrees, 11 degrees, -5 degrees, 12, -5 and so on.

 The starting point would be at the highest point and go around counter clock wise.

 Rule one. The sum of relative chain code for a complete circle is |360| degrees. that would be the head.

 Rule two. The sum of relative angled chain code around a rough blob is also |360| degrees. Surprise? So that would be
the wheel that looks like a "C" and the body.

The head would be 120 dots at all 3 degrees to the next one inline.
So now instead of having a image you can convert the image into a data base. so if you loose the image it can be recreated from the data base.
The head's chain code would look like in the data base would be 120, 3, 500,50.
The 500, 50 is absolute starting position of the head. 500 pixel the right and 50 pixel down.

With objects entered into a data base in this format mean they can be hit with a million types of algorithms. And thus gives you access to what you seek. Morphing images?


Title: Re: outline from gadient mask
Post by: yotamarker on April 10, 2017, 01:01:17 PM
the head breaks of anyways
the body has a break off from the chair that should be utilized
Title: Re: outline from gadient mask
Post by: keghn on April 10, 2017, 03:17:49 PM
 The following are guess of the features of the body in relative chain code of a descriptor list.
relative chain code  Features of body outline
pixel length, angles
30,3               +90   back of shoulders
90,0               0     back
30,3               90   joint
100,0               0   back thigh
1,-45               -45   back of knee
90,0               0   back leg
1,90               90   heel
30,0               0   bottom foot
30,6               180 toes
30,0               0    top of foot
1,-90               -90 joint
89,0               0   front of leg shin
15,3               +45   knee
89,0               0   thigh
1,-90               -90 joint
15,0               0   
1,-90               -90  joint
77,0               0   bottom of arm/handle of wheel chair
20,9               +180 fist/hand
77,0               0 top of arm
1,-90               -90
60,0               0 chest
30,3               +90 shoulders, front

909            outline is 909 pixels long.
500, 100 absolute starting position for the body.

If you want to move the body away from the chair or the head then just add  the same movement
value to the absolute x or y position of each body pixel of the body outline.

 If you want to double the size, then multiply all of the pixel lengths by 2,
 To make it half the size divide by two.

 if you want the  arms to move then change the angles at the joints:-)

 But will need to code a subroutine to deal with chain code.
Title: Re: outline from gadient mask
Post by: yotamarker on April 12, 2017, 02:33:30 PM
I'm getting some psyco overlapping rectangles


(https://i.imgflip.com/1n4jfm.jpg) (https://imgflip.com/i/1n4jfm) (https://imgflip.com/memegenerator)

@kei10 any thoughts ?
Title: Re: outline from gadient mask
Post by: yotamarker on April 12, 2017, 02:36:40 PM
(https://i.imgflip.com/1n4jql.jpg) (https://imgflip.com/i/1n4jql) (https://imgflip.com/memegenerator)
Title: Re: outline from gadient mask
Post by: yotamarker on April 12, 2017, 02:38:21 PM
maybe it's not going through the whole thing
Title: Re: outline from gadient mask
Post by: yotamarker on April 12, 2017, 02:51:30 PM
maybe I could tweak it
and then I shall eat bananas and none shell stop me bwa ha ha

https://www.youtube.com/watch?v=X-Y6YfDBmh8 (https://www.youtube.com/watch?v=X-Y6YfDBmh8)
Title: Re: outline from gadient mask
Post by: keghn on April 12, 2017, 05:33:53 PM
 I personally find this very interesting and is important work.

 I see a seven sided Heptagon:

https://en.wikipedia.org/wiki/Heptagon


 One "outline" classification is one outline that do not have lines inside. So there are seven triangles. A seven separate descriptions are needed. That is if you are interested in enter them into a descriptor data base, later on?

 So when searching lines you will come to decision branch of with line to scan out. Like a fork in the road.

 There is a eighth outline is the outline of heptagon with with no spokes within,. And there are even more. like a pie with bite
taken out. That is the heptagon with one sub triangle taken out. or more: 

https://en.wikipedia.org/wiki/Low_poly
Title: Re: outline from gadient mask
Post by: yotamarker on April 12, 2017, 06:55:51 PM
Russian leaf girl gonna be a tough boss.
Title: Re: outline from gadient mask
Post by: keghn on April 12, 2017, 08:25:56 PM
 I know Just brought to think about in the back of your head when you have the time.
Title: Re: outline from gadient mask
Post by: yotamarker on April 13, 2017, 07:47:25 PM
https://www.youtube.com/watch?v=nKDnOfaAGu0 (https://www.youtube.com/watch?v=nKDnOfaAGu0)
Title: Re: outline from gadient mask
Post by: yotamarker on April 17, 2017, 09:26:28 AM
https://www.youtube.com/watch?v=Oqqyc1-90NI (https://www.youtube.com/watch?v=Oqqyc1-90NI)

the alg is too massive.
Title: Re: outline from gadient mask
Post by: yotamarker on April 17, 2017, 09:39:41 AM
please post an alg for recognizing colors
Title: Re: outline from gadient mask
Post by: yotamarker on April 17, 2017, 10:48:57 AM
https://www.youtube.com/watch?v=I0Sg7nD8kD8 (https://www.youtube.com/watch?v=I0Sg7nD8kD8)
Title: Re: outline from gadient mask
Post by: keghn on April 17, 2017, 01:34:41 PM
 Very interesting. You are making great progress! Wow, you are picking up a lot of detail with the edge detector, may be a little
too much. May need to blur the image so computer cannot see each hair fiber? I know you know. I just like talking out loud.

Title: Re: outline from gadient mask
Post by: yotamarker on April 17, 2017, 03:22:25 PM
thanks man.
at any rate : as for the leafs I was thinking about using motion detection to see where the girl is.

also the alg I used for recognizing the C of the wheelchair sign is also too slow.

I am interested in:
1 any additional solution for the leafs
2 a blur alg
3 and in a get pixel color alg. something more accurate than what I wrote back in the day :
Code: [Select]
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
Title: Re: outline from gadient mask
Post by: korrelan on April 17, 2017, 04:16:01 PM
Better colour naming

Strip the colour names and RGB values from the page and write a simple closest match routine.

http://cloford.com/resources/colours/500col.htm (http://cloford.com/resources/colours/500col.htm)

Simple blurring

sample the pixels on the leading side the pixel you are scanning and average the results. So if you scanning left to right/ top to bottom; sample the pixels at x,y .. x+1,y .. x+1,y+1 .. x,y+1.. divide by 4 and set the RGB of x,y to the new value.

Extracting the girl/ objects from the leafs

Build a skin tone colour pallet.  You should then be able to highlight any skin tones in a picture; or indeed a leaf extraction pallet.

I suppose the ideal method is to run the picture through several convolution filters; each designed to extract/ highlight different aspects.  Then average all the results to get the final boundaries.

 :)
Title: Re: outline from gadient mask
Post by: yotamarker on April 17, 2017, 05:11:56 PM
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
Title: Re: outline from gadient mask
Post by: yotamarker on April 17, 2017, 05:14:33 PM
also I think about tracing the outline pixels would not work if the outline is not consistant
like the case of mouths.
Title: Re: outline from gadient mask
Post by: yotamarker on April 17, 2017, 05:26:10 PM
apart from motion detection other solutions maybe :

a color tracer that ignores the main appearing color, and *ignores black
also the tracing can not be of too many colors as this would not hold a substantial shape.
another problem with this is that the alg runs at least twice :
once to get the colors, once to process. a possible solution to this is to process a smaller portion of the image.

what do you think ?
Title: Re: outline from gadient mask
Post by: yotamarker on April 17, 2017, 07:44:00 PM
cluster color ! 1.21 gigawatts !
Title: Re: outline from gadient mask
Post by: korrelan on April 17, 2017, 08:32:04 PM
Quote
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 know you are hoping to find one algorithm/ technique to handle all images but I think that’s going to be impossible.  Your system is going to have to adapt and use different filters/ pallets to extract information from an image.

Motion detection would probably help over several frames and background occlusion would also give a hint at the objects outline.

Quote
a possible solution to this is to process a smaller portion of the image.

Yes… you could process the image in blocks, or sub-sample the image down to a lower resolution to speed things up.  Perhaps reading the pixel information into an array just once and then performing operations on that might be faster; you could read every third pixel for example and achieve both at the same time.

For objects on a plain/ monochrome background this outline/ boundary technique will work up to a point.  Your main problem is that to define a boundary the system has to have an idea of the shape of the objects it’s looking for; it’s a top down/ bottom up process.  A object recognition system like has to learn to recognise objects as it learns to see the objects.

Using stereo depth perception from either two cameras, a prism/ mirror rig on one camera or a Kinect makes it much easier to define the outline of an object in a scene using the displacement map. The stereo displacement is directly proportional to the distance from the camera.  If this project is for a bot then you might as well start with a stereo system.

https://inst.eecs.berkeley.edu/~cs61c/fa14/projs/01/

You really need to consider ‘feature detection’ as an alternative method… but it seems like your enjoying your project and learning a lot as you go… which is all good.


Code: [Select]
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


 :)
Title: Re: outline from gadient mask
Post by: keghn on April 17, 2017, 08:43:44 PM
 For myself, I like to change the image and put it into a descriptor table. Of chain codes colors of outline,  absolute position,
relative position, features in the outline, distances of feature to each other in a outline, and relationship of similarity of between
features in a outline, color inside a outline, complete outline length, and length of feature. Then get rid of picture and bring it into existence when needed.


 Or, if you are interested  in staying with images, all the time during the process, then down sample the
image to a really small size where you can barely tell the difference between
one image from  another other. Then  deal with a reduced amount of information. Then
expand back to full size when you need to focus on a detail that you are interested in.

 The simplest would find the dead center of all outlines and just tack them moving around and expand them when needed.

 Or use many thread programing?
 Or use GPU's?

 In chain code, reducing the information is about taking out the bumps in the outline, also known as features in a
outline. In a way that will morph into completely smooth circle. After a certain amounts of iterations.

 The detached head in the early wheel chair picture is already there. It is a circle right now. But the body will take a few hundred rations with a FFT filter like algorithm to rid it of its features, and also any noise. And thus turn in to a circle that is bigger then the head.
 The distance to the centers of the two circles of the body and the head will still be there, untouched by the algorithm.

 I see now that the head is connected in the  wheelchair picture.


 All of his is something to think about.

Title: Re: outline from gadient mask
Post by: korrelan on April 18, 2017, 01:07:12 PM
https://www.youtube.com/watch?v=92NqMLSaZKI (https://www.youtube.com/watch?v=92NqMLSaZKI)

 :)
Title: Re: outline from gadient mask
Post by: yotamarker on April 18, 2017, 01:34:43 PM
enjoying this ? no, ideally someone else would solve it and I would DL a book and read about it and
buy the product for a reasonable price.

in my specific case I can't let go of a puzzle.
Title: Re: outline from gadient mask
Post by: keghn on April 18, 2017, 11:45:56 PM
 I am enjoying it. Also i very sorry for bruising our brain. No need to rush this. May be you should take it easy for few
days? I do not want your brain become too knotted. That will bad in the long run.
Title: Re: outline from gadient mask
Post by: korrelan on April 19, 2017, 01:09:16 PM
https://www.youtube.com/watch?v=uaKe5jvQ3dk (https://www.youtube.com/watch?v=uaKe5jvQ3dk)

Messing around with different object perimeter techniques. This method would obviously have a problem 'seeing' around corners lol. Going to try a matrix with a perimeter trace next.

 :)
Title: Re: outline from gadient mask
Post by: yotamarker on April 19, 2017, 04:07:50 PM
how does it work ?
Title: Re: outline from gadient mask
Post by: korrelan on April 19, 2017, 04:25:19 PM
Similar in principal to a radar.

Points are defined along a line moving from the centre to the radius of the circle; the line of points is rotated counter clockwise until the complete circumference is covered.  If a major colour change is detected between the centre and the point being checked along the line then it's noted.  So each line of points moving from the centre to the radius will have a point where it crosses into a completely new colour (within a bias range). These points are then joined with a banded/ poly line that joins all the points around the colour boundary together.

 :)
Title: Re: outline from gadient mask
Post by: korrelan on April 20, 2017, 10:28:20 AM
I tried several methods of tracing an outline but they all had their limitations.

I like a distraction and a problem to be solved; it needs to be accurate, fast and efficient…

Time to apply a bit of machine learning… I wrote a simple pixel bot.

First I extract a matrix of pixels around the mouse pointer and load them into an array.  Then I ‘posterise’ the pallet of the selected pixels to limit/ blend the number of colours. Next I mark all pixels with a similar colour (within bias range) to the pixel I clicked with the colour blue to make them obvious to me. So any pixels that are similar to the one I click on are now coloured blue.

The bot has a centre from which the outline is drawn and is surrounded by its eight surrounding pixels which are it’s sensors/ eyes.  Each surrounding pixel has a binary value 1,2,4,8,16,32,64,128 which can be simply added together to give a single number that represents the pixel pattern around the bot.  Each of the 255 sensor combinations is mapped to an array along with the +/- x,y directions it should move when it ‘sees’ that pattern.  I can give the bot the relevant direction by pressing the number pad for the eight directions.  The bots sensors pick up on the colour blue.
 
This vid shows me ‘teaching’ the software to follow a perimeter. The bot is the red dot; at the start the bot is on the right boarder of the square.  This is because it was sensing 255 which means it was totally surrounded by blue.  I pressed ‘right’ so the bot move to the right until it hit the boundary; this is where the vid begins.

I then press ‘down’ and it moves down; it now knows when ever it sees the pattern for a vertical line to its right to move down; the rest of the vid is just me teaching the bot which direction to move depending on what it’s sensing around it.  As you will see it quickly improves as it learns.  Toward the end it has no problem following complex outlines using the information it’s learned.

https://www.youtube.com/watch?v=WH9Bc4aF6Nc (https://www.youtube.com/watch?v=WH9Bc4aF6Nc)

Because the outline is mapped into the array I can easily change the scale, get the boundaries/ vectors and center of the shape.

 :)
Title: Re: outline from gadient mask
Post by: yotamarker on April 20, 2017, 06:42:38 PM
I gave it some thought, (it's not like I can think about anything other than A.I anyways) and that girl
she could be wearing camouflage so motion detection is the best bet. the colors can help for faster recognition.
by the way, what programming environment are you using ?
Title: Re: outline from gadient mask
Post by: keghn on April 20, 2017, 08:42:09 PM
@korrelan program mostly in BASIC?
I program in C++ or C and BASH. All on a Linux operating system.
I am developing my audio softwar for the rest of this year and will be moving to develop my vision software next.
  Cheers
Title: Re: outline from gadient mask
Post by: korrelan on April 20, 2017, 08:57:38 PM
@Yot & Keghn

Yeah! I tend to prototype in VB6/ API; not to be confused with VB.NET which is much too slow for this kind of work.  I write in C++ and compile as DLL’s when I need the extra speed boost; though VB6 has a native compiler and is just as fast for most purposes.

I can code in several languages but I find VB6/ API is a very quick language to develop with; if I have an idea I can have it coded and working in an hour or so.

Use the right tool for the job… lol.

 :)

Good luck with the audio/ vision software.

:)
Title: Re: outline from gadient mask
Post by: yotamarker on April 21, 2017, 12:48:13 PM
wow those are some mad skills, what do you do if you want to make a mobil app ?
Title: Re: outline from gadient mask
Post by: korrelan on April 23, 2017, 09:49:20 AM
I've never had to produce a mobile app; but I would probably use HTML5 or Java.

 :)
Title: Re: outline from gadient mask
Post by: yotamarker on April 23, 2017, 01:37:43 PM
I accidently found out something amazing.
Title: Re: outline from gadient mask
Post by: yotamarker on April 23, 2017, 01:39:34 PM
this was so insane I am now taking suggestions for the next vid's music
Title: Re: outline from gadient mask
Post by: yotamarker on April 23, 2017, 07:22:14 PM
the survey corp took out the female titan

https://www.youtube.com/watch?v=BgoIJzn8M-Y (https://www.youtube.com/watch?v=BgoIJzn8M-Y)
Title: Re: outline from gadient mask
Post by: korrelan on April 23, 2017, 08:16:04 PM
So you have implemented a pallet extraction/ highlight to pick out the tones in the girls skin/ leaf colours?

http://aidreams.co.uk/forum/index.php?topic=12069.msg46524#msg46524 (http://aidreams.co.uk/forum/index.php?topic=12069.msg46524#msg46524)

Cool.  Though like you said…

Quote
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

This problem still exists.

Good progress though.

 :)
Title: Re: outline from gadient mask
Post by: yotamarker on April 25, 2017, 03:47:03 PM
could you explain corner detection algorithm ?
also do you have any point of interest regarding motion detection ? like should I detect the overall movement or all movements or other stuff
Title: Re: outline from gadient mask
Post by: yotamarker on April 25, 2017, 03:48:44 PM
also Shi-Tomasi corner-detector and Lukas-Kanade algorithm  ?