Color Distance

Using the Video4Linux API’s to capture an image I used a color distance algorithm that filtered out a specific color so that the color chosen appears “close” and other colors appear “far”. The color distance algorithm is calculated when the pixels are inputted and written to the .ppm file.

int ppm_save_yuyv(const char* name, int cols, int rows, void* buffer, int bufferSize)
{
    char header[128];
    sprintf(header, "P6\n%d %d 255\n", cols, rows);
    FILE* file = fopen (name, "w");
    if (file==0) return(-1);
    fputs(header, file);

    {
        int Y0, Y1, Cb, Cr;                             // gamma pre-corrected input [0;255]
        int y0,y1, pb, pr;                              // temporaries
        char r0,r1,g0,g1,b0,b1;                         // temporaries
        unsigned long long int sumH=0, sumW=0, sumD=0;     // use int64_t not 32-bit long int
        int dr,dg,db,distance;                            //dr,dg,db must be signed!

        int iterations = cols*rows/2;
        int i = 0,row = 0, col = 0;
        while( i < iterations )
        {
            unsigned int packed_value = *((int*)buffer+i);

            if(row>rows){row = 0; col++;}

            Y0 = (char)(packed_value & 0xFF);
            Cb = (char)((packed_value >> 8 ) & 0xFF);
            Y1 = (char)((packed_value >> 16 ) & 0xFF);
            Cr = (char)((packed_value >> 24 ) & 0xFF);

            // Strip sign values after shift (i.e. unsigned shift)
            Y0 = Y0 & 0xFF;
            Cb = Cb & 0xFF;
            Y1 = Y1 & 0xFF;
            Cr = Cr & 0xFF;

            y0 = 255*(Y0 - 16)/219;
            y1 = 255*(Y1 - 16)/219;
            pb = 255*(Cb - 128)/224;
            pr = 255*(Cr - 128)/224;

            // Generate first pixel
            r0 = clamp(( 298 * y0            + 409 * pr + 128) >> 8);
            g0 = clamp(( 298 * y0 - 100 * pb - 208 * pr + 128) >> 8);
            b0 = clamp(( 298 * y0 + 516 * pb            + 128) >> 8);

            // Generate next pixel - must reuse pb & pr as 4:2:2
            r1 = clamp(( 298 * y1            + 409 * pr + 128) >> 8);
            g1 = clamp(( 298 * y1 - 100 * pb - 208 * pr + 128) >> 8);
            b1 = clamp(( 298 * y1 + 516 * pb            + 128) >> 8);

            //calculate difference of each color component range of (0-255)
            dr = r0 - 255;
            dg = g0 - 0;
            db = b0 - 0;

            //calculate the distance using the difference of the color components and the max value for the colors (255)
            //update the color pixel to the distance calculated
            distance = 255 -floor(sqrt(dr*dr+dg*dg+db*db));
            if(distance<0){distance = 0;}
            r0 = distance;
            g0 = distance;
            b0 = distance;

            //update the weighted sums for center width and height
            sumH=sumH+row*distance;
             sumW=sumW+col*distance;
             sumD=sumD+distance;
            row++;

            //Same as above (since this function takes in and outputs 2 pixels at a time) make sure that your dr, dg, db
            //functions are the same as the ones above for r0,g0,b0.
            dr = r1 - 255;
            dg = g1 - 0;
            db = b1 - 0;

            distance = 255 - floor(sqrt(dr*dr+dg*dg+db*db));
            if(distance<0){distance = 0;}
            r1 = distance;
            g1 = distance;
            b1 = distance;

            sumH=sumH+row*distance;
             sumW=sumW+col*distance;
             sumD=sumD+distance;
            row++;

            //prints the updated pixel information to the .ppm file
            fprintf( file, "%c%c%c%c%c%c",r0,g0,b0,r1,g1,b1); // Output two pixels

            i++;
        }
    }

    fclose (file);
    return(0);
}

The following Images are the result of the color distance on red:

Unfiltered image:

