Ask Your Question

MikeSZ's profile - activity

2019-06-14 10:33:41 -0600 edited question Behavior of PCA, Eigen, SVD (and other SVD)

Behavior of PCA, Eigen, SVD (and other SVD) Hi. In a development I'm doing I need an SVD for a 2x2 matrix. This matrix

2019-06-13 12:42:17 -0600 edited question Behavior of PCA, Eigen, SVD (and other SVD)

Behavior of PCA, Eigen, SVD (and other SVD) Hi. In a development I'm doing I need an SVD for a 2x2 matrix. This matrix

2019-06-13 11:43:59 -0600 edited question Behavior of PCA, Eigen, SVD (and other SVD)

Behavior of PCA, Eigen, SVD (and other SVD) Hi. In a development I'm doing I need an SVD for a 2x2 matrix. This matrix

2019-06-13 11:43:06 -0600 asked a question Behavior of PCA, Eigen, SVD (and other SVD)

Behavior of PCA, Eigen, SVD (and other SVD) Hi. In a development I'm doing I need an SVD for a 2x2 matrix. This matrix

2018-03-09 14:12:29 -0600 commented answer image coordinate to world coordinate opencv

Hello. I did this, and also this related article on StackOverflow: https://stackoverflow.com/questions/12299870/com

2018-03-09 14:11:50 -0600 commented answer image coordinate to world coordinate opencv

Hello. I did this, and also this related article on StackOverflow: https://stackoverflow.com/questions/12299870/com

2018-03-09 14:11:15 -0600 commented answer image coordinate to world coordinate opencv

Hello. I did this, and also this related article on StackOverflow: https://stackoverflow.com/questions/12299870/com

2018-03-09 14:10:30 -0600 commented answer image coordinate to world coordinate opencv

Hello. I did this, and also this related article on StackOverflow: https://stackoverflow.com/questions/12299870/comput

2017-04-21 08:45:10 -0600 commented question do Farneback Optical flow destroy AMD cards? or is my code?

Yes, I know is VERY strange. I asked the same thing in the forum of the development community of AMD, an answer asks me if I can share the code but unfortunately I can not share everything.

2017-04-21 08:37:07 -0600 commented question do Farneback Optical flow destroy AMD cards? or is my code?

The two cards were well within the proper temperatures, less than 60 degrees C the first, barely 53 C the second. The level of use was about 50% if I remember. This is just one process among 50 others, some with much higher demand for processing (eg, superresolution), but the two times the failure has been with this one. The most I can think of is a memory or memory controller failure, as one of the kernels performs several steps (up to 5) over a buffer of several MB, which contains several consecutive frames, each workitem processing one pixel in each Frame each time, this is for each new input box of the video. But with 640x480 never failed!!

2017-04-21 08:34:07 -0600 commented question do Farneback Optical flow destroy AMD cards? or is my code?

I also use the cards to play, AAA games, and have never come close to the maximum working temperature defined by the manufacturer, in the worst case only the oldest card reached about 73 degrees C. I keep the fans regulated with MSI Afterburner. Here I also observe the level of use of the GPU/CPU during the tests. The power supply is more than enough for the hardware (1000W, 46A). The system is well ventilated by 4 additional fans, ambient temperature of about 25C. The second card only had about 3 weeks of use. The error has occurred almost immediately, less than 5 seconds of processing initiation, I think. Both times. The second time I had forgotten how the previous one had failed, I remembered it in the worst way, seeing it happen again trying the code in its last version, I hate myself.

2017-04-20 12:57:33 -0600 received badge  Student (source)
2017-04-20 12:50:23 -0600 asked a question do Farneback Optical flow destroy AMD cards? or is my code?

I have had a serious problem with a code that I have been developing for a few months. It is created using OpenCL and I use only one OpenCV function, calcOpticalFlowFarneback, accelerated with OpenCL also, the rest of the code are several not very complex kernels.

The issue is that this has destroyed 2 graphics cards in a period of 5 months, an XFX R9 270 and an MSI RX 470. The first was in a state that could only be "used" without the drivers, and during the boot PC pink dots were observed in the letters. The second remained usable for a while, with sporadic hangings and screens in black / white / pink until it completely failed.

