Skip to content

Commit 384d865

Browse files
authored
Merge pull request #23 from lucidcode/face-regions
Limit REM detection to face region
2 parents 745ec28 + e85c810 commit 384d865

4 files changed

Lines changed: 23 additions & 7 deletions

File tree

Halovision/PluginHandler.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ public static int GetTossThreshold()
9494
return visionForm.TossThreshold;
9595
}
9696

97+
public static bool DetectREM()
98+
{
99+
return visionForm.DetectREM;
100+
}
101+
97102
public static int GetTossHalfLife()
98103
{
99104
return visionForm.TossHalfLife;
@@ -548,7 +553,15 @@ public override double Value
548553
int eyeMoveMax = Device.GetEyeMoveMax();
549554
int idleTicks = Device.GetIdleTicks();
550555

551-
history.Add(Device.GetVision());
556+
if (Device.DetectREM())
557+
{
558+
history.Add(Device.GetVision());
559+
}
560+
else
561+
{
562+
history.Add(0);
563+
}
564+
552565
if (history.Count > 768) { history.RemoveAt(0); }
553566

554567
// Check for blinks

Halovision/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.3.2.0")]
36-
[assembly: AssemblyFileVersion("1.3.2.0")]
35+
[assembly: AssemblyVersion("1.3.3.0")]
36+
[assembly: AssemblyFileVersion("1.3.3.0")]

Halovision/VisionForm.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public partial class VisionForm : Form
6262
private VideoCaptureDevice videoSource;
6363
private Rectangle[] faceRegions;
6464
private CascadeClassifier cascadeClassifier;
65+
public bool DetectREM = true;
6566

6667
private bool processing = false;
6768
private Bitmap currentBitmap = null;
@@ -165,6 +166,7 @@ private void LoadClassifier()
165166
{
166167
try
167168
{
169+
DetectREM = true;
168170
cascadeClassifier = null;
169171
if (cmbClassifier.Text != "" && cmbClassifier.Text != "None")
170172
{
@@ -650,6 +652,7 @@ private void tmrDiff_Tick(object sender, EventArgs e)
650652
Image<Bgr, byte> imageFrame = new Image<Bgr, Byte>(currentBitmap);
651653
Image<Gray, byte> grayFrame = imageFrame.Convert<Gray, byte>();
652654
faceRegions = cascadeClassifier.DetectMultiScale(grayFrame);
655+
DetectREM = faceRegions != null && faceRegions.Length > 0;
653656
}
654657

655658
Difference(ref previousBitmap, ref currentBitmap, out diff);

Installer/Lucid Scribe Halovision.vdproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28626,15 +28626,15 @@
2862628626
{
2862728627
"Name" = "8:Microsoft Visual Studio"
2862828628
"ProductName" = "8:Lucid Scribe Halovision"
28629-
"ProductCode" = "8:{36D23BBF-F7BC-4F57-9EB2-5590AFDEDAAE}"
28630-
"PackageCode" = "8:{A961F9DC-AA06-4903-8974-5A955A416F3E}"
28629+
"ProductCode" = "8:{38886B29-6C7F-43C0-B77D-AB74D44D53DC}"
28630+
"PackageCode" = "8:{89FDD31B-48F5-4CFD-BA7B-E79BF69FAB0A}"
2863128631
"UpgradeCode" = "8:{CAAB2187-AD23-435C-A3DB-568744247625}"
2863228632
"AspNetVersion" = "8:4.0.30319.0"
2863328633
"RestartWWWService" = "11:FALSE"
2863428634
"RemovePreviousVersions" = "11:TRUE"
2863528635
"DetectNewerInstalledVersion" = "11:TRUE"
2863628636
"InstallAllUsers" = "11:TRUE"
28637-
"ProductVersion" = "8:1.3.2"
28637+
"ProductVersion" = "8:1.3.3"
2863828638
"Manufacturer" = "8:lucidcode"
2863928639
"ARPHELPTELEPHONE" = "8:"
2864028640
"ARPHELPLINK" = "8:http://www.lucidcode.com/Contact"
@@ -29158,7 +29158,7 @@
2915829158
{
2915929159
"{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_395AC690E5F04358B866710FD743FFE4"
2916029160
{
29161-
"SourcePath" = "8:"
29161+
"SourcePath" = "8:..\\Halovision\\obj\\x86\\Release\\lucidcode.LucidScribe.Plugin.Halovision.dll"
2916229162
"TargetName" = "8:"
2916329163
"Tag" = "8:"
2916429164
"Folder" = "8:_491A001224CF4D699EA475B2FB5F2890"

0 commit comments

Comments
 (0)