Filtered image:

Print Friendly

Video 4 Linux 2

Dr. Malinowski showed me an interesting example that he found online called Video 4 Linux 2 or V4L2. The mainpage for V4L2 is located here and here are the documentation and video capture example provided via links from the mainpage. Another useful link from TI’s website is the OMAP35x Linux PSP. Dr. Malinowski already tweaked the video capture example so that it would work with a /dev/video0 devices.

This code produces a Segmentation error and after going through it and debugging I figured out that it was missing CLEAR(buf) before declaring buf.type, buf.memory, and buf.index. The CLEAR(buf) can be replace with the line of code:

struct v4l2_buffer buf;
memset(&buf, sizeof(buf), 0);

Using the Video4Linux example with the corrections the following code captures 2 images and saves them as a .ppm file.

//* WebCam access example based on video4linux v2 *

/*When compiling this program on your system type in "gcc -Wall Name_of_your_file.c /usr/lib/libm.a -o Name_of_your_program"
without the "" marks. If you don't have the /usr/lib/libm.a file available on your system typing "gcc Name_of_your_file.c -lm"
without the "" marks and just run the a.out file that it gives you by typing "./a.out" without the "" marks. As of right now
the function uses the YUYV format since the RGB24 format has some issues with sizing. */

#include <fcntl.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/mman.h> //mmap
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>

#include <linux/types.h>
#include <linux/videodev2.h>

struct buffer {
    void *                  start;
    size_t                  length;
};

const char VideoDeviceName0[]     = "/dev/video0";

#define fname_maxlen (64)
const char CapturedImageNameIO[]  = "image_io"; // .ppm will be appended
const char CapturedImageNameMM[]  = "image_mm"; // .ppm will be appended

static int xioctl (int fd, int request, void* arg)
{
    int status;
    do { status = ioctl (fd, request, arg); } while (-1==status && EINTR==errno);
    return status;
}

int ppm_save_rgb24(const char* name, int cols, int rows, void* buffer, int bufferSize);
int ppm_save_yuyv(const char* name, int cols, int rows, void* buffer, int bufferSize);

int main(int argc, char **argv)
{
    const char* VideoDeviceName = VideoDeviceName0;
    int  status;

    if (argc>1)
    {
        VideoDeviceName = argv[1];
    }

    // Open the device
    int webcam = open(VideoDeviceName, O_RDWR|O_NONBLOCK, 0);
    if (-1==webcam)
    {
        fprintf(stderr, "ERROR: cannot open the device %s\n", VideoDeviceName);
        exit(EXIT_FAILURE);
    }

    // Query the device capacity
    struct v4l2_capability cap;
    status = xioctl (webcam, VIDIOC_QUERYCAP, &cap);
    if (0!=status)
    {
        fprintf(stderr, "ERROR: ioctl VIDIOC_QUERYCAP returned status of %d\n", status);
    }

    if ( !(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE) )
    {
        fprintf(stderr, "ERROR: the device does not support image capture\n");
        exit(EXIT_FAILURE);
    }
    if ( !(cap.capabilities & V4L2_CAP_READWRITE) )
    {
        fprintf(stderr, "WARNING: the device does not support read i/o\n");
    }
    if ( !(cap.capabilities & V4L2_CAP_STREAMING) )
    {
        fprintf(stderr, "WARNING: the device does not support streaming\n");
    }

    // Select video input and video standard, and/or tune TV card hare
    struct v4l2_cropcap cropcap;
    memset(&cropcap, sizeof(cropcap), 0);
    cropcap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
    status = xioctl (webcam, VIDIOC_CROPCAP, &cropcap);
    if (0==status)
    {
        struct v4l2_crop crop;
        // memset(&crop, sizeof(crop), 0);
        crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
        crop.c = cropcap.defrect; // reset to default

        status = xioctl (webcam, VIDIOC_S_CROP, &crop);
        if (0!=status)
        {
            if (EINVAL==errno)
                fprintf(stderr, "WARNING: the device does not support cropping\n");
            else ; // Errors ignored
        }
    } else {   
         // Errors ignored
    }

    struct v4l2_format form;
    memset(&form, sizeof(form), 0);
    form.type                = V4L2_BUF_TYPE_VIDEO_CAPTURE;
    form.fmt.pix.width       = 1280;//Here you can change your resolution to whatever your camera is best fit for!!!!!!
    form.fmt.pix.height      = 960;
    // common format: V4L2_PIX_FMT_YUYV, desired format: V4L2_PIX_FMT_RGB24
    form.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;//As of right now the program uses the YUYV formate to do the color distance calculations
    // form.fmt.pix.pixelformat = V4L2_PIX_FMT_RGB24;
    form.fmt.pix.field       = V4L2_FIELD_INTERLACED;
    status = xioctl (webcam, VIDIOC_S_FMT, &form);
    if (0!=status)
    {
        fprintf(stderr, "ERROR: ioctl VIDIOC_S_FMT returned status of %d (format %d is not supported)\n",
                        status, (int)form.fmt.pix.pixelformat);
        exit(EXIT_FAILURE);
    }

    // Note VIDIOC_S_FMT may change width and height!
    int min = form.fmt.pix.width * 2;
    if (form.fmt.pix.bytesperline < min)
            form.fmt.pix.bytesperline = min;
    min = form.fmt.pix.bytesperline * form.fmt.pix.height;
    if (form.fmt.pix.sizeimage < min)
            form.fmt.pix.sizeimage = min;

    // Demonstrate reading using memory map io (streaming)
    if ( cap.capabilities & V4L2_CAP_STREAMING )
    {
        struct buffer* buffers   = NULL;
        unsigned int   n_buffers = 0;
        unsigned int i;

        // Initialize buffer
        struct v4l2_requestbuffers req;
        memset(&req, sizeof(req), 0);
        req.count               = 4;
        req.type                = V4L2_BUF_TYPE_VIDEO_CAPTURE;
        req.memory              = V4L2_MEMORY_MMAP;

        status = xioctl (webcam, VIDIOC_REQBUFS, &req);
        if (0!=status )
        {
            fprintf(stderr, "ERROR: ioctl VIDIOC_REQBUFS returned status %d\n", status);
            exit (EXIT_FAILURE);
        }

        if (req.count < 2) {
            fprintf (stderr, "ERROR: Insufficient buffer memory on %s\n", VideoDeviceName);
            exit (EXIT_FAILURE);
        }

        n_buffers = req.count;
        buffers = calloc(n_buffers, sizeof(*buffers));
        if (0==buffers) {
            fprintf (stderr, "ERROR: Out of memory\n");
            exit (EXIT_FAILURE);
        }

        for (i = 0; i < n_buffers; ++i) {
            struct v4l2_buffer buf;
            memset(&buf, sizeof(buf), 0);

            buf.type        = V4L2_BUF_TYPE_VIDEO_CAPTURE;
            buf.memory      = V4L2_MEMORY_MMAP;
            buf.index       = i;

            status = xioctl (webcam, VIDIOC_QUERYBUF, &buf);
            if (0!=status)
            {
                fprintf(stderr, "ERROR: ioctl VIDIOC_QUERYBUF for buffer %d returned status %d\n", i, status);
                exit (EXIT_FAILURE);
            }

            buffers[i].length = buf.length;
            buffers[i].start = mmap (NULL /* start anywhere */,             buf.length,
                                     PROT_READ | PROT_WRITE /* required */, MAP_SHARED /* recommended */,
                                     webcam,                                buf.m.offset);

            if (MAP_FAILED==buffers[i].start)
            {
                fprintf(stderr, "ERROR: MemoryMap failed for buffer %d of %d\n", i, n_buffers);
                exit (EXIT_FAILURE);
            }
        } // end of for loop for each buffer

        // Start capturing
        for (i = 0; i < n_buffers; ++i)
        {
            struct v4l2_buffer buf;
            memset(&buf, sizeof(buf), 0);
            buf.type        = V4L2_BUF_TYPE_VIDEO_CAPTURE;
            buf.memory      = V4L2_MEMORY_MMAP;
            buf.index       = i;

            status = xioctl (webcam, VIDIOC_QBUF, &buf);
            if (0!=status)
            {
                fprintf(stderr, "ERROR: ioctl VIDIOC_QBUF returned status %d\n", status);
                exit (EXIT_FAILURE);
             }
        }

        enum v4l2_buf_type type1;
         type1 = V4L2_BUF_TYPE_VIDEO_CAPTURE;
        status = xioctl (webcam, VIDIOC_STREAMON, &type1);
        if (0!=status)
         {
            fprintf(stderr, "ERROR: ioctl VIDIOC_STREAMON returned status %d\n", status);
            exit (EXIT_FAILURE);
        }

        // Let's take 2 frames NOTE: you can change how many frames you take with this for loop but make sure that you have
        //enough space if you are taking a very large amount of pictures.
        for (i=0; i<2; ++i)
        {
            // Wait for a new frame to become available
            struct timeval timeout;
            timeout.tv_sec = 2;
            timeout.tv_usec = 0;

            fd_set fds;
            FD_ZERO (&fds);
            FD_SET (webcam, &fds);
            status = select (webcam+1, &fds, NULL, NULL, &timeout);

            if (-1==status)
            {
                if (EINTR==errno) continue;
                fprintf (stderr, "ERROR: select failed\n");
                exit (EXIT_FAILURE);
            }

            if (0==status)
            {
                fprintf (stderr, "ERROR: webcam tiemout\n");
                exit (EXIT_FAILURE);
            }

            // Read one frame
            struct v4l2_buffer buf;
            memset(&buf, sizeof(buf), 0);
            buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
            buf.memory = V4L2_MEMORY_MMAP;

            // Hold onto the buffer that holds the most recently captured image
            status = xioctl (webcam, VIDIOC_DQBUF, &buf);
            if (0!=status)
            {
                if (EAGAIN==errno) continue; // read again
                else
                {
                    fprintf(stderr, "ERROR: ioctl VIDIOC_DQBUF returned status %d\n", status);
                    exit(EXIT_FAILURE);
                }
            }

            assert (buf.index < n_buffers);

            // process_image (buffers[buf.index].start, buffers[buf.index].length);
            {
                char* buffer   = buffers[buf.index].start;
                int bytes_read = buffers[buf.index].length;
                char fname[fname_maxlen];
                sprintf(fname, "%s-%03d.ppm", CapturedImageNameMM, i);
                if (V4L2_PIX_FMT_RGB24==form.fmt.pix.pixelformat)
                {
                    status = ppm_save_rgb24(fname, form.fmt.pix.width, form.fmt.pix.height, buffer, bytes_read);
                    if (0!=status)
                    {
                        fprintf(stderr, "ERROR: cannot write to file %s\n", fname);
                        free(buffer);
                        exit(EXIT_FAILURE);
                    }
                } else if (V4L2_PIX_FMT_YUYV==form.fmt.pix.pixelformat){
                    status = ppm_save_yuyv(fname, form.fmt.pix.width, form.fmt.pix.height, buffer, bytes_read);
                    if (0!=status)
                    {
                        fprintf(stderr, "ERROR: cannot write to file %s\n", fname);
                        free(buffer);
                        exit(EXIT_FAILURE);
                    }
                } else {
                    status=-1; /* format not supported by us */
                }
            }

            // Release hod of the locked recent buffer
            status = xioctl (webcam, VIDIOC_QBUF, &buf);
            if (0!=status)
             {
                fprintf(stderr, "ERROR: ioctl VIDIOC_QBUF returned status %d\n", status);
                // exit (EXIT_FAILURE);
            }
        }

        // Stop capturing
        enum v4l2_buf_type type2;
        type2 = V4L2_BUF_TYPE_VIDEO_CAPTURE;
        status = xioctl (webcam, VIDIOC_STREAMOFF, &type2);
        if (0!=status)
         {
            fprintf(stderr, "ERROR: ioctl VIDIOC_STREAMON returned status %d\n", status);
            exit (EXIT_FAILURE);
        }

        // Shutdown buffers
        for (i = 0; i < n_buffers; ++i)
            status = munmap (buffers[i].start, buffers[i].length);
            if (0!=status)
            {
                fprintf(stderr, "ERROR: MemoryMap unmapping failed\n");
                exit (EXIT_FAILURE);
            }

    }

    close (webcam);

    return(EXIT_SUCCESS);
}

