Ask Your Question

hua's profile - activity

2019-06-10 14:07:15 -0500 asked a question I got out of memory error when loading 4096*4096 image to my OpenCV_CUDA program.

I got out of memory error when loading 4096*4096 image to my OpenCV_CUDA program. This is the error message I got when l

2019-06-10 06:54:13 -0500 asked a question I can't get different convolution results when calling the function successively with different parameters.

I can't get different convolution results when calling the function successively with different parameters. void Gauss_

2019-06-10 06:54:04 -0500 asked a question I can't get different convolution results when calling the function successively with different parameters.

I can't get different convolution results when calling the function successively with different parameters. void Gauss_

2019-06-06 19:54:49 -0500 edited question How to make fft convolution in OpenCV?

How to make fft convolution in OpenCV? I have Matlab code for convolution in Fourier Transform but I don't know how to i

2019-06-06 19:54:38 -0500 edited question How to make fft convolution in OpenCV?

How to make fft convolution in OpenCV? I have Matlab code for convolution in Fourier Transform but I don't know how to i

2019-06-06 19:54:33 -0500 edited question How to make fft convolution in OpenCV?

How to make fft convolution in OpenCV? I have Matlab code for convolution in Fourier Transform but I don't know how to i

2019-06-06 10:02:05 -0500 asked a question How to make fft convolution in OpenCV?

How to make fft convolution in OpenCV? I have Matlab code for convolution in Fourier Transform but I don't know how to i

2019-06-06 10:01:56 -0500 asked a question How to make fft convolution in OpenCV?

How to make fft convolution in OpenCV? I have Matlab code for convolution in Fourier Transform but I don't know how to i

2019-06-06 08:30:15 -0500 asked a question How to pass the cv::Mat or cv::cuda::GpuMat to custom CUDA kernel?

How to pass the cv::Mat or cv::cuda::GpuMat to custom CUDA kernel? Is there an efficient way to pass the Mat to CUDA cus

2019-05-20 19:40:49 -0500 commented answer How do I can create a Gaussian filter in CUDA that is larger than 32 and double type?

@HYPEREGO Thank you for your time. It was the same as mine.

2019-05-20 06:46:01 -0500 commented answer How do I can create a Gaussian filter in CUDA that is larger than 32 and double type?

I have generated the Gaussian kernels (using function) by myself and I add padding to image by using copyMakeBorder and

2019-05-20 06:43:18 -0500 asked a question I got wrong cv::cuda::Convoltion::convolution results.

I got wrong cv::cuda::Convoltion::convolution results. I separated the color channels into BGR and convolved each color

2019-05-18 23:02:28 -0500 commented answer How do I can create a Gaussian filter in CUDA that is larger than 32 and double type?

Thank you. So, if want to apply the filter size larger than 32 x 32 and want high efficiency, I have to write my own cus

2019-05-18 22:57:42 -0500 marked best answer How do I can create a Gaussian filter in CUDA that is larger than 32 and double type?

The following code gives an error:

`OpenCV(3.4.1) Error: Assertion failed (rowFilter_ != 0) in `anonymous-namespace'::SeparableLinearFilter::SeparableLinearFilter, file c:\opencv\3.4.1\opencv-3.4.1\modules\cudafilters\src\filtering.cpp, line 413`

 filter3 = cv::cuda::createGaussianFilter(CV_64FC1, CV_64FC1, cv::Size(1501, 1501), 250);

and the below code gives an error:

