Pages: [1] 2 3   Go Down
Author Topic: Capturing jpeg from camera to sd card  (Read 5409 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a idea for a project and just want to make sure its feasible before purchasing everything.  I am a complete noob to Arduino and I have posted about this before but my project plans have changed and it dramatically effects the whole finished product, so please don't yell at me. 
Let me explain:  I want to make my own trail camera.  A trail camera is one of those cameras with a PIR sensor that takes a picture every time something passes it.  you attach it to a tree in the woods to look for dear to hunt so you know before you go hunting what is there instead of wasting needless days scoping out spots to hunt. 
I am obviously going to be using the Arduino as a interface.  Originally I was going to use a off the shelve camera.  However I was just made aware of this (http://www.sparkfun.com/products/9334).  It is a LinkSprite JPEG Color Camera TTL Interface, that apparently you can send a capture command to to capture video or JPED High Definition photos (I would really like to know what their definition of "High Definition" is btw). 
So the new plan is this:  Use the Arduino with a PIR sensor to send the capture command to the LinkSprite Camera Interface and then store it on a SD shield for the Arduino such as "Arduino SD Card Shield Module Memory Read/Write reader" (http://www.ebay.com/itm/Arduino-SD-Card-Shield-Module-Memory-Read-Write-reader-/150632479517?pt=LH_DefaultDomain_0&hash=item2312653b1d).
But wait, there's more.
I would like to be able to wireless-ly send these photo files to a very nearby computer.  Could I do this using Xbee or a wifi shield?  If so is there a tutorial someone can point me to for this process.  As I seem to only be able to find tutorials for sending signals, not files,  via xbee and wifi protocol to computers and other xbee units. 
Any help would be greatly appreciated.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 634
Posts: 34519
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Many times people ask about this and I have yet to see anyone compleat it. Quite simply the arduino is too slow and has too little memory to be effective at doing this. Likewise file transfer through an Xbee is going to be slow.
Sorry.
Logged

Offline Offline
Edison Member
*
Karma: 8
Posts: 1341
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm doing it with Seedstudio's JPG camera.  The files can be as small as 10K which takes about a second to send.  The camera does the compression for you.  In the end our projects are the same!  So let's stay in touch.

The Bushnell Trophycam is hard to beat.  It only takes 2ma power, so batteries last for months.  The PIR sensor is very sensitive, enough to trigger on a mouse 20m away sometimes.  Only the biggest wind storm caused a false trigger.  Bugs will trigger it if you want!  The pictures aren't bad day or night.  Video not so good.  I've been trying to trigger on beavers while they're in the water.  Since they are icy cold it'd difficult, but it does work!  Even with just their head sticking out.

Another alternative is the USB Host PTP library.  You can send pictures from a real camera.

@Mike, I will finish this and post the results!
Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I've got a JPEG serial camera from Adafruit that's great fun to play round with. Save data to an SD card, stream it back over an ethernet port. Its last task was a webcam which also took a week-long timelapse (a new image every thirty seconds) from my front window, while right now I've made it part of an utterly ludicrous potato battery monitor.

It takes twenty seconds or so to save an image at maximum quality (the camera running at 38400bps), and the Arduino has no idea what the pixels actually are, but it's a really handy addition. Just accept that you won't be approaching anywhere near remote video with such a thing, and without some clever programming things will be very stop-start while saving images.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've got a JPEG serial camera from Adafruit that's great fun to play round with. Save data to an SD card, stream it back over an ethernet port. Its last task was a webcam which also took a week-long timelapse (a new image every thirty seconds) from my front window, while right now I've made it part of an utterly ludicrous potato battery monitor.

It takes twenty seconds or so to save an image at maximum quality (the camera running at 38400bps), and the Arduino has no idea what the pixels actually are, but it's a really handy addition. Just accept that you won't be approaching anywhere near remote video with such a thing, and without some clever programming things will be very stop-start while saving images.

How did you manage to save the JPEG to the SD?  I think I understand how to send and receive the data between Arduinos via XBees, but haven't been able to find anything as far as saving it as a readable JPEG (more specifically, for viewing on a digital picture frame).  All the tips I've found point to saving binary data in a binary file with a .txt extension, which needs to be manually converted to .jpg in order to actually view it.
Logged

Offline Offline
Edison Member
*
Karma: 5
Posts: 1730
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I haven't done it but I imagine that if you send the binary data of picture.jpg on the local sd card to a copy elsewhere also called picture.jpg it would work fine, you just need to have the arduino send the data byte by byte maybe to another arduino to reconstructed it byte by byte
Logged

Texas, land of the free, home of the stupid
Offline Offline
Sr. Member
****
Karma: 5
Posts: 268
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yeah, right, everybody asks and they always say cant be done......
Check out this link and see if it gives you any ideas:  "http://www.riccibitti.com/witnesscam/entry/witnesscam.htm"
good luck with your project.  Don't give up.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26485
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
they always say it cant be done
I don't think anyone has ever said you can't store a JPEG image from a camera to an SD card.
Slow, yes, but not infeasible.
What is usually said is that you can't do anything with the JPEG image on the Arduino, apart from moving it around.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 98
Posts: 4813
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
they always say it cant be done
I don't think anyone has ever said you can't store a JPEG image from a camera to an SD card.
Slow, yes, but not infeasible.
What is usually said is that you can't do anything with the JPEG image on the Arduino, apart from moving it around.

Given enough time (a really BIG caveat there) you can process an image stored on an SD card or other external storage with an Arduino. Question is why, when there are so many other better solutions.

Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Texas, land of the free, home of the stupid
Offline Offline
Sr. Member
****
Karma: 5
Posts: 268
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

AWOL, My bad, but it really bothers me to hear somebody's idea shot down, when similar ones can and have been done.

Smoke, I agree about image processing, but the OP's about capture/store/xmit, which is well within the limitations of the Amtel uC's (especially as used in the UNO).

psi3000, I will be really interested in hearing how your project goes.  Also interrested in whether you go with the Xbee or something like the NRF2401 variants.  Again, good luck!
Logged

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 98
Posts: 4813
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think that the OP has both feet and expectations on the ground and I don't see him flapping his arms....
Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 634
Posts: 34519
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
but it really bothers me to hear somebody's idea shot down, when similar ones can and have been done.

I assume that this is aimed at me. So would you rather I took my 40 years of doing projects an knowing what can or can't be done on a processor of this power and capability an enthusiastically gush at a beginner trying to do something that he clearly doesn't understand. If he did understand it fully then he would not be asking if it could be done.

This project is one that can be done (I never said it couldn't) but the restrictions in frame rate and speed of transfer make it not worth while doing. However, I am aware that many people have very low expectations of projects and others redefine success to the meager performance that can be achieved.
All projects are a trade off between many factors and in my view this project does not have many things to trade and the result is going to be poor.

I deplore this modern "hey go for it" approach to beginners for things clearly beyond them because ultimately they will fail get frustrated and go and take up knitting or something else. Much better I feel to give people an expectation of what can be achieved and what effort is involved.

But then I suppose 123Splat you are as they say now "differently correct"
Logged

Offline Offline
Edison Member
*
Karma: 8
Posts: 1341
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It CAN be done with XBee instead of an SD card.  The SD card is even easier, with a few lines of code.  It takes a few seconds to send a compressed 640x480 image at 9KB/s.  These results can be achieved with an Arduino and ZERO coding.  The hardware comes with a PC application that displays the image.  Just connect the modules and go.  The Uno is acting as a power supply with no sketch running.  The JPG camera talks directly to XBee.  This proves the concept is possible.  Then you can write the code to customize it for your application.

Frame rate?  That's for video.  1 "fps" is plenty fast for still images.  Low expectations?  We expect to see an image.  Yes it's 640x480.  Our expectations of the quality are realistic.  It's amazing to see whats happening 300m away without wires.  It can also detect motion or visual changes.  It's amazingly simple code if there is no movement normally.  It can ignore some leaves blowing in the distance as well as changing shadows due to the suns movement.  In fact it's only 1 line in my sketch!
« Last Edit: December 28, 2011, 01:27:58 pm by sbright33 » Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9681
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If the issue is sending video over a serial connection, that is old stuff. I use to run MS Netmeeting and CuSeeme over a 33.6 dialup connecion.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Edison Member
*
Karma: 8
Posts: 1341
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

XBee is about 4x that speed.  What hardware can we use to compress the video and send it serially to XBee?
Small in size?  Low power?
Would be cool to see 10fps!
Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Pages: [1] 2 3   Go Up
Jump to: