Ask Your Question

AMBTB's profile - activity

2017-09-11 02:18:42 -0600 marked best answer RE Streaming to webserver Visual Studio 2017

It is safe to say I have read nearly every post on Google about streaming the frames captured via OpenCV over the last few years :) I have only ever got a couple of things to work and they are terrible.

I am working now on a C++ project in Visual Studio 2017, I usually work in Python) I have a time restriction so I have to ask for some help on this, as have not been able to get a single example working over the last few weeks now.

What I need to achieve is simple or should be, the frames are captured and processed, and then streamed to a local server that can be connected to via a browser.

I have tried creating mjpg to then try and use something like mjpeg_streamer, but videowriter works with none of the available codecs I have, I installed FFDShow but none of the codecs installed with that program show up in openCV when using -1 in the codec section, I cannot even write avi files, this is not an issue on this one laptop, I have never been able to on all the devices in my office. I have looked literally everywhere for a solution for a stream, please could someone put me out of my misery please :)

There must be a working example somewhere that shows how to stream the feed on a local server with C++. Any suggestions please.

2017-09-10 17:12:40 -0600 answered a question RE Streaming to webserver Visual Studio 2017

I have now solved this using a combination of ffmpeg, node js and websockets.

2017-09-09 04:50:14 -0600 commented answer RE Streaming to webserver Visual Studio 2017

Thanks for the reply. I fully understand that, I know what OpenCV is, I was asking about solutions, I cannot find an exa

2017-09-09 04:16:01 -0600 received badge  Enthusiast
2017-09-08 15:04:50 -0600 asked a question RE Streaming to webserver Visual Studio 2017

RE Streaming to webserver Visual Studio 2017 It is safe to say I have read nearly every post on Google about streaming t

2017-02-11 20:58:55 -0600 commented question RENAMED: How to remove background light on high quality frames

Could do with some help with this guys, it will hardly ever detect faces any more, does anyone have any suggestions?

2017-02-07 16:56:51 -0600 commented question RENAMED: How to remove background light on high quality frames

Any ideas guys ? In natural lighting this works fairly OK at night it now does not when the lights are on, something that has never been an issue when directly accessing the frames from the webcam. I know that I have to reduce background light etc but am struggling to find a good solution.

2017-02-07 03:19:31 -0600 commented question RENAMED: How to remove background light on high quality frames

Out of ideas now, eyes and smiles detects even when there is nothing in view, so far have tried to remove background color, tried to darken image, no luck, tried modifying the brightness of the stream itself, again no luck.

2017-02-07 00:20:53 -0600 commented question RENAMED: How to remove background light on high quality frames

It is the quality increase that is the issue on the NN side, but it is stemming from OpenCV, if I shut the lights off and just keep the screen lighting on my face it detects ok on opencv side and also the NN:

GOT FIRST FAIL
GOT SECOND FAIL
Found 1 face(s)
Published to Device Tass Commercial Recognition Channel

Where as with the light it skips to 3rd fail (Order as in configs above) until hitting the eyes and smile cascaade. So need to work on the lighting I guess, this is the weirdest night I have had in ages lol In addition the images end up on the NN server about 10 minutes behind.

2017-02-06 21:16:50 -0600 commented question RENAMED: How to remove background light on high quality frames

EDITED as included in first post.

UPDATE: I solved the issue by including eyes and smile, which still meant that the main face detections failed, but, it was picked up with the inclusion of the other haarcascades, now my issue lies on the A.I server (Not related to open CV, just moaning lol ) it is not identifying captured images now so I am retraining the neural net on the newly captured images (with hope :) that it is in the increase in quality that is failing it ) If anyone can suggest some modifications I can make to get the main haarcascades detecting again would be great. Thanks in advance.

2017-02-06 14:11:27 -0600 asked a question RENAMED: How to remove background light on high quality frames

Hi guys due to not being able to get a stable stream running, I switched to having a stream set up with Linux Motion and am attempting to get that imported into my opencv program which works but, the haarcascades facial detection is terrible now. As the settings for the stream are different I have done the following:

    self.OpenCVCapture = cv2.VideoCapture()
    self.OpenCVCapture.open('http :// 192.168.1.XX:XXXX/stream.mjpg')

    self.OpenCVCapture.set(CV_CAP_PROP_FPS, 30) 
    self.OpenCVCapture.set(3,1280)
    self.OpenCVCapture.set(4,720)

The settings for the dimensions worked and increased the accuracy of the detection which prior to this when simply pulling the frames from a webcam was working great.

