WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-20-2012, 11:03 PM
goro goro is offline
Member
 
Join Date: May 2012
Posts: 33
Unhappy Flip WebCam input Horizontally

Hi,
I am new to vizard working on Augmented Reality. I am trying to flip my Web Camera input horizontally. I am successfully flipping it but my system performance is going down. Here is my code:

Code:
import viz
import vizact
viz.go()

video = viz.add('VideoCamera.dle')
ar = viz.add('ARToolKit.dle')

cam = video.addWebcam(type=viz.TEX_2D)
width, height, type = cam.getSize()
flipCam = viz.addBlankTexture([width,height])
width_3 = width*3

camera = ar.addCamera(flipCam)
dataCam = cam.getImageData()
dataFlipCam = flipCam.getImageData()

def mainLoop():
	for y in range(0,height-1):
		for x in range(0,width-1):
			dataFlipCam[(3*x+y*width_3)] = dataCam[(3*(width-1-x)+y*width_3)] 
			dataFlipCam[(3*x+1+y*width_3)] = dataCam[(3*(width-1-x)+1+y*width_3)] 
			dataFlipCam[(3*x+2+y*width_3)] = dataCam[(3*(width-1-x)+2+y*width_3)] 
			
	flipCam.hint(viz.TEXTURE_MODIFIED_HINT)
	
vizact.ontimer(0,mainLoop)
Please suggest me alternate.

Thanks!
Reply With Quote
 

Tags
artoolkit, camera, flip, flip horizontally, webcam


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
User keyboard input without halting the program Zhi Vizard 2 06-23-2011 12:53 PM
Controlling User Input ohad Vizard 1 03-15-2010 05:16 PM
How to input several model files and then save one output file mspusch Vizard 1 07-15-2008 10:30 PM
problems with webcam plug-in v-clizzin Plug-in development 2 01-25-2008 03:06 PM
problem with input boxes shai Vizard 6 08-15-2005 10:51 AM


All times are GMT -7. The time now is 07:43 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC