outline from gadient mask

  • 226 Replies
  • 74876 Views
*

yotamarker

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1003
  • battle programmer
    • battle programming
Re: outline from gadient mask
« Reply #45 on: April 12, 2017, 04:03: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

*

keghn

  • Trusty Member
  • *********
  • Terminator
  • *
  • 824
Re: outline from gadient mask
« Reply #46 on: April 12, 2017, 06:45: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

*

yotamarker

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1003
  • battle programmer
    • battle programming
Re: outline from gadient mask
« Reply #47 on: April 12, 2017, 08:07:51 pm »
Russian leaf girl gonna be a tough boss.

*

keghn

  • Trusty Member
  • *********
  • Terminator
  • *
  • 824
Re: outline from gadient mask
« Reply #48 on: April 12, 2017, 09:37:56 pm »
 I know Just brought to think about in the back of your head when you have the time.

*

yotamarker

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1003
  • battle programmer
    • battle programming

*

yotamarker

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1003
  • battle programmer
    • battle programming
Re: outline from gadient mask
« Reply #50 on: April 17, 2017, 10:38:28 am »

*

yotamarker

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1003
  • battle programmer
    • battle programming
Re: outline from gadient mask
« Reply #51 on: April 17, 2017, 10:51:41 am »
please post an alg for recognizing colors

*

yotamarker

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1003
  • battle programmer
    • battle programming

*

keghn

  • Trusty Member
  • *********
  • Terminator
  • *
  • 824
Re: outline from gadient mask
« Reply #53 on: April 17, 2017, 02:46: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.


*

yotamarker

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1003
  • battle programmer
    • battle programming
Re: outline from gadient mask
« Reply #54 on: April 17, 2017, 04:34: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
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

*

Korrelan

  • Trusty Member
  • ***********
  • Eve
  • *
  • 1454
  • Look into my eyes! WOAH!
    • YouTube
Re: outline from gadient mask
« Reply #55 on: April 17, 2017, 05:28: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

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.

 :)
« Last Edit: April 17, 2017, 05:50:39 pm by korrelan »
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 #56 on: April 17, 2017, 06:23: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

*

yotamarker

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1003
  • battle programmer
    • battle programming
Re: outline from gadient mask
« Reply #57 on: April 17, 2017, 06:26:33 pm »
also I think about tracing the outline pixels would not work if the outline is not consistant
like the case of mouths.

*

yotamarker

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1003
  • battle programmer
    • battle programming
Re: outline from gadient mask
« Reply #58 on: April 17, 2017, 06:38: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 ?

*

yotamarker

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1003
  • battle programmer
    • battle programming
Re: outline from gadient mask
« Reply #59 on: April 17, 2017, 08:56:00 pm »
cluster color ! 1.21 gigawatts !

 


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

215 Guests, 0 Users

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

Articles