tag:blogger.com,1999:blog-58690142400126174342024-03-05T01:06:12.422-08:00Final Year Engineering Project Guidance, Tutorials, Experiences, Resources and MoreThe Only Place To Get Wholesome Information And Guidance On Your Final Year Engineering Projects and ThesisAnonymoushttp://www.blogger.com/profile/00008509205060164209noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-5869014240012617434.post-21486354317967324772013-06-13T09:36:00.002-07:002013-06-19T02:31:38.576-07:00Real Time Skin Detection In Video For Curbing Pornography on Web <div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Verdana, sans-serif;">Access to Porn in today's world is very easy. Keeping children out of reach of porn has become as difficult as keeping them away from candies. The parental lock and other control features provided in today's laptops and TVs are easy to pass by. What we need is an automatic control feature that detects the images and videos in real time and provides feedback to user regarding the content. We intend to make such a system. </span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><u><b>Prerequisites:</b></u></span><br />
<span style="font-family: Verdana, sans-serif;"><u><b><br /></b></u></span>
<span style="font-family: Verdana, sans-serif;">1. MATLAB R2010B</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><b><u>Steps:</u></b></span><br />
<span style="font-family: Verdana, sans-serif;"><b><u><br /></u></b></span>
<span style="font-family: Verdana, sans-serif;">1. Load Video</span><br />
<span style="font-family: Verdana, sans-serif;">2. Extract Frames</span><br />
<span style="font-family: Verdana, sans-serif;">3. Detect Skin Regions and Take Decision</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><b><u>Step 1 : Load Video </u></b></span><br />
<span style="font-family: Verdana, sans-serif;"><b><u><br /></u></b></span>
<span style="font-family: Verdana, sans-serif;">We begin with loading a video in MATLAB, start by creating a new .m file under the file menu in the editor window.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<i><span style="font-family: Courier New, Courier, monospace;">% Get Video </span></i><br />
<i><span style="font-family: Courier New, Courier, monospace;">obj = VideoReader('4.avi');</span></i><br />
<i><span style="font-family: Courier New, Courier, monospace;"><br /></span></i>
<i><span style="font-family: Courier New, Courier, monospace;">% Calculate Number of Frames</span></i><br />
<span style="font-family: Courier New, Courier, monospace;"><i></i></span><br />
<i><span style="font-family: Courier New, Courier, monospace;">nFrames = obj.NumberOfFrames;</span></i><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Note that in MATLAB R2009B you have to use mmreader() instead of VideoReader() since mmreader() has been discontinued or better renamed. If uploading only avi files you can even use aviread(). We intend to use multiple formats. The supported formats can be checked by typing in the command window the code below</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<i><span style="font-family: Courier New, Courier, monospace;">VideoReader.getFileFormats();</span></i><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">This will return a list of supported formats</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<i><span style="font-family: Courier New, Courier, monospace;">Video File Formats:</span></i><br />
<i><span style="font-family: Courier New, Courier, monospace;"> .asf - ASF File</span></i><br />
<i><span style="font-family: Courier New, Courier, monospace;"> .asx - ASX File</span></i><br />
<i><span style="font-family: Courier New, Courier, monospace;"> .avi - AVI File</span></i><br />
<i><span style="font-family: Courier New, Courier, monospace;"> .mj2 - Motion JPEG2000</span></i><br />
<i><span style="font-family: Courier New, Courier, monospace;"> .mpg - MPEG-1</span></i><br />
<span style="font-family: Courier New, Courier, monospace;"><i></i></span><br />
<i><span style="font-family: Courier New, Courier, monospace;"> .wmv - Windows Media Video</span></i><br />
<i><span style="font-family: Courier New, Courier, monospace;"><br /></span></i>
<i><span style="font-family: Courier New, Courier, monospace;"><br /></span></i>
<u><b><span style="font-family: Verdana, sans-serif;">Step 2 : Extract Frames</span></b></u><br />
<u><b><span style="font-family: Verdana, sans-serif;"><br /></span></b></u>
<span style="font-family: Courier New, Courier, monospace;"><i>for k = 1 : nFrames</i></span><br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><i>img = read(obj,k);</i></span><br />
<span style="font-family: Courier New, Courier, monospace;"><i><br /></i></span>
<span style="font-family: Verdana, sans-serif;">The above code extracts one frame at a time and stores it in the variable 'img'. We then pre-process each frame to detect skin regions and then take decisive actions.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><b><u>Step 3 : Detect Skin Regions and Take Decisions</u></b></span><br />
<span style="font-family: Verdana, sans-serif;"><b><u><br /></u></b></span>
<span style="font-family: Verdana, sans-serif;">The skin detection algorithm is pretty straight forward. </span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><u>Algorithm for Skin Detection in an Image :</u></span><br />
<br />
<span style="font-family: Verdana, sans-serif;">1. GetRofimg, GetBofimg, GetGofimg</span><br />
<span style="font-family: Verdana, sans-serif;">2. Calculate R-G and R-B</span><br />
<span style="font-family: Verdana, sans-serif;">3. if R-G >= minskinthreshold1 && R-G <= maxskinthreshold1 && R-B </span><br />
<span style="font-family: Verdana, sans-serif;"> <=</span><span style="font-family: Verdana, sans-serif;">maxskinthreshold2 && R-B >= minskinthreshold2 then Goto 4</span><br />
<span style="font-family: Verdana, sans-serif;">4. if skin region > = max(allowed) then blurred image</span><br />
<span style="font-family: Verdana, sans-serif;">5. regular image (when 3 is false) </span><br />
<span style="font-family: Verdana, sans-serif;">6. increment frame</span><br />
<span style="font-family: Verdana, sans-serif;">7. Goto 1</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Thus using the above algorithm skin regions are detected in each frame and decisive action is also taken by checking the area of detected skin. </span><br />
<br />
<span style="font-family: Verdana, sans-serif;">Using the 'tic' and 'toc' routines in matlab, we found out that this method was faster than other detection techniques and yield better skin detection rate than other known techniques of skin detection.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Checkout the video of the project in action here...</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<a href="https://www.youtube.com/watch?v=XLAPTdbZJYc">https://www.youtube.com/watch?v=XLAPTdbZJYc</a><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
Anonymoushttp://www.blogger.com/profile/00008509205060164209noreply@blogger.com1tag:blogger.com,1999:blog-5869014240012617434.post-88596619574914804182013-06-12T10:33:00.002-07:002013-06-19T08:09:22.467-07:00Control Your Computer Using Speech <div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Verdana, sans-serif;">This was inspired by the Iron Man series, i was really fascinated to see Tony Stark talking to his computer JARVIS and getting quick and witty replies. Though it is possible to get JARVIS developed, but it is out of the scope of this blog.</span><span style="font-family: Verdana, sans-serif;">Let's try and make a more simpler application that would do specific tasks like open a new window, or pause a video, or even type automatically as you say, or maybe scroll through texts and give intelligent feedback by cross referencing a particular knowledge base,all this just using voice commands</span><br />
<span style="font-family: Verdana, sans-serif;"><br />
</span> <span style="font-family: Verdana, sans-serif;"><b><u>Prerequisites:</u></b></span><br />
<span style="font-family: Verdana, sans-serif;"><b><u><br />
</u></b></span> <span style="font-family: Verdana, sans-serif;">1. JDK 1.6 or higher</span><br />
<span style="font-family: Verdana, sans-serif;">2. Eclipse IDE</span><br />
<span style="font-family: Verdana, sans-serif;">3. Sphinx 4.0 </span><br />
<span style="font-family: Verdana, sans-serif;"><br />
</span> <span style="font-family: Verdana, sans-serif;"><b><u>Steps:</u></b></span><br />
<span style="font-family: Verdana, sans-serif;"><b><u><br />
</u></b></span> <span style="font-family: Verdana, sans-serif;">1. Configure Sphinx 4.0 with JAVA Application</span><br />
<span style="font-family: Verdana, sans-serif;">2. Custom Code for Specific Applications Written in C</span><br />
<span style="font-family: Verdana, sans-serif;">3. Combine (C & Java)</span><br />
<span style="font-family: Verdana, sans-serif;">4. Deployment</span><br />
<span style="font-family: Verdana, sans-serif;"><br />
</span><b><u><span style="font-family: Verdana, sans-serif;">Step 1 : </span><span style="font-family: Verdana, sans-serif;">Configure Sphinx 4.0 with JAVA Application</span></u></b><br />
<b><u><span style="font-family: Verdana, sans-serif;"><br />
</span></u></b> <span style="font-family: Verdana, sans-serif;">Information regarding sphinx 4.0 can be found here </span><span style="font-family: Courier New, Courier, monospace;"><i><a href="http://cmusphinx.sourceforge.net/sphinx4/">http://cmusphinx.sourceforge.net/sphinx4/</a></i></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br />
</span> <span style="font-family: Verdana, sans-serif;">Download the latest version of Sphinx </span><span style="-webkit-tap-highlight-color: rgb(0, 119, 170); color: magenta; font-family: Courier New, Courier, monospace; line-height: 18px; margin: 0px; outline: none; padding: 0px; vertical-align: baseline; white-space: nowrap;"><i><a class="name" href="http://sourceforge.net/projects/cmusphinx/files/sphinx4/1.0%20beta6/sphinx4-1.0beta6-src.zip/download" style="-webkit-tap-highlight-color: rgb(0, 119, 170); line-height: 18px; margin: 0px; outline: none; padding: 0px; vertical-align: baseline; white-space: nowrap;" title="Click to download sphinx4-1.0beta6-src.zip">sphinx4-1.0beta6-src.zip</a></i></span><br />
<span style="-webkit-tap-highlight-color: rgb(0, 119, 170); color: #a64d79; font-family: Courier New, Courier, monospace; line-height: 18px; margin: 0px; outline: none; padding: 0px; vertical-align: baseline; white-space: nowrap;"><br /></span><span style="font-family: Verdana, sans-serif;"><span style="line-height: 18px; white-space: nowrap;">See the video for more details on Setting up Sphinx 4.0 with Eclipse IDE</span></span><br />
<span style="font-family: Verdana, sans-serif;"><span style="line-height: 18px; white-space: nowrap;"><br /></span></span>
<br />
<iframe allowfullscreen="" frameborder="0" height="315" src="http://www.youtube.com/embed/Z0f3vvCJWyo" width="420"></iframe><br />
<br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Once you have done the basic setup as illustrated in the video above we need to change the grammar file as well as the dictionary to suit our application. </span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">The hello.gram file is located in 'HelloWorld.jar' file in </span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">'C:\sphinx4-1.0beta6\bin'. </span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Extract the contents of the jar file into the same location and open the hello.gram file at location</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">C:\sphinx4-1.0beta6\bin\edu\cmu\sphinx\demo\helloworld</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYX_y-2KExwVnX1KEZl8inDP2o62f1kB_s3y6ntFYABxOVVWVPgaa1bhga18HTYcqcwaStaeRteABAXFMXxhub9QxLtnaz2sfwpvMnJIsC6j_UKHiZSV15W77gl_nkoa5gLHKGai6KEWc/s1600/project3.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYX_y-2KExwVnX1KEZl8inDP2o62f1kB_s3y6ntFYABxOVVWVPgaa1bhga18HTYcqcwaStaeRteABAXFMXxhub9QxLtnaz2sfwpvMnJIsC6j_UKHiZSV15W77gl_nkoa5gLHKGai6KEWc/s1600/project3.JPG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;">Open the hello.gram file using wordpad or similar editor </span></td></tr>
</tbody></table>
<br />
<span style="font-family: Verdana, sans-serif;">Change it to look like the figure below and this click on save. You are done with the first part of configuration.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy6DsRMQANC3UvXc62WdocIIa7oTeTBdG3ffguh64aF3fGa0SQSggITv94WU-DSl0Mn3Pq1LuLl4Kbb_rtI5R8IE_4g84GE1z9lHeenkUgAsz1rfVlY0rz_lE1CS-IYrGPAX7ZptYOMHA/s1600/project4.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="241" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy6DsRMQANC3UvXc62WdocIIa7oTeTBdG3ffguh64aF3fGa0SQSggITv94WU-DSl0Mn3Pq1LuLl4Kbb_rtI5R8IE_4g84GE1z9lHeenkUgAsz1rfVlY0rz_lE1CS-IYrGPAX7ZptYOMHA/s1600/project4.JPG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;">See the Notes Section to Know More About JSGF Grammar Formats</span></td></tr>
</tbody></table>
<br />
<span style="font-family: Verdana, sans-serif;">Now we need to modify the dictionary file found at </span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">C:\sphinx4-1.0beta6\lib\WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz\WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz\dict</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">You will need to extract the file </span><br />
<span style="font-family: Verdana, sans-serif;">WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.jar found under </span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">C:\sphinx4-1.0beta6\lib\</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">to get the dictionary file (cmudict.0.6D) mentioned above.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">See the image below for more details .. </span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1nrGZ7FTPM0Ri1p4Z_RevpQKn2ffPtAzSXSTxwSHhWlKbhyphenhyphenunAzbCItA0RyeP_P2sUOCucvbvkPwbMmoUdnelz2Mnn7ZOWz-yjsN3BR_vPLBhdIoRXTJ222tMcu2r6C1cwdw9yFUQh4k/s1600/project5.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="241" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1nrGZ7FTPM0Ri1p4Z_RevpQKn2ffPtAzSXSTxwSHhWlKbhyphenhyphenunAzbCItA0RyeP_P2sUOCucvbvkPwbMmoUdnelz2Mnn7ZOWz-yjsN3BR_vPLBhdIoRXTJ222tMcu2r6C1cwdw9yFUQh4k/s1600/project5.JPG" width="400" /></a></div>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Once you have opened it in wordpad the file should look something like this </span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">!EXCLAMATION-POINT EH K S K L AH M EY SH AH N P OY N T</span><br />
<span style="font-family: Verdana, sans-serif;">"OPEN-QUOTE OW P AH N K W OW T</span><br />
<span style="font-family: Verdana, sans-serif;">"CLOSE-QUOTE K L OW Z K W OW T</span><br />
<span style="font-family: Verdana, sans-serif;">"DOUBLE-QUOTE D AH B AH L K W OW T</span><br />
<span style="font-family: Verdana, sans-serif;">"END-OF-QUOTE EH N D AH V K W OW T</span><br />
<br />
<span style="font-family: Verdana, sans-serif;">"END-QUOTE EH N D K W OW T</span><br />
<div>
</div>
<div>
<br /></div>
<div>
<span style="font-family: Verdana, sans-serif;">Followed with many such illustrations of different words..</span></div>
<div>
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Verdana, sans-serif;">Select all and Delete it..Now open a Notepad file and fill it as shown in the image below.</span></div>
<div>
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKDDai9dwXDoHULQwk5nKQXzHIkgw49vM-Xb1S4vOBCBxyTN4R7N0JUNvvSvFrjoeOdHVdhjnSJF6QBOPlMu7BQDOxUEgFOuZOYhpSikawLDM2Nz0Y01E6LgRzldMFy47iwHMXhDeClPg/s1600/project6.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="241" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKDDai9dwXDoHULQwk5nKQXzHIkgw49vM-Xb1S4vOBCBxyTN4R7N0JUNvvSvFrjoeOdHVdhjnSJF6QBOPlMu7BQDOxUEgFOuZOYhpSikawLDM2Nz0Y01E6LgRzldMFy47iwHMXhDeClPg/s1600/project6.JPG" width="400" /></a></div>
<div>
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Verdana, sans-serif;">Save the Notepad file with any name on desktop. Now browse to </span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><i><a href="http://www.speech.cs.cmu.edu/tools/lmtool.html">http://www.speech.cs.cmu.edu/tools/lmtool.html</a></i></span></div>
<div>
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Verdana, sans-serif;">and upload the Notepad file you just saved on your desktop in the step above..Click on choose file to upload the txt file and then click on 'Compile Knowledge Base' button. If the process was smooth you should see a new window that resembles the figure below</span></div>
<div>
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9zejvmlB9ekTAjfcSCnx-ulw1Q45xSFvy-p5lNOz0iyIF1W5JMIldEjDLcb1a2sLCI4A9g8e2hAdJbEwpYoZC_0h8MXmmUmCyGnSH2Kxyc-BgKeQXcN0tGFoQkDf6I7X-PklX0wMRedY/s1600/project7.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="192" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9zejvmlB9ekTAjfcSCnx-ulw1Q45xSFvy-p5lNOz0iyIF1W5JMIldEjDLcb1a2sLCI4A9g8e2hAdJbEwpYoZC_0h8MXmmUmCyGnSH2Kxyc-BgKeQXcN0tGFoQkDf6I7X-PklX0wMRedY/s1600/project7.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;">Click on Dictionary to get a new window with text resembling the cmudict.0.6D file</span></td></tr>
</tbody></table>
<div>
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Verdana, sans-serif;">if you don't manage to follow the process of creating a dictionary then you can just copy and paste the following content to the 'cmudict.0.6D' file and click on save</span></div>
<div>
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div>
<pre style="white-space: pre-wrap; word-wrap: break-word;"><span style="font-family: Verdana, sans-serif;">COMMAND K AH M AE N D
DOWN D AW N
FACEBOOK F EY S B UH K
GMAIL G M EY L
GOOGLE G UW G AH L
MUTE M Y UW T
PAUSE P AO Z
PLAY P L EY
SOLVE S AA L V
UP AH P
WRITE R AY T
YAHOO Y AA HH UW
YOUTUBE Y AW T Y UW B</span></pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;"><span style="font-family: Verdana, sans-serif;">
</span></pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;"><span style="font-family: Verdana, sans-serif;">
</span></pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;"><span style="font-family: Verdana, sans-serif;">you will now need to convert the folder </span><span style="font-family: Verdana, sans-serif;">WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz back to a .jar file the conversion process is as follows folder - > zip - > jar</span></pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;"><span style="font-family: Verdana, sans-serif;">
</span></pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;"><span style="font-family: Verdana, sans-serif;">Compress the folder to a .zip archive and then change the extension to .jar</span></pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;"><span style="font-family: Verdana, sans-serif;">
</span></pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;"><span style="font-family: Verdana, sans-serif;">now that the basic setup is completed.lets see how to use this newly configured sphinx library in our project.</span></pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;"><span style="font-family: Verdana, sans-serif;">
</span></pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;"><span style="font-family: Verdana, sans-serif;">Start Eclipse IDE, and Create a New Java Project, Name it HelloWorld and click on Next and add the external JARS as specified in the video above.</span></pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;"><span style="font-family: Verdana, sans-serif;">Instead of the HelloWorld.class file we will write our own code for HelloWorld.Java</span></pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;"><span style="font-family: Verdana, sans-serif;">
</span></pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;"><span style="font-family: Verdana, sans-serif;">
</span></pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;"><b><u><span style="font-family: 'Times New Roman'; white-space: normal;"><span style="font-family: Verdana, sans-serif;">Step 2 : </span></span><span style="font-family: Verdana, sans-serif;">Custom Code for Specific Applications Written in C</span></u></b></pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;"></pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;"></pre>
</div>
<span style="font-family: Verdana, sans-serif;">Imagine if you say up and you want to scroll up a page how would you do that? One way is to just automate a key press.i.e. make the software think that a key was press even though it wasn't physically. so we write a C/C++ code for the purpose. </span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">The below algorithm can be used to simulate a key press using C </span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">#include<windows .h=""></windows></span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">main ()</span><br />
<span style="font-family: Verdana, sans-serif;">{</span><br />
<span style="font-family: Verdana, sans-serif;">// Code for Key Press</span><br />
<span style="font-family: Verdana, sans-serif;"> Sleep(miliseconds)</span><br />
<span style="font-family: Verdana, sans-serif;">// Code for Key Release</span><br />
<span style="font-family: Verdana, sans-serif;"> break;</span><br />
<span style="font-family: Verdana, sans-serif;">}</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">You can use a combination of key presses too. like 'Alt + F4' will close a window when you say 'Close' or you can scroll up using 'Page Up' when you say 'Scroll Up'</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Virtual Key codes for almost all the keys are available on </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><i><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx">http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx</a></i></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><u><b>Step 3 : Combine C and Java</b></u></span><br />
<span style="font-family: Verdana, sans-serif;"><u><b><br /></b></u></span>
<span style="font-family: Verdana, sans-serif;">Java coding is done for Speech Recognition and when a specific speech pattern returns a specific result we either use Java to call external applications or use Compiled C (.exe) code to execute applications not triggered by Java. </span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><b><u>Step 4 : Deployment</u></b></span><br />
<span style="font-family: Verdana, sans-serif;"><b><u><br /></u></b></span>
<span style="font-family: Verdana, sans-serif;">Deploy the Compiled Java code to a .Jar or .exe file so it can be used on any system supporting Java Compilers, which is basically almost everything.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Checkout the video of the working project here ....</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span><span style="font-family: Courier New, Courier, monospace;"><i>http://youtu.be/5vqFWqCK1-A</i></span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
Anonymoushttp://www.blogger.com/profile/00008509205060164209noreply@blogger.com0