Programming/openCV2014. 7. 4. 13:23
openCV 2.3.1
디버그 모드로 하면 tbb_debug.dll 을 요구함
-> intel TBB 설치 하등가..
[링크 : http://stackoverflow.com/questions/7293160/c-tbb-debug-dll-missing]

크아아아앙 45MB에 2분이나 걸려 받았더니 여기에 두구둥!!!



openCV 2.4.7 / 2.4.9
라이브러리가 깨졌는지 메모리 침범하는 듯한 현상 발생
[링크 : http://stackoverflow.com/.../why-do-the-characters-iiii-get-stuck-onto-the-begining-of-my-strings]


걍 짜증나서 2.3.1에 릴리즈 모드 사용중 ㅠㅠ
일단 tbb 정도는 설치해 볼까나..

'Programming > openCV' 카테고리의 다른 글

opencv2.. VideoCapture 클래스..  (0) 2015.09.25
openCV Mat Class  (0) 2014.07.04
opencv2 highgui  (0) 2014.07.03
opencv2 VideoCapture::get() / set() - 웹캠 설정 읽어오기  (2) 2014.07.03
opencv2 채널분리하기(split)  (0) 2014.07.03
Posted by 구차니
Programming/php2014. 7. 3. 15:48
웹소켓 조만간 쓸일이 있을것 같아서 조사중

[링크 : http://yoontaesub.egloos.com/2045579]
[링크 : http://tools.ietf.org/html/rfc6455]

웹소켓 php 적용 버전
[링크 : https://code.google.com/p/phpwebsocket/ ]


+
[링크 : http://dev.w3.org/html5/websockets/ ]

'Programming > php' 카테고리의 다른 글

lighthttpd / php / FastCGI  (0) 2014.08.28
php5 class / object oriented programming  (4) 2014.07.07
php 로그인 예제  (0) 2014.05.19
php framework / 읽을꺼리  (0) 2014.04.09
php 메뉴얼  (0) 2014.03.28
Posted by 구차니
Programming/openCV2014. 7. 3. 15:02
highgui는 이미지를 불러오거나 GUI를 꾸미기 위한 기능을 지원한다.

크게는 윈도우 생성/조절/파괴 및 키 입력대기
CV_EXPORTS_W void namedWindow(const string& winname, int flags = WINDOW_AUTOSIZE);
CV_EXPORTS_W void destroyWindow(const string& winname);
CV_EXPORTS_W void destroyAllWindows();

CV_EXPORTS_W void resizeWindow(const string& winname, int width, int height);
CV_EXPORTS_W void moveWindow(const string& winname, int x, int y);

CV_EXPORTS_W int waitKey(int delay = 0);

이미지 불러오기/저장/출력
CV_EXPORTS_W void imshow(const string& winname, InputArray mat);
 
CV_EXPORTS_W Mat imread( const string& filename, int flags=1 );
CV_EXPORTS_W bool imwrite( const string& filename, InputArray img, const vector<int>& params=vector<int>());
CV_EXPORTS_W Mat imdecode( InputArray buf, int flags );
CV_EXPORTS Mat imdecode( InputArray buf, int flags, Mat* dst );
CV_EXPORTS_W bool imencode( const string& ext, InputArray img,
                            CV_OUT vector<uchar>& buf,
                            const vector<int>& params=vector<int>()); 

비디오 캡쳐(파일 및 웹캠 지원)
class CV_EXPORTS_W VideoCapture
{
public:
    CV_WRAP VideoCapture();
    CV_WRAP VideoCapture(const string& filename);
    CV_WRAP VideoCapture(int device);

    virtual ~VideoCapture();
    CV_WRAP virtual bool open(const string& filename);
    CV_WRAP virtual bool open(int device);
    CV_WRAP virtual bool isOpened() const;
    CV_WRAP virtual void release();

    CV_WRAP virtual bool grab();
    CV_WRAP virtual bool retrieve(CV_OUT Mat& image, int channel=0);
    virtual VideoCapture& operator >> (CV_OUT Mat& image);
    CV_WRAP virtual bool read(CV_OUT Mat& image);

    CV_WRAP virtual bool set(int propId, double value);
    CV_WRAP virtual double get(int propId);

protected:
    Ptr<CvCapture> cap;
};


class CV_EXPORTS_W VideoWriter
{
public:
    CV_WRAP VideoWriter();
    CV_WRAP VideoWriter(const string& filename, int fourcc, double fps,
                Size frameSize, bool isColor=true);

    virtual ~VideoWriter();
    CV_WRAP virtual bool open(const string& filename, int fourcc, double fps,
                      Size frameSize, bool isColor=true);
    CV_WRAP virtual bool isOpened() const;
    CV_WRAP virtual void release();
    virtual VideoWriter& operator << (const Mat& image);
    CV_WRAP virtual void write(const Mat& image);

protected:
    Ptr<CvVideoWriter> writer;
};  




Posted by 구차니
Programming/openCV2014. 7. 3. 14:35

v4l2의 문제인지 설정은 잘안되고
못 불러 오는 설정사항도 많다 -_-a

VideoCapture::get
C++: double VideoCapture::get(int propId)
C: double cvGetCaptureProperty(CvCapture* capture, int property_id)

propId – Property identifier. It can be one of the following:
– CV_CAP_PROP_POS_MSEC Current position of the video file in milliseconds or video capture timestamp.
– CV_CAP_PROP_POS_FRAMES 0-based index of the frame to be decoded/captured next.
– CV_CAP_PROP_POS_AVI_RATIO Relative position of the video file: 0 - start of the film, 1 - end of the film.
CV_CAP_PROP_FRAME_WIDTH Width of the frames in the video stream.
CV_CAP_PROP_FRAME_HEIGHT Height of the frames in the video stream.
– CV_CAP_PROP_FPS Frame rate.
– CV_CAP_PROP_FOURCC 4-character code of codec.
– CV_CAP_PROP_FRAME_COUNT Number of frames in the video file.
– CV_CAP_PROP_FORMAT Format of the Mat objects returned by retrieve() .
– CV_CAP_PROP_MODE Backend-specific value indicating the current capture mode.
– CV_CAP_PROP_BRIGHTNESS Brightness of the image (only for cameras).
– CV_CAP_PROP_CONTRAST Contrast of the image (only for cameras).
– CV_CAP_PROP_SATURATION Saturation of the image (only for cameras).
– CV_CAP_PROP_HUE Hue of the image (only for cameras).
– CV_CAP_PROP_GAIN Gain of the image (only for cameras).
– CV_CAP_PROP_EXPOSURE Exposure (only for cameras).
– CV_CAP_PROP_CONVERT_RGB Boolean flags indicating whether images should be converted to RGB.
– CV_CAP_PROP_WHITE_BALANCE Currently not supported
– CV_CAP_PROP_RECTIFICATION Rectification flag for stereo cameras (note: only supported by DC1394 v 2.x backend currently) 

웹캠 설정 덤프
주석처리한 두개는 2.3.1에서는 지원하지 않고 2.4.9 에서 지원하는 항목이다.
                VideoCapture cap(0);
 
               cout << "POS_MSEC : "           << cap.get(CV_CAP_PROP_POS_MSEC) << endl;
                cout << "POS_FRAMES : "         << cap.get(CV_CAP_PROP_POS_FRAMES) << endl;
                cout << "POS_AVI_RATIO : "      << cap.get(CV_CAP_PROP_POS_AVI_RATIO) << endl;
                cout << "POS_FRAME_WIDTH : "    << cap.get(CV_CAP_PROP_FRAME_WIDTH) << endl;
                cout << "POS_FRAME_HEIGHT : "   << cap.get(CV_CAP_PROP_FRAME_HEIGHT) << endl;
                cout << "FPS : "                << cap.get(CV_CAP_PROP_FPS) << endl;
                cout << "FOURCC : "             << cap.get(CV_CAP_PROP_FOURCC) << endl;
//              cout << "FRAME_OUT : "          << cap.get(CV_CAP_PROP_FRAME_OUT) << endl;
                cout << "FORMAT : "             << cap.get(CV_CAP_PROP_FORMAT) << endl;
                cout << "MODE : "               << cap.get(CV_CAP_PROP_MODE) << endl;
                cout << "BRIHTNESS : "          << cap.get(CV_CAP_PROP_BRIGHTNESS) << endl;
                cout << "CONTRAST : "           << cap.get(CV_CAP_PROP_CONTRAST) << endl;
                cout << "SATURATION : "         << cap.get(CV_CAP_PROP_SATURATION) << endl;
                cout << "HUE : "                << cap.get(CV_CAP_PROP_HUE) << endl;
                cout << "GAIN : "               << cap.get(CV_CAP_PROP_GAIN) << endl;
                cout << "EXPOSURE : "           << cap.get(CV_CAP_PROP_EXPOSURE) << endl;
                cout << "CONVERT_RGB : "        << cap.get(CV_CAP_PROP_CONVERT_RGB) << endl;
//              cout << "WHITE_BALANCE : "      << cap.get(CV_CAP_PROP_WHITE_BALANCE) << endl;
                cout << "RECTIFICATION : "      << cap.get(CV_CAP_PROP_RECTIFICATION) << endl; 



'Programming > openCV' 카테고리의 다른 글

openCV2 관련 꿍시렁 꿍시렁  (0) 2014.07.04
opencv2 highgui  (0) 2014.07.03
opencv2 채널분리하기(split)  (0) 2014.07.03
opencv2 rgb2hsv color space 변환하기  (0) 2014.07.02
openCV2 2.3.1 ubuntu 컴파일하기  (0) 2014.07.01
Posted by 구차니
Programming/openCV2014. 7. 3. 14:02
core.hpp에 선언되어 있는 split을 사용하면 된다.
//! makes multi-channel array out of several single-channel arrays
CV_EXPORTS void merge(const Mat* mv, size_t count, OutputArray dst);
//! makes multi-channel array out of several single-channel arrays
CV_EXPORTS_W void merge(const vector<Mat>& mv, OutputArray dst);
    
//! copies each plane of a multi-channel array to a dedicated array
CV_EXPORTS void split(const Mat& src, Mat* mvbegin);
//! copies each plane of a multi-channel array to a dedicated array
CV_EXPORTS_W void split(const Mat& m, CV_OUT vector<Mat>& mv); 

vector<Mat> 형으로 변수를 선언하여
split(src, dst); 식으로 사용하면 되며
imshow에서 channel[0] 이런식으로 하면 채널별로 출력하면 된다.

[링크 : http://opencvexamples.blogspot.com/2013/10/split-and-merge-functions.html#.U7TjMPl_vKl]
[링크 : http://compvisionlab.wordpress.com/2013/03/07/opencv-basics-splitting-rgb-channels/]
[링크 : http://denislantsman.com/?p=103]
[링크 : http://baram4815.tistory.com/entry/OpenCV-2이미지에서-RGB-채널-분리
[링크 : http://baram4815.tistory.com/entry/OpenCVsplit-and-merge]
Posted by 구차니
Programming/C Win32 MFC2014. 7. 3. 13:38
무슨 차이인지 모르겠다 -_-
일단 정의추적해서 보니..
vector는 _Vector_val을 상속받아 만든 derived class이고
Vector는 순수 클래스 이다.

vector
// TEMPLATE CLASS vector
template<class _Ty, class _Ax> class vector : public _Vector_val<_Ty, _Ax>
{

operations.hpp
template <typename _Tp> class Vector
{
}

+
std::vector 라고 하는것 봐서 스탠다드 라이브러리(?)에 vector가 사용되는 듯.
[링크 : http://hongkwan.blogspot.kr/2013/01/opencv-2-6-example_5.html ]

'Programming > C Win32 MFC' 카테고리의 다른 글

printf POSIX 확장 %1$d  (0) 2014.12.09
include guard  (0) 2014.11.05
순열생성관련  (0) 2014.06.27
2중 포인터 사용이유  (0) 2014.03.19
typeof  (0) 2014.03.11
Posted by 구차니
Programming/openCV2014. 7. 2. 23:45
어렵거나 대단한 코드는 아니고 단순하게 RGB를 HSV로 변환하는 코드이다.

BGR 이니까.. 블루값에 Hue 성분이 들어갔으려나?
나중에 색상 조절해서 채널별로 출력을 해봐야겠다



#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>

using namespace cv;
using namespace std;

int main(int argc, char* argv[])
{
        VideoCapture cap(0);
        if(!cap.isOpened())
        {
                cout << "No camera detected" << endl;
                return -1;
        }
        else
        {
                cout << "In capture ..." << endl;
        }

        namedWindow( "Display window", WINDOW_AUTOSIZE );

    for(;;)
    {
                Mat frame;
                Mat hsv;
                if(!cap.read(frame)) break;

                cvtColor(frame,hsv, CV_BGR2HSV);
                imshow("Display window", frame);
                imshow("HSV window", hsv);
                if(waitKey(30) >= 0) break;
    }

        return 0;
}

imgproc.hpp에 다음과 같이 정의 되어 있으며
cvtColor()는 독립된 함수로 되어있다.(클래스 랩핑이 안되어 있다)
enum
{
    COLOR_BGR2HSV     =40,
    COLOR_RGB2HSV     =41,
 
    COLOR_COLORCVT_MAX  = 135
};
 
//! converts image from one color space to another
CV_EXPORTS_W void cvtColor( InputArray src, OutputArray dst, int code, int dstCn=0 ); 
Posted by 구차니

어제 열심히 달렸거늘.. 겨우 4%?!?!? 에게!??!


일단 무기를 1단계씩 업그레이드!
그나저나 보팔검 1단계는 150 이더니 2단계는 왜이렇게 매너가 없어 ㅠㅠ






눈깔 주전자를 죽이니 눈깔이 굴러 가는구나












드디어 조립(?)되는 모자장수







어익후 앨리스 머리 끄딩지는줄 알았네 ㄷㄷ





우산 반사~!


히스테리아 모드 발동!
발동 이펙트가 멋지기도 하고 그러고 보니 이렇게 얻어 터진거 참 오랫만인듯?




악몽열차 출발이여 뿌뿌뿡!






헐.. 슈발 저거 싸우려니 죽어나겠.....





헐 이거 머야 웬 훼이크냐?!



도와준다더니 안도와줘서 딥빡치는 우리의 앨리스


차오르는 홍차에 하나둘씩 잠기고



정신이 들어보니 현실



 
이 넘이.. 잭 스플리터?


자세히 보면 저기 누워있는 팀 아저씨 칼빵 맞으셨....





어허이 이런 미친넘이 우리 앨리스에게 손찌검을 해!?!?



엌ㅋ 웬 운석이야 했더니


헐 저 옷도 좀 태워주....세요....


새로운 챕터의 시작






3번 무기 ㅋㅋㅋ
나이스샷 싸모님 ㅋㅋㅋㅋ





이시키.. 자꾸 바닥에 숨어서 짜증난다 -_-





후... 아무튼 4시간해서 20%면.. 아직도 16시간은 더 해야하는거야? ㅠㅠ






Posted by 구차니
추억을 되살리며 구매하고 싶은 충동이 마구드네?
그런데.. 윈도우에서 잘 돌아가려나?..


[링크 : https://www.origin.com/ko-kr/store/browse/pc-download/wingcommander]

'게임 > 오리진&스팀&유플레이' 카테고리의 다른 글

오늘의 무료게임(?) 겟 ㅋㅋ  (0) 2014.08.06
심즈 2 디럭스팩 겟! ㅋㅋㅋ  (0) 2014.07.24
또 지름!!!  (0) 2014.06.29
스팀 여름할인!  (0) 2014.06.28
식물 vs 좀비 끝(스샷 없음)  (0) 2014.05.25
Posted by 구차니
Programming/openCV2014. 7. 1. 17:49
소스는 이전글 참조
2014/07/01 - [Programming/openCV] - openCV2 2.4.9 + VS2008 좌충우돌 프로젝트 생성하기 

$ g++ cv2cam.cpp `pkg-config --libs opencv` 

$ pkg-config --libs opencv
-lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann

[링크 : https://help.ubuntu.com/community/OpenCV ] 

일단.. #if 로 막은 아래소스를 사용한건데
2.3.1에서는 문제없이 되는 것을 봐서는 윈도우에서 라이브러리 버전이 꼬였거나 먼가 설정 문제인 듯 하다.




Posted by 구차니