Ask Your Question

Bilityuk's profile - activity

2020-05-22 08:57:57 -0600 received badge  Notable Question (source)
2020-04-20 11:49:35 -0600 asked a question Exception 0x7B17A5A9 (opencv_core2410.dll) in sdkDemo.exe: 0xC0000005: acces violation writing the address 0x00000001.

Exception 0x7B17A5A9 (opencv_core2410.dll) in sdkDemo.exe: 0xC0000005: acces violation writing the address 0x00000001. H

2019-12-11 14:09:03 -0600 received badge  Popular Question (source)
2019-10-30 10:47:06 -0600 edited question Diferent objects detection in one picture

Diferent objects detection in one picture Hi, i am trying to find the right way of how to detect different objects in on

2019-10-30 10:43:05 -0600 asked a question Diferent objects detection in one picture

Diferent objects detection in one picture Hi, i am trying to find the right way of how to detect different objects in on

2019-08-27 05:47:36 -0600 received badge  Famous Question (source)
2018-11-08 21:35:12 -0600 received badge  Notable Question (source)
2018-06-14 13:41:48 -0600 received badge  Popular Question (source)
2018-01-16 19:18:43 -0600 received badge  Popular Question (source)
2017-08-24 02:55:12 -0600 received badge  Student (source)
2016-02-13 01:48:05 -0600 commented question Speedup predict

Can anybody help me please?

2016-02-13 01:47:28 -0600 commented question Speedup predict

I tried to use openMP to reduce work time of function, but result became worse. it takes 70-75 msec if i use openMP for predict:

#pragma omp parallel
{
    model->predict(preprocessedFace, label, confidence); 
}
2016-02-12 10:26:09 -0600 commented question Speedup predict

No i mean one person. Firstly i run the code with 10 faces for one person and it took 3 msec, then i run 200 faces for the same person and it took 40-45 msec.

2016-02-11 13:27:35 -0600 commented question Speedup predict

For 10 faces it takes 3 msec For 200 faces it takes 40-45 msec

2016-02-11 06:23:44 -0600 commented question Speedup predict

I am not sure.. Ok i understand the task.. I will measure the time of predict function with 10 faces in training set and with 200 faces. And let you know the results..

2016-02-10 04:59:16 -0600 asked a question Speedup predict

Hello, can anybody share a solution how to reduce operation time for LBPHFaceRecognizer model->predict() method? When i load more than 100 faces to the trainset and after training start the prediction loop, it works very slow. How to increase the perfomance?

2016-02-09 21:28:29 -0600 commented answer YUYV422 to BGR

Thank you it works for me

2016-02-08 23:55:16 -0600 asked a question YUYV422 to BGR

Good morning! Can anybody help me to convert between YUYV422 and BGR pixel formats?

1) This way i load the pixel data: cv::Mat cameraFrame = cv::Mat(h, w,CV_8UC3,(char*)YUYV422_data); 
2) i need to convert cv::Mat YUYV422  to cv::Mat BGR 
3) after processing i need to convert cv::Mat BGR to (char*)YUYV422_data.

Thank you!

2016-02-08 05:16:02 -0600 commented question convert char** to cv::Mat

Can anybody share a working pixel convertion function. I cant find the right solution fo my problem..

2016-02-07 22:57:23 -0600 commented question convert char** to cv::Mat

The broblem is clear for now. How to convert BGR24 to YUYV422 that i can draw it with DrawVideoImage function? Wich CV_8U option to use (CV_8UC1,CV_8UC2,CV_8UC3,CV_8UC4) and wich option to use for cv::CvtColor(dst,src, ????).

2016-02-07 11:58:23 -0600 commented question convert char** to cv::Mat

The second part of the problem is in:

Mat InImg(h, w,CV_8UC1);  
memcpy(InImg.data,Frame->data, sizeof(char)*w*h);           
InImg.copyTo(displayedFrame);

Becase i think it is not properly copy the char* data from Frame to Mat, maybe it requires some decoding i have no idea. If i put the displayedFrame to imshow() just after i memcpy() it to Mat it will not be drawn properly.

2016-02-07 11:52:04 -0600 commented question convert char** to cv::Mat

I feel that the problem somewhere in (char*)displayedFrame.data. I think that the renderer doesnt recognize it as native Frame->data format that is of type char data[0];

2016-02-07 11:48:50 -0600 commented question convert char** to cv::Mat

I don't think copying to a Mat is your problem, but getting the right data. When I look at the Frame struct, I see that there's more than just the data container. So I think GetVideoData(hwnd, (char)&Frame, &dataLen, videofmt,&mediaSpeed); could be the problem. At first I would check (char)&Frame and try something like &Frame->data

I am sure that

GetVideoData(hwnd, (char**)&Frame, &dataLen, videofmt,&mediaSpeed);

is not a problem, because it works perfect and if i pass the native Frame->data to the renderer it draws the video even with 30 fps without a problems..

m_d3d.DrawVideoIamge(Frame->data, 1, 0);

But when i am trying to pass the processed Mat to renderer there is a problem:

m_d3d.DrawVideoIamge((char*)displayedFrame.data, 1, 0);
2016-02-07 11:26:43 -0600 commented question convert char** to cv::Mat