int ppm_save_rgb24(const char* name, int cols, int rows, void* buffer, int bufferSize)
{
    char header[128];
    sprintf(header, "P6\n%d %d 255\n", cols, rows);
    int file = open (name, O_WRONLY|O_CREAT, 0666);
    if (file==0) return(-1);
    write (file, header, strlen(header));
    write (file, buffer, bufferSize);
    close (file);
    return(0);
}

static int clamp(int i)
{
    if (i<0) return(0);
    else if (i<256) return(i);
    else return(255);
}

int ppm_save_yuyv(const char* name, int cols, int rows, void* buffer, int bufferSize)
{
    char header[128];
    sprintf(header, "P6\n%d %d 255\n", cols, rows);
    FILE* file = fopen (name, "w");
    if (file==0) return(-1);
    fputs(header, file);

    {
        int Y0, Y1, Cb, Cr;                             // gamma pre-corrected input [0;255]
        int y0,y1, pb, pr;                              // temporaries
        char r0,r1,g0,g1,b0,b1;                         // temporaries
        unsigned long long int sumH=0, sumW=0, sumD=0;     // use int64_t not 32-bit long int
        int dr,dg,db,distance;                            //dr,dg,db must be signed!

        int iterations = cols*rows/2;
        int i = 0,row = 0, col = 0;
        while( i < iterations )
        {
            unsigned int packed_value = *((int*)buffer+i);

            if(row>rows){row = 0; col++;}

            Y0 = (char)(packed_value & 0xFF);
            Cb = (char)((packed_value >> 8 ) & 0xFF);
            Y1 = (char)((packed_value >> 16 ) & 0xFF);
            Cr = (char)((packed_value >> 24 ) & 0xFF);

            // Strip sign values after shift (i.e. unsigned shift)
            Y0 = Y0 & 0xFF;
            Cb = Cb & 0xFF;
            Y1 = Y1 & 0xFF;
            Cr = Cr & 0xFF;
  
            y0 = 255*(Y0 - 16)/219;
            y1 = 255*(Y1 - 16)/219;
            pb = 255*(Cb - 128)/224;
            pr = 255*(Cr - 128)/224;

            // Generate first pixel
            r0 = clamp(( 298 * y0            + 409 * pr + 128) >> 8);
            g0 = clamp(( 298 * y0 - 100 * pb - 208 * pr + 128) >> 8);
            b0 = clamp(( 298 * y0 + 516 * pb            + 128) >> 8);

            // Generate next pixel - must reuse pb & pr as 4:2:2
            r1 = clamp(( 298 * y1            + 409 * pr + 128) >> 8);
            g1 = clamp(( 298 * y1 - 100 * pb - 208 * pr + 128) >> 8);
            b1 = clamp(( 298 * y1 + 516 * pb            + 128) >> 8);

            //prints the updated pixel information to the .ppm file
            fprintf( file, "%c%c%c%c%c%c",r0,g0,b0,r1,g1,b1); // Output two pixels

            i++;
        }
    }

    fclose (file);
    return(0);
}
Print Friendly

