Saturday, June 11, 2011

OpenCV - Images

Adding two images into a new a big canvas.
http://nashruddin.com/OpenCV_Region_of_Interest_(ROI)

http://opencv.wordpress.com/


good examples.
cvLine, cvCircle
http://www.cs.iit.edu/~agam/cs512/lect-notes/opencv-intro/opencv-intro.html

OpenCV - Thread

How to create a thread ?
http://msdn.microsoft.com/en-us/library/ms682453(v=vs.85).aspx

http://stackoverflow.com/questions/2050369/display-image-in-second-thread-opencv

main() {
DispThreadHasFinished=FALSE;
MainThreadHasFinished=FALSE;
CreateThread(..,..,Thread,..);

while(IsTheUserDone()){
myImg=AcquireFrame();
DoProcessing();
TakeAction();
}
MainThreadHasFinished=TRUE;


while (!DisplayThreadHasFinished){
CvWaitKey(100);
}

return;
}

/** Thread that displays image at ~30fps **/
Thread(){
while (!MainThreadHasFinished) {
cvShowImage(myImage);
cvWaitKey(30);
}
DispThreadHasFinished=TRUE;
return;
}

Thursday, May 5, 2011

TTS (Text to Speech)

Speech SDK 5.1
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=5e86ec97-40a7-453f-b0ee-6583171b4530&displaylang=en

Go to the ‘control panel’ -> search ‘text to speech’.

Forum


pyttsx


Issues:

Sol: Thanks to lap0918 for the hint! I just ran into this issue on Windows 7 x64. I couldn't find any UI to bring up a 32-bit TTS control panel, so I created a shortcut to the normal TTS control panel and looked at its contents with a hex editor. It was running sapi.cpl. I searched my system for sapi.cpl and found a separate 32-bit version at C:\Windows\SysWOW64\Speech\SpeechUX\sapi.cpl. When I ran that, I was able to select my Cepstral voice as the default voice and my 32-bit apps picked up on it successfully. I don't do TTS in any 64-bit apps (yet).
 https://www.cepstral.com/forum/viewtopic.php?t=242&highlight=control+panel


Important !!!!!

https://www.cepstral.com/forum/viewtopic.php?t=242&highlight=control+panel

The Control Panel TTS Voice option lists only properly registered
64 bit Voices. Microsoft's Anna is the only 64 bit Voice that is
supplied with the operating systems. Loquendo's Kate, which is
probably the highest quality TTS Voice that is currently available,
has both 32 and 64 bit versions. Kate is difficult to obtain in small
quantities and is very expensive. The next best alternative is
believed to be the Acapela-Group Voice Heather. It is only
currently available in a 32 bit version for the Windows operating
systems. (64 bit Heather is available for Apple's Snow Leopard).
A third possibility is Cepstral's Callie. I believe that this is still
available only as a 32 bit Voice. The demo version has some glitches.
Testing with Microsoft's sample program, TTSApp, revealed two
problems that we haven't encountered with any other Voice. Text
highlighting doesn't track properly even when the TTS has not been
interrupted with a "nag" statement and the program hangs when a
stop is requested before the end of the text that is being spoken. 



Useful Questions

http://code.google.com/p/pyspeech/wiki/Discussion

I want to know during writing my python code, how can I know which voices are pre-installed?? Means in my windows Vista, Microsoft Anna comes as default, but if I install espeak for windows, then 3 more voices comes automatically. Now what I want during coding is that, which voice options are available to the user, so that I can show them into my application and user is able to select them directly from my application.
I want something like:
speak = win32com.client.Dispatch('Sapi.SpVoice?')
voices= speak.get_all_voices()
so that voices contains a list of all the voices available currently?? Please note that get_all_voices() is an imaginary function only for sake of clarity, I want something like this function. Is it available or not??
Thanks and regards
Chirag


useful webs
http://code.google.com/p/pyspeech/
http://wiki.roboteducation.org/Windows_Setup#Easy_Instructions_for_Windows_7 

Choose a voice (code-wise)
http://forum.worldviz.com/showthread.php?t=1780

Monday, May 2, 2011

virtual function

http://www.learncpp.com/cpp-tutorial/125-the-virtual-table/

http://www.codersource.net/c/c-tutorials/c-virtual-function.aspx

http://en.wikipedia.org/wiki/Virtual_function

Thursday, April 28, 2011

Intersense IS-900 and Vizard

http://dipeshbhattarai.com/category/tracking/

Seemingly trivial case of adding button and analog channels to the Intersense 900 VRPN configuration has become a big problem. I used the following in the vrpn.cfg to configure the IS900:
vrpn_Tracker_InterSense tracker AUTO 115200 \
u /
Wand            button           1       -.99 0.0 0.0 1.0  -.99 0.0 0.0 1.0 /
Wand            analog           0       -.99 0.0 0.0 1.0  -.99 0.0 0.0 1.0
The vrpn server is able add both the channels with no problem. But when I access the data, it always returns 0.
Update:
It seems, we do not need to configure analog channel to access the joystick outputs. The button channel can be used to access the joysticks’ analog outputs. So, I removed the second line from the config file and used the following line in VR Juggler config file to configure the anlog vrpn server and it worked:
<analog_server>button@<vrpnhost></analog_server>


After struggling with IS-900, VRPN and VMD for almost a week, I am finally able to understand the interactions among these components.
The coordinate frame the IS-900 uses in itself is very odd. The X-axis goes from top to bottom, Y-axis from front to back and Z-axis from right to left. Converting that frame to a normal right-handed coordinated required setting up a proper rotation matrix. After setting up that matrix, I had to figure out how VMD uses the matrix to transform the coordinate frame. After going through pile of source code, I finally figured that out. Even then it didn’t work the way I wanted it to work. The problem was the format I was providing the matrix element. VMD expected the elements in column-major format and I was using row-major format.
After I fixed everything, I was able to select the molecules on standalone application mode. As soon I switched to clustered environment, there was problem. The cursor didn’t select anyting. I suspect it has something to do with how VR Juggler assigns the coordinates to views that different computers in cluster handle.

Thursday, March 24, 2011

Sample-PointViewer for two hands.

You can track two hands with the PointViewer sample. You need juste to activate this on the NITE.ini
file that you can find at C:\Program Files (x86)\Prime Sense\NITE\Hands\Data. It is enough to uncomment the two lines.

http://groups.google.com/group/openni-dev/browse_thread/thread/b3347a34db0ac6f6/72c99a2122c3f397?lnk=gst&q=PointViewer+two+hands#72c99a2122c3f397

Tuesday, March 1, 2011

OpenCV Download

http://sourceforge.net/projects/opencvlibrary/files/opencv-win/