1. 이미지 버퍼에서 cv::Mat 초기화 하기.
cv::Mat originFrame = cv::Mat(GetHeight(), GetWidth(), CV_8UC1, GetBits());
2. cv::Mat 의 영상을 BYTE 배열로 변환하기.
LPBYTE src = originFrame.data;
LPBYTE dst = GetBits();
if (src != dst)
{
Concurrency::parallel_for(0l, (LONG)GetHeight(), [&](int y)
{
LPBYTE src_line = src + (y * originFrame.cols);
LPBYTE dst_line = dst + (y * GetWidthBytes());
memcpy(dst_line, src_line, GetWidth());
});
}
'I ♥ Programming' 카테고리의 다른 글
| 영상 왜곡 형태에 따른 분류 (0) | 2020.09.08 |
|---|---|
| Nuget 패키지 관리자 "사용 가능한 패키지 소스" 수동 추가 방법 (0) | 2020.03.16 |
| pure virtual function call이 발생되는 예제 (0) | 2017.02.15 |
| [펌] 메모리릭 위치 알아내기. (발생 위치에 Breakpoint) (0) | 2016.12.27 |
| JScript라는 Windows용 Script Host에서 메시지 박스 출력하기 (0) | 2016.04.08 |