OpenCV(3.4.1) Error: Assertion failed (rowKernel_.cols > 0 && rowKernel_.cols <= 32) in `anonymous-namespace'::SeparableLinearFilter::SeparableLinearFilter, file c:\opencv\3.4.1\opencv-3.4.1\modules\cudafilters\src\filtering.cpp, line 404

filter1 = cv::cuda::createGaussianFilter(CV_8UC1, CV_8UC1, cv::Size(33, 33), 15);
2019-05-16 12:54:36 -0500 asked a question Why I can't use the resulted gpumat from cv::cuda::Convolution::convole()?

Why I can't use the resulted gpumat from cv::cuda::Convolution::convole()? cv::cuda::GpuMat d_b1, d_b2, d_b3, d_addb; cv

2019-05-16 10:03:10 -0500 commented answer Can I use cv::cuda::add for per-element addition to Mat?

@HYPEREGO Could you answer another question of mine? I'm asking about cv::cuda::createGaussianFilter.

2019-05-16 10:01:07 -0500 commented answer Can I use cv::cuda::add for per-element addition to Mat?

Thank you, I am understanding now:)

2019-05-16 10:00:27 -0500 marked best answer Can I use cv::cuda::add for per-element addition to Mat?

I want to add 1 to all of the pixels in the Mat. In usual OpenCV code result = cv::Mat + 1;. And I want to write that in OpenCV CUDA like the following.

cv::cuda::add(cuda_Mat1, 1, cuda_ResultMat);

Can I use like this?

Thank you for your time.

2019-05-16 09:22:52 -0500 asked a question How do I can create a Gaussian filter in CUDA that is larger than 32 and double type?

How do I can create a Gaussian filter in CUDA that is larger than 32 and double type? The following code gives an error:

2019-05-16 08:48:01 -0500 commented answer Can I use cv::cuda::add for per-element addition to Mat?

cv::cuda::add in this documentation it says Computes a matrix-matrix or matrix-scalar sum. I'm confused I have to use ju

2019-05-16 08:47:25 -0500 commented answer Can I use cv::cuda::add for per-element addition to Mat?

link text in this documentation it says Computes a matrix-matrix or matrix-scalar sum. I'm confused I have to use just 1

2019-05-16 08:21:14 -0500 asked a question Can I use cv::cuda::add for per-element addition to Mat?

Can I use cv::cuda::add for per-element addition to Mat? I want to add 1 to all of the pixels in the Mat. In usual OpenC

2019-05-10 11:44:59 -0500 asked a question I want to run following program visual studio?

I want to run following program visual studio? #include<iostream> #include<cstdio> #include<opencv2/core/

2019-05-10 11:44:27 -0500 asked a question I want to run following program visual studio?

I want to run following program visual studio? #include<iostream> #include<cstdio> #include<opencv2/core/

2019-05-10 11:44:23 -0500 asked a question I want to run following program visual studio?

I want to run following program visual studio? #include<iostream> #include<cstdio> #include<opencv2/core/

2019-05-10 11:42:27 -0500 asked a question I want to run following program visual studio?

I want to run following program visual studio? #include<iostream> #include<cstdio> #include<opencv2/core/

2019-05-09 10:13:33 -0500 marked best answer How to access pixels by using pointer in OpenCV C++?

define pc(image, x, y, c) image->imageData[(image->widthStep * y) + (image->nChannels * x) + c]

I think this is the accessing the image pixel using C pointer. Am I right? But I don't know what this code means and I don't know how to write this code in OpenCV C++.

It was used in the following code.

void Msrcr::FilterGaussian(IplImage* img, double sigma)
{
    int i, j, k, source, filter_size;
    vector<int> kernel;
    IplImage* temp;
    int v1, v2, v3;

    // Reject unreasonable demands
    // 设置上限
    if ( sigma > 300 ) sigma = 300;

    // get needed filter size (enforce oddness)
    // 获取需要的滤波尺寸,且强制为奇数;
    filter_size = (int)floor(sigma*6) / 2;
    filter_size = filter_size * 2 + 1;

    // Create Kernel
    // 创建内核
    kernel = CreateFastKernel(sigma);

    temp = cvCreateImage(cvSize(img->width, img->height), img->depth, img->nChannels);

    // filter x axis
    // X轴滤波
    for (j = 0; j < temp->height; j++)
    {
        for (i = 0; i < temp->width; i++)
        {
            // inner loop has been unrolled
            // 内层循环已经展开
            v1 = v2 = v3 = 0;
            for (k = 0; k < filter_size; k++)
            {
                source = i + filter_size / 2 - k;

                if (source < 0) source *= -1;
                if (source > img->width - 1) source = 2*(img->width - 1) - source;

                v1 += kernel[k] * (unsigned char)pc(img, source, j, 0);
                if (img->nChannels == 1) continue;
                v2 += kernel[k] * (unsigned char)pc(img, source, j, 1);
                v3 += kernel[k] * (unsigned char)pc(img, source, j, 2);
            }

            // set value and move on
            pc(temp, i, j, 0) = (char)int2smallint(v1);
            if (img->nChannels == 1) continue;
            pc(temp, i, j, 1) = (char)int2smallint(v2);
            pc(temp, i, j, 2) = (char)int2smallint(v3);

        }
    }

    // filter y axis
    // Y轴滤波
    for (j = 0; j < img->height; j++)
    {
        for (i = 0; i < img->width; i++)
        {
            v1 = v2 = v3 = 0;
            for (k = 0; k < filter_size; k++)
            {
                source = j + filter_size / 2 - k;

                if (source < 0) source *= -1;
                if (source > temp->height - 1) source = 2*(temp->height - 1) - source;

                v1 += kernel[k] * (unsigned char)pc(temp, i, source, 0);
                if (img->nChannels == 1) continue;
                v2 += kernel[k] * (unsigned char)pc(temp, i, source, 1);
                v3 += kernel[k] * (unsigned char)pc(temp, i, source, 2);
            }

            // set value and move on
            pc(img, i, j, 0) = (char)int2smallint(v1);
            if (img->nChannels == 1) continue;
            pc(img, i, j, 1) = (char)int2smallint(v2);
            pc(img, i, j, 2) = (char)int2smallint(v3);

        }
    }

    cvReleaseImage( &temp );
}

This is the full program link of this program.

https://github.com/upcAutoLang/MSRCR-...

2019-05-09 07:29:21 -0500 commented question Retinex Color Restoration

Both crb, msrb are CV_64FC1, sir. Following are the output from the program, sir. msrb depth, no. of channels, and type

2019-05-08 13:26:38 -0500 asked a question Retinex Color Restoration

Retinex Color Restoration I want to restore the colour of MSR(Multi-scale Retinex) using the following equation. MSRCR(

2019-05-04 10:54:35 -0500 commented answer How to access pixels by using pointer in OpenCV C++?

Sorry! I didn't understand your code very well, especially the codes in the if statement; size_t index = y*frame.cols*nu

2019-05-04 10:49:44 -0500 commented question How to access pixels by using pointer in OpenCV C++?

@eshirima Thank you!

2019-05-02 09:26:12 -0500 commented question How to access pixels by using pointer in OpenCV C++?

I want to use OpenCV to load the image need to process in CUDA. Is that I don't need to use the pointer? Is there any ef

2019-05-02 04:51:41 -0500 commented question How to access pixels by using pointer in OpenCV C++?

Sorry, sir. I don't get it. I have to rewrite the Gaussian convolution in CUDA code for my project. I couldn't use the c

2019-05-02 04:15:12 -0500 commented question How to save image into specific location and the name?

Thank you! I will try it, sir.