Connect a camera to Arduino for image recongnition

Hi there guys. I am starting a project which needs to have real time video recognition. I was thinking of utilizing Matlab for that but, receiving the video from a camera module connected to the arduino. What I have been struggling with is to connect a camera to the arduino. I currently own a 600TVL like this one, but I'm not sure if this module is possible for what I intend to do.

Do you have any suggestions of what to do? Do I need an SD card as I have read? What camera module and driver would I need to acquire to successfully get the video to Matlab?

Thank you very much.

I suggest using a RaspberryPi3 instead of an Arduino

CAPTURING VIDEO WITH AN ARDUINO

/***********************************************************************/
//  VIDEO FRAME CAPTURE FOR ARDUINO                                    //
//                                                                     //
// CARLOS AGELL - MoviMED - www.movimed.com                            //
//                                                                     //
// Version 1.0 (Release) June 3rd 2011 by Carlos Agell (MoviMED)       //
//  Arduino code based on the example by Michael Krumpus               //
//  at Nootropic Design.                                               //
//  The software dynamically changes the threshold for the analog      //
//  video acquisition taking advantage of an R2R ladder. As soon as    //
//  a serial character is received the arduino starts acquisition and  //
//  sending process over serial. The serial counterpart needs to put   //
//  together the image by adding all the images and scaling to 255.    //
//                                                                     //
//  See LabVIEW counterpart. Processing counterpart will be coded soon //
//                                                                     //
//  TO DO: Improve speed on sending by packing bytes into hex codes    //
//   it currently sends a single bit per byte.                         //
//                                                                     //
/***********************************************************************/



#include <TVout.h>
#include <fontALL.h>
#define W 128
#define H 96

TVout tv;
unsigned char x,y,i,j,auxpix,k,cnt,turn;
char s[32];


int firstSensor = 0;    // first analog sensor
int inByte = 0;         // incoming serial byte


void setup()  {
  Serial.begin(115200);
  tv.begin(NTSC, W, H);
  initOverlay();
  initInputProcessing();

  tv.select_font(font4x6);
  tv.fill(0);
  turn=0;
  
  pinMode(A3, OUTPUT);
  pinMode(A4, OUTPUT);
  digitalWrite(A3, LOW);
  digitalWrite(A4, LOW);
}


void initOverlay() {
  TCCR1A = 0;
  // Enable timer1.  ICES0 is set to 0 for falling edge detection on input capture pin.
  TCCR1B = _BV(CS10);

  // Enable input capture interrupt
  TIMSK1 |= _BV(ICIE1);

  // Enable external interrupt INT0 on pin 2 with falling edge.
  EIMSK = _BV(INT0);
  EICRA = _BV(ISC11);
}

void initInputProcessing() {
  // Analog Comparator setup
  ADCSRA &= ~_BV(ADEN); // disable ADC
  ADCSRB |= _BV(ACME); // enable ADC multiplexer
  //
  //  ADMUX &= ~_BV(MUX0);  // select A2 for use as AIN1 (negative voltage of comparator)
  //  ADMUX |= _BV(MUX1);
  //  ADMUX &= ~_BV(MUX2);
  ADMUX &= ~_BV(MUX2); // select A1 for use as AIN1 (negative voltage of comparator)
  ADMUX &= ~_BV(MUX1);
  ADMUX |= _BV(MUX0);
  //
  ACSR &= ~_BV(ACIE);  // disable analog comparator interrupts
  ACSR &= ~_BV(ACIC);  // disable analog comparator input capture
}

ISR(INT0_vect) {
  display.scanLine = 0;
}
  
void loop() {
  tv.capture();

  if (Serial.available()>0){
    for(k=0;k<8;k++){
     //set the threshold
     PORTC &= ~(7 << 3);
     PORTC |= (k << 3);
     //Acquire
     tv.capture();
     //send 
     for (j=0;j<H;j++)
       for (i=0;i<W;i++)
          Serial.print(tv.get_pixel(i,j),HEX);
        inByte = Serial.read();
    }
  }
    PORTC &= ~(7 << 3);
    PORTC |= (turn << 3);
    //turn = (turn+1)%4;
    turn = (turn+1)%8;
  
  tv.resume();
  tv.delay_frame(5);
}

I don't think an Arduino has anything near the processing power needed to do video recognition. A Pi may be pushing it already.

JoaoSantos12:
Hi there guys. I am starting a project which needs to have real time video recognition. I was thinking of utilizing Matlab for that but, receiving the video from a camera module connected to the arduino. What I have been struggling with is to connect a camera to the arduino. I currently own a 600TVL like this one, but I'm not sure if this module is possible for what I intend to do.

Do you have any suggestions of what to do? Do I need an SD card as I have read? What camera module and driver would I need to acquire to successfully get the video to Matlab?

Thank you very much.

Your requirements contradict themselves. You want realtime video recognition, what ever that is, at the same time your want to move a frame of video data from device to device that may take days.

Paul