nickneubrand
Posts: 29
Joined: Fri Apr 26, 2013 4:54 am

Webcam to TFT screen

Fri Apr 26, 2013 5:01 am

Hi, Im looking into buying a raspberry pi for a project that I wanted to try out, but I'm not sure if it is possible because I have yet to see anyone post on it.

Project:
I want to hook up a USB camera to the Pi and then output a stream of video, (no need to record) to a TFT screen that is directly attached to the Pi as well. No Wifi available so I don't want to go that route. So overall it would be like a digital camera without the ability to take pictures or record, just used to view.

Questions:
1) Is it possible and how complicated would this be?
2) What kind of programming language should this be done in?
3) At a later point how hard would it be to take an image and overlay that on top of the webcam stream?

ghans
Posts: 7878
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Webcam to TFT screen

Fri Apr 26, 2013 9:51 am

I'd wait for the official camera module.
If you use a HDMI display or one with DVI-D input it will be
very easy and expensive.
If you use anything else it will be extremely complicated.
(and "cheap" - your time is , of course , worthless :roll: )

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

nickneubrand
Posts: 29
Joined: Fri Apr 26, 2013 4:54 am

Re: Webcam to TFT screen

Sat Apr 27, 2013 4:35 am

Alright sounds good, do you know of any mini HDMI capable screens? I was looking for something roughly 3 inches at widest. Thats why was thinking the TFT screens used for reverse cameras on cars, they are small and cheap. If i didn't use HDMI would it be just as easy to send the signal though analog to a different screen?

ghans
Posts: 7878
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Webcam to TFT screen

Sat Apr 27, 2013 10:17 am

Car reverse camera screens work well - as long you are happy
with the resolution and it does indeed have a composite input.


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Webcam to TFT screen

Mon Apr 29, 2013 11:45 am

nickneubrand wrote:Alright sounds good, do you know of any mini HDMI capable screens? I was looking for something roughly 3 inches at widest. Thats why was thinking the TFT screens used for reverse cameras on cars, they are small and cheap. If i didn't use HDMI would it be just as easy to send the signal though analog to a different screen?
Hi,
there is the option to configure an attached TFT screen as an additoinal framebuffer, so does not use the hdmi port. This is screen is a bit smaller than you've specified, but the priciple can use the same (for compatable TFT screens) :
http://www.raspberrypi.org/phpBB3/viewt ... 59&t=40674

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

nickneubrand
Posts: 29
Joined: Fri Apr 26, 2013 4:54 am

Re: Webcam to TFT screen

Mon Apr 29, 2013 10:55 pm

Hi,
there is the option to configure an attached TFT screen as an additoinal framebuffer, so does not use the hdmi port. This is screen is a bit smaller than you've specified, but the priciple can use the same (for compatable TFT screens) :
http://www.raspberrypi.org/phpBB3/viewt ... 59&t=40674

Texy[/quote]

Wow thank you so much, this is actually closer to what I had in mind the 1.8 would be a perfect size for what I'm doing, I just hadn't seen anyone using one with real images, all they used were files text.

"screen as an additoinal framebuffer" not sure what that means exactly, but overall how hard would be to replicate what was shown in that video with python. I know absolutely nothing about kernel, to be honest I don't even know what it really is.

williamrdg
Posts: 1
Joined: Tue Apr 30, 2013 6:21 am

Re: Webcam to TFT screen

Tue Apr 30, 2013 6:23 am

Where you able to accomplish the project connecting the the screen and camera to the pi and get real time video?

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Webcam to TFT screen

Tue Apr 30, 2013 6:38 am

nickneubrand wrote:Hi,
there is the option to configure an attached TFT screen as an additoinal framebuffer, so does not use the hdmi port. This is screen is a bit smaller than you've specified, but the priciple can use the same (for compatable TFT screens) :
http://www.raspberrypi.org/phpBB3/viewt ... 59&t=40674

Texy
Wow thank you so much, this is actually closer to what I had in mind the 1.8 would be a perfect size for what I'm doing, I just hadn't seen anyone using one with real images, all they used were files text.

"screen as an additoinal framebuffer" not sure what that means exactly, but overall how hard would be to replicate what was shown in that video with python. I know absolutely nothing about kernel, to be honest I don't even know what it really is.[/quote]


Actually python is used to control most of it, and also calls mplayer to play the video. See this thread :
http://www.raspberrypi.org/phpBB3/viewt ... 64&t=40677

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

nickneubrand
Posts: 29
Joined: Fri Apr 26, 2013 4:54 am

Re: Webcam to TFT screen

Tue Apr 30, 2013 7:05 am

Thank you so much this is super helpful.

Thanks again.

nickneubrand
Posts: 29
Joined: Fri Apr 26, 2013 4:54 am

Re: Webcam to TFT screen

Fri May 03, 2013 7:29 am

Hey, so I got my pi and wrote this code in python, using pygame:

____________________________________________________________
import pygame,sys
import pygame.camera
from pygame.locals import *

pygame.init()
pygame.camera.init()

screen = pygame.display.set_mode([640,480])

cam = pygame.camera.Camera("/dev/video0", (640,480))
cam.start()

while 1:
image = cam.get_image()
screen.blit(image,(0,0))
pygame.display.update()

for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()
___________________________________________________________________

It works but the image stream is glitchy at best and misses frames, do you have any suggestions on how to fix this? or should I just scrap the webcam and wait till the camera accessory for the pi comes out?

Return to “Other projects”