Thread: How do I get&use my AI's camera's images if I don't have them beforehand in my code!

  1. #1
    Registered User
    Join Date
    Dec 2015
    Posts
    142

    How do I get&use my AI's camera's images if I don't have them beforehand in my code!

    I have one major Mah-Jorrr problemo I'm facing, and I'm using this thread to only solve this as it's important.

    Here is something I had already wrote. Try #2 is below this. (same thing, said different, though it sucks & isn't same thing).
    As each image is recorded and saved, I didn't have access to their names in the code beforehand, so how are they(each image frame) or all millions of 0s&1s going to be sent to a IF-Function and check if matches the special-image!? Plus I need a Function to get some of the image's 0s&1s and send em to motors.

    Try #2.
    I need each saved image to be sent to a function and to motors and to other functions to ex. link senses. How do I code such, when, I have no images in my code until it's running in which I can't touch it then plllus the code probably doesn't receive them lol. Maybe my a ARDUINO will label MAT as each new image and so I will fill in the variables mats are processed here ect? I'm lost, ..........

  2. #2
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    Start by doing a search for "c++ programming image recognition" and go from there.

  3. #3
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    OpenCV is probably something you'd find interesting.
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  4. #4
    Registered User
    Join Date
    Dec 2015
    Posts
    142
    All your suggestions provide me ways to match the images, but I cannot do that without coding it, and I can't code it because how do I say what will match when they don't exist until the robot saves them in memory!

  5. #5
    Ticked and off
    Join Date
    Oct 2011
    Location
    La-la land
    Posts
    1,728
    Why not use the Amazon Mechanical Turk API? Just send the pairs of images, and you'll get whether they match as a result. Surely your AI will have to be connected to the internet anyway, so this should not be a problem. And it's not even that expensive.

  6. #6
    Registered User
    Join Date
    Dec 2015
    Posts
    142
    I need to make the full code of my AI and have it go in a real/virtual robot. Not a online cloud match system to test a comparison o-n-l-y...

    I'm really considering hiring someone soon....huh....it's all over the place and hidden and is NOT in English in their tutorials. Like, no manual, omg. And soon I'll be back in my humble sleeping, not able to control my body and figure out what to do till morning.

  7. #7
    Ticked and off
    Join Date
    Oct 2011
    Location
    La-la land
    Posts
    1,728
    Are you sure? You could have made the AI breakthrough on top of Amazon's Mechanical Turk; think of the publicity alone! The adulation! The interview requests you'll get! The money! The chicks! Everybody will be soooo jelly!

  8. #8
    Registered User
    Join Date
    Dec 2015
    Posts
    142
    I don't even get what the link goes to, you'd have to explain what Amazon's Mechanical Turk is man I don't even understand are we talking nonsense now...but read below:

    ! Screw images, I don't need to have my AI robot match em! EM! LAAAAAH! IT'LL BBBBB BLIND YAAAAAAAAAAAAAAAAAAAAAAAAA. wHEN it gets acceleration or sound or feel, that's its que, to save guessed actions, all agree? Let's go/>

    Programming taught me things. Write like this seeImCool(ya, ok); cout << I'm loving it << endl;
    Return 0;

    void noBecauseImAPro-GrammerOk():

  9. #9
    Registered User
    Join Date
    Jan 2016
    Posts
    6
    what the...

  10. #10
    Registered User
    Join Date
    Dec 2015
    Posts
    142
    It's ok, why is that weird?, we are robots, that can be made to think anything is either hot or ugly. (particles = ugly/hot no exist, reactions do, so guessed actions get trigger to save guessed actions and do when sense " ").

  11. #11
    Registered User
    Join Date
    Dec 2015
    Posts
    142
    How do I make guess1 = char('left') when in cout it outputs the variable not the letter,

    see below:

    Code:
    #include <iostream>
    #include <stdlib.h>
    #include <time.h>
    #include <ctime>
    
    
    using namespace std;
    
    
    int main()
    {
        srand( time(0));
        int guess1 = rand();
        int guess2 = rand();
        int guess3 = rand();
        int guess4 = rand();
    
    
        char left(97);
        if (guess1 < 50000)
        guess1 = left;
    
    
        cout << "Leg 1 moved " << guess1 << endl;
        cout << "Leg 2 moved " << guess2 << endl;
        cout << "Leg 3 moved " << guess3 << endl;
        cout << "Leg 4 moved " << guess4 << endl;
    
    
        return 0;
    }

  12. #12
    Registered User
    Join Date
    Dec 2015
    Posts
    142
    nvm i made a bad fix....look at what da code does so-far

    Code:
    #include <iostream>
    #include <stdlib.h>
    #include <time.h>
    #include <ctime>
    
    
    using namespace std;
    
    
    int main()
    {
        srand( time(0));
        int guess1 = rand();
        int guess2 = rand();
        int guess3 = rand();
        int guess4 = rand();
    
    
    
    
    
    
        if (guess1 < 5000)
        cout << "Leg 1 moved left" << endl;
        else if (guess1 < 13000)
        cout << "Leg 1 moved forward" << endl;
        else if (guess1 < 17000)
        cout << "Leg 1 moved backward" << endl;
        else if (guess1 < 40000)
        cout << "Leg 1 moved right" << endl;
    
    
        if (guess2 < 5000)
        cout << "Leg 2 moved left" << endl;
        else if (guess2 < 13000)
        cout << "Leg 2 moved forward" << endl;
        else if (guess2 < 17000)
        cout << "Leg 2 moved backward" << endl;
        else if (guess2 < 40000)
        cout << "Leg 2 moved right" << endl;
    
    
        if (guess3 < 5000)
        cout << "Leg 3 moved left" << endl;
        else if (guess3 < 13000)
        cout << "Leg 3 moved forward" << endl;
        else if (guess3 < 17000)
        cout << "Leg 3 moved backward" << endl;
        else if (guess3 < 40000)
        cout << "Leg 3 moved right" << endl;
    
    
        if (guess4 < 5000)
        cout << "Leg 4 moved left" << endl;
        else if (guess4 < 13000)
        cout << "Leg 4 moved forward" << endl;
        else if (guess4 < 17000)
        cout << "Leg 4 moved backward" << endl;
        else if (guess4 < 40000)
        cout << "Leg 4 moved right" << endl;
    
    
    
    
    
    
        return 0;
    }

  13. #13
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Does your robot QWOP?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  14. #14
    Registered User
    Join Date
    Dec 2015
    Posts
    142
    And now run it:

    Code:
    #include <iostream>
    #include <stdlib.h>
    #include <time.h>
    #include <ctime>
    
    
    using namespace std;
    
    
    int legnum(int legnumber)
    {
        if (legnumber < 10000)
        return 1;
        else if (legnumber < 15000)
        return 2;
        else if (legnumber < 20000)
        return 3;
        else if (legnumber < 50000)
        return 4;
    }
    
    
    int legs(int leg)
    {
        static int doItAgain = 0;
        ++doItAgain;
        if (doItAgain == 5)
        doItAgain = doItAgain - 4;
    
    
        if (doItAgain == 1)
        cout << "leg 1 ";
        else if (doItAgain == 2)
        cout << "leg 2 ";
        else if (doItAgain == 3)
        cout << "leg 3 ";
        else if (doItAgain == 4)
        cout << "leg 4 ";
    
    
        if (leg < 10000)
        cout << "moved left" << endl;
        else if (leg < 15000)
        cout << "moved forward" << endl;
        else if (leg < 20000)
        cout << "moved backward" << endl;
        else if (leg < 50000)
        cout << "moved right" << endl;
    
    
        return 0;
    }
    
    
    int main()
    {
        tryAgain:
        srand( time(0));
        int guess1 = rand();
        int guess2 = rand();
        int guess3 = rand();
        int guess4 = rand();
    
    
        int leg1 = guess1;
        int leg2 = guess2;
        int leg3 = guess3;
        int leg4 = guess4;
        leg1 = legnum(leg1);
        leg2 = legnum(leg2);
        leg3 = legnum(leg3);
        leg4 = legnum(leg4);
    
    
        legs(guess1);
        legs(guess2);
        legs(guess3);
        legs(guess4);
    
    
        if (leg1 == leg2 && leg1 == leg3 && leg1 == leg4)
        cout << "Robot moved forward and got acceleration sense by accelometer, which is the trigger to save actions just guessed" << endl;
        else
        goto tryAgain;
    
    
        return 0;
    }

  15. #15
    Registered User
    Join Date
    Dec 2015
    Posts
    142
    My AI does get the actions yes and yes does improve them by ex. when in use tweaks themmmm and so ya~ But for my demonstration above I may not include the improve part just the important things precisely to prove I-got-AI. Cus I know I got it, so I'm tryin to prove it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 12-28-2012, 11:14 PM
  2. creating images using C# code
    By synyyy in forum C# Programming
    Replies: 1
    Last Post: 01-26-2011, 11:27 PM
  3. ip camera
    By sgh in forum C# Programming
    Replies: 3
    Last Post: 03-12-2009, 01:50 PM
  4. Following camera
    By pandu in forum Game Programming
    Replies: 5
    Last Post: 06-10-2008, 07:20 PM
  5. Digital Camera -> Slo-Mo Camera??
    By Masa in forum Tech Board
    Replies: 6
    Last Post: 12-24-2003, 11:11 AM

Tags for this Thread