The interesting thing is that this only happened to me with videos of 1280x720 (dont tested higher resolutions), but with 320x240 and 640x480, they did not fail. The second time forget how the previous problem had been. I just run the code, with video of this resolution, and a second later, after shown some results, the system fails. A black screen occurred the first time, the second time, a hang up.

The OpenCV I used was first 3.0, then 3.2.

At the moment I do not have any cards to try and I do not want to risk either.

Anyone have any ideas? If the problem is calcOpticalFlowFarneback to these resolutions? Or my kernels?

The host code is mostly flow control. With ocv3.0 ther are copy/writes, with 3.2 I avoid that, the UMats use my bufferas. The most complex kernels are (the rest are only grayscale convertions, type convertion, etc):

 __kernel void kernel_SumAndDiv(__global uchar4 *imageIn, __global float4 *imageSum, __global uchar4 *imageOut, uint count)
{  

    const uint x = get_global_id(0);
    const uint y = get_global_id(1);
    const uint width = get_global_size(0);
    const uint pos = x + y * width;
    float4 color = imageSum[pos];
    color =  color + convert_float4(imageIn[pos]);
    imageSum[pos] = color;
    imageOut[pos] = convert_uchar4(clamp(color / (float)count, 0.0f, 255.0f));
}

 __kernel void kernel_Add(__global uchar4* srcImage, __global uchar4* framesBuffer, __global float4* cumulImage,  __global uchar4* dstImage, const int framePos)
{

    const uint x = get_global_id(0);
    const uint y = get_global_id(1);
    const uint width = get_global_size(0);
    const uint height = get_global_size(1); 
    const uint pixelPos = x + y * width;
    const uint bufferFramePos = width * height * framePos;
    const uint bufferPixelPos = bufferFramePos + pixelPos;
    uchar4 srcColor = srcImage[pixelPos];
    float4 cumulColor = cumulImage[pixelPos];  
    cumulColor = cumulColor + convert_float4(srcColor);
    framesBuffer[bufferPixelPos] = srcColor;
    cumulImage[pixelPos] = cumulColor; 
    dstImage[pixelPos] = convert_uchar4(clamp(cumulColor / (float)(framePos+1), 0.0f, 255.0f));
}

 __kernel void kernel_InsertAndUpdate(__global uchar4* srcImage, __global uchar4* framesBuffer, __global float4* cumulImage, __global uchar4* dstImage,  const int framePos, const int frameCount)
{

    const uint x = get_global_id(0);
    const uint y = get_global_id(1);
    const uint width = get_global_size(0);
    const uint height = get_global_size(1);  
    const uint pixelPos = x + y * width;
    const uint bufferFramePos = width * height * framePos;
    const uint bufferPixelPos = bufferFramePos + pixelPos;
    uchar4 srcColor = srcImage[pixelPos];
    float4 srcColorf = convert_float4(srcColor);
    float4 cumulColor = cumulImage[pixelPos];
    float4 bufferColor = convert_float4(framesBuffer[bufferPixelPos]);
    cumulColor = cumulColor - bufferColor + srcColorf;  
    framesBuffer[bufferPixelPos] = srcColor;
    cumulImage[pixelPos] = cumulColor ...
(more)
2016-12-23 07:11:55 -0600 commented answer OpenCV 3.1 custom OpenCL Queue

that's right. using "finish" the host thread waits until the OpenCL queue completes. anyway, I'm thinking on expose the command_queue class field in OpenCV, or add a property, and recompile, so I can delete what it create an attach my own queue, and control/avoid delete the queue when the class is destroyed.

2016-12-23 07:07:40 -0600 received badge  Scholar (source)
2016-12-23 07:07:37 -0600 received badge  Supporter (source)
2016-12-16 14:19:12 -0600 asked a question OpenCV 3.1 custom OpenCL Queue

With OpenCV 3.1, when I use cv :: ocl :: attachContext for interoperation, a new queue is created. If I run an OpenCV function, it runs in its own queue, different from the main queue.

Main question: How can I set OpenCV to use the same queue I already have created and in use?

Or, how do I check that the OpenCV queue has finished running, while I pause the main queue, until OpenCV finishes?

Or wait for the main queue to run, before running the OpenCV functions, and move on to the subject of the previous question?

2016-09-09 14:56:42 -0600 received badge  Enthusiast
2016-09-07 09:30:26 -0600 received badge  Editor (source)
2016-09-07 09:27:01 -0600 answered a question Superresolution: how to process only particular sampled frames

A simple solution I'm using right now. Extend cv::superres::FrameSource with a setFrame member

class MyFrameSource : public cv::superres::FrameSource { cv::Mat origFrame_; void MyFrameSource::setFrame(Mat & frame) { frame.copyTo(origFrame_); } void MyFrameSource::nextFrame(cv::OutputArray frame) { origFrame_.copyTo(frame); } } then cv::Ptr<myframesource> lowresSource(new MyFrameSource(cv::superres::createFrameSource_Empty(), scale)); and superRes->setInput(lowresSource);

then, in the process loop, first copy your nput frame to framesource with setFrame(), then call superRes->nextFrame(dest) and you will be using that frame. But you will get a TemporalAreaRadius*2+1 frames latency for superres to begin to work as it should. You can, for example, loop your frameslist to use the first umprocesed frames. is not the best but it works.

2016-09-07 09:26:53 -0600 answered a question create FrameSource for super-res using createFrameSource_Empty

A simple solution I'm using right now. Extend cv::superres::FrameSource with a setFrame member

class MyFrameSource : public cv::superres::FrameSource { cv::Mat origFrame_; void MyFrameSource::setFrame(Mat & frame) { frame.copyTo(origFrame_); } void MyFrameSource::nextFrame(cv::OutputArray frame) { origFrame_.copyTo(frame); } } then cv::Ptr<myframesource> lowresSource(new MyFrameSource(cv::superres::createFrameSource_Empty(), scale)); and superRes->setInput(lowresSource);

then, in the process loop, first copy your nput frame to framesource with setFrame(), then call superRes->nextFrame(dest) and you will be using that frame. But you will get a TemporalAreaRadius*2+1 frames latency for superres to begin to work as it should. You can, for example, loop your frameslist to use the first umprocesed frames. is not the best but it works.

2016-09-06 11:47:45 -0600 commented question Superresolution: how to process only particular sampled frames

A simple solution extend cv::superres::FrameSource with a setFrame member

class MyFrameSource : public cv::superres::FrameSource cv::Mat origFrame_; void MyFrameSource::setFrame(Mat & frame) { frame.copyTo(origFrame_); } void MyFrameSource::nextFrame(cv::OutputArray frame) { origFrame_.copyTo(frame); }

then cv::Ptr<myframesource> lowresSource(new MyFrameSource(cv::superres::createFrameSource_Empty(), scale));

and superRes->setInput(lowresSource);

then, in a i-loop, first copy your i-frame with setFrame then you call superRes->nextFrame(dest) and you will be using that frame. But you will get a TemporalAreaRadius*2+1 frames latency for superres begin to work as it should. You can, for example, loop your frameslist to use the first umprocesed frames.

2016-08-30 16:54:06 -0600 commented question create FrameSource for super-res using createFrameSource_Empty

A simple solution extend cv::superres::FrameSource with a setFrame member

class MyFrameSource : public cv::superres::FrameSource cv::Mat origFrame_; void MyFrameSource::setFrame(Mat & frame) { frame.copyTo(origFrame_); } void MyFrameSource::nextFrame(cv::OutputArray frame) { origFrame_.copyTo(frame); }

then cv::Ptr<myframesource> lowresSource(new MyFrameSource(cv::superres::createFrameSource_Empty(), scale));

and superRes->setInput(lowresSource);

then, in a i-loop, first copy your i-frame with setFrame then you call superRes->nextFrame(dest) and you will be using that frame. But you will get a TemporalAreaRadius*2+1 frames latency for superres begin to work as it should. You can, for example, loop your frameslist to use the first umprocesed frames.