|
|
@ -702,11 +702,16 @@ sub-matrices. |
|
|
|
-# Process "foreign" data using OpenCV (for example, when you implement a DirectShow\* filter or |
|
|
|
-# Process "foreign" data using OpenCV (for example, when you implement a DirectShow\* filter or |
|
|
|
a processing module for gstreamer, and so on). For example: |
|
|
|
a processing module for gstreamer, and so on). For example: |
|
|
|
@code |
|
|
|
@code |
|
|
|
void process_video_frame(const unsigned char* pixels, |
|
|
|
Mat process_video_frame(const unsigned char* pixels, |
|
|
|
int width, int height, int step) |
|
|
|
int width, int height, int step) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Mat img(height, width, CV_8UC3, pixels, step); |
|
|
|
// wrap input buffer
|
|
|
|
GaussianBlur(img, img, Size(7,7), 1.5, 1.5); |
|
|
|
Mat img(height, width, CV_8UC3, (unsigned char*)pixels, step); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Mat result; |
|
|
|
|
|
|
|
GaussianBlur(img, result, Size(7, 7), 1.5, 1.5); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
@endcode |
|
|
|
@endcode |
|
|
|
-# Quickly initialize small matrices and/or get a super-fast element access. |
|
|
|
-# Quickly initialize small matrices and/or get a super-fast element access. |
|
|
|