Announcement

Collapse
No announcement yet.

Calling Any Java Programmers - Computer Vision Project

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Calling Any Java Programmers - Computer Vision Project

    This is what this project aims to do:



    Here's a comptuer vision primer.

    And here's a sticky link to the latest code: CarVision_0.4a.jar. This also contains the source code.

    If you don't know anything about coding but would like to see how things are developing, then here are the instructions on how to install the progam posted below.

    First, you need to get a Java Runtime Environment installed. Go to http://java.sun.com and download the latest for your operating system.

    Then, you'll need the Java Media Framework. Get that for your OS from here

    ensure that your webcam/video capture card is working first, without Java. So use whatever program you normally use to do bi-directional porn and make sure the video feed is working.

    Now that you have all the software, start JMStudio, which JMF should have just installed, and go to File -> Preferences. Click on the Capture Devices tab, and click on Detect Capture Devices. This will register any capture devices you have so that Java can see them. Just make sure the VFW (video for windows) one is visible, and that it's locator is vfw://0 (I'll add the ability to select which locator to use later).

    Finally, double click on the jar and you should get a window appear, which will immediately start to capture the background. Do not stand in it's way whilst it's learning. Let it point at some part of the room/road for a few seconds so it can distinguish between background and foreground.

    The result will be that any moving objects should only appear, whilst non-moving objects will remain black.

    This currently works best indoors, or on a day with consistant lighting.


    Orignal post

    I'm developing a computer vision library to later create applications with. The Java Media Framework and Advanced Imagine Api's are being used to extract frames from a stream and process the pixel data.

    So far, I have exactly that. The next steps are to create algorithms for motion detection and the likes. If you have any experience in the field and would like to get involved, please get in touch.
    Current:
    [BMW E46 ///M3 Convertible]

    Previous:
    [BMW E31 850CSi]|[BMW E39 535i]|[BMW HVAC Research]|[IBUS Scrolling Text]|[BMPuter]|[Velocity]|[TomTom]|[Vision]|[Space Navigator Driver]|[Super Fast Boot]

  • #2
    Good luck.
    Would help a bit but im busy with my own stuff.

    dont suppose you know why im only getting 0s or 255s bytes of my serial line instead of numbers 0-255???

    haha (been asking all over the place).
    Core duo
    1tb harddrive
    256 ddr
    8 lilliput
    bu-353

    still installing...

    Comment


    • #3
      what are you feeding into it?
      Current:
      [BMW E46 ///M3 Convertible]

      Previous:
      [BMW E31 850CSi]|[BMW E39 535i]|[BMW HVAC Research]|[IBUS Scrolling Text]|[BMPuter]|[Velocity]|[TomTom]|[Vision]|[Space Navigator Driver]|[Super Fast Boot]

      Comment


      • #4
        i have some decent experience with java, but not much with vision in java. i've done some java3d programming and what not. i have also done some vision programming in c++. if you could give me some more details on what you've done and where you want to go, i might be able to help.

        Comment


        • #5
          I was loosing hope there and getting ready to take the plunge.

          So far, I have the following algorithms that I've done in different projects. I'm currently in the processes of grouping them into a library.

          1. A motion detector that continuously learns a background, and subtracts the current frame from that background. This difference image shows moving objects. This image is then scanned using a connected components algorithm, which groups connected pixels together, and labels them as unique regions.

          2. I've also got a tracker, that will predict (in a linear fashion) the next location of a moving region from the above region identifier. It uses the centroid of the as the coordinates.

          3. I've got code to connect to a video source, either file/url/capture (currently video for windows... not the best but ok for now. directshow would be better). Each frame that is captured fires off an event, which a connected listner can use to retrieve that frame.

          the projects I've got in mind are these:

          Buffered Recording:
          This project is the primary directive. To continuously record, and discard any footage older than a specified timeframe. The idea is that if something happens, like an accident or similar, the user can press a button and have a record of what just happened, in addition to everything that happens after that, up to a specified timeframe / when the user aborts.

          Since this stream is running all the time, it can be used for other things. There's a massive distniction between moving and stationary projects, so here's the stationary one first:

          Motion Initiated Recording:
          This project is failry easy, and can currently be done through various means, but this would put the library to the test. It's to record only when a certan sized region appears in view. The regions can be profiled to distinguish between person/car/animal, using some matching techniques, which will require some research and development. I'm aware that some users will have power issues, but it would be useful to have a recorder run whilst away from the car in a dodgy area for example.

          Rain Sensor:
          This is sort of both moving and stationary! Using some filters, it should be possible to identify rain drops on the screen. And after a certain threshold, it would be possible to fire off an event to turn the wipres on.

          A Passive Radar:
          This will be a real challange. A rear view camera that alerts the user of fast moving objects. Since the vehicle is in motion, object detection takes a whole different direction. I'm assuming that optic flow will have to be used here see (this link) for more info.

          Interested?
          Current:
          [BMW E46 ///M3 Convertible]

          Previous:
          [BMW E31 850CSi]|[BMW E39 535i]|[BMW HVAC Research]|[IBUS Scrolling Text]|[BMPuter]|[Velocity]|[TomTom]|[Vision]|[Space Navigator Driver]|[Super Fast Boot]

          Comment


          • #6
            Sure, I'm interested. I worked with a professor at my college last semester, and he's developed something similar in c. It basically is an object detector. It will constantly monitor a scene, and if an object is added/removed it will take a few pictures of it, and try to match it to something in its database, i.e. a coffee cup, etc. It sounds like what you want to do is pretty similar, and I can tell you that it is a whole lot of work. There is alot of code written in c for this, and im sure we could use a lot of the same algorithms. Have you looked at OpenCV at all? They have excellent motion detection algorithms. Also, if I speak to my professor he might be willing to give me some hints for some good algorithms for the object detection stuff. Another option would be to create Java that interfaces with C, and then we could use some of the code that's already written, unless you just want to write all the code yourself?

            Comment


            • #7
              Originally posted by pyrotechnique
              Sure, I'm interested. I worked with a professor at my college last semester, and he's developed something similar in c. It basically is an object detector. It will constantly monitor a scene, and if an object is added/removed it will take a few pictures of it, and try to match it to something in its database, i.e. a coffee cup, etc. It sounds like what you want to do is pretty similar, and I can tell you that it is a whole lot of work.
              I've already got that far except the matching. I'm not even sure matching is required at the moment, as long as some form of distinguishment between cars and people is done. that way cars / newspapers flying by can be ignored, but people walking can be recorded, since they may end up breaking in.

              Originally posted by pyrotechnique
              There is alot of code written in c for this, and im sure we could use a lot of the same algorithms. Have you looked at OpenCV at all? They have excellent motion detection algorithms.
              I've brielfy looked at CV, but I was a little offput by the non-java stuff. Although I've done some C++ in the past, it's a bit dated and I've now got 5 years of industry experience in Java. You're right about it containing everything though. I just had another look.

              I've also found a Java library of similar features. ImageJ. Have a look at the speed charecteristics! I came accross this when looking for a java optic flow implementation that I could steal. Turns out it was a plugin for the ImageJ opensource api.

              Originally posted by pyrotechnique
              Also, if I speak to my professor he might be willing to give me some hints for some good algorithms for the object detection stuff.
              defo a good idea. I'm also in touch with a Dr. at university here, whom I also worked with whilst at uni! this is where my experience comes from so we're in similar waters here He's offered to help and I may do a part time phd in this. I figured if I'm going to do all this work, I may as well get something for it. But we'll see how that pans out.

              Originally posted by pyrotechnique
              Another option would be to create Java that interfaces with C, and then we could use some of the code that's already written,...
              sure we can, if we have to take something from the OpenCV library that's in not in ImageJ. I'm not completely closed to the idea of working with C++. I'm rusty but I can get back into it. What I don't want is to be held up by my inablity with C++ rather than getting on with getting the project stuff going.

              Originally posted by pyrotechnique
              ...unless you just want to write all the code yourself?
              I'm more interested in getting a solution to work more than anything. If we can just plug a load of modules together and get the requirements done, then that's great. I'm not concerened about performance or anything else at the moment, just getting the goals done. The rest is a known science and attackable.



              so.. today I tried to work with ImageJ but didn't get very far in integrating it to my code. ImageJ needs to get its frames from somewhere, so the video capture stuff I have should be good starting point for that. I expect to have a working demo of the stuff I have so far by Friday. I can send that to you to get familiar with whilst it's nice and early, and we can collaborate in moving from there.

              The type of help I'd like is someone to experiment and share ideas with, since this is a research based project.
              Current:
              [BMW E46 ///M3 Convertible]

              Previous:
              [BMW E31 850CSi]|[BMW E39 535i]|[BMW HVAC Research]|[IBUS Scrolling Text]|[BMPuter]|[Velocity]|[TomTom]|[Vision]|[Space Navigator Driver]|[Super Fast Boot]

              Comment


              • #8
                damn im interesting now.
                dont know how much time i can add tho.

                ill try to get into it a bit.
                give me a couple days to look more into it.
                Core duo
                1tb harddrive
                256 ddr
                8 lilliput
                bu-353

                still installing...

                Comment


                • #9
                  great! I'll send my code tommorow, when I hope to get a working version done
                  Current:
                  [BMW E46 ///M3 Convertible]

                  Previous:
                  [BMW E31 850CSi]|[BMW E39 535i]|[BMW HVAC Research]|[IBUS Scrolling Text]|[BMPuter]|[Velocity]|[TomTom]|[Vision]|[Space Navigator Driver]|[Super Fast Boot]

                  Comment


                  • #10
                    I also am interested, I will have to read up on what you are doing, but this sounds really interesting. I am in the process of adding a nitemax camera to my setup and was just thinking about software possibilities.
                    My Install

                    Software:
                    CFiG v1
                    iGuidance Plugin for CF

                    CarShell
                    Working shell for a CarPC

                    StopWatch
                    StopWatch plugin remade for centrafuse RC1

                    Comment


                    • #11
                      cool! glad to see some more interest. I'll post my code up 2moz, with a write up to follow later.

                      EDIT: Here's a write up I did for my final year project. It should serve as a good computer vision primer.
                      Current:
                      [BMW E46 ///M3 Convertible]

                      Previous:
                      [BMW E31 850CSi]|[BMW E39 535i]|[BMW HVAC Research]|[IBUS Scrolling Text]|[BMPuter]|[Velocity]|[TomTom]|[Vision]|[Space Navigator Driver]|[Super Fast Boot]

                      Comment


                      • #12
                        ok, I've managed to get some code up and running it's attached.

                        inside the zip, you'll find a jar and the source code.

                        you'll need to install the java media framework first, and have a device capture card working. you can do this by running JMStudio (when JMF is installed, you get this) and going to File->Preferences. Under the "Capture Devices" tab, press "Detect Capture Devices" (can take a while), then look at the location of that device. it should be something like: vfw://0. commit and exit that screen then try File->Capture. If you can capture in JMStudio, and the location is vfw://0 then the jar application should just work. If the capture doesn't work, sort that out

                        If the location is different, then you'll need to edit the ProcessorTest.java and change the location.



                        about the code:

                        currently, it's not optimised or anything, but it does get you familiar and started with grabbing and processing.

                        If you leave the camera pointed in a direction, it will slowly learn that background. After about 10 seconds, try to move around in front of the camera. Only the moving parts should appear in the image (plus a load of noise, depending on the quality of the cam, but you always get noise).

                        Be careful not to make the camera's auto-intensity change too much, by going too close to it, since this will fool the algorithm into thinking the background has changed.

                        have a mess around with this and any questions, fire away.
                        Attached Files
                        Current:
                        [BMW E46 ///M3 Convertible]

                        Previous:
                        [BMW E31 850CSi]|[BMW E39 535i]|[BMW HVAC Research]|[IBUS Scrolling Text]|[BMPuter]|[Velocity]|[TomTom]|[Vision]|[Space Navigator Driver]|[Super Fast Boot]

                        Comment


                        • #13
                          Thanks for the update and the code to check out. I started reading but have not yet finished your projects write up (very good by the way) And plan to look at the code early next week (planning a wedding kills your weekends ) I also just received my nitemax cameras in the mail today, but I have to wait to find the correct ac-dc power source to fire them up.

                          Once I get everything up and running I will give any thoughts (hopefully helpful) that I can think of, and hopefully I might be able to provide some help on the project as it really interests me. BTW if you are into AI at all check out On Intelligence by Jeff Hawkins, the only reason I mention it, is because he spends some thought in his book as to how the brain can recognize and identify people and objects at any angle, with such precision and speed, when it is so difficult on a computer. He also goes into depth on what we know of how the brain interprets the signals sent from our retinas over the optic nerve.

                          Sorry about my rambling.
                          My Install

                          Software:
                          CFiG v1
                          iGuidance Plugin for CF

                          CarShell
                          Working shell for a CarPC

                          StopWatch
                          StopWatch plugin remade for centrafuse RC1

                          Comment


                          • #14
                            Ill probably give it a try tomorrow in my carputer.
                            Core duo
                            1tb harddrive
                            256 ddr
                            8 lilliput
                            bu-353

                            still installing...

                            Comment


                            • #15
                              Originally posted by alti
                              I also just received my nitemax cameras in the mail today, but I have to wait to find the correct ac-dc power source to fire them up.
                              this will be very interesting. currently I'm using hue and saturation to identify moving objects, and ignoring illumanatoin (see HSI colour models in teh write up). The nitemax will be B&W I beleive, which means it has to work on a single channel RGB-style model. The code doesn't yet deal with that, but I'll modify it so it does... hopefuly by the time your wedding is sorted

                              use an ATX supply for power?

                              Originally posted by alti
                              Once I get everything up and running I will give any thoughts (hopefully helpful) that I can think of, and hopefully I might be able to provide some help on the project as it really interests me.
                              cool.

                              Originally posted by alti
                              BTW if you are into AI at all check out On Intelligence by Jeff Hawkins, the only reason I mention it, is because he spends some thought in his book as to how the brain can recognize and identify people and objects at any angle, with such precision and speed, when it is so difficult on a computer. He also goes into depth on what we know of how the brain interprets the signals sent from our retinas over the optic nerve.
                              I am very much into AI. There's a book called Vision by a genius called David Marr. I highly recommend this (if you can find it). He delves into explaining how human vision is a process, and not some magic, and he mixes neuropsychology with computer programs. I've been trying to locate a copy ever since I read a part of it. I may have to buy it for the full price of $300-400 (out of print now). I will look into the Jeff Hawkins stuff too.

                              Originally posted by alti
                              Sorry about my rambling.
                              all input is good input dude!


                              Originally posted by 84RegalRider
                              Ill probably give it a try tomorrow in my carputer.
                              nice. what camera do you have? does it have automatic intensity control or is that fixed?

                              ps. my dad had an 84 regal!
                              Current:
                              [BMW E46 ///M3 Convertible]

                              Previous:
                              [BMW E31 850CSi]|[BMW E39 535i]|[BMW HVAC Research]|[IBUS Scrolling Text]|[BMPuter]|[Velocity]|[TomTom]|[Vision]|[Space Navigator Driver]|[Super Fast Boot]

                              Comment

                              Working...
                              X