2019년 3월 13일 수요일

unity GUI style list

UnityEditor.ConsoleWindow.Constants

  • "CN Box"
  • "Button"
  • "ToolbarButton"
  • "ToolbarButton"
  • "ToolbarButton"
  • "ToolbarButton"
  • "Toolbar"
  • "CN EntryInfo"
  • "CN EntryWarn"
  • "CN EntryError"
  • "CN EntryBackEven"
  • "CN EntryBackodd"
  • "CN Message"
  • "CN StatusError"
  • "CN StatusWarn"
  • "CN StatusInfo"
  • "CN CountBadge"
  • "Box"
  • "Button"
  • "MiniButton"
  • "MiniButtonLeft"
  • "MiniButtonMiddle"
  • "MiniButtonRight"
  • "LogStyle"
  • "WarningStyle"
  • "ErrorStyle"
  • "EvenBackground"
  • "OddBackground"
  • "MessageStyle"
  • "StatusError"
  • "StatusWarn"
  • "StatusLog"
  • "Toolbar"
  • "CountBadge"

UnityEditor.EditorStyles

  • "ColorPickerBox"
  • "In BigTitle"
  • "miniLabel"
  • "LargeLabel"
  • "BoldLabel"
  • "MiniBoldLabel"
  • "WordWrappedLabel"
  • "WordWrappedMiniLabel"
  • "WhiteLabel"
  • "WhiteMiniLabel"
  • "WhiteLargeLabel"
  • "WhiteBoldLabel"
  • "MiniTextField"
  • "Radio"
  • "miniButton"
  • "miniButtonLeft"
  • "miniButtonMid"
  • "miniButtonRight"
  • "toolbar"
  • "toolbarbutton"
  • "toolbarPopup"
  • "toolbarDropDown"
  • "toolbarTextField"
  • "ToolbarSeachTextField"
  • "ToolbarSeachTextFieldPopup"
  • "ToolbarSeachCancelButton"
  • "ToolbarSeachCancelButtonEmpty"
  • "SearchTextField"
  • "SearchCancelButton"
  • "SearchCancelButtonEmpty"
  • "HelpBox"
  • "AssetLabel"
  • "AssetLabel Partial"
  • "AssetLabel Icon"
  • "selectionRect"
  • "MinMaxHorizontalSliderThumb"
  • "DropDownButton"
  • "BoldLabel"
  • "Label"
  • "MiniLabel"
  • "MiniBoldLabel"
  • "ProgressBarBack"
  • "ProgressBarBar"
  • "ProgressBarText"
  • "FoldoutPreDrop"
  • "IN Title"
  • "IN TitleText"
  • "BoldToggle"
  • "Tooltip"
  • "NotificationText"
  • "NotificationBackground"
  • "MiniPopup"
  • "textField"
  • "ControlLabel"
  • "ObjectField"
  • "ObjectFieldThumb"
  • "ObjectFieldMiniThumb"
  • "Toggle"
  • "ToggleMixed"
  • "ColorField"
  • "Foldout"
  • "TextFieldDropDown"
  • "TextFieldDropDownText"

UnityEditor.ObjectListArea.Styles

  • "PR Label"
  • "ProjectBrowserGridLabel"
  • "ObjectPickerResultsGrid"
  • "ObjectPickerBackground"
  • "ObjectPickerPreviewBackground"
  • "ProjectBrowserHeaderBgMiddle"
  • "ProjectBrowserHeaderBgTop"
  • "Label"
  • "MiniLabel"
  • "Foldout"
  • "ObjectPickerToolbar"
  • "PR TextField"
  • "PR Ping"
  • "PR Ping"
  • "ProjectBrowserIconDropShadow"
  • "ProjectBrowserTextureIconDropShadow"
  • "ProjectBrowserIconAreaBg"
  • "ProjectBrowserPreviewBg"
  • "ProjectBrowserSubAssetBg"
  • "ProjectBrowserSubAssetBgOpenEnded"
  • "ProjectBrowserSubAssetBgCloseEnded"
  • "ProjectBrowserSubAssetBgMiddle"
  • "ProjectBrowserSubAssetBgDivider"
  • "ProjectBrowserSubAssetExpandBtn"

2019년 3월 5일 화요일

OpenCV

막 적는다 일단

색 저장 순서 : RGB 아닌 BGR




========================================================
자주쓰는 구문

1. 이미지 불러오기
1
2
3
4
5
6
7
8
9
10
11
12
#include "opencv.hpp"
using namespace cv;
using namespace std;
int main()
{
    Mat img_bw = imread("example.png",0); // 흑백
    Mat img_color = imread("example.png");   // 칼라
 
    imshow("images", img_color); // 영상 출력
    waitKey();
    return 0;
}
cs
2. 이미지 생성

1
2
3
4
5
6
7
    // 가로 640 세로 480, 8 bit uchar 1 채널 이미지 생성(Scalar(0)으로 초기화 즉 까만색으로 초기화)
    Mat IMAGEch1(640,480,CV_8U,Scalar(0));    
    // 8 bit uchar 3 채널(CV_RGB(0,0,255)으로 초기화 즉 파란색으로 초기화)
    Mat IMAGEch3(640,480,CV_8UC3,CV_RGB(0,0,255));    
 
    //Scalar(B,G,R) 순서
    //CV_RGB(R,G,B) 순서
cs

3. 사이즈 변환 

1
    resize(IMAGEch1, IMAGEch1re, Size(320240)); // 사이즈 변환
cs

4. 이미지 복사

1
2
3
    Mat cIMAGEch1;
    IMAGEch1.copyTo(cIMAGEch1);    // 복사
    Mat cIMAGEch3 = IMAGEch3.clone(); // 복제
cs 

5. 컬러/흑백 변경

1
2
    cvtColor( IMAGEch1, cIMAGEch1, COLOR_GRAY2BGR ); // 칼라로 변경
    cvtColor( IMAGEch3, cIMAGEch3, COLOR_BGR2GRAY ); // 흑백으로 변경
cs

6. ROI 설정

1
2
    Rect roi(0,0,50,50); // 왼쪽부터 순서대로 x,y,width,height 값
    Mat ROIimg = IMAGEch1(roi);
cs

7. 영상 반전

1
2
3
4
    // 영상 반전
    flip(img_color, dst1, 0); // 상하 반전
    flip(img_color, dst2, 1); // 좌우 반전
    flip(img_color, dst3, -1); // 상하좌우 반전


8. 영상 회전

1
2
3
    Point center(640/2,480/2); // 이미지 중심
    Mat matRotation = getRotationMatrix2D(center, -901); //-90 : 시계방향 90도
    warpAffine( img_color, img_colorr, matRotation, img_color.size() ); // 회전
cs

9. Mat <-> Iplimage 변환

1
2
3
4
5
6
7
8
9
 // Mat --> IplImage
 Mat matimg;
 IplImage* iplimg;
 iplimg = &IplImage(matimg);
 
 // IplImage --> Mat
 IplImage* iplimg;
 Mat matimg;
 matimg = cvarrToMat(iplimg);
cs

10. 글자 입력


1
putText(img, "text", Point(x,y), FONT_HERSHEY_SIMPLEX, 1., color, thickness);
cs