OpenCV 4.13.0
Open Source Computer Vision
読み込み中...
検索中...
見つかりません
🤖 AIによる機械翻訳(非公式) — これは OpenCV 4.13.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。
WinRT support

詳細説明

この図は、WinRT GUIで実装された新機能を説明している。新しいGUIは、画像コントロールとスライダーパネルを提供する。スライダーパネルは、それに取り付けられたトラックバーを保持する。

スライダーは画像コントロールの下に取り付けられる。新しいスライダーは、前のスライダーの下に追加される。

図を生成するために使用した例を以下に示す:

void sample_app::MainPage::ShowWindow()
{
static cv::String windowName("sample");
cv::winrt_initContainer(this->cvContainer);
cv::namedWindow(windowName); // not required
cv::Mat image = cv::imread("Assets/sample.jpg");
cv::Mat converted = cv::Mat(image.rows, image.cols, CV_8UC4);
cv::cvtColor(image, converted, COLOR_BGR2BGRA);
cv::imshow(windowName, converted); // this will create window if it hasn't been created before
int state = 42;
cv::TrackbarCallback callback = [](int pos, void* userdata)
{
if (pos == 0) {
cv::destroyWindow(windowName);
}
};
cv::TrackbarCallback callbackTwin = [](int pos, void* userdata)
{
if (pos >= 70) {
}
};
cv::createTrackbar("Sample trackbar", windowName, &state, 100, callback);
cv::createTrackbar("Twin brother", windowName, &state, 100, callbackTwin);
}
n-dimensional dense array class
Definition mat.hpp:840
int cols
Definition mat.hpp:2204
int rows
the number of rows and columns or (-1, -1) when the matrix has more than 2 dimensions
Definition mat.hpp:2204
std::string String
Definition cvstd.hpp:151
#define CV_8UC4
Definition interface.h:91
void winrt_initContainer(::Windows::UI::Xaml::Controls::Panel^ container)
Initializes container component that will be used to hold generated window content.
void(* TrackbarCallback)(int pos, void *userdata)
Callback function for Trackbar see cv::createTrackbar.
Definition highgui.hpp:235
void imshow(const String &winname, InputArray mat)
Displays an image in the specified window.
void namedWindow(const String &winname, int flags=WINDOW_AUTOSIZE)
Creates a window.
void destroyAllWindows()
Destroys all of the HighGUI windows.
void destroyWindow(const String &winname)
Destroys the specified window.
int createTrackbar(const String &trackbarname, const String &winname, int *value, int count, TrackbarCallback onChange=0, void *userdata=0)
Creates a trackbar and attaches it to the specified window.
Mat imread(const String &filename, int flags=IMREAD_COLOR_BGR)
Loads an image from a file.
void cvtColor(InputArray src, OutputArray dst, int code, int dstCn=0, AlgorithmHint hint=cv::ALGO_HINT_DEFAULT)
Converts an image from one color space to another.
@ COLOR_BGR2BGRA
[8U/16U/32F] add alpha channel to RGB or BGR image
Definition imgproc.hpp:543

関数

void cv::winrt_initContainer (::Windows::UI::Xaml::Controls::Panel^ container)
 生成されたウィンドウのコンテンツを保持するために使用されるコンテナコンポーネントを初期化する。
 

関数詳解

◆ winrt_initContainer()

void cv::winrt_initContainer ( ::Windows::UI::Xaml::Controls::Panel^ container)

#include <opencv2/highgui/highgui_winrt.hpp>

生成されたウィンドウの内容を保持するために使用されるコンテナコンポーネントを初期化する。

引数
container生成されたウィンドウの内容(コントロールおよび画像)を保持するために使用されるコンテナ(Panel^)への参照。
覚え書き
作成されたウィンドウの内容を保持するWinRTコンテナを割り当てるために、必ず呼び出さなければならない。