Ask Your Question

flaviu2's profile - activity

2020-10-28 05:09:41 -0600 received badge  Student (source)
2020-10-28 03:03:47 -0600 marked best answer Input file is invalid

I am a newbie in Python. I have a OpenCV related issue. I have this simple code:

import sys
from matplotlib import pyplot
import cv2

im = cv2.imread("E:\\Face.jpg")

def plot_img(img):
    rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
    pyplot.imshow(rgb)

if im.any():
    plot_img(im)

if im.any():
    classifier = cv2.CascadeClassifier()
    classifier.load("E:\\haarcascade_eye.xml")
    classifier.detectMultiScale(im)

but on line classifier.load("E:\haarcascade_eye.xml") I got the following error:

Exception has occurred: error
OpenCV(4.4.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-d54til6p\opencv\modules\core\src\persistence.cpp:717: error: (-49:Unknown error code -49) Input file is invalid in function 'cv::FileStorage::Impl::open'
  File "D:\Tempx\PythonApplication1\PythonApplication1.py", line 18, in <module>
    classifier.load("E:\\haarcascade_eye.xml")

I have downloaded haarcascade_eye.xmlfrom here: https://github.com/opencv/opencv/tree...

What could be the problem ?

2020-10-27 11:16:09 -0600 commented question Input file is invalid

Thank you a lot, that was the problem. I wonder from where can I take the right xml files because I took the wrong xml f

2020-10-27 06:33:17 -0600 edited question Input file is invalid

Input file is invalid I am a newbie in Python. I have a OpenCV related issue. I have this simple code: import sys from

2020-10-27 06:33:02 -0600 edited question Input file is invalid

detectMultiScale in Python I am a newbie in Python. I have a OpenCV related issue. I have this simple code: import sys

2020-10-27 06:32:22 -0600 asked a question Input file is invalid

detectMultiScale in Python I am a newbie in Python. I have a OpenCV related issue. I have this simple code: import sys

2020-10-06 04:26:30 -0600 marked best answer Using OpenCV in MFC cause memory leak

I am using OpenCV into MFC project ... but I noticed something strange: if I only insert

#include <opencv2/opencv.hpp>

then I have a lot of memory leak:

Detected memory leaks!
Dumping objects ->
{27112} normal block at 0x02BA8360, 128 bytes long.
 Data: <                > FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 
{146} normal block at 0x00D35158, 4 bytes long.
 Data: < Q  > 98 51 D3 00 
{145} normal block at 0x00D35098, 125 bytes long.
 Data: <                > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD 
{144} normal block at 0x00D34FE0, 122 bytes long.
 Data: <                > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD 
{143} normal block at 0x00D34F28, 121 bytes long.
 Data: <                > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD 
{142} normal block at 0x00D34E68, 129 bytes long.
 Data: <                > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD 
 Data: <    8L      (   > CD CD CD CD 38 4C D3 00 00 00 00 00 28 00 00 00 
Object dump complete.
The program '[4428] TestOpen.exe: Native' has exited with code 0 (0x0).

and I used no object from OpenCV library ... I have done something wrong ?

2020-10-06 04:26:27 -0600 received badge  Supporter (source)
2020-01-02 08:28:33 -0600 commented question Add opencv resources to my MFC project

I added manually the needed libraries. Seem to go by now.

2020-01-02 05:39:21 -0600 commented question Add opencv resources to my MFC project

I updated the first post. There is some link errors now ...

2020-01-02 05:38:54 -0600 edited question Add opencv resources to my MFC project

Add opencv resources to my MFC project I have successfully compiled the latest OpenCV library (4.2.0). Now, I intend to

2020-01-02 05:28:31 -0600 commented question Add opencv resources to my MFC project

You had right :)

2020-01-02 05:04:33 -0600 asked a question Add opencv resources to my MFC project

Add opencv resources to my MFC project I have successfully compiled the latest OpenCV library (4.2.0). Now, I intend to

2018-08-30 04:52:49 -0600 commented question How to read .mov file ?

Please put some .mov file here, in order to try it ... maybe I can help you.

2018-07-26 04:29:44 -0600 commented question How to use opencv in c++ classes?

And which C++ framework intend to use ?

2018-07-25 04:14:49 -0600 marked best answer Error loading CascadeClassifier

Hi. I have met a weird crash rtying to load an xml into CascadeClassifier:

            if(! m_CascadeFace.load("haarcascade_frontalface_alt.xml")) // <-- crash
            return;

where m_CascadeFace is type of cv::CascadeClassifier.

Is there any wrong here ? I have taken this xml from here: link text

can you help me ?

2018-07-25 03:50:39 -0600 commented question Error loading CascadeClassifier

Berak, tank you. You were right. I have checked xml files with this tool: link text but I downloaded from github, withou

2018-07-25 01:36:53 -0600 commented question Error loading CascadeClassifier

I remove the image.

2018-07-24 06:44:15 -0600 edited question Error loading CascadeClassifier

Error loading CascadeClassifier Hi. I have met a weird crash rtying to load an xml into CascadeClassifier:

2018-07-24 06:43:30 -0600 edited question Error loading CascadeClassifier

Error loading CascadeClassifier Hi. I have met a weird crash rtying to load an xml into CascadeClassifier:

2018-07-24 05:57:14 -0600 asked a question Error loading CascadeClassifier

Error loading CascadeClassifier Hi. I have met a weird crash rtying to load an xml into CascadeClassifier:

2018-07-23 08:18:40 -0600 commented question OpenCV 3.4.1 compiled with VS2008

As far as I remember, yes, I have used OpenCV dll compiled in VS2010 in VS2008 projects ... but I quickly convert my VS2

2018-06-28 04:31:33 -0600 commented question Run OpenCV to MFC

Can you detail a little bit ? These blobs should not be drawn on m_Mat ? But where then ? P.S. And do you mean with IOW

2018-06-28 04:30:46 -0600 commented question Run OpenCV to MFC

Can you detail a little bit ? These blobs should not be drawn on m_Mat ? But where then ?

2018-06-19 06:05:23 -0600 edited answer Run OpenCV to MFC

Here is the code: void CMyDoc::DrawVideoImageSubtractionAndCount() { if(m_bFirstFrame) { m_Video.read(m_Mat1);

2018-06-18 06:49:13 -0600 edited answer Run OpenCV to MFC

Here is the code: void CMyDoc::DrawVideoImageSubtractionAndCount() { if(m_bFirstFrame) { m_Video.read(m_Mat1);

2018-06-18 06:48:37 -0600 edited answer Run OpenCV to MFC

Here is the code: void CMyDoc::DrawVideoImageSubtractionAndCount() { if(m_bFirstFrame) { m_Video.read(m_Mat1);

2018-06-18 06:36:37 -0600 edited answer Run OpenCV to MFC

Here is the code: void CMyDoc::DrawVideoImageSubtractionAndCount() { if(m_bFirstFrame) { m_Video.read(m_Mat1);

2018-06-18 06:18:52 -0600 answered a question Run OpenCV to MFC

Here is the code: void CMyDoc::DrawVideoImageSubtractionAndCount() { if(m_bFirstFrame) { m_Video.read(m_Mat1);

2018-06-15 04:38:03 -0600 edited question Run OpenCV to MFC

Run OpenCV to MFC I have reproduced this sample, in a MFC app. The cv::Mat is a CDOcument variable member: // Attribut

2018-06-15 04:04:16 -0600 edited question Run OpenCV to MFC

Run OpenCV to MFC I have reproduced this sample, in a MFC app. The cv::Mat is a CDOcument variable member: // Attribut

2018-06-15 04:03:52 -0600 asked a question Run OpenCV to MFC

Run OpenCV to MFC I have reproduced this sample, in a MFC app. The cv::Mat is a CDOcument variable member: // Attribut

2018-05-11 07:30:10 -0600 marked best answer Rendering to slow

Hi. I have tried a people detector from here:

People detector

beside it doesn't detect very well the people inside of video, the program takes 99% CPU load … why ? It is normal ?

Here is the sample code:

    VideoCapture cap;
cap.open(_T("C:\\Flaviu\\Cat Calls Walking in Street.avi"));
Detector detector;
Mat frame;
for(;;)
{
    cap >> frame;
    if (frame.empty())
    {
        cout << "Finished reading: empty frame" << endl;
        break;
    }
    int64 t = getTickCount();
    vector<Rect> found = detector.detect(frame);    // <------------- this line takes 99% CPU load !!!
    t = getTickCount() - t;
    // show the window
    {
        ostringstream buf;
        buf << "Mode: " << detector.modeName() << " ||| "
            << "FPS: " << fixed << (getTickFrequency() / (double)t);
        putText(frame, buf.str(), Point(10, 30), FONT_HERSHEY_PLAIN, 2.0, Scalar(0, 0, 255), 2, LINE_AA);
    }
    for (vector<Rect>::iterator i = found.begin(); i != found.end(); ++i)
    {
        Rect &r = *i;
        detector.adjustRect(r);
        rectangle(frame, r.tl(), r.br(), cv::Scalar(0, 255, 0), 2);
    }//*/
    imshow("People detector", frame);
    // interact with user
    const char key = (char)waitKey(30);
    if (key == 27 || key == 'q') // ESC
    {
        cout << "Exit requested" << endl;
        break;
    }
    else if (key == ' ')
    {
        detector.toggleMode();
    }
}

I have done soething wrong here ?

2018-05-11 07:30:10 -0600 received badge  Scholar (source)
2018-05-11 06:59:42 -0600 commented question Rendering to slow

No, I don't have CUDA … hmm .. so, if I haven't, it isn't possible to run a decent OpenCV app, with some filters ?

2018-05-11 06:43:12 -0600 asked a question Rendering to slow

Rendering to slow Hi. I have tried a people detector from here: People detector beside it doesn't detect very well the

2018-05-09 01:49:37 -0600 edited question draw rect around cars

draw rect around cars Hi all of you. For the first beginning, please have patience with my question, I am a beginner in

2018-05-08 08:50:00 -0600 asked a question draw rect around cars

draw rect around cars Hi all of you. For the first beginning, please have patience with my question, I am a beginner in

2018-04-19 03:21:22 -0600 commented question Draw image incorrectly

Berak, your comments mean a lot for me, I am a newbie in OpenCV ! Thank you !

2018-04-18 06:22:54 -0600 edited question Draw image incorrectly

Draw image incorrectly I intent to use OpenCV into MFC app, when to render images and videos ... I have used cv::Mat to

2018-04-18 06:22:12 -0600 commented question Draw image incorrectly

I have updated my answer. Thank you !

2018-04-18 06:05:21 -0600 commented question Draw image incorrectly

I have updated my answer. Thank you for any hint !

2018-04-18 06:04:31 -0600 received badge  Editor (source)
2018-04-18 06:04:31 -0600 edited question Draw image incorrectly

Draw image incorrectly I intent to use OpenCV into MFC app, when to render images and videos ... I have used cv::Mat to

2018-04-18 05:23:13 -0600 commented question Draw image incorrectly

Then, how to compute the image width ?

2018-04-18 05:17:21 -0600 commented question Draw image incorrectly

Kindly thank you for your response. Can you detail a little bit how to re-compute the image alignment ? Or, should I not

2018-04-18 04:35:13 -0600 asked a question Draw image incorrectly

Draw image incorrectly I intent to use OpenCV into MFC app, when to render images and videos ... I have used cv::Mat to

2018-04-18 04:02:18 -0600 received badge  Enthusiast