Ask Your Question

eco_bach's profile - activity

2020-10-18 10:38:25 -0600 received badge  Popular Question (source)
2020-10-16 15:01:49 -0600 received badge  Popular Question (source)
2018-11-30 11:50:26 -0600 commented question 'Thumbs-up' recognition- accuracy and performance

Thanks for feedback

2018-11-30 09:31:56 -0600 edited question 'Thumbs-up' recognition- accuracy and performance

'Thumbs-up' recognition- accuracy and perforamcne Hi. Exploring Kinect alternatives to detecting 'thumbs-up' gestures. A

2018-11-30 09:31:17 -0600 asked a question 'Thumbs-up' recognition- accuracy and performance

'Thumbs-up' recognition- accuracy and perforamcne Hi. Exploring Kinect alternatives to detecting 'thumbs-up' gestures. A

2018-11-21 14:25:22 -0600 edited question Current state of eye tracking, gaze detection using webcam OR dedicated eye tracker

Current state of eye tracking, gaze detection using webcam Hi Researching for a current project what is possible using a

2018-11-21 14:25:22 -0600 received badge  Editor (source)
2018-11-21 13:58:46 -0600 asked a question Current state of eye tracking, gaze detection using webcam OR dedicated eye tracker

Current state of eye tracking, gaze detection using webcam Hi Researching for a current project what is possible using a

2015-09-04 14:24:40 -0600 asked a question Background subtraction to create chroma key effect with live webcam stream

I've implemented a C# based OpenCV demo using BackgroundSubtractorMOG. The C# code is exactly based on the Java port of OpenCV. I am correctly getting contours or very rough outlines of any moving objects.

However, the effect I am more interested in is a 'chromakey' or 'green screen' type effect on a live webcam stream without using green screen. The way it works is that a 'reference' frame is grabbed when the live web cam stream starts and then this frame is used to create a difference matte to mask out any moving objects(people) and then composited with another static or moving background image. A simple threshold is used to adjust the matte.

I've compiled a demo of this in OpenFrameworks but am having a problem finding any OpenCV Java code to reference. Part of the problem is perhaps I'm not using the correct search terms. Can any OpenCV gurus at least point me in the right direction?Just searching for 'background subtraction + OpenCV + java" isn't getting me anywhere...

2015-09-02 08:41:46 -0600 asked a question Background subtraction C# implementation

Using a Unity asset for OpenCV which in turn is based on OpenCV for Java. Background subtraction IS supported however no code samples so I am trying to get something working based on OpenCV Java samples online. The folowing compiles correctly and we correctly see the webcamTexture, however stumped on getting the computed foreground mask(_fgMask) to either display or properly mask the original image.

The problem area is immediately after the processFrame() method call in my Update loop.

Not absolutely sure if I need to be creating a new Bitmap instance as well

Can any OpenCV and or C# experts possibly help?

using OpenCVForUnity;
using System.Collections;
using System.Drawing;
using System.Drawing.Imaging;
using UnityEngine;

public class OpenCV_backgroundSubtraction : MonoBehaviour
{
private WebCamTexture webCamTexture;

private WebCamDevice webCamDevice;

private Color32[] colors;


private int width = 640;

private int height = 480;

private Mat rgbaMat;

private Mat grayMat;

private Mat _fgMask;

private Mat _rgbaMat;

private Texture2D texture;

private BackgroundSubtractorMOG2 _mBGSub;
private VideoCapture _camera;

private bool initDone = false;

// Use this for initialization
private void Start()
{
StartCoroutine(init());
}

private IEnumerator init()
{
if (webCamTexture != null)
{
_minSize = (float)width / 6.0f;
_maxSize = _minSize * 1.5f;

webCamTexture.Stop();
initDone = false;

rgbaMat.Dispose();
grayMat.Dispose();
}
_mBGSub = new BackgroundSubtractorMOG2(2, 16, true);

_camera = new VideoCapture();

if (webCamTexture == null)
{
webCamDevice = WebCamTexture.devices[0];
webCamTexture = new WebCamTexture(webCamDevice.name, width, height);
}

// Starts the camera
webCamTexture.Play();

while (true)
{
if (webCamTexture.didUpdateThisFrame)
{
colors = new Color32[webCamTexture.width * webCamTexture.height];

rgbaMat = new Mat(webCamTexture.height, webCamTexture.width, CvType.CV_8UC4);
grayMat = new Mat(webCamTexture.height, webCamTexture.width, CvType.CV_8UC1);

texture = new Texture2D(webCamTexture.width, webCamTexture.height, TextureFormat.RGBA32, false);

gameObject.GetComponent<Renderer>().material.mainTexture = texture;
// Camera.main.orthographicSize = webCamTexture.height / 2;

Camera.main.orthographicSize = webCamTexture.height / 2;
initDone = true;

break;
}
else
{
yield return 0;
}
}
}

// Update is called once per frame
private void Update()
{
Bitmap bmp = null;
// if (!initDone)
// return;

//*/

if (webCamTexture.didUpdateThisFrame)
{
Utils.webCamTextureToMat(webCamTexture, rgbaMat, colors);
_fgMask = new Mat(webCamTexture.height, webCamTexture.width, CvType.CV_8UC1);
_rgbaMat = _fgMask.clone();
processFrame();

bmp = new System.Drawing.Bitmap(100, 100, PixelFormat.Format32bppArgb);

Utils.matToTexture2D(rgbaMat, texture, colors);
}

//*/
}

protected void processFrame()//
{
_camera.retrieve(_rgbaMat, Highgui.CV_CAP_ANDROID_COLOR_FRAME_RGB);

_mBGSub.apply(_rgbaMat, _fgMask, 0.1);
Imgproc.cvtColor(_fgMask, _rgbaMat, Imgproc.COLOR_GRAY2BGRA, 4);
}

private void OnDisable()
{
webCamTexture.Stop();
}

private void OnGUI()
{
}
}
2015-08-18 06:40:06 -0600 asked a question Tracking just ONE face at a time

I'm using a C# implementation of OpenCv which in turn is a port of Java OpenCV. http://docs.opencv.org/java/

The specific line where I call the HAAR classifier is

 cascade.detectMultiScale(grayMat, faces, 1.2, 3, 2, new Size(60, 60), new Size(150, 150));

The problem is I only want to track one face at a time, even if several are detected. ie if there are 2 faces detected, my tracking rectangles keep jumping randomly between the 2 faces. How can I ONLY detect 1 face at a time(ie the first one detected)?

Can anyone provide a simple example?

2015-06-10 13:56:34 -0600 asked a question Background Subtraction in Unity (C#)

I'm using this Unity C# package which works quite well for face detection, tracking. https://github.com/EnoxSoftware/OpenC...

However, the OpenCV feature I am MOST interested in is background subtraction. ie achieving green screen like effects without green screen. So that someone walking in front of a static background would be masked out from the background.

I emailed the developer and he replied saying it is supported http://enoxsoftware.github.io/OpenCVF...

but there are no actual demos to get it working.:(

Can any OpenCV - C# gurus help?

2015-01-05 00:22:17 -0600 asked a question opencv.org/documentation.html vs docs.opencv.org/java/

I'm looking for the most uptodate documentation for OpenCV java. Can anyone tell me the difference between

opencv.org/documentation.html v& docs.opencv.org/java/