330
edits
| (2 intermediate revisions by the same user not shown) | |||
| Line 16: | Line 16: | ||
| '''And here is the github link for my full code:''' <https://github.com/ConnorFk/DBL_VisitorsCount> | '''And here is the github link for my full code:''' <https://github.com/ConnorFk/DBL_VisitorsCount> | ||
| <source lang="Java" line start= "17"> | <source lang="Java" line start= "17"> | ||
| Line 28: | Line 29: | ||
| [[File:codeProcessing1.jpg]] | [[File:codeProcessing1.jpg]] | ||
| <source lang="Java" line start= "32"> | |||
| // ================================================== | |||
| // captureEvent() | |||
| // ================================================== | |||
| void captureEvent(Capture cam) | |||
| { | |||
| 	cam.read(); // to start the webcam | |||
| 	newFrame = true; // keep grabbing the new frames | |||
| } | |||
| void draw() | |||
| { | |||
| 	if (newFrame) | |||
| 	{ | |||
| 		newFrame=false; | |||
| 		image(cam,0,0,width,height); | |||
| 		img.copy(cam, 0, 0, cam.width, cam.height,  | |||
| 				0, 0, img.width, img.height); | |||
| 		fastblur(img, 2); | |||
| 		theBlobDetection.computeBlobs(img.pixels); | |||
| 		drawBlobsAndEdges(true,true); | |||
| 	} | |||
|   count = theBlobDetection.getBlobNb(); // get the numbers of blobs captured | |||
|   println(count); // print out the numbers in Processing console | |||
| } | |||
| </source> | |||
| [[File:codeProcessing2.jpg]] | [[File:codeProcessing2.jpg]] | ||
edits