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 Thanks! |
I have found the optimised way to flip the Image, Video and Web cam Input. Flipping is now not an issue but the issue is while flipping video & web cam images the colour changes.
This Image will illustrate what happens when I flip video: http://i438.photobucket.com/albums/q...alkar/Mona.jpg Code for the above mentioned flipping video image Code:
import viz |
Do you actually need the image data to be flipped, or do you just want to display the texture flipped? If you just want to display the texture flipped horizontally, then simply apply a negative scale on the texture quad:
Code:
quat.setScale([-1,1,1]) |
Solved the Flip Image Issue
Thanks farshizzo for the reply. I actually need the Image data to be flipped. I am working on Augmented Reality Project & I want to create a Mirror. If I flipped the quad containing the Image then the marker wont get flipped, so the co-ordination between image & logo gets lost and mismatch happens. To overcome this issue I need help. I have solved the colour issue in flipping video image by modifying the code as shown below & got the output as shown in below image:
http://i438.photobucket.com/albums/q...kar/Mona_1.jpg Code:
import viz |
Marker is not getting detected in Flipped Image
I working on ARToolKit & Successfully flipped the Webcam Image. But now the issue is Marker is not getting detected in flipped texture.
Here is the code: Code:
import viz |
You need to flip the image before ARToolkit processes the camera image. Try scheduling the FlipHorizontal function with a lower update priority using the following code, instead of using vizact.ontimer:
Code:
vizact.onupate(viz.PRIORITY_PLUGINS,FlipHorizontal,cam,tex) |
Nope.. Its not working... :(
I have even tried to set priority values from -1000 to 1000. |
Is the incoming raw video data flipped or are you flipping it for another reason? If you are artificially flipping the data and the marker you are tracking is not horizontally symmetrical, then ARToolkit will fail to track the marker.
|
My webcam is giving real image & not the flipped image. But my application requirement is my customer should see him on screen as he is seeing him in mirror & marker should also respond in the same way. So can you tell me any alternate method so I can flip my webcam input out and out before applying it to artoolkit?
|
This simple code flips the texture but it doesn't solve the purpose..
Code:
import viz |
You will need to "flip" the position/rotation values of the markers as well. You can use the link.swapPos and link.swapEuler commands to accomplish this. Here is some sample code:
Code:
import viz |
Thanks friend! Its working. :)
|
All times are GMT -7. The time now is 03:32 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC