Ai Dreams Forum

Artificial Intelligence => General AI Discussion => Topic started by: yotamarker on July 10, 2016, 05:30:43 pm

Title: A.eye
Post by: yotamarker on July 10, 2016, 05:30:43 pm
this thread is about artificial eyes for A.I what is needed and related stuff

starting :

ocr
motion detection
object recognition
object counter
color scheme getter
*face recog
grid recognition and defining

what else ?
Title: Re: A.eye
Post by: ivan.moony on July 10, 2016, 05:49:44 pm
Maybe 3D -> 2D mapping for understanding object positions on planes?

Why is grid recognition so important?

I still wonder what is the difference between beautiful art and unattractive trash...
Title: Re: A.eye
Post by: yotamarker on July 10, 2016, 06:08:01 pm
how to go about distinguishing 2d or 3d ???

grids spread out and they can't be recognized like other objects also
humans seem to instinctively use them for storing data for game boards for tiling and flooring
Title: Re: A.eye
Post by: yotamarker on July 10, 2016, 06:12:15 pm

I still wonder what is the difference between beautiful art and unattractive trash...

think about a women who hit the wall she would have too much data that would make her
inconsistent therefore her visual data would not repeat enough to be desired as a goal
like wrinkles flabby arms cellulite and grey hair.
Title: Re: A.eye
Post by: keghn on July 10, 2016, 06:35:53 pm
@yotamarker
What you are interested in is computer vision.
OpenCV software is the king in this area of computer science:

http://docs.opencv.org/2.4/doc/tutorials/tutorials.html (http://docs.opencv.org/2.4/doc/tutorials/tutorials.html)

 Tho it is not big on C#. It is mostly in c++, python, and java.
Title: Re: A.eye
Post by: yotamarker on July 10, 2016, 06:59:48 pm
wouldn't it be better to develop a new A.eye
that way full access to manipulate and read the data

object size estimation also
Title: Re: A.eye
Post by: ivan.moony on July 10, 2016, 07:31:04 pm
grids spread out and they can't be recognized like other objects also
humans seem to instinctively use them for storing data for game boards for tiling and flooring

I think it is about repeating patterns. A row is a repeated cell. A table is repeated row.
Title: Re: A.eye
Post by: yotamarker on July 10, 2016, 07:53:48 pm
here is the thing you get a picture a bitmap
you get the outline dotes

you break it down to minipics of the objects dot clusters in lighty soroundings

the grid doesn't break at some area it is spread and ya gotta difine it
Title: Re: A.eye
Post by: keghn on July 10, 2016, 08:16:59 pm
http://ivrl.epfl.ch/research/superpixels (http://ivrl.epfl.ch/research/superpixels)
Title: Re: A.eye
Post by: yotamarker on July 10, 2016, 08:53:33 pm
come to think of it maybe should also take out obstacle objects like dust
and unrelated lines, how would you do that ?
at first idea I'd see them as different light level than the objects contour and outlines
Title: Re: A.eye
Post by: keghn on July 10, 2016, 10:20:38 pm
gaussian algorithm to blur out the fine details.

subtract the gaussian image form the original image will give just the fine detail image:)
Title: Re: A.eye
Post by: yotamarker on July 11, 2016, 03:21:46 pm
this looks like the code
Code
Public Shared Sub GaussianImageDemo()

    Dim fileName As String = "c:/Sample.png"

    Dim reImage As REImage = REFile.OpenImageFile(fileName)

    Dim newImage As REImage = ImageProcessing.ApplyBlurGaussian(reImage)

    REFile.SaveImageFile(newImage, "c:/reimage.png", New PNGEncoder())
does someone have a noob friendly explanation as to how that algorithm  (Gaussian blur)works logic wize ?
Title: Re: A.eye
Post by: ivan.moony on July 11, 2016, 04:48:52 pm
If you ask me how I would program blur, I'd take every pixel, calculate the median value of pixels near taken one and store the median in the position of the taken pixel.

