|
-
Jun 24th, 2011, 09:00 PM
#1
Thread Starter
Addicted Member
Capture Images From 2 deffirent webcams
Hi There,
i just want ask you guys how to capture images from 2 different webcams.is there any dll out there that i can use?..please post some link if you have any idea on this and i really appreciate it...
thank you
glen.a
-
Jun 25th, 2011, 09:58 PM
#2
Thread Starter
Addicted Member
Re: Capture Images From 2 deffirent webcams
Hi Everyone,
i found this thread http://www.vbforums.com/showthread.p...22#post4029722, but it only start 1 camera..please guide on how to modify this code to start 2 camera..
thank you
-
Jun 25th, 2011, 10:04 PM
#3
Banned
Re: Capture Images From 2 deffirent webcams
maybe it can be done with 2 videoLab input controls
-
Jun 25th, 2011, 10:25 PM
#4
Thread Starter
Addicted Member
Re: Capture Images From 2 deffirent webcams
hi moti,
what do you mean by that 2 videoLab input controls.can you guide me on how to this?..
thanks
-
Jun 26th, 2011, 01:12 PM
#5
Banned
Re: Capture Images From 2 deffirent webcams
4.1 install your usb webcams drivers from its cd
4.2 download and install .net (framework) 2.0
download and install videoLab and its pdf manual from:
mitov dot com
4.3 follow the manual till you have the image capture control on your vb.net toolbox
4.4 connect usb webcams
you will then add 2 video in (or dx something) controls to thee form and from theire little arrow set to the respective webcam
, add 2 image capture, finally set the video in's output pin property to the respective image capture conrol
. the 2 image capture control's input pin property should by now be the respective video in control
run the form application
Last edited by moti barski; Jun 26th, 2011 at 01:17 PM.
-
Jun 26th, 2011, 08:29 PM
#6
Thread Starter
Addicted Member
Re: Capture Images From 2 deffirent webcams
thanks moti for this guide,
this is a good start..i don't know if it can grab images from the video..like,i want to take a picture.
thanks very much!
-
Jun 27th, 2011, 12:35 AM
#7
Thread Starter
Addicted Member
Re: Capture Images From 2 deffirent webcams
Hi moti,
currently,i am using videolab as for your suggestion.but there is one problem i cannot saved the image i capture..do you have any idea on this..
thank you
glen.a
-
Jun 27th, 2011, 01:22 PM
#8
Banned
Re: Capture Images From 2 deffirent webcams
 Originally Posted by [gja]
Hi moti,
currently,i am using videolab as for your suggestion.but there is one problem i cannot saved the image i capture..do you have any idea on this..
thank you
glen.a
yeah, I know what you are talking about.
if the video capture control has a get image property and someone knows how to use it please share.
at any rate I have a crude temporary solution for you :
capture the screen image as a bitmap, then get the bitmap rectangle region containing the images. remember the coordinates of the video capture controls are in theire respective propertise
41 screen capture
Code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim screenBounds = Screen.PrimaryScreen.Bounds
Dim screenShot As New Bitmap(screenBounds.Width, screenBounds.Height)
Using g = Graphics.FromImage(screenShot)
g.CopyFromScreen(screenBounds.Location, Point.Empty, screenBounds.Size)
End Using
PictureBox1.Image = screenShot
'Dim filePath = IO.Path.Combine(My.Computer.FileSystem.SpecialDirectories.MyPictures, "ScreenShot.bmp")
'screenShot.Save(filePath, Imaging.ImageFormat.Bmp)
End Sub
End Class
-
Jun 27th, 2011, 07:58 PM
#9
Thread Starter
Addicted Member
Re: Capture Images From 2 deffirent webcams
hi moti,
i was thinking also this solution before but if this is pointing to a screen and not to my form which reside the video capture control..what if a user will move the form so it will not capture the exact location of the video..
the latest version of videolab have a demo projects and has a CaptureBitmap project there located at your drive C: where you install the videolab, but i was written in c# and i am not that familiar with c#..can you look at it for me.please..
the example plays an .avi video and it capture the video by frame and convert it to bitmap and passed to a picturebox...
this is the code from the example.this will loop until the .avi video finish..
Code:
private void genericFilter1_ProcessData(object Sender, Mitov.VideoLab.VideoProcessDataEventArgs Args)
{
// Capture Image.
System.Drawing.Bitmap ABitmap = Args.InBuffer.ToBitmap();
// Draw Frame No.
System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(ABitmap);
System.Drawing.SolidBrush ABrush = new SolidBrush(Color.White);
g.DrawString(m_FrameNo.ToString(), Font, ABrush, 0, 0);
++m_FrameNo;
// Show the bitmap.
pictureBox1.Image = ABitmap;
}
-
Jun 27th, 2011, 09:07 PM
#10
Banned
Re: Capture Images From 2 deffirent webcams
on the fly this looks like a genericFilter1 and perhaps a video in (or dx in) controls were used.
this is the code in vb.net
Code:
Private Sub genericFilter1_ProcessData(Sender As Object, Args As Mitov.VideoLab.VideoProcessDataEventArgs)
' Capture Image.
Dim ABitmap As System.Drawing.Bitmap = Args.InBuffer.ToBitmap()
' Draw Frame No.
Dim g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(ABitmap)
Dim ABrush As System.Drawing.SolidBrush = New SolidBrush(Color.White)
g.DrawString(m_FrameNo.ToString(), Font, ABrush, 0, 0)
m_FrameNo += 1
' Show the bitmap.
pictureBox1.Image = ABitmap
End Sub
-
Jun 29th, 2011, 01:19 AM
#11
Thread Starter
Addicted Member
Re: Capture Images From 2 deffirent webcams
hello moti,
im using DSCapture component,i had encountered problem when i am closing the form and re-open it again..it will not capture a video anymore..i have 2 windows form...FormMain and FormCamera,in FormMain i placed a button there..if i clicked that button FormCamera Form will show up..In FormCamera Form from there, i placed the DSCapture component...i got problem when i re-open the FormCamera it will not capture video anymore..i think this is my last question to you moti and im good to go..
thank you.
-
Jun 29th, 2011, 02:24 PM
#12
Banned
Re: Capture Images From 2 deffirent webcams
 Originally Posted by [gja]