Information reguarding the Camera module connection

Will be using Parallel in generic interface (SYNC mode) which the Camera ISP supports12 bits and the camera ISP can interface with RAW interlaced or progressive image sensors using RGB. More information on Pg. 1337 OMAP35x Applications Processor Technical Reference Manual

A description of SYNC mode is on Pg. 1334 OMAP35x Applications Processor Technical Reference Manual which states SYNC mode: In this mode, the image-sensor module provides horizontal and vertical synchronization signals to the parallel interface, along with the pixel clock. This mode works with 8-, 10-, 11-, and 12-bit data (above 10-bit RAW data, the processing pipe cannot be used; data must be transferred to memory). SYNC mode supports progressive and interlaced image-sensor modules. Since we are using a 5Mp Camera we will be using 12-bit data.

Pg. 1335 OMAP35x Applications Processor Technical Reference Manual Video processing front end (VPFE): Performs signal-processing operations on RAW image input data. The output data can go directly to memory for software processing, or to the video-processing back end for further processing. The video-processing front end is supported by the CCDC module. Signal-processing operations include:
• Optical clamping
• Optical black clamp
• Black-level compensation
• Look-up table (LUT) based faulty pixel correction
• 2D lens-shading compensation
• Data formatter
• Output formatter

NOTE: Up to 12-bit data at 83 MHz can be transferred from the video port to the ISP
submodules. The video processing ISP can treat 1 pixel every two interconnect clock
cycles.