Gaussian Blur? That has something to do with Gaussian bell curve, right?
Title: Re: A.eye
Post by: yotamarker on July 11, 2016, 05:11:32 pm
this worls for small pics but it is way too slow
Code
Public Class Form1
    Private Function Average(ByVal Size As Size, ByVal imageSize As SizeF, _
           ByVal PixelX As Integer, ByVal Pixely As Integer) As Color


        Dim pixels As New ArrayList
        Dim x As Integer, y As Integer
        Dim bmp As Bitmap = PictureBox1.Image.Clone


        ' Find the color for each pixel and add it to a new array.
        '
        ' Remember a 5X5 area on or near the edge will ask
        ' for pixels that don't
        ' exist in our image, this will filter those out.
        '
        For x = PixelX - CInt(Size.Width / 2) To PixelX + _
               CInt(Size.Width / 2)
            For y = Pixely - CInt(Size.Height / 2) To Pixely + _
                   CInt(Size.Height / 2)
                If (x > 0 And x < imageSize.Width) And _
                   (y > 0 And y < imageSize.Height) Then
                    pixels.Add(bmp.GetPixel(x, y))
                End If
            Next
        Next

        ' Adverage the A, R, G, B channels
        ' reflected in the array

        Dim thisColor As Color
        Dim alpha As Integer = 0
        Dim red As Integer = 0
        Dim green As Integer = 0
        Dim blue As Integer = 0

        For Each thisColor In pixels
            alpha += thisColor.A
            red += thisColor.R
            green += thisColor.G
            blue += thisColor.B
        Next

        ' Return the sum of the colors / the number of colors (The average)
        '
        Return Color.FromArgb(alpha / pixels.Count, _
                              red / pixels.Count, _
                              green / pixels.Count, _
                              blue / pixels.Count)
    End Function


    Private Sub gausianBlur(ByVal alphaEdgesOnly As Boolean, _
                            ByVal blurSize As Size)

        Dim PixelY As Integer
        Dim PixelX As Integer
        Dim bmp As Bitmap = PictureBox1.Image.Clone

        ' UI Stuff
        Label1.Text = "Applying Gausian Blur of " & blurSize.ToString

        Progress.Maximum = bmp.Height * bmp.Width
        Progress.Minimum = 0
        Progress.Value = 0

        ' Loop the rows of the image
        For PixelY = 0 To bmp.Width - 1

            ' Loop the cols of the image
            For PixelX = 0 To bmp.Height - 1
                If Not alphaEdgesOnly Then     ' Blur everything
                    bmp.SetPixel(PixelX, PixelY, Average(blurSize, _
                                 bmp.PhysicalDimension, PixelX, PixelY))
                ElseIf bmp.GetPixel(PixelX, PixelY).A _
                       <> 255 Then  ' Alpha blur channel check
                    bmp.SetPixel(PixelX, PixelY, Average(blurSize, _
                                 bmp.PhysicalDimension, PixelX, PixelY))
                End If
                Progress.Value += 1
                Application.DoEvents()
            Next
        Next

        PictureBox1.Image = bmp.Clone
        bmp.Dispose()
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        gausianBlur(False, New Size(6, 6))
    End Sub
End Class
Title: Re: A.eye
Post by: yotamarker on July 11, 2016, 05:20:08 pm
it just make the image fuzzy
Title: Re: A.eye
Post by: yotamarker on July 11, 2016, 06:42:05 pm
http://people.eecs.berkeley.edu/~fateman/kathey/char_recognition.html (http://people.eecs.berkeley.edu/~fateman/kathey/char_recognition.html)
Title: Re: A.eye
Post by: keghn on July 11, 2016, 07:29:31 pm
Ya, it will make the image fuzzy. this is the easiest way to do it rid of the fine detail.
If you can get a image of just the fine detail and subtract it from the original you may have
better luck.

  or you could blow the image up bigger, up sample, then blur it a algorithm and then shrink it
back down, down sampling, is another way.

  The working of the eye sees thing clearly in the middle and blurred at the edges. So the eye
does it owen Blurring function.

 
Title: Re: A.eye
Post by: yotamarker on July 11, 2016, 08:24:34 pm
I need time to research this but the noise probably has some different attributes
the above Gaussian algorithm takes way to long to run anyways.

another problem is that when the light level change the image outline(dark pixels) change
at the moment I think to solve this by connecting the images captured in the most light conditions
to the ones taken at darker
 :P
Title: Re: A.eye
Post by: keghn on July 11, 2016, 10:27:24 pm
 There is allot to think about here. I think about it allot.
 There are a lot of ways of doing it.

 The way i am doing it is getting the outline of object of interest, for pattern matching.
i do this with a contour program: 

http://docs.opencv.org/2.4/doc/tutorials/imgproc/shapedescriptors/find_contours/find_contours.html (http://docs.opencv.org/2.4/doc/tutorials/imgproc/shapedescriptors/find_contours/find_contours.html)


 Then i convert the outline or contour into a chain code file:

http://answers.opencv.org/question/88501/how-to-classify-chain-codes/ (http://answers.opencv.org/question/88501/how-to-classify-chain-codes/)
http://www.cis.hut.fi/research/IA/paper/publications/bmvc97/node2.html (http://www.cis.hut.fi/research/IA/paper/publications/bmvc97/node2.html)

 Then the chain code is converted from absolute position to relative position.

The chain code file look like a wave file or combination of sine wave. Can hit them with
a FFT filter to take out some of frequencies or whatever to algorithm smooth them out.
 All out line removed of their bumps make a circle.
 I pick a random pick point, in the circular outline, for the beginning of chain code file.

 I am sure your C# library will have a contour program, or Canny edge detector algorithm.

  Wish you lots of luck

   k




 
 
Title: Re: A.eye
Post by: yotamarker on July 12, 2016, 03:19:04 pm
she would need a mini move in object recognition
like when you tie shoe laces or shopping bags
you know something about that ?
Title: Re: A.eye
Post by: yotamarker on July 15, 2016, 10:26:06 am
do you think sight is one sense or many
like is counting a sense ?
Title: Re: A.eye
Post by: keghn on July 15, 2016, 04:47:33 pm
Many pixel combination values. That can shift together to new locations. As opposed to a motor position is value is stuck in that one location

Title: Re: A.eye
Post by: keghn on August 19, 2016, 12:28:47 am

Introduction to Local Interpretable Model-Agnostic Explanations (LIME):

https://www.oreilly.com/learning/introduction-to-local-interpretable-model-agnostic-explanations-lime?twitter=@bigdata (https://www.oreilly.com/learning/introduction-to-local-interpretable-model-agnostic-explanations-lime?twitter=@bigdata)
Title: Re: A.eye
Post by: yotamarker on March 13, 2017, 08:12:00 pm
how do you get distance from an image ?
like recognizing dangerous high places like roof tops
and distances from cars ?
Title: Re: A.eye
Post by: keghn on March 13, 2017, 08:38:09 pm
 There is the parallax effect.

 Also, when you focus on things that are close then a small center area is in focus and the edges
blurred. 
 When you view a image that is far away, then all thing will be if focus or there will be a much larger
area in the center that is in focus. 

https://en.wikipedia.org/wiki/Miniature_faking
Title: Re: A.eye
Post by: keghn on March 17, 2017, 10:12:51 pm
William Orbit - Optical Illusions: 

https://www.youtube.com/watch?v=d41NrXz0yMA (https://www.youtube.com/watch?v=d41NrXz0yMA)
Title: Re: A.eye
Post by: yotamarker on March 17, 2017, 10:40:54 pm
like mobileye how does it get the distance from a car ?
Title: Re: A.eye
Post by: keghn on March 18, 2017, 02:10:50 am

Inel just bought them and last year they bought Nervana, 2016: 

https://www.nervanasys.com/ (https://www.nervanasys.com/)


 I do not really know how  they are doing it. But a neural network can be trained to judge distance by its self. I do not
know if they are also using lidar, radar, or sonar also.
Title: Re: A.eye
Post by: yotamarker on March 27, 2017, 05:53:27 pm
https://www.youtube.com/watch?v=a2i3NDrZCSI&t=18s (https://www.youtube.com/watch?v=a2i3NDrZCSI&t=18s)
Title: Re: A.eye
Post by: yotamarker on March 27, 2017, 05:57:51 pm
https://www.youtube.com/watch?v=5m3_2C8xrFI (https://www.youtube.com/watch?v=5m3_2C8xrFI)

Dijkstra's algorithm probably isn't the best solution
Title: Re: A.eye
Post by: yotamarker on March 27, 2017, 07:25:27 pm
3 problems with dijksra's alg :
big pictures :
stack overflow
too long process time

colorful pictures :

shapes not consistant
Title: Re: A.eye
Post by: keghn on March 27, 2017, 10:43:23 pm
 Are testing it.  by seeing which route around a triangle is the shortest?
Title: Re: A.eye
Post by: yotamarker on March 28, 2017, 03:24:22 pm
the shape don't matter