1. 請問一下,matlab安裝好edm工具包後,輸入網上給的代碼發現不顯示時間和位移,該怎麼辦
打開emd_visu源代碼,在畫圖的地方加上xlabel('橫坐標');另外這兩個代碼最後畫圖部分amd_visu參數都不一樣,一個是y是加噪後的信號,一個是x是單純的信號,第一張圖應該是代碼二的,第二張圖應該是代碼一的
2. matlab 里emd 工具箱的調用方法 就是用哪個指令進行emd 分解
matlab沒有自帶工具箱吧。。。
應該執行它的.m文件
3. opencv中的EMD演算法,幾個參數求解釋
整個項目的結構圖:
編寫DetectFaceDemo.java,代碼如下:
[java] view
plainprint?
package com.njupt.zhb.test;
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.MatOfRect;
import org.opencv.core.Point;
import org.opencv.core.Rect;
import org.opencv.core.Scalar;
import org.opencv.highgui.Highgui;
import org.opencv.objdetect.CascadeClassifier;
//
// Detects faces in an image, draws boxes around them, and writes the results
// to "faceDetection.png".
//
public class DetectFaceDemo {
public void run() {
System.out.println("\nRunning DetectFaceDemo");
System.out.println(getClass().getResource("lbpcascade_frontalface.xml").getPath());
// Create a face detector from the cascade file in the resources
// directory.
//CascadeClassifier faceDetector = new CascadeClassifier(getClass().getResource("lbpcascade_frontalface.xml").getPath());
//Mat image = Highgui.imread(getClass().getResource("lena.png").getPath());
//注意:源程序的路徑會多列印一個『/』,因此總是出現如下錯誤
/*
* Detected 0 faces Writing faceDetection.png libpng warning: Image
* width is zero in IHDR libpng warning: Image height is zero in IHDR
* libpng error: Invalid IHDR data
*/
//因此,我們將第一個字元去掉
String xmlfilePath=getClass().getResource("lbpcascade_frontalface.xml").getPath().substring(1);
CascadeClassifier faceDetector = new CascadeClassifier(xmlfilePath);
Mat image = Highgui.imread(getClass().getResource("we.jpg").getPath().substring(1));
// Detect faces in the image.
// MatOfRect is a special container class for Rect.
MatOfRect faceDetections = new MatOfRect();
faceDetector.detectMultiScale(image, faceDetections);
System.out.println(String.format("Detected %s faces", faceDetections.toArray().length));
// Draw a bounding box around each face.
for (Rect rect : faceDetections.toArray()) {
Core.rectangle(image, new Point(rect.x, rect.y), new Point(rect.x + rect.width, rect.y + rect.height), new Scalar(0, 255, 0));
}
// Save the visualized detection.
String filename = "faceDetection.png";
System.out.println(String.format("Writing %s", filename));
Highgui.imwrite(filename, image);
}
}
package com.njupt.zhb.test;
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.MatOfRect;
import org.opencv.core.Point;
import org.opencv.core.Rect;
import org.opencv.core.Scalar;
import org.opencv.highgui.Highgui;
import org.opencv.objdetect.CascadeClassifier;
//
// Detects faces in an image, draws boxes around them, and writes the results
// to "faceDetection.png".
//
public class DetectFaceDemo {
public void run() {
System.out.println("\nRunning DetectFaceDemo");
System.out.println(getClass().getResource("lbpcascade_frontalface.xml").getPath());
// Create a face detector from the cascade file in the resources
// directory.
//CascadeClassifier faceDetector = new CascadeClassifier(getClass().getResource("lbpcascade_frontalface.xml").getPath());
//Mat image = Highgui.imread(getClass().getResource("lena.png").getPath());
//注意:源程序的路徑會多列印一個『/』,因此總是出現如下錯誤
/*
* Detected 0 faces Writing faceDetection.png libpng warning: Image
* width is zero in IHDR libpng warning: Image height is zero in IHDR
* libpng error: Invalid IHDR data
*/
//因此,我們將第一個字元去掉
String xmlfilePath=getClass().getResource("lbpcascade_frontalface.xml").getPath().substring(1);
CascadeClassifier faceDetector = new CascadeClassifier(xmlfilePath);
Mat image = Highgui.imread(getClass().getResource("we.jpg").getPath().substring(1));
// Detect faces in the image.
// MatOfRect is a special container class for Rect.
MatOfRect faceDetections = new MatOfRect();
faceDetector.detectMultiScale(image, faceDetections);
System.out.println(String.format("Detected %s faces", faceDetections.toArray().length));
// Draw a bounding box around each face.
for (Rect rect : faceDetections.toArray()) {
Core.rectangle(image, new Point(rect.x, rect.y), new Point(rect.x + rect.width, rect.y + rect.height), new Scalar(0, 255, 0));
}
// Save the visualized detection.
String filename = "faceDetection.png";
System.out.println(String.format("Writing %s", filename));
Highgui.imwrite(filename, image);
}
}
3.編寫測試類:
[java] view
plainprint?
package com.njupt.zhb.test;
public class TestMain {
public static void main(String[] args) {
System.out.println("Hello, OpenCV");
// Load the native library.
System.loadLibrary("opencv_java246");
new DetectFaceDemo().run();
}
}
//運行結果:
//Hello, OpenCV
//
//Running DetectFaceDemo
///E:/eclipse_Jee/workspace/JavaOpenCV246/bin/com/njupt/zhb/test/lbpcascade_frontalface.xml
//Detected 8 faces
//Writing faceDetection.png
package com.njupt.zhb.test;
public class TestMain {
public static void main(String[] args) {
System.out.println("Hello, OpenCV");
// Load the native library.
System.loadLibrary("opencv_java246");
new DetectFaceDemo().run();
}
}
//運行結果:
//Hello, OpenCV
//
//Running DetectFaceDemo
///E:/eclipse_Jee/workspace/JavaOpenCV246/bin/com/njupt/zhb/test/lbpcascade_frontalface.xml
//Detected 8 faces
//Writing faceDetection.png
4. MATLAB中如何調用EMD工具箱
你在晚上找emd.m文件,然後添加到matlab的toolbox文件夾下就行
5. 求助,請教EMD工具箱使用問題,出來的c2f,f2c是什麼東西
你在命令床後輸入「help emd」就知道這個工具箱是否添加進來了,沒有的話就是路徑設置不成功,可能是沒有保存
6. 為什麼我把EMD工具箱放在MATLAB\TOOLBOX\下,並且也設置了路徑,但是在start---toolbox中卻找不到呢,本人剛
你在命令床後輸入「help
emd」就知道這個工具箱是否添加進來了,沒有的話就是路徑設置不成功,可能是沒有保存
7. 我在MATLAB中新添加的一個EMD工具箱,怎麼界面上找不到 不知道怎麼運行
不知道你添加成功沒有,在File-set path中加
如果成功的話,點matlab左下角的Start,Toolboxes裡面就有你加入的工具箱了
8. MATLAB中EMD工具箱安裝不上
經驗模態分解不需要工具箱啊,就是幾個函數 放到你的執行文件夾下面直接調用就可以啊。
9. matlab emd工具箱使用
其實用起來也很簡單的,舉個例子:
clearall;
clf;
t=0:0.1:4*pi;
%構造一個信號
x=10.*sin(t)+5.*cos(2.*t);
%加點內噪容聲
noise=normrnd(0,1,1,length(x));
y=x+noise;
%emd分解
imf=emd(x);
[mn]=size(imf);
emd_visu(x,t,imf);
10. matlab裝上EMD工具箱後怎麼調用emd函數啊
下載的工具箱中的emd.m文件里的注釋有詳細的用法介紹。
工具箱的安裝
運行install_emd.m文件可以實現此工具箱的安裝,uninstall_emd.m實現卸載。
安裝中的問題
但是安裝的時候,如果使用的是VS的編譯器(mbuild –setup、mex –setup設置),會報找不到complex.h的問題(用Linux下的Matlab不會出錯),從而使cemdc2_fix.c等文件編譯失敗,這幾個文件是為了快速實現計算EMD而用c編寫的,所以即使編譯失敗,也不影響直接使用emd.m實現EMD功能。如果想編譯成功,可如下修改:(摘自http://www.chinavib.com/thread-79866-1-1.html)
G. Rilling 07年3月份的程序,運行作者的install_emd.m,出現找不到complex.h的問題,以下是個人的理解和解決過程:(個人的運行環境為matlab6.5)
complex.h的問題
產生原因:採用matlab的C編譯函數mex時,定義了C99_OK的宏(EMDS/make_emdc.m (28行)),利用的是ANSI C99標准如果個人的電腦中沒有相關的支持,就會出現這個問題。
解決方法:EMDS/make_emdc.m中第28行中mex(』-DC99_OK『,args(:))語句中的 '-DC99_OK' 即可。
注意:
改完之後,運行install_emd,會出現M_PI沒有定義的問題,缺少了常數PI的宏定義,導致一些.c文件編譯失敗。
產生原因:去掉C99_OK之後,程序中使用的是作者提供的 emd_complex.h和emd_complex.c兩個文件來支持復數運算,這兩個文件中,並沒有定義M_PI這個宏。
解決方法:M_PI這個宏,只在兩個文件中(clocal_mean.c和clocal_mean2.c)使用,個人的解決方法是,在相應的頭文件(clocal_mean.h和clocal_mean2.h)中加入M_PI的宏定義即可。
在兩個.h文件中分別加入一下語句:
#define CLOCAL_MEAN_H
#ifndef M_PI
#define M_PI 3.1415926
#endif
安裝完成後,編譯輸出的.dll文件會出現,重復後綴名的問題,及 xxx.dll 變成了 xxx.dll.dll自己去掉多餘的.dll即可
最後,關於版本問題:作者推薦使用7.1+版本,但只是針對個別的函數有影響,主要是作者提供的例子程序,無法在matlab6.5環境中運行,演算法的主要功能函數並不受影響。