Pg. 1339 OMAP35x Applications Processor Technical Reference Manual The parallel interface in generic configuration mode works with 8-, 10-, 11-, and
12-bit sensors. 8 to 12 bits refers to data-lane count, not pixel coding. For
example, when a video decoder is used, it sends 16 bits per pixel. The data is
transmitted through 8 data lanes at x2 pixel clock. The bridge can be used to
reassemble the 16-bit pixels.

Using SYNC mode the pixel data is presented on cam_d, where one pixel is sampled for every cam_pclk rising edge. Additional pixel times between rows represent blanking periods. Active pixels are identified by a combination of two additional timing signals: horizontal synchronization (cam_hs) and vertical synchronization (cam_vs). During the image-sensor readout, these signals define when a row of valid data begins and ends, and when a frame starts and ends. More is explained on pg. 1343 OMAP35x Applications Processor Technical Reference Manual

We will be using RAW RGB 12 and data must be sent to memory when our bits are over 10 bits so the path we have to take shown below is (C) Pg. 1397 OMAP35x Applications Processor Technical Reference Manual

I will look more into timing control pg 1412 OMAP35x Applications Processor Technical Reference Manual and the control signal generator pg 1412-1416 OMAP35x Applications Processor Technical Reference Manual. Also, I shall look into the RAW12 storage format which is located onpg 1379-1380 OMAP35x Applications Processor Technical Reference Manual.

 

 

 

 

Print Friendly

Finding the required information to use Camera Module on BeagleBoard

OMAP3530/25 Applications Processor

www.ti.com/lit/gpn/omap3530

page 98 shows the table for video interfacing

OMAP35x Applications Processor Technical Reference Manual

http://www.ti.com/general/docs/lit/getliterature.tsp?literatureNumber=spruf98v&fileType=pdf

Since we are using a generic camera module pg 1339 shows the interconnections of the camera

Additional pages with useful information:

pg 1384 to 1386 describes clock functionality of the Camera ISP

pg 1389 to 1390 is Camera ISP interrupt information

and Camera ISP information ends on page 1764

BeagleBoard-xM System Reference Manual

beagleboard.org/static/BBxMSRM_latest.pdf

Pg 98 to 101 shows the interconnections of the camera as shown below

Print Friendly

Getting the DSP to compile (cont.)

Completed the instructions for cross compiling on a host computer. Still need to do target preparations steps to finalize it. Installed c6run_m_yoder and Angstrom ARM toolchain under toolchains in the home directory.

The following files were downloaded:

C6run_m_yoder.tgz

angstrom-2010.4-test-20100422-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.2.tar.bz2

The following commands were used to install and complete the cross compiling on a host computer process:

