cv2 rgb分离_OpenCV——RGB三通道分离

opencv 和 matlab 在处理彩色图像的时候。通道的存储顺序是不同的。

matlab 的排列顺序是R,G,B; 而在opencv中,排列顺序是B,G,R。

以下通过一个小程序看看opencv中的三个通道。

// PS_Algorithm.h

#ifndef PS_ALGORITHM_H_INCLUDED

#define PS_ALGORITHM_H_INCLUDED

#include

#include

#include "cv.h"

#include "highgui.h"

#include "cxmat.hpp"

#include "cxcore.hpp"

using namespace std;

using namespace cv;

#endif // PS_ALGORITHM_H_INCLUDED

// Public_Function.h

#ifndef PUBLIC_FUNCTION_H_INCLUDED

#define PUBLIC_FUNCTION_H_INCLUDED

#include

#include

#include "cv.h"

#include "highgui.h"

#include "cxmat.hpp"

#include "cxcore.hpp"

using namespace std;

using namespace cv;

void Show_Image(Mat&, const string &);

v

你可能感兴趣的:(cv2,rgb分离)