chipKIT Lesson: LinkSprite JPEG Camera

July 24th, 2013  Posted at   Lesson ChipKIT
arrow   |   1 Commentarrow

LinkSprite JPEG Camera with chipKIT

LinkSprite JPEG Camera digunakan untuk mengambil gambar dan data nya dalam bentuk JPEG. Interface LinkSprite JPEG Camera dengan PIC boleh rujuk PIC Lesson: LinkSprite JPEG Camera.

Data JPEG bermula dengan dua byte 0xFF 0xD8 dan berakhir dengan dua byte 0xFF 0xD9. Memproses data JPEG menggunakan microcontroller sangat kompleks. Oleh itu, menggunakan Visual Basic untuk memaparkan gambarnya.

Berikut adalah videonya.

ChipKIT Source Code

VB source code

One Response to “chipKIT Lesson: LinkSprite JPEG Camera”

  1. Justice says:

    Thank you it is very helpful but when trying to write in C# i get parameter is not valid error. And this how i did it :

    private void timer1_Tick(object sender, EventArgs e)
    {
    int upperBound = richTextBox1.TextLength % 2;
    byte[] ByteArr = new byte[upperBound];
    data = serialPort1.ReadExisting();
    if (data != “”)
    {
    counter = 0;
    richTextBox1.AppendText(data);
    richTextBox1.ScrollToCaret();
    }
    else
    {
    if (counter < 7) counter += 1;
    }
    if(counter == 6)
    {
    for (int i = 0; i < (upperBound – 1); i++)
    {
    ByteArr[i] = Convert.ToByte(richTextBox1.Text.Substring(i * 2, 2), 16);
    }
    ByteToImage(pictureBox1.Image, ByteArr);
    pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
    button2.Enabled = true;
    }
    }
    public void ByteToImage(Image NewImage, Byte[] ByteArr)
    {
    MemoryStream ImageStream;
    ImageStream = new MemoryStream(ByteArr);
    try { NewImage = Image.FromStream(ImageStream); }
    catch (Exception ex) { MessageBox.Show(ex.Message); }
    }

Leave a Reply

What is 9 + 8 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)