Ask Your Question

Qichao Chen's profile - activity

2018-06-26 04:30:19 -0600 received badge  Great Answer (source)
2017-06-17 15:27:50 -0600 received badge  Taxonomist
2015-04-22 11:29:29 -0600 received badge  Good Answer (source)
2014-10-22 05:06:20 -0600 received badge  Nice Answer (source)
2014-08-04 11:07:13 -0600 received badge  Teacher (source)
2013-05-26 09:32:40 -0600 answered a question When I run the following code, I get the error

The correct code should be as follow:

//You should include correct hpp file


#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/video/background_segm.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "vector"

using namespace cv;
using namespace std;

int main(int argc, char *argv[])

{
    Mat frame;
    Mat back;
    Mat fore;
    VideoCapture cap;
    //open video
    cap.open("test.avi");

    //Background Model
    BackgroundSubtractorMOG2 bg;
    vector<vector<Point> > contours;

    namedWindow("Input");
    namedWindow("Frame");
    namedWindow("Foreground");
    namedWindow("Background");
    for(;;)
    {
        //read frame
        if(!cap.read(frame))
        {
            return 0;
        }
        imshow("Input",frame);
        //get foreground
        bg(frame,fore,0.01);
        imshow("Foreground",fore);
        //get background
        bg.getBackgroundImage(back);
        //erode image
        erode(fore,fore,Mat());
        //dilate image
        dilate(fore,fore,Mat());
        //find contours
        findContours(fore,contours,CV_RETR_EXTERNAL,CV_CHAIN_APPROX_NONE);
        //draw contours to frame
        drawContours(frame,contours,-1,Scalar(0,0,255),2);
        imshow("Frame",frame);
        imshow("Background",back);

        if(waitKey(33) >= 0)
        {
            break;
        }

    }
    cap.release();
    return 0;

}

Hope can help you.

2013-05-07 08:23:08 -0600 answered a question use opencv as static library

I think you should refer to docs for help: Application Development with Static Initialization.

2013-05-04 11:09:28 -0600 commented answer How to use cvMakeSeqHeaderForArray in Javacv?

What is your purpose?

2013-05-04 05:09:57 -0600 answered a question How to use cvMakeSeqHeaderForArray in Javacv?

See FQA about OpenCV wrappers.

If you have any question about JavaCV,you should go to JavaCV groups,instead here.JavaCV is independent project.

BTW,OpenCV != JavaCV.

2013-05-03 13:42:29 -0600 answered a question CVTConvert inplace not working.
  1. If you have any question about javacv,you should go to javacv groups,javacv is an independent project.See FQA
  2. You can try this code for init each IplImage:
     IplImage Image = IplImage.create(width, height, IPL_DEPTH_8U, nChannels);
2013-05-03 13:19:18 -0600 received badge  Supporter (source)
2013-05-03 13:15:34 -0600 answered a question How can I resize an image with OpenCV ?

if you use opencv2,you can do like this:

Size size(100,100);//the dst image size,e.g.100x100
Mat dst;//dst image
Mat src;//src image
resize(src,dst,size);//resize image

2013-04-27 12:22:05 -0600 commented answer Super Resolution with opencv

Maybe you can check out this website: http://opencv.jp/opencv2-x-samples/usage_of_sparsemat_2_superresolution it has code for super resolution.

2013-04-27 00:59:12 -0600 answered a question Super Resolution with opencv

See the full Change Log for more information about 2.4.5

and the same topic!

2013-04-19 09:28:50 -0600 answered a question How to link open CV libraries to my apk

OpenCV4Android SDK allow you to develop apps without opencv manager! you have to look at docs for help.

2013-04-05 00:08:09 -0600 received badge  Scholar (source)
2013-04-04 11:07:55 -0600 asked a question How to get background image from frames,android?

OpenCV4Android(2.4.4) doesn't support BackgroundSubtractorMOG2,it has BackgroundSubtractorMOG.how to get background and foreground image from frames.BTW,why OpenCV4Android doesn't support BackgroundSubtractorMOG2? thanks!

2012-12-08 13:41:44 -0600 asked a question How to pass Mat array between two android activities

I have a problem with passing Mat array between two android activities,anyone can help me?

I have solved these problem by writing Mat array to SD-Card as images and read images from SD-Card in another activity.but it has a problem with speed when running on the android phone.

thanks.

2012-11-07 12:52:57 -0600 received badge  Editor (source)
2012-11-07 12:52:06 -0600 asked a question Why I always get errors on static initialization for Android

Here is my problem ask on stackoverflow http://stackoverflow.com/questions/13276068/anyone-has-succeed-with-static-linking-opencv-for-android.

I just follow the steps on opencv official doc here http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.html#dev-with-ocv-on-android

and check the opencv Q&A and stackoverflow same topic but at least now I haven't solve the problem.anyone can give the steps to static linking opencv for android.

Forgive me for unfamiliar English

Thanks,Chen

2012-11-05 13:31:06 -0600 asked a question How to solve the problem of static initialization of opencv manager

First of all thanks to opencv developers! I want to consult on how to static initialize opencv in my own android application,and I was develop a camera application which have to using opencv,I begin with this link text but when I try to static initialize the examples of opencv-2.4.3-android-sdk,and I did the same steps that "Application development with static initialization" gives,but can't get success,it always says "package not found" and I have checked the topic the same to my question but still could not find the right ways. anyone can help me? what step I should pay attention to? thanks again!