Here is the rest of the enum:

DECTYPE_YUV420,
DECTYPE_YUYV422,
DECTYPE_UYVY422,
DECTYPE_H264,
DECTYPE_MJPEG,  
DECTYPE_MJPEG_BASE64,
DECTYPE_H264_BASE64,        
DECTYPE_AUDIORAW,
DECTYPE_G726,
DECTYPE_G711U,
DECTYPE_PCM,
DECTYPE_ADPCM,
DECTYPE_G711A,
DECTYPE_AAC,
}DECFMT;
2016-02-07 11:25:06 -0600 commented question convert char** to cv::Mat

berak, can you explaine please wich way to dig? DECFMT has the following types:

typedef enum  
{
DECTYPE_VIDEORAW,
DECTYPE_ARGB32,   //packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
DECTYPE_RGBA32,    //packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
DECTYPE_ABGR32,    //packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
DECTYPE_BGRA32,    //packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
DECTYPE_RGB24,    //packed RGB 8:8:8, 24bpp, RGBRGB...
DECTYPE_BGR24,     //packed RGB 8:8:8, 24bpp, BGRBGR...
DECTYPE_RGB565BE,  //packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), big-endian
DECTYPE_RGB565LE,  //packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), little-endian
DECTYPE_BGR565BE,  //packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), big-endian
DECTYPE_BGR565LE,  //packed BGR 5:6:5, 16bpp
2016-02-07 11:19:33 -0600 commented question convert char** to cv::Mat

could be the problem. At first I would check (char**)&Frame and try something like &Frame->data

&Frame->data doesnt make any sence in compare with Frame->data The same result.

2016-02-07 11:04:50 -0600 commented question convert char** to cv::Mat

Function:

if (GetVideoData(hFos, (char**)&Frame, &dataLen, videofmt,&mediaSpeed) )
{
SetMediaSpeed(mediaSpeed);
if (dataLen)
{
w = pFrame->media.video.picWidth;
h = pFrame->media.video.picHeight;
m_ddraw.CreatEmptySurface(Frame->media.video.picWidth, Frame->media.video.picHeight);
m_ddraw.CreatOverlaySurface(Frame->media.video.picWidth, Frame->media.video.picHeight);
HWND hWnd = GetDlgItem(IDC_STATIC_SCREEN)->GetSafeHwnd();
m_d3d.InitDDraw(hWnd, w, h);
}
Mat InImg(h, w,CV_8UC3);  
memcpy(InImg.data,pFrame->data, sizeof(char)*w*h);          
InImg.copyTo(displayedFrame);

//Face Recogition processing//<<-- process the displayedFrame Mat

//display image//
m_d3d.DrawVideoIamge((char*)displayedFrame.data, 1, 0);
}
2016-02-07 11:01:00 -0600 commented question convert char** to cv::Mat

Here is global variables:

HANDLE hFos = m_h;
DEC_DATA* Frame = NULL;
int dataLen = 0;
DECFMT videofmt = DECTYPE_YUYV422;
DECFMT audiofmt = DECTYPE_PCM;
int w=0, h=0;
int mediaSpeed = 0;
2016-02-07 10:56:44 -0600 commented question convert char** to cv::Mat

I want to post the full function code. But there is not enough space for comments. I will post it in slices

2016-02-07 08:42:02 -0600 commented question convert char** to cv::Mat

Just tried:

Mat cameraFrame;
Mat InImg(h, w,CV_8UC3);  
memcpy(InImg.data,Frame->data, 3*w*h);       
InImg.copyTo(cameraFrame);

It throws an exception on the memcpy line of code:

Image and video hosting by TinyPic

2016-02-07 08:03:36 -0600 commented question convert char** to cv::Mat

CV_8UC3 doesn't work for this code(throws c000005):

cv::Mat cameraFrame = cv::Mat(h, w, CV_8UC3, Frame->data);

If use CV_8UC3 with this code:

Mat InImg(h, w,CV_8UC3);  
memcpy(InImg.data,pFrame->data, sizeof(char)*w*h);  
InImg.copyTo(cameraFrame);

Results the almost the same as for CV_8UC1. But now it lookes like triple image.

Here is CV_8UC3 with imshow():

Image and video hosting by TinyPic

Here is CV_8UC3 with DrawVideoIamge():

Image and video hosting by TinyPic

2016-02-07 07:09:18 -0600 commented question convert char** to cv::Mat

If i use imshow() instead of DrawVideoIamge(). I've got the gray image like on the previos screen i posted.

2016-02-07 07:03:52 -0600 commented question convert char** to cv::Mat

Also i tried to use another way of convertion, and it behaves different. Here i convert the Frame->data to cv:Mat:

Mat cameraFrame;
Mat InImg(h, w,CV_8UC1);  
memcpy(InImg.data,Frame->data, sizeof(char)*w*h);       
InImg.copyTo(cameraFrame);

make some face recognition processing with cameraFrame and finally trying to draw the image this way:

DrawVideoIamge((char*)cameraFrame.data, 1, 0);

And now i got the color image, but it seems like it mirrored or i dont know how to explaine. Here is a link i upload the screen shot.

Image and video hosting by TinyPic</a">link text