The issue I have now is changing the FPS to match the stream, everything I have found fails, this is the only thing I can think of that is causing the decrease in identification, all of the images made from the capture are spot on clear and the correct dimensions, in fact even maybe more clear than the webcam was running through open cv alone, can anyone offer any advice as how to change the FPS please ?

I now have the stream from motion in realtime 30 fps, somethings I tried:

 self.OpenCVCapture.set(cv2.cv.CV_CAP_PROP_FPS, 30)
AttributeError: 'module' object has no attribute 'cv'

 self.OpenCVCapture.set(CV_CAP_PROP_FPS, 30)
NameError: name 'CV_CAP_PROP_FPS' is not defined

This is really annoying, the picture quality from the frame capture write is double the quality of what it was before but now it is detecting a face at maybe 5 / 100, where as before it was around maybe 75 / 100. Any ideas guys ?

The image write after further inspection is massively behind. I can only put it down to the fps, but cannot find a solution to set it that works.

Updated (AGAIN):

I have managed to get the FPS sorted, but this has not solved the issue.

self.OpenCVCapture.set(5, 30)

It actually made it worse, can someone put me out of my misery please :) It is failing with the following settings which were previously detecting my face almost every time:

"ClassifierSettings":{
        "HAAR_FACES": "Haarcascades/haarcascade_frontalface_default.xml",
        "HAAR_FACES2": "Haarcascades/haarcascade_frontalface_alt.xml",
        "HAAR_FACES3": "Haarcascades/haarcascade_frontalface_alt2.xml",
        "HAAR_PROFILES": "Haarcascades/haarcascade_profileface.xml",
        "HAAR_SMILE": "Haarcascades/haarcascade_smile.xml",
        "HAAR_EYE": "Haarcascades/haarcascade_eye.xml",
        "HAAR_SCALE_FACTOR": 1.3,
        "HAAR_MIN_NEIGHBORS":4,
        "height":112,
        "width": 92
    }

Smile and eyes are not used.

UPDATE AGAIN:

So I have made a hacky solution and some progress. I worked out that if the lights are off and the screen light is the only light, it does not fail on the first 1-3 haarcascades (Order as above in the config snippet), equally my NN does not fail identification. If the lights are on, it fails all haarcascades until eys and smile, but the NN fails identification almost every time.

SOO :) I am make a guess that this is directly to do with the increase in image dimensions and quality, what would be a good way to remove the background light ?

2016-12-07 03:19:49 -0600 commented question Illegal Instruction on createEigenFaceRecognizer

You missed variable ;)

Ptr<S> something = makePtr<S>();

That works fine no crash.

2016-12-06 20:07:21 -0600 received badge  Editor (source)
2016-12-06 20:06:38 -0600 commented question Illegal Instruction on createEigenFaceRecognizer

Ok thanks, ugh. ;)

2016-12-06 08:04:38 -0600 commented answer Illegal Instruction on createEigenFaceRecognizer

http://answers.opencv.org/question/18...

This was almost exactly the same situation, we have tried the solution but it also did not solve things. Could it be related to missing something that was required in ccmake it was the first time I have used ccmake so possible I missed something out when making.

2016-12-06 08:02:10 -0600 commented answer Illegal Instruction on createEigenFaceRecognizer

Unfortunately that does not solve the error.

2016-12-06 07:58:28 -0600 commented answer Illegal Instruction on createEigenFaceRecognizer

Thanks will do.

2016-12-06 07:58:16 -0600 commented question Illegal Instruction on createEigenFaceRecognizer

Hi thanks for the reply, the exact error is Illegal Instruction. OpenCV 3.1.0, it is using Intel IoT IDE and is i586-poky-linux-g++ It happens at runtime.

http://answers.opencv.org/question/18...

This was almost exactly the same situation, we have tried the solution but it also did not solve things. Could it be related to missing something that was required in ccmake it was the first time I have used ccmake so possible I missed something out when making.

2016-12-06 01:09:07 -0600 asked a question Illegal Instruction on createEigenFaceRecognizer

Hi hoping someone can help us out. We have built OpenCV on an Intel Edison and the extended modules and got the very last stage of setting up the trainer but we are faced with Illegal Operation as soon as the code gets to:

Ptr<FaceRecognizer> model = createEigenFaceRecognizer();

We have tried suggestions about illegal instruction found on this forum but none of them have fixed it, could anyone help us fix it please? It is really very urgent. Thanks in advance.