mat

How to give YUV data input to Opencv?

☆樱花仙子☆ 提交于 2019-12-01 09:45:09
I am a beginner to Opencv. In my new opencv project I have to capture video frames from a camera device and need to give them to the opencv for processing, But now my camera is not working(hardware issue). And I need to test the opencv application with a YUV file obtained from another camera device of the same type. So my questions are: How can i give YUV data to opencv? Does opencv support YUV data? From my investigation I could know that The opencv converts the captured frames to a format Mat.So Is there any way to convert the YUV data directly to Mat object and given to the opencv for

How to give YUV data input to Opencv?

北城以北 提交于 2019-12-01 08:27:54
问题 I am a beginner to Opencv. In my new opencv project I have to capture video frames from a camera device and need to give them to the opencv for processing, But now my camera is not working(hardware issue). And I need to test the opencv application with a YUV file obtained from another camera device of the same type. So my questions are: How can i give YUV data to opencv? Does opencv support YUV data? From my investigation I could know that The opencv converts the captured frames to a format

list file extensions supported by OpenCV

送分小仙女□ 提交于 2019-12-01 06:28:48
In OpenCV, I see imread() and VideoCapture() both take a string to a file path of multiple extensions. Is there a way to get a list of extensions that are supported by them? For example, getting a list of "jpg", "png", "mov", "mpg", etc.? I assume this is system dependent and others have needed to query this at runtime. Furthermore, how is support determined? If have something like the below code and the Mat I get back always seems partially corrupted (I can see a bit of the image). It doesn't seem to change regardless of the frame number I ask for. I can play this video in my video player

How to read the text file and create Mat object in C++

假如想象 提交于 2019-12-01 06:16:00
Hi i have being able to write a Mat object in to a text file. As follows, std::fstream outputFile; outputFile.open( "myFile.txt", std::ios::out ) ; outputFile << des_object.rows << std::endl; outputFile << des_object.cols << std::endl; for(int i=0; i<des_object.rows; i++) { for(int j=0; j<des_object.cols; j++) { outputFile << des_object.at<float>(i,j) << std::endl; } } outputFile.close( ); In my code in the first 2 lines im printing the row count and the column count to use when im reading it back. But im unable to read the text file and create the Mat Object again. The following is the code i

How to read the text file and create Mat object in C++

十年热恋 提交于 2019-12-01 04:58:21
问题 Hi i have being able to write a Mat object in to a text file. As follows, std::fstream outputFile; outputFile.open( "myFile.txt", std::ios::out ) ; outputFile << des_object.rows << std::endl; outputFile << des_object.cols << std::endl; for(int i=0; i<des_object.rows; i++) { for(int j=0; j<des_object.cols; j++) { outputFile << des_object.at<float>(i,j) << std::endl; } } outputFile.close( ); In my code in the first 2 lines im printing the row count and the column count to use when im reading it

list file extensions supported by OpenCV

浪子不回头ぞ 提交于 2019-12-01 04:25:51
问题 In OpenCV, I see imread() and VideoCapture() both take a string to a file path of multiple extensions. Is there a way to get a list of extensions that are supported by them? For example, getting a list of "jpg", "png", "mov", "mpg", etc.? I assume this is system dependent and others have needed to query this at runtime. Furthermore, how is support determined? If have something like the below code and the Mat I get back always seems partially corrupted (I can see a bit of the image). It doesn

How to create empty Mat in OpenCV?

回眸只為那壹抹淺笑 提交于 2019-11-30 19:13:35
How to create empty Mat in OpenCV? After creation I want to use push_back method to push rows in Mat. Something like: Mat M(0,3,CV_32FC1); or only option is: Mat M; M.converTo(M,CV_32FC1); ? You can create an empty matrix simply using: Mat m; If you already know its type , you can do: Mat1f m; // Empty matrix of float If you know its size : Mat1f m(rows, cols); // rows, cols are int or Mat1f m(size); // size is cv::Size And you can also add the default value : Mat1f m(2, 3, 4.1f); // // 4.1 4.1 4.1 // 4.1 4.1 4.1 If you want to add values to an empty matrix with push_back , you can do as

How to create empty Mat in OpenCV?

梦想与她 提交于 2019-11-30 16:56:51
问题 How to create empty Mat in OpenCV? After creation I want to use push_back method to push rows in Mat. Something like: Mat M(0,3,CV_32FC1); or only option is: Mat M; M.converTo(M,CV_32FC1); ? 回答1: You can create an empty matrix simply using: Mat m; If you already know its type , you can do: Mat1f m; // Empty matrix of float If you know its size : Mat1f m(rows, cols); // rows, cols are int or Mat1f m(size); // size is cv::Size And you can also add the default value : Mat1f m(2, 3, 4.1f); // //

How to get Mat with a drawable input in Android using OpenCV

笑着哭i 提交于 2019-11-30 13:57:32
I have some image files in the drawable folder. And now, I want to convert them into opencv Mat object. I've found a function: Mat img = Highgui.imread(inFile); which is reading a file path to get the Mat. However, I can't get path of my images as I can only read them by using their id like R.drawable.img1. How could I achieve what I want? This should do Mat img = Utils.loadResource(context, refrenceimgID, Highgui.CV_LOAD_IMAGE_COLOR); Imgproc.cvtColor(img, gryimg, Imgproc.COLOR_RGB2BGRA); 来源: https://stackoverflow.com/questions/20184215/how-to-get-mat-with-a-drawable-input-in-android-using

How to convert a heap dump in android to eclipse format

亡梦爱人 提交于 2019-11-30 03:55:24
Im attempting to analyze a memory leak that has been driving me crazy for weeks, I found out about the eclipse MAT tool that helps you to figure out what is wrong, the problem is every single tutorial I have found says that I need to convert the format of the file from dalvik to HPROF format, however not one single tutorial I can find explains how to actually do it, instead I get vague things like this Now the file you will get does not conform to the "standard" Sun .hprof format but is written in Dalvik's own format and you need to convert it: hprof-conv heap-dump-tm-pid.hprof 4mat.hprof what