まだ明らかでない場合、これはOpenCVでの初日です。 私がやりたいことはmirror2です。そしてそれをアップサンプリングします。OSX上のOpenCVでライブミラーリングしたいビデオ、どこから始めるべきかわからない
IplImageタイプのフレームで行列操作を使用する方法がわかりません。どのようにフレーム2をミラーリングし、それをWebcam2ウィンドウにアップサンプリングできますか?以下は私のコードです:
#include "cv.h"
#include "highgui.h"
#include <stdio.h>
// A Simple Camera Capture Framework
int main() {
CvCapture* capture = cvCaptureFromCAM(CV_CAP_ANY);
if (!capture) {
fprintf(stderr, "ERROR: capture is NULL \n");
getchar();
return -1;
}
// Create a window in which the captured images will be presented
cvNamedWindow("Webcam", CV_WINDOW_AUTOSIZE);
cvNamedWindow("Webcam2", CV_WINDOW_AUTOSIZE);
// Show the image captured from the camera in the window and repeat
while (1) {
// Get one frame
IplImage* frame = cvQueryFrame(capture);
IplImage* frame2 = cvCreateImage(cvSize (frame->width*2, frame->height*2),
frame->depth, frame->nChannels);
cvPyrUp (frame, frame2);
if (!frame) {
fprintf(stderr, "ERROR: frame is null...\n");
getchar();
break;
}
cvShowImage("Webcam", frame);
cvShowImage("Webcam2", frame2);
// Do not release the frame!
//If ESC key pressed, Key=0x10001B under OpenCV 0.9.7(linux version),
//remove higher bits using AND operator
if ((cvWaitKey(10) & 255) == 27) break;
}
// Release the capture device housekeeping
cvReleaseCapture(&capture);
cvDestroyWindow("Webcam");
cvDestroyWindow("Webcam2");
return 0;
}
* transpose *、* rotate *、* flip *を意味しますか? –
転置。基本的には、行列[1、0、1; 1、0、0; 1、0、0]のように見える。 0,0,1; 0,0,1]である。それは明確ですか?私はライブフレームで行列演算を実行する方法を知りません。 – JesseBikman
これは、左右反転(鏡像)のように見えます - それはあなたが望むものですか? –