tar -C ~/toolchains -xjf angstrom-2010.4-test-20100422-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.2.tar.bz2
tar -xvzf c6run_m_yoder.tgz
cd c6run_m_yoder
tar -C ~/toolchains -xzf c6run_0_95_02_02_beagleboard.tar.gz
cd ~/toolchains/c6run_0_95_02_02_beagleboard
vi environment.sh
:1,$s/\${HOME}/\/home\/beagle
cd example ! You should be in /home/beagle/toolchains/c6run_0_95_02_02_beagleboard/examples
make
cd c6runapp/emqbit
ls

We need to install the DSP bios on the beagleboard.

 

Print Friendly

Getting the DSP to compile

Found a website that showed instructions on how to get the beagleboard cross compiled with a host computer:

http://elinux.org/ECE597_Installing_DSP_Development_Tools_c6run

The following files were downloaded and installed:

bios_setuplinux_5_41_09_34.bin

ti_cgt_c6000_7.3.2_setup_linux_x86.bin

The following commands were used to install these files:

 mkdir ~/toolchains
 cd ~/Downloads
 chmod +x ti_cgt_c6000_7.3.2_setup_linux_x86.bin
 ls -l ! Look for an x by ti_... to verify it is executable
 ./ti_cgt_c6000_7.3.2_setup_linux_x86.bin --installto ~/toolchains --mode silent
chmod +x bios_setuplinux_5_41_09_34.bin
./bios_setuplinux_5_41_09_34.bin --mode silent --prefix ~/toolchains

I still need to download and install the following files

angstrom-2010.4-test-20100422-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.2.tar.bz2

C6run_m_yoder.tgz

Additional websites looked at:

http://stackoverflow.com/questions/4699033/beagleboard-how-do-i-send-receive-data-to-from-the-dsp

http://elinux.org/BeagleBoard/DSP_Howto

Print Friendly

The DSP chip

Today I, yet again, looked into how to get the DSP running on the beagleboard since it didn’t seem to be working. I found out that we do indeed need the c6x compiler and I downloaded it by running the following commands:

cd
wget http://linux-c6x.org/files/releases/linux-c6x-2.0.0.63/linux-c6x-2.0.0.63-src.tar.gz
tar xvzf linux-c6x-2.0.0.63-src.tar.gz
mv linux-c6x-2.0.0.63 my-linux-c6x
cd my-linux-c6x

which the information was obtained from the following site:

http://www.linux-c6x.org/wiki/index.php/Linux-c6x_2.0_Release

I still need to finish up the necessary downloads and commands to get the DSP completely working.On a side note this website we stumbled upon while searching seems to have a lot of useful information on it:

http://processors.wiki.ti.com/index.php/C6000_Linux_Support

 

Print Friendly

Back from break

Before leaving for winter break we managed to get the drivers for the leopard imaging LI-LBCM5M1 camera working. I am currently reading up on how to get code working on the beagleboard that will interface with the camera. This is the website:

http://elinux.org/BeagleBoard/DSP_Howto

 

After discussing with Brad we are not going to use the DSP toolchain C6x compiler CTG 6.0.22 but instead we are going to code in g++ for the DSP. Brad recommended the following webpage tutorial:

http://www.hbrobotics.org/wiki/index.php5/Beagle_Board

I am currently in the process of trying his code at the bottom of the page but referencing to the C6accel library.

Print Friendly

Should have posted awhile ago

As of right now this is where I stand. The BeagleBoard is still getting worked on by Brad so I can start working with the camera image processing. I’m currently reading a book called Embedded Image Processing on the TMS320C6000 DSP that was recommended by Dr. Sanchez. I’ve decided to use Canny edge detection with the IR distance sensors to do object detection to avoid obstacles. It achieves this by knowing the distance from the camera to the IR distance sensors. We then should be able to map distance points located at specific location on the image and using the edge detection we can roughly get a depth map generated.

Beagleboard DSP chip runs at 800 Mhz and was looking at downloading C6x compiler CGT 6.0.22 to create code and compile for the DSP chip.

Print Friendly