0

hi all , i search for motion detector documents and code source with systemC programming language, any help pls

Edited by yosri_1: study project

3
Contributors
40
Replies
134
Views
6 Months
Discussion Span
Last Post by yosri_1
Featured Replies
  • Can you be a little more specific? Read More

  • Why do you insist on writing this in VBA? Why not vb.net which has more capabilities and less overhead? Read More

  • PS. I think this is a shame since all the fun stuff you want to do is not in the capture step. The capture step is so well discussed (I supplied a google) that you should have had that working in a hour or two. Here we are and you … Read More

0

This is a well worn research area. I'll share a cheap motion detection system we used in a low budget system. NO SOURCE CODE EVER. Do not ask.

The basic method is to take a frame or bitmap and put it through a Sobel filter (what this is and code is on the web.)
Now since we had only a pitiful 16MHz CPU our image only had a few zones so in simple words we had a count of the edges in each zone and if the count changed by more than some percent or number we called that movement.

0

i want to deveelopp a motion detector that composed of two program,
when i activate VBA code, it command the webcam (manycam) to get video and it takes photo with defined frequencyand store them on a folder or queue ato be processed in visual studio solution(systemc) to compare each two successive frame , if there is no difference systemC (visual studio) store the process time in text file , if there is differnce systemc (Vs) make alarm and store store time process of execution system C code in text file, thank you for help me really i dont have enough time for posting my master thesis and i dont accomplish my application yet

0

thank you dr Jim and doctor reprofitt, i you hellp me i will grateful

0

Sounds like you have a plan. Now go write some code to do it step by step. Many blow up on launch. That is, webcam capture to the bitmap we need to run through a Sobel filter. Have you got step 1 (image capture) done yet?

Remember that this is your app to write. I don't mind chatting how we did it on a very very small system.

0

dr reprofitt not yet, i start reading to understand how motion detector system function, also time is running fast and i had to prepare application and report max on june.
dr Jim as you know im obliged to deal with integrated VBA, the time before i start to try example of simple adder to try VBA and Vs automation, now i had to developp the real system

0

@yosri_1 I guess as a challenge you could try this in VBA. To me that's a non-starter in so many ways.

Good luck on your apps and reports.

0
                good evening , hi all members, i have this code and i want to modify it wshing that when debug it my webcam directy capture  images at defined frequence and store this image in folder any help plz 
 Imports AForge
    Imports AForge.Video

Imports AForge.Video.DirectShow
Imports System.IO

  Public Class Form1
 Dim CAMERA As VideoCaptureDevice
 Dim bmp As Bitmap
 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
               Dim cameras As VideoCaptureDeviceForm = New VideoCaptureDeviceForm
If cameras.ShowDialog = System.Windows.Forms.DialogResult.OK Then
    CAMERA = cameras.VideoDevice
    AddHandler CAMERA.NewFrame, New NewFrameEventHandler(AddressOf Captured)
    CAMERA.Start()
End If
 End Sub
  Private Sub Captured(Sender As Object, EventArgs As NewFrameEventArgs)
   bmp = DirectCast(EventArgs.Frame.Clone(), Bitmap)
PictureBox1.Image = DirectCast(EventArgs.Frame.Clone(), Bitmap)
 End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
PictureBox2.Image = PictureBox1.Image
 End Sub

' Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
'f SaveFileDialog1.ShowDialog = System.Windows.Forms.DialogResult.OK Then

'End If
' End Sub
End Class
Sans_titre.png

0
   i need help on VB.NET i want modify this function to start autmatically without button click 
   Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
           Dim cameras As VideoCaptureDeviceForm = New VideoCaptureDeviceForm
   If cameras.ShowDialog = System.Windows.Forms.DialogResult.OK Then
   CAMERA = cameras.VideoDevice
   AddHandler CAMERA.NewFrame, New NewFrameEventHandler(AddressOf Captured)
   CAMERA.Start()
   End If
   End Sub
0

Here's a basic item you learn as you write more VB code. If you want code that runs when the app or form loads, use form.load()'s handler.

0

thank you dr reprofitt :) it still the problem saving image at defined frequency pls

0