hello moti,
im using DSCapture component,i had encountered problem when i am closing the form and re-open it again..it will not capture a video anymore..i have 2 windows form...FormMain and FormCamera,in FormMain i placed a button there..if i clicked that button FormCamera Form will show up..In FormCamera Form from there, i placed the DSCapture component...i got problem when i re-open the FormCamera it will not capture video anymore..i think this is my last question to you moti and im good to go..
thank you.
you can ask me as many questions as you want, I think it's amazing how you've tackled this project.
what controls are you using ? what code are you using to get the image ?
also first try doing it with only one form, tell me if a glitch fires up if yes maybe the controls need to be disposed or something.
-
Jun 29th, 2011, 07:30 PM
#13
Thread Starter
Addicted Member
Re: Capture Images From 2 deffirent webcams
Hello moti,
I'm using the DSCapture Control..there was no code moti,i just drop the DSCapture control and DSImageDisplay on the form and set up there properties and run the application...there is no error when im using only one form..error occur when im using 2 forms.like what i have explained in my previous post..the camera will not start anymore if i re-open the FormCamera Form..i checked this using this code.
If DSCapture1.Opened = True Then 'it returns False this time
End If
Please help...
glen.a
Last edited by [gja]; Jun 29th, 2011 at 07:59 PM.
-
Jun 29th, 2011, 08:40 PM
#14
Banned
Re: Capture Images From 2 deffirent webcams
what about the genericFilter1 and the code in post #10 did you try it , in post #13 I don't see how you get it saved as an image without any code.
as for thee question :
maybe if you change the DSCapture1 open property or other property after switching forms it would help,
as a plan B you could put both controls on the same form and change theire respective visibility property
with a button event for example.
-
Jun 29th, 2011, 09:03 PM
#15
Thread Starter
Addicted Member
Re: Capture Images From 2 deffirent webcams
hi moti,
I'm not anymore using genericFilter,i just use your idea to capture image using screenshot but this time it point only to my Form..
can i ask you a favor moti,if you can try this in your pc...Create 2 windows forms, FormMain and FormCamera ,in FormMain put 1 button.and then if i clicked that button, FormCamera should show up..then place your DSCapture control and DSImageDisplay in FormCamera Form and set up there properties..
To test this:
1.Set FormMain as your startup form
2.Click the button in your FormMain,so your FormCamera will show and of course it will start the video.
3.close the FormCamera Form
4.Clicked again the button in the FormMain,and it will show the FormCamera again,but this time your webcam will not start anymore...this is my problem..
im sure i had already follow all what you have advised but still i dont get it work...
thank you very much for your help...
glen.a
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|