Ask Your Question

ythen's profile - activity

2020-11-06 19:19:07 -0600 received badge  Nice Question (source)
2018-06-27 23:23:12 -0600 received badge  Famous Question (source)
2016-04-04 10:46:14 -0600 received badge  Notable Question (source)
2015-04-15 07:18:33 -0600 received badge  Popular Question (source)
2013-08-16 01:29:39 -0600 received badge  Nice Answer (source)
2013-05-13 00:48:58 -0600 answered a question OpenCV VideoCapture cannot read video in Python but able in VS11

I have solved the problem by installing the binaries from this download link provided by this answer.

It copied all opencv DLLs to C:\Python27 (or maybe other files). But I don't understand why it wouldn't work earlier as I have already included those DLLs into my PATH

2013-05-06 03:48:01 -0600 received badge  Student (source)
2013-05-06 00:32:21 -0600 asked a question OpenCV VideoCapture cannot read video in Python but able in VS11

As title, I am not able to read video using VideoCapture in python with the following code:

v = 'C:\\test.mp4'
import cv2
cap = cv2.VideoCapture(v)
if cap.isOpened():
  print "Finally"
else:
  print "BOOM"

BOOM is always being printed. sigh

Whereas in VS11, the following code works:

#include "stdafx.h"

#include <opencv2\highgui\highgui.hpp>
#include <iostream>

using namespace cv;
using namespace std;

int main(int argc, char* argv[])
{
    string v = "C:\\test.mp4";
    VideoCapture cap;
    cap.open(v);
    if (cap.isOpened()) {
        cout << "Yes!" << endl;
    } else {
        cout << "BOOM" << endl;
    }

    return 0;
}

I do realize there's a number solution in SO, but nothing works for me. I have the following dlls in C:\Python27 and C:\Python27\DLLs, as well as in PATH

  • opencv_ffmpeg.dll
  • opencv_ffmpeg_64.dll
  • opencv_ffmpeg_245_64.dll
  • opencv_ffmpeg_245.dll

I have no more idea what have not done.

Please help me. Thank you very much.

2013-04-12 03:26:59 -0600 received badge  Teacher (source)
2013-03-22 03:13:39 -0600 received badge  Self-Learner (source)
2013-03-14 02:32:38 -0600 answered a question Explanation of cascade.xml in a haar classifier

After digging into OpenCV's source code, I finally obtain answers to my own questions.

  • Values enclosed withtin internalNodes tags

node.left node.right node.featureIdx node.threshold

I'm not sure what's node.left and node.right are for as I can't see them being called anywhere.

  • The weights are used to calculate the feature as in below:

float ret = rect[0].weight * CALC_SUM(p[0], _offset) + rect[1].weight * CALC_SUM(p[1], _offset);

  • As mentioned in the first bullet, the node.featureIdx are the index of the feature that's being evaluated at that particular node.
2013-03-04 00:04:05 -0600 asked a question Explanation of cascade.xml in a haar classifier

It would be best if someone could explain the numbers/values in the cascade.xml entirely. Example in:

<!-- stage 0 -->
<_>
  <maxWeakCount>3</maxWeakCount>
  <stageThreshold>-8.8384145498275757e-001</stageThreshold>
  <weakClassifiers>
    <_>
      <internalNodes>
        0 -1 66 5.1593100652098656e-003</internalNodes>
      <leafValues>
        -8.0555558204650879e-001 8.0694979429244995e-001</leafValues></_>
    <_>
      <internalNodes>
        0 -1 108 1.5044789761304855e-002</internalNodes>
      <leafValues>
        -6.2940740585327148e-001 7.5122624635696411e-001</leafValues></_>
    <_>
      <internalNodes>
        0 -1 99 -4.7172707127174363e-005</internalNodes>
      <leafValues>
        5.5112153291702271e-001 -8.6111217737197876e-001</leafValues></_></weakClassifiers></_>

What are the meanings of these values

      <internalNodes>
        0 -1 99 -4.7172707127174363e-005</internalNodes>

Another question is, how does the program know which feature to use for a particular stage? As far as I know, features are in the form as below

<_>
  <rects>
    <_>
      21 6 3 5 -1.</_>
    <_>
      22 6 1 5 3.</_></rects>
  <tilted>0</tilted></_>

Whereby it's the coordinates of two rectangles, forming something like below:

=-=    = Black colored rectangle
=-=    - White colored rectangle
=-=
=-=
=-=

What are the values -1. and 3. mean? I know it's weights but how is it used to calculate the feature?

Summary

  1. What are the meaning of the values inside <internalNodes>?
  2. How is the feature calculated? How are the weights in <rects> use?
  3. Most importantly, which field denotes that which features are being used in a particular stage/node.

Thanks!

2013-02-24 09:23:05 -0600 commented answer Display Haar features from a trained AdaBoost classfier

great find! i actually contacted adam yesterday and he provided me with some codes. Anyways, now that I know, I still need to know which features are being tested at a particular stage and node. I would be great if anyone able to help

2013-02-22 22:53:13 -0600 asked a question Display Haar features from a trained AdaBoost classfier

Is there a way to display visually which Haar features are used at every stage of the classifier?

I have recently trained a classfier to detect vehicles, using opencv_traincascade.exe. For further analysis, I would like to see the features being evaluated at every stage.

Thanks for your help.

It will be great if anyone can supply information about the cascade.xml, what are the meaning of the nodes. Thanks

This question has also been asked here.

2013-01-29 01:10:19 -0600 received badge  Supporter (source)