6/29/2017

Error MSB8031, multi byte character set problem in vs 2013

error MSB8031: Building an MFC project for a non-Unicode character set is deprecated. You must change the project property to Unicode or download an additional library. See http://go.microsoft.com/fwlink/p/?LinkId=286820 for more information.

Don't worry about that.
VS 2013 is not support MFC library for MBCS.
They recommend unicode default.

So it can solve easily.
Go below url, download and install.

6/26/2017

cvCvtPixToPlane, cvCvtPlaneToPix -> split, merge / example code and explanation


In previous version of oepncv which used iplImage, these functions are used -> cvCvtPixToPlane and cvCvtPlaneToPix.

This article introduces how this functions are used and what to use in the current version.


1. cvCvtPixToPlane

It is same with split function in current version.
So channels of the input image are seperately stored.

ex) old version
iplImage img; //BGR 3 colors image
iplImage B,G,R;
cvCvtPixToPlane(img, B, G, R, NULL);


ex) current version

Mat img; //BGR 3 colors image
vector< Mat > BGR(3);
split(img, BGR);
BGR[0]; //B Mat
BGR[1]; //G Mat
BGR[2]; //R Mat


2. cvCvtPlaneToPix
It is same with mere function in current version.
So each mat is merged into one Mat.

ex) old version

iplImage B,G,R;
iplImage BGR;
cvCvtPlaneToPix(B, G, R, NULL, BGR);


ex) current version
vector< Mat > BGR(3);
Mat img;
merge(BGR, img);


Thank you.

refer to gpu version split and merge example :
http://study.marearts.com/2014/11/opencv-gpu-3-channel-blur-example.html



6/19/2017

tip, CString token in MFC

refer to below code.


CString selectedModel;
m_ListBoxOfConnection.GetText(sel, selectedModel);
//selectedModel = "com1,model1,base";

CString comStr;
CString modelStr;
CString optionStr;

AfxExtractSubString(comStr, selectedModel, 0, ',');
AfxExtractSubString(modelStr, selectedModel, 1, ',');
AfxExtractSubString(optionStr, selectedModel, 2, ',');


//then
//comStr = com1
//modelStr = model1
//optionStr = base


Thank you.



6/18/2017

small tip, mfc listbox all delete

ListBox.ResetContent();

^^

tip, CString to int, MFC

CString str; 
int integer; 

integer = _wtoi(str); // wide charater formats 
integer = _atoi(str); // otherwise


Thank you~!!


6/15/2017

small tip : Convert char * to LPCTSTR

CA2W(str)

for example

char str[100];
sprintf(str, "str_%d", 100);
CString A = CA2W(str);

^^

6/14/2017

stl vector test for pop back and pop front


STL Vector test for pop_back, pop_back_n and pop front.

I wanted to erase first element.
but there is no inner function.
pop_back, pop_back_n is that erase last element in vectors.
The last sample is the method to pop front.

refer to this sample code.

< gist >



< /gist >