This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to comnect the Webcam automaticly

Well i am an inactive user so i am trying to share smth very valuable.

I have working sauce code written by me in C to connect webcam automaticly and it gets a frame when you want. Also if you want you can get frames using loops. This source code is a fundemental stone for all image processing projects.
Only thing you have to is call this code from your source code while your webcam is running.
but I dont know how to connect webcam to processor! I tried connecting to the port pins but it didnt work properly. do I Need To connect to the UsB Pins of the processor? but I cannot find the usb connector?

If You Can Help me I Will Let You have Some of my Code.

Parents
  • Your very valuable source code can only work under very specific conditions. That the camera is connected in the way your very valuable source code expects. That the camera handles the commands your very valuable code expects. That the camera supplies the images in the format your very valuable source code expects, and with the timing your very valuable source code expects.

    If your very valuable source code is general, and does not have any requirements about connection mode, frame rate, video format, command set, encoding type, ..., then your very valuable source code will look something like this:

    #include "user_defined_camera_inferface_layer.h"
    void very_valuable_function(void) {
        user_defined_camera_info_struct_t info;
        user_defined_camera_frame_struct_t frame;
        user_defined_function_to_power_on_camera();
        if (!user_defined_function_to_detect_camera()) {
            return;
        }
        if (!user_defined_function_to_query_camera_info(&info)) {
            return;
        }
        if (!user_defined_function_to_manipulate_setting(&info)) {
            return;
        }
        if (!user_defined_function_to_config_camera(&info)) {
            return;
        }
        user_defined_function_to_allocate_frame_buffer(&frame);
        for (;;) {
            while (user_defined_function_detects_more_frame_data(&frame)) ;
            user_defined_function_to_send_frame(&frame);
            if (!user_defined_function_to_ask_continue()) break;
        }
        user_defined_function_to_power_off_camera();
    }
    


    Are your very valuable code so general, or are there any user-defined-functions that aren't userr-defined but already available? If so, that function should - in it's documentation - specify the requirements for how to communicate with the camera.

Reply
  • Your very valuable source code can only work under very specific conditions. That the camera is connected in the way your very valuable source code expects. That the camera handles the commands your very valuable code expects. That the camera supplies the images in the format your very valuable source code expects, and with the timing your very valuable source code expects.

    If your very valuable source code is general, and does not have any requirements about connection mode, frame rate, video format, command set, encoding type, ..., then your very valuable source code will look something like this:

    #include "user_defined_camera_inferface_layer.h"
    void very_valuable_function(void) {
        user_defined_camera_info_struct_t info;
        user_defined_camera_frame_struct_t frame;
        user_defined_function_to_power_on_camera();
        if (!user_defined_function_to_detect_camera()) {
            return;
        }
        if (!user_defined_function_to_query_camera_info(&info)) {
            return;
        }
        if (!user_defined_function_to_manipulate_setting(&info)) {
            return;
        }
        if (!user_defined_function_to_config_camera(&info)) {
            return;
        }
        user_defined_function_to_allocate_frame_buffer(&frame);
        for (;;) {
            while (user_defined_function_detects_more_frame_data(&frame)) ;
            user_defined_function_to_send_frame(&frame);
            if (!user_defined_function_to_ask_continue()) break;
        }
        user_defined_function_to_power_off_camera();
    }
    


    Are your very valuable code so general, or are there any user-defined-functions that aren't userr-defined but already available? If so, that function should - in it's documentation - specify the requirements for how to communicate with the camera.

Children
  • Sorry, for the missing infortamion.

    I knwo the code works becuase I make It and There are No Errors.
    The code
    I Didnt Say that the Processor is a 8052 with the BASic code but I am Not Using the Bascc but Using C instead. beacuse it is faster.
    the Processor Has inputs for fast signels {interrupts} and I tried connecting the webcam to them but I Dont see the video in the code.

    I Do Not think your code Example is very good. i Use loops a lot.

    Plz ask any more questions you need to give Me an Answer

  • Your code - written by you - works, but you do not know how, because you do not know how you will get any data into the processor...

    You haven't told what processor.
    You haven't told what camera.
    You don't seem to have read the camera manual (should tell what electrical interface it has).
    You don't seem to have read the processor manual (should tell if the processor has any compatible electrical interface, or if you need external hardware - or if you need to switch to another processor).

    How can your code work, if you don't even know if you processor has USB support? By the way, does that mean that your camera is using an USB interface?

    Define working code? Most people define it as "proven in real life". That shouldn't be the full definition, but at least a starting point for working code. If you haven't proven that your code can take dat from the camera and forward wherever it should be forwarded, then you do not know if your code works. You may possibly define working code as possible to compile, or "in theory written" or something like that.

    Before you start writing code, you must have a plan. That plan must (!) include how you connect camera and processor - without that knowledge, it is impossible to write the code, other than possibly as "pseudo-code".

  • I knwo the code works becuase I make It and There are No Errors.

    what it should be is

    when runninng in my environment the code presumably works becuase I make It and with what I have tried so far No Errors. The one ond only worthless qualifier is 'tested'

    The problem with such ("sample code") is that the 'user' believes (s)he can take it and use it with no hitches and thus get into the mode of using code (s)he does not understand.

    OH, how often have we seen follow ups on such "I used the code and it does not work" Notably most kitchen table programmers and non-MAX 232 interfaces.

    Erik

  • Erik,

    I think you are very impolite! You need to learn that not everyone has the same understanding. You should learn to respect other people. We are not all the same.

    Do you remember a time when you did not know everything? Or were you born with all knowledge?

  • Dacter,
    I don't think Erik was impolite. He just stated the obvious that anybody that is seriously involved in (embedded) software development should be aware of. for crying out loud, what did you expect him to say: "your doing great working with a device you know nothing about?". I would like to help you but you have very little to offer: no model, no electrical interface, to protocols, no nothing.

  • in addition to that, he didn't make a single statement that was false or inaccurate:

    when runninng in my environment the code presumably works becuase I make It and with what I have tried so far No Errors. The one ond only worthless qualifier is 'tested'

    why is this offensive?

    The problem with such ("sample code") is that the 'user' believes (s)he can take it and use it with no hitches and thus get into the mode of using code (s)he does not understand.

    and this? you don't understand the code and you don't know anything about your device. these are facts!

    OH, how often have we seen follow ups on such "I used the code and it does not work" Notably most kitchen table programmers and non-MAX 232 interfaces.

    this statement is based upon his personal experience and is intended to offend you. you just fit perfectly into this notion.
    sit down, learn, and come back with questions once you can deal with the task.
    good luck!

  • I meant of course,
    this statement is based upon his personal experience and is not intended to offend you

  • I heard about Erik and his crazy answers from my friends but I did not think he was so bad.

  • some of us here treat him like a god :-)

  • "some of us here treat him like a god :-)"

    And some of us definitely do not!

  • LOL

    Took me a time to understand it!

  • Please welcome our friend and colleague Jack Sprat. I suspect that you have been dancing lately...

  • "I make It and There are No Errors"

    That is absolutely no guarantee whatsoever that the code will actually work!

    It simply shows that you haven't broken any of the syntax rules of the language - it is still thoroughly possible that you have logical and other errors that would prevent it from actually working.

    " I tried connecting the webcam to them but I Dont see the video in the code."

    How are you expecting to "see" video "in the code"?