Page 2 of 3 FirstFirst 123 LastLast
Results 41 to 80 of 93

Thread: [Vb.Net] WebCam Class (ICam)

  1. #41

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: [Vb.Net] WebCam Class (ICam)

    Quote Originally Posted by ^Clark^ View Post
    very nice class...

    however i think this will be great if there is a record functionality.
    Watch this space.

  2. #42
    New Member
    Join Date
    Apr 2009
    Posts
    3

    Re: [Vb.Net] WebCam Class (ICam)

    ok ill watch for it... you're fast to reply huh...

  3. #43

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: [Vb.Net] WebCam Class (ICam)

    Email Notifications FTW

    I'm working on a C# Class for this now, since my skill base has swifted away from VB. However the DLL release will be find for using with VB

  4. #44
    New Member
    Join Date
    Apr 2009
    Posts
    3

    Thumbs up Re: [Vb.Net] WebCam Class (ICam)

    wow that will be great... now i see you shifted to c#

  5. #45
    New Member
    Join Date
    Apr 2009
    Posts
    9

    hello...i have a dream for my webcam!

    Hi everyone.. finally i founded someone that is working on my problem..
    unfortunely i'm not a good developer and i'm trying to solve my big trouble..
    I need to create something "fun" for the kids in an hospitality centre.. they need to register themself (i created a small VB6 application with Ms Access) but we need also a picture of them. I can create a button that call an external exe (created with modern system ...) and this program create a fun picture (with png background, like Happy Birthday, Baloons..etc etc)
    For this reason i'm trying to help this friend of mine with the creation of this simple software..
    if anyone can help me, i will be appreciate very much.. it's for a good thing.
    I downloaded the EDID software.. and i'm able to see webcam in the form, but i cannot customize the effects..
    i attached here with the post the picture of my "desire"..
    thank you very much everybody!
    Attached Images Attached Images  

  6. #46
    New Member
    Join Date
    Apr 2009
    Posts
    9

    Re: [Vb.Net] WebCam Class (ICam)

    nobody can help me with any advices?

  7. #47

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: [Vb.Net] WebCam Class (ICam)

    I'd post that question in the MainForum since its not really to do with the webcam feed.

    As for the re-write I'm working on, I'm likly going to drop it. The recording of video is effectivly useless without compression (1 sec = 1Meg). The support for adjusting FPS is not very good.

    Suppose I could re-write it using DirectShow but documentation is limited to C++

  8. #48
    Member
    Join Date
    Apr 2009
    Posts
    37

    Re: [Vb.Net] WebCam Class (ICam)

    hi pino i have used your code the WebCamVewer and i have a problem... it starts me camera but all i see is black, even the snapshots are black! i dont know what to do, pls help..

  9. #49

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: [Vb.Net] WebCam Class (ICam)

    Quote Originally Posted by tripes View Post
    hi pino i have used your code the WebCamVewer and i have a problem... it starts me camera but all i see is black, even the snapshots are black! i dont know what to do, pls help..
    Which camera do you have?

  10. #50
    Member
    Join Date
    Apr 2009
    Posts
    37

    Re: [Vb.Net] WebCam Class (ICam)

    i dont remember the model of the camera, but is a built-on Webcam on my hp pavilion dv9000 labtop...

  11. #51

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: [Vb.Net] WebCam Class (ICam)

    Quote Originally Posted by tripes View Post
    i dont remember the model of the camera, but is a built-on Webcam on my hp pavilion dv9000 labtop...
    Can any other webcam applications use your camera?

  12. #52
    Member
    Join Date
    Apr 2009
    Posts
    37

    Re: [Vb.Net] WebCam Class (ICam)

    if i understand well you are asking me if another application is using the camera the same time... there is no other app that uses the webcam that time

  13. #53

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: [Vb.Net] WebCam Class (ICam)

    Have you ever used your webcam with any other application?

  14. #54
    Member
    Join Date
    Apr 2009
    Posts
    37

    Re: [Vb.Net] WebCam Class (ICam)

    yes i have with skype and msn

  15. #55
    New Member
    Join Date
    Apr 2009
    Posts
    1

    Re: [Vb.Net] WebCam Class (ICam)

    Exactly same problem as tripes...and yup, I've used my webcam before, in fact, I use it daily.

    Hope you can help!

  16. #56
    Member
    Join Date
    Apr 2009
    Posts
    37

    Re: [Vb.Net] WebCam Class (ICam)

    pino i forgot to tell you that i used my cam with the app "Cyberlink YouCam" as with msn and skype...

  17. #57
    New Member
    Join Date
    Apr 2009
    Posts
    1

    Re: [Vb.Net] WebCam Class (ICam)

    i have the same problem!!! please help if you can

  18. #58
    New Member
    Join Date
    May 2009
    Posts
    1

    Re: [Vb.Net] WebCam Class (ICam)

    I found the code very very usefull. However I have almost the same problem as the other guys, my ViewFinder is black, BUT the capture works fine. I'm using the built in camera of an HP pavilion dv2000 (Manufacturer: Microsoft)
    Any idea??

  19. #59
    New Member
    Join Date
    May 2009
    Posts
    2

    Re: [Vb.Net] WebCam Class (ICam)

    Here is the icam class used in a motion detector.

    I was too lazy to rename some of the labels and such but its not that bad i promise.

    all the main guts of the program are commented and named.
    I just left the unimportant stuff default.


    Attachment 71112

  20. #60

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: [Vb.Net] WebCam Class (ICam)

    Invalid Link

  21. #61
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    Re: [Vb.Net] WebCam Class (ICam)

    I want to make a note regarding "motion detection".

    Comparing 2 images pixel by pixel will not guarantee to detect a motion. Also changing light etc will cause a detection. Its better to divide the image in several areas. In each area the avarage is taken. Then the ratios between the areas can be used as detection. Averaging of several areas can be time consuming. However certain algoritms like "integral image" can be used and are fast.

  22. #62
    New Member
    Join Date
    May 2009
    Posts
    2

    Re: [Vb.Net] WebCam Class (ICam)

    namrekka

    thank you for the input. I didn't think to go about it in such a way but the more i think about it the more that makes sense. I've already started working on it. Thanks

  23. #63
    Lively Member
    Join Date
    Jul 2009
    Posts
    78

    Re: [Vb.Net] WebCam Class (ICam)

    Hey Pino that`s a great code!

    I was wondering if you could help me a little bit with your class!

    I don`t understand the following:

    1) these are used inside the copyFrame function what are they exactly?

    Dim HDC1 As IntPtr = srcPic.GetHdc
    Dim HDC2 As IntPtr = srcMem.GetHdc

    BitBlt(HDC2, 0, 0, CInt(rect.Width), _
    CInt(rect.Height), HDC1, CInt(rect.X), CInt(rect.Y), 13369376)

    copyFrame = CType(srcBmp.Clone(), Bitmap)

    srcPic.ReleaseHdc(HDC1)
    srcMem.ReleaseHdc(HDC2)
    srcPic.Dispose()
    srcMem.Dispose()

    2) and this bitmapdirect class what does it do exactly?

    Public Class BitmapDirect



    i`m trying to implement your code for a motion detection one!

    Thanks in advance!

  24. #64
    New Member
    Join Date
    Nov 2009
    Posts
    1

    Re: [Vb.Net] WebCam Class (ICam)

    Hi

    Do everyone know a possible way to catch de button press event form the button of my webcam? My app should recognize when someone presses the button of my webcam.

    I'm happy about every information that solves my problem

  25. #65

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: [Vb.Net] WebCam Class (ICam)

    Quote Originally Posted by red00dragon View Post
    Hi

    Do everyone know a possible way to catch de button press event form the button of my webcam? My app should recognize when someone presses the button of my webcam.

    I'm happy about every information that solves my problem
    Using the method above, i dont think is possible. You will need to interact directly with the camera and to do that you will need to use the driver provided.

    Pino

  26. #66
    New Member
    Join Date
    Dec 2009
    Posts
    1

    Re: [Vb.Net] WebCam Class (ICam)

    This is a great thread.

    I would like to know, do I need one class for each web cam. for example i want to put this on a passworded website, but i need the ability for 6 web cams. Is this possible with the code on here ?

    Thanks.

    Addy

  27. #67
    New Member
    Join Date
    Feb 2010
    Posts
    1

    Re: [Vb.Net] WebCam Class (ICam)

    I have been experimenting with this and find there is a significant problem. The technique used to capture frames from the camera video is actually capturing the current displayed screen image. As such, it captures whatever is displayed on the screen, which includes any other windows that might be on top of the one with the camera image.

    It seemed like a great idea until I started working on motion detection and started seeing unexpected motion when other windows were active.

    It would seem that the only reliable way to capture an image from the camera might be sending the WM_CAP_EDIT_COPY message after all...

    William

  28. #68
    New Member
    Join Date
    Feb 2010
    Posts
    2

    Re: [Vb.Net] WebCam Class (ICam)

    Hello everyone.
    I have downloaded & compiled ICam and have it working on my local machine. Now I am needing to be able to broadcast the video to a website. Can anyone help me in accomplishing this. Also, will this handle audio also?

  29. #69
    Lively Member
    Join Date
    Dec 2005
    Location
    UK
    Posts
    127

    Re: [Vb.Net] WebCam Class (ICam)

    Quote Originally Posted by nightkids31 View Post
    Is there a motion detection function included?..
    this is pretty easy to implement

  30. #70
    Lively Member
    Join Date
    Dec 2005
    Location
    UK
    Posts
    127

    Re: [Vb.Net] WebCam Class (ICam)

    Quote Originally Posted by rdollc View Post
    Hello everyone.
    I have downloaded & compiled ICam and have it working on my local machine. Now I am needing to be able to broadcast the video to a website. Can anyone help me in accomplishing this. Also, will this handle audio also?
    search for http file streaming ;0) dont know how to stream audio but pictures should be pretty straight forward

    and does this control support multiple cameras ?
    Last edited by illskills; Mar 2nd, 2010 at 10:07 PM.

  31. #71
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Re: [Vb.Net] WebCam Class (ICam)

    Motion Detection:

    I wrote some motion detection code to catch the dog dumping in my front garden

    Attached is the source project for this.

    Run it. Click button 1 to start camera.
    The slider adjusts the sensitivity of the motion detection.

    The SecurityCam::GetMotion method is responsible for detecting motion.
    This can be coded to look for specific colors.
    ie. I set it up so it only detected white moving objects, as I knew the dog was whitish and not blue

    Hope this helps.
    #
    Woka
    Attached Files Attached Files

  32. #72
    Lively Member
    Join Date
    Mar 2010
    Posts
    71

    Re: [Vb.Net] WebCam Class (ICam)

    Wokawidget your last source works fine... everything, starts the cam and everything, but don't show any image..

  33. #73
    Lively Member
    Join Date
    Mar 2010
    Posts
    71

    Re: [Vb.Net] WebCam Class (ICam)

    Anyone?

  34. #74

  35. #75
    Lively Member
    Join Date
    Mar 2010
    Posts
    71

    Re: [Vb.Net] WebCam Class (ICam)

    Quote Originally Posted by Wokawidget View Post
    Any errors?
    Works fine on my test pcs.
    Have you got the shutter/cover open on your web cam?

    Woka
    No errors, everything in my cam is ok (because I can open it in whatever other place - including MSN).

    Btw, do you know some code like this for vb6?

  36. #76
    New Member
    Join Date
    May 2010
    Posts
    6

    Re: [Vb.Net] WebCam Class (ICam)

    thx for the code Pino.....it was a great help for me
    btw... I have one problem here.... which is why after I have complied the code...
    the webcam image that I have capture is not at the center meaning I was in front of the webcam already.. and the webcam image should have shown an image of myself in the center rite, but the result is the image of myself is on the right hand side only.........

  37. #77
    Lively Member
    Join Date
    Mar 2010
    Posts
    71

    Re: [Vb.Net] WebCam Class (ICam)

    jack, could you get image from the webcam?

  38. #78
    New Member
    Join Date
    May 2010
    Posts
    6

    Re: [Vb.Net] WebCam Class (ICam)

    Quote Originally Posted by SirPereira View Post
    jack, could you get image from the webcam?

    can....
    actually my problem is the size of the picture box....
    everything is working fine now.....

    but I am having problems using the luxand FaceSDK.....which is so far no one help me........T_T

  39. #79
    New Member
    Join Date
    Nov 2010
    Posts
    1

    Re: [Vb.Net] WebCam Class (ICam)

    Thank you!!

    This usefulness works perfectly.

    But I have a doubt: Since it is possible to conceal the floating picture that goes out " origin of video "?? I need to conceal it. Thank you

  40. #80
    New Member
    Join Date
    Jan 2011
    Posts
    2

    Re: [Vb.Net] WebCam Class (ICam)

    i need help..
    this progrma hung up line "SendMessage(hWnd, WM_CAP_DRIVER_DISCONNECT, CamSource, 0)"

    this my coding,,,

    vb.net Code:
    1. Imports System
    2. Imports System.IO
    3. Imports System.Runtime.InteropServices
    4. Imports Microsoft.Win32
    5.  
    6. Public Class Form1
    7.     Inherits System.Windows.Forms.Form
    8.     Const WM_CAP_START = &H400S
    9.     Const WS_CHILD = &H40000000
    10.     Const WS_VISIBLE = &H10000000
    11.  
    12.     Const WM_CAP_DRIVER_CONNECT = WM_CAP_START + 10
    13.     Const WM_CAP_DRIVER_DISCONNECT = WM_CAP_START + 12
    14.     Const WM_CAP_EDIT_COPY = WM_CAP_START + 30
    15.     Const WM_CAP_SEQUENCE = WM_CAP_START + 62
    16.     Const WM_CAP_FILE_SAVEAS = WM_CAP_START + 23
    17.  
    18.     Const WM_CAP_SET_SCALE = WM_CAP_START + 53
    19.     Const WM_CAP_SET_PREVIEWRATE = WM_CAP_START + 52
    20.     Const WM_CAP_SET_PREVIEW = WM_CAP_START + 50
    21.  
    22.     Const SWP_NOMOVE = &H2S
    23.     Const SWP_NOSIZE = 1
    24.     Const SWP_NOZORDER = &H4S
    25.     Const HWND_BOTTOM = 1
    26.     '--The capGetDriverDescription function retrieves the version
    27.     ' description of the capture driver--
    28.     Declare Function capGetDriverDescriptionA Lib "avicap32.dll" _
    29.        (ByVal wDriverIndex As Short, _
    30.         ByVal lpszName As String, ByVal cbName As Integer, _
    31.         ByVal lpszVer As String, _
    32.         ByVal cbVer As Integer) As Boolean
    33.  
    34.     '--The capCreateCaptureWindow function creates a capture window--
    35.     Declare Function capCreateCaptureWindowA Lib "avicap32.dll" _
    36.        (ByVal lpszWindowName As String, ByVal dwStyle As Integer, _
    37.         ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, _
    38.         ByVal nHeight As Short, ByVal hWnd As Integer, _
    39.         ByVal nID As Integer) As Integer
    40.  
    41.     '--This function sends the specified message to a window or windows--
    42.     Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
    43.        (ByVal hwnd As Integer, ByVal Msg As Integer, _
    44.         ByVal wParam As Integer, _
    45.        <MarshalAs(UnmanagedType.AsAny)> ByVal lParam As Object) As Integer
    46.  
    47.     '--Sets the position of the window relative to the screen buffer--
    48.     Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" _
    49.        (ByVal hwnd As Integer, _
    50.         ByVal hWndInsertAfter As Integer, ByVal x As Integer, _
    51.         ByVal y As Integer, _
    52.         ByVal cx As Integer, ByVal cy As Integer, _
    53.         ByVal wFlags As Integer) As Integer
    54.  
    55.     '--This function destroys the specified window--
    56.     Declare Function DestroyWindow Lib "user32" _
    57.        (ByVal hndw As Integer) As Boolean
    58.  
    59.     '---used to identify the video source---
    60.     Dim CamSource As Long
    61.     '---used as a window handle---
    62.     Dim hWnd As Integer
    63.     Private Sub cameraSource()
    64.         Dim DriverName As String = Space(80)
    65.         Dim DriverVersion As String = Space(80)
    66.         For i As Integer = 0 To 9
    67.             If capGetDriverDescriptionA(i, DriverName, 80, _
    68.                DriverVersion, 80) Then
    69.                 ListBox1.Items.Add(DriverName.Trim)
    70.             End If
    71.         Next
    72.     End Sub
    73.     Private Sub previewCamera(ByVal pbCtrl As PictureBox)
    74.         hWnd = capCreateCaptureWindowA(CamSource, _
    75.         WS_VISIBLE Or WS_CHILD, 0, 0, 0, _
    76.         0, pbCtrl.Handle.ToInt32, 0)
    77.         If SendMessage( _
    78.            hWnd, WM_CAP_DRIVER_CONNECT, _
    79.            CamSource, 0) Then
    80.             '---set the preview scale---
    81.             SendMessage(hWnd, WM_CAP_SET_SCALE, True, 0)
    82.             '---set the preview rate (ms)---
    83.             SendMessage(hWnd, WM_CAP_SET_PREVIEWRATE, 30, 0)
    84.             '---start previewing the image---
    85.             SendMessage(hWnd, WM_CAP_SET_PREVIEW, True, 0)
    86.             '---resize window to fit in PictureBox control---
    87.             SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, _
    88.                pbCtrl.Width, pbCtrl.Height, _
    89.                SWP_NOMOVE Or SWP_NOZORDER)
    90.         Else
    91.             '--error connecting to video source---
    92.             DestroyWindow(hWnd)
    93.         End If
    94.     End Sub
    95.     Private Sub stopPreviewCamera()
    96.         SendMessage(hWnd, WM_CAP_DRIVER_DISCONNECT, CamSource, 0)
    97.         DestroyWindow(hWnd)
    98.     End Sub
    99.  
    100.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    101.         cameraSource()
    102.         Button4.Enabled = False
    103.         Button1.Enabled = False
    104.         Button2.Enabled = False
    105.         Button3.Enabled = False
    106.     End Sub
    107.     Private Sub ListBox1_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.DoubleClick
    108.         Label1.Visible = False
    109.         previewCamera(PictureBox1)
    110.         Button1.Enabled = True
    111.         Button4.Enabled = False
    112.         Button2.Enabled = True
    113.     End Sub
    114.     Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
    115.         CamSource = ListBox1.SelectedIndex
    116.         '---preview the selected video source
    117.     End Sub
    118.     'stop preview
    119.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    120.         stopPreviewCamera()
    121.         Button4.Enabled = True
    122.         Button1.Enabled = False
    123.     End Sub
    124.     ' recording
    125.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    126.         Button3.Enabled = True
    127.         Button2.Enabled = False
    128.         SendMessage(hWnd, WM_CAP_SEQUENCE, 0, 0)
    129.     End Sub
    130.     ' stop recording and ask to save video
    131.     Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
    132.         SendMessage(hWnd, WM_CAP_FILE_SAVEAS, 0, "C:\RecordedVideo.avi")
    133.         Button2.Enabled = True
    134.         Button3.Enabled = False
    135.     End Sub
    136.     ' preview
    137.     Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
    138.         CamSource = ListBox1.SelectedIndex
    139.         previewCamera(PictureBox1)
    140.         Button4.Enabled = False
    141.         Button1.Enabled = True
    142.     End Sub
    143. End Class

    i need solution please help me,,

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width