I don't see enough code so this is at a high level. Now that you know to put the code you want to run in form.load, put a timer on the form and in form.load, set the timer duration and enable it. Now when the timer fires, you have code to do what you want at that frequency.

0
        thank you deeply dr, this is my attempt dr can you help me more :  iwant when lunch the app it start the webcam and at each 2 seconds it captures a photo and save it 

       Imports AForge
       Imports AForge.Video
      Imports AForge.Video.DirectShow
     Imports System.IO

     Public Class Form1
Dim CAMERA As VideoCaptureDevice
Dim bmp As Bitmap
Dim yosri1 As Boolean = True
Private Counter As Integer = 0

Private Sub Captured(sender As Object, eventArgs As NewFrameEventArgs)
    bmp = DirectCast(eventArgs.Frame.Clone(), Bitmap)
    PictureBox1.Image = DirectCast(eventArgs.Frame.Clone(), Bitmap)
End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button2.Click
    SaveFileDialog1.DefaultExt = ".jpg"
    If SaveFileDialog1.ShowDialog = System.Windows.Forms.DialogResult.OK Then
        PictureBox2.Image.Save(SaveFileDialog1.FileName, Imaging.ImageFormat.Jpeg)
    End If
End Sub

Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
    CAMERA.Stop()
End Sub

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
    Captured()
    PictureBox2.Image = PictureBox1.Image

End Sub

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Dim cameras As VideoCaptureDeviceForm = New VideoCaptureDeviceForm
    If cameras.ShowDialog = System.Windows.Forms.DialogResult.OK Then
        CAMERA = cameras.VideoDevice
        AddHandler CAMERA.NewFrame, New NewFrameEventHandler(AddressOf Captured)
        CAMERA.Start()
    End If
    ' Label1.Text = Counter.ToString
    Me.Timer1.Interval = TimeSpan.FromSeconds(10).TotalMilliseconds
    Me.Timer1.Start()
     End Sub
   End Class
0

You tell me what you want, I tell you to place the code to run in the form's load event handler and there's no handler in your code dump.

I think you need to find and do more tutorials on the language you are using.

0

you are right dr im not familiar with VB.NET this is the first time i used it i dont have enough time to learn new programming language i have a lot of thing that i should accomplish in my project beacause my thesis is on july, but im trying,
Sans_titre.png12.png
dr i think that i should call captured function in timer_click in order to take photo every 2 sec, but i dont know how to call method with arguments can you help pls

0

Remember this is your thesis. You'll have to detail how it works so that means you would have to learn what tools you are using.

Big hint? Learn about the form.load handler. Google that!

0

i know dr but i ask for help after googling those new funtions, my problem is how can i call captunring and saving capture and save method from Timer_click method to be executed. as you show i dont have problem with Form_load
dfg.png
i open the webcam as well as enabling the timer, but when i call captured function within Timer_click method
12.png
Sans_titre.png
i dont no how to manipulating arguments, if you can help me and sorry for the disturbance.

0

Why call them at all?

Put the code you want to run in the timer handler.

As to calling, there are tutorials on the web today so I don't duplicate that here.

0

before calling captured , i tried to put the code of this finction in timer's handler but it the error is more complicated problem of event i thought ,

ghvj.png
thats why i think to call the function

0

Back to Aforge to check doucuments on how to call DirectCast. You didn't define EventArgs so just incomplete code at this point.

Edited by rproffitt: Clarifying

0

eventargs derives from class.system.
i replaced Directcast by CType it displays that frame is not member for eventargs

0

Start with the code where Directcast works. Look above those lines to see where eventargs is defined or is passed to the call.

Remember you are using Aforge's addons so they get to document how to use.

0

dr i tried this modification referring to Aforge documentation but i reamins erronned
qdf.png

0

Not what I asked you to try. I said start with a working example so you can see where the Aforge stuff is used.
In your last reply you seem to have repeated the use of DirectCast without setting up to use their stuff.

I think we made minor progress with changes to using Form.Load to autorun your code and the timer to do what you want in the timer loop.

But to use a library like Aforge, that's where you get them to tell you more if they didn't document the library's use.

0

i really thank you deeply dr for the help :) im searching more for a solution and if you have any suggestion about new method or thing like this do no hesitate to help me :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.