Ask Your Question

esconda's profile - activity

2019-09-12 03:36:07 -0600 received badge  Notable Question (source)
2018-12-02 23:50:14 -0600 received badge  Popular Question (source)
2018-01-17 05:15:02 -0600 commented question Gpu is working slower than Cpu(General Filters)

I basically measured performance using time specification and I put my image processing algorithm between initial time a

2018-01-17 05:12:19 -0600 commented question Gpu is working slower than Cpu(General Filters)

I basically measured performance using time specification and I put my image processing algorithm between initial time a

2018-01-17 05:11:40 -0600 commented question Gpu is working slower than Cpu(General Filters)

I basically measured performance using time specification and ı put my image processing algorithm between initial time a

2018-01-16 08:07:30 -0600 edited question Gpu is working slower than Cpu(General Filters)

Gpu is working slower than Cpu(General Filters) I am working on a barcode recognition project that includes filtration,I

2018-01-16 07:30:33 -0600 edited question Gpu is working slower than Cpu(General Filters)

Gpu is working slower than Cpu(General Filters) I am working on a barcode recognition project that includes filtration,I

2018-01-16 07:27:36 -0600 edited question Gpu is working slower than Cpu(General Filters)

Gpu is working slower than Cpu(General Filters) I am working on a barcode recognition project that includes filtration,I

2018-01-16 07:26:14 -0600 asked a question Gpu is working slower than Cpu(General Filters)

Gpu is working slower than Cpu(General Filters) I am working on a barcode recognition project that includes filtration,I

2018-01-15 07:32:00 -0600 marked best answer Nvdia Cuda gpu implementation and filters with opencv

I just would like to inform you that according to performance criteria i would like to transfer image processing algorithms from CPU to GPU.Therefore I will be able to run it faster in high resolution image(I hope)

But unfortunately ı get some errors using filters in cuda::filter implementation.First of all I use videostream to get image continously by using normal Mat variable.Then I convert it to GpuMat using Gpumat.upload(Mat) function and i call sobel filter function using GpuMat operations.

But unfortunately there is an error indicating after using apply function for filters(I found in Debug) : sobelxfilter->apply(gray_image, sobel_variables[0].Gradx);

The error is :

OpenCV Error: Gpu API call (invalid device symbol) in filter::linearRow, file c:\users\burak.dogancay\desktop\opencv\sources\modules\cudafilters\src\cuda\row_filter.hpp, line 365

I would like to share function that includes the sobel filter operation for clear understanding.

Code :

cuda::GpuMat Morphology::Sobel_operations(cuda::GpuMat& gray_image)

vector<Sobel_variables> sobel_variables(1);
//Sobel_variables sobel_variables;
sobel_variables[0].alpha = 1;

sobel_variables[0].beta = 0.9;

//Apply sobel filter to x
Ptr<cuda::Filter> sobelxfilter=cuda::createSobelFilter(gray_image.type(), sobel_variables[0].ddepth, 1, 0, 3);
sobelxfilter->apply(gray_image, sobel_variables[0].Gradx); **//error occurs after this operation**

//Apply sobel filter to y
Ptr<cuda::Filter> sobelyfilter = cuda::createSobelFilter(gray_image.type(),sobel_variables[0].ddepth, 0, 1, 3);
sobelyfilter->apply(gray_image, sobel_variables[0].Grady);

cuda::subtract(sobel_variables[0].Gradx, sobel_variables[0].Grady, sobel_variables[0].Gradient);

//normalize(sobel_variables[0].Gradient, sobel_variables[0].Gradient, 1, 0, NORM_MINMAX);
//convertScaleAbs(sobel_variables[0].Gradient, sobel_variables[0].Gradient);


cuda::add(sobel_variables[0].Grady, sobel_variables[0].Gradx, sobel_variables[0].Gradient1);


//convertScaleAbs(sobel_variables[0].Gradient1, sobel_variables[0].Gradient1);//It can be used but not necessary

cuda::addWeighted(sobel_variables[0].Gradient, sobel_variables[0].alpha, sobel_variables[0].Gradient1, sobel_variables[0].beta, 0, sobel_variables[0].Out_Image);

//Mat cpu_sobeloutimage=Mat(sobel_variables[0].Out_Image);

imshow("Sobel_operations", sobel_variables[0].Out_Image);

//------free memory of all unnecessarry images--------------------------
sobel_variables[0].Gradx.release();
sobel_variables[0].Grady.release();
gray_image.release();
sobel_variables[0].Gradient.release();
sobel_variables[0].Gradient1.release();

return sobel_variables[0].Out_Image;

}

2018-01-15 07:20:46 -0600 commented question Nvdia Cuda gpu implementation and filters with opencv

LBerger, I solved it using Cuda 8.0 according to architecture compability of my graphic card.Thank you so much.

2018-01-15 07:18:07 -0600 received badge  Self-Learner (source)
2018-01-15 07:09:50 -0600 answered a question Nvdia Cuda gpu implementation and filters with opencv

According to my research the problem was on the architecture version of cuda.Thanks to LBerger, he directed me to find t

2018-01-11 02:22:37 -0600 commented question Nvdia Cuda gpu implementation and filters with opencv

I will try to find it out and inform you here, Thank you.

2018-01-11 01:57:53 -0600 commented question Nvdia Cuda gpu implementation and filters with opencv

I read this before but unfortunately I don't know how to make these gpu configurations for VS 2015

2018-01-11 01:09:28 -0600 asked a question Nvdia Cuda gpu implementation and filters with opencv

Nvdia Cuda gpu implementation and filters with opencv I just would like to inform you that according to performance crit

2017-12-20 08:39:55 -0600 received badge  Self-Learner (source)
2017-12-20 08:00:00 -0600 edited answer Cmake - Compile problem for "Cuda" libraries

CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sur

2017-12-20 07:59:07 -0600 edited answer Cmake - Compile problem for "Cuda" libraries

CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sur

2017-12-20 07:58:34 -0600 edited answer Cmake - Compile problem for "Cuda" libraries

CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sur

2017-12-20 07:58:12 -0600 edited answer Cmake - Compile problem for "Cuda" libraries

CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sur

2017-12-20 07:57:07 -0600 edited answer Cmake - Compile problem for "Cuda" libraries

CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sur

2017-12-20 07:56:26 -0600 edited answer Cmake - Compile problem for "Cuda" libraries

CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sur

2017-12-20 07:55:20 -0600 edited answer Cmake - Compile problem for "Cuda" libraries

CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sur

2017-12-20 07:54:53 -0600 edited answer Cmake - Compile problem for "Cuda" libraries

CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sur

2017-12-20 07:52:55 -0600 edited answer Cmake - Compile problem for "Cuda" libraries

CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make

2017-12-20 07:51:28 -0600 answered a question Cmake - Compile problem for "Cuda" libraries

CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sur

2017-12-11 10:46:38 -0600 received badge  Teacher (source)
2017-12-11 06:14:20 -0600 marked best answer Image rotation problem in for loop(Geometric transformation)

Nowaday I am trying to write barcode reader program with opencv and zbar.The code works correctly, but the zbar plugin only reads the bar code on the horizontal and vertical axes.For this reason, I want to rotate the cross image at the end of the image output.So zbar will read the picture correctly.

But unfortunately I could not rotate the image correctly in the for loop. It rotates the image but does not do this for 180 degrees.I tried to write the code correctly, but I could not reach the end result.I think there's a problem with the warpaffine geometric tarnsformation function.

Any help will be apreciated to find the solution.

Here is example image outputs which is not properly rotated according to specified angle in for loop with explaination : image description

For loop(main code part) , which will be able to rotate image untill 120 degree of angle :

if ((zbar_scanner.barcode_string == "") || (zbar_scanner.barcode_string.length() <= 5)){


    for (float tr = 0; tr <= 120; tr += 20){

        cout << "ANGLE OF ROTATION" << tr << endl;


            zbar_scanner.Image_Transform = Geometric_Transformation(zbar_scanner.cut_image_zbar1, tr);//call rotate function.It is available below.zbar_scanner.cut_image_zbar1 is the image that will be processed and rotated

        zbar_scanner.scanner1.set_config(ZBAR_NONE, ZBAR_CFG_ENABLE, 1);

        Image image1(zbar_scanner.Image_Transform.cols, zbar_scanner.Image_Transform.rows, "Y800", zbar_scanner.Image_Transform.data, zbar_scanner.Image_Transform.cols * zbar_scanner.Image_Transform.rows);

         zbar_scanner.scanner1.scan(image1);

        for (Image::SymbolIterator symbol1 = image1.symbol_begin();
            symbol1 != image1.symbol_end();
            ++symbol1) {

            // print out barcode string in each turn
            cout << "DECODED " << symbol1->get_type_name() << " SYMBOL \"" << symbol1->get_data() << '"' << endl;
            zbar_scanner.barcode_after_transform.append(symbol1->get_data());
        }

        if ((zbar_scanner.barcode_after_transform != "") || (zbar_scanner.barcode_after_transform.length() > 5)){

            return zbar_scanner.barcode_after_transform;
            break;//if barcode is read, break the for loop
        }

        image1.set_data(NULL, 0);
    }
}

Here is the rotation function which is called above by

zbar_scanner.Image_Transform=Geometric_Transformation(zbar_scanner.cut_image_zbar1,tr);

Mat Morphology::Geometric_Transformation(Mat& CutImage, float Transform){

src_center = Point2f(CutImage.cols /2 , CutImage.rows / 2); /// 2.0F /10.0f

rot_mat = getRotationMatrix2D(src_center, -Transform, 1);

rot_imagebox = RotatedRect(src_center, CutImage.size(), -Transform).boundingRect();

rot_mat.at<double>(0, 2) += rot_imagebox.width / 2.0 - src_center.x;//look for at command
rot_mat.at<double>(1, 2) += rot_imagebox.height / 2.0 - src_center.y;

if ((CutImage.cols > 0) && (CutImage.rows > 0)){
    warpAffine(CutImage, dst, rot_mat, rot_imagebox.size()); //rotate image with given angle by for loop value

    cvtColor(dst, dst, CV_RGB2GRAY);
    imshow("Rotated Image", dst);

}
return dst; //return otput image for each rotation

}

2017-12-11 06:14:13 -0600 received badge  Self-Learner (source)
2017-12-11 06:13:58 -0600 marked best answer Barcode recognition, Sobel derivatives and image transformation problem!

First of all, I am developing a program for barcode reading.I use Sobel derivatives to obtain Gradient representation of image in x and y direction for barcode bars.It works very well in both directions(0 to 270 degree).

But unfortunately Sobel derivative representation can not recognize another angle of the image.I don't know how to explain it, but you can understand it by looking at the two different pictures I've added below.

Correctly recognized barcode bars,

image description

Can not detect from the same angle in reverse view, image description

Here is my code for sobel derivatives , I have added y direction gradient view to x direction using addweighted command.

vector<Sobel_variables> sobel_variables(1);
sobel_variables[0].alpha = 1;

sobel_variables[0].beta = 0.9;

Sobel(gray_image, sobel_variables[0].Gradx, sobel_variables[0].ddepth, 1, 0, 3);
Sobel(gray_image, sobel_variables[0].Grady, sobel_variables[0].ddepth, 0, 1, 3);

subtract(sobel_variables[0].Gradx, sobel_variables[0].Grady, sobel_variables[0].Gradient);

convertScaleAbs(sobel_variables[0].Gradient, sobel_variables[0].Gradient);

subtract(sobel_variables[0].Grady, sobel_variables[0].Gradx, sobel_variables[0].Gradient1);

convertScaleAbs(sobel_variables[0].Gradient1, sobel_variables[0].Gradient1);

addWeighted(sobel_variables[0].Gradient, sobel_variables[0].alpha, sobel_variables[0].Gradient1, sobel_variables[0].beta, 0, sobel_variables[0].Out_Image);

//sobel_variables[0].Out_Image.

imshow("Sobel_operations", sobel_variables[0].Out_Image);
return sobel_variables[0].Out_Image;

It is really strange.Any help will be apreciated to solve this problem.

2017-12-11 06:13:50 -0600 received badge  Self-Learner (source)
2017-12-11 01:37:25 -0600 answered a question Barcode recognition, Sobel derivatives and image transformation problem!

I solved it using "add" function to calculate image vertices in x and y axis.Therefore it we are able to combine each th

2017-12-11 01:17:42 -0600 edited answer Image rotation problem in for loop(Geometric transformation)

I would like to inform you that I solved this problem using MinRect function instead of boundingbox.Therefore I am able

2017-12-11 01:10:55 -0600 edited answer Image rotation problem in for loop(Geometric transformation)

I would like to inform you that I solved this problem using MinRect function instead of boundingbox.Therefore I am able

2017-12-11 01:08:45 -0600 answered a question Image rotation problem in for loop(Geometric transformation)

I would like to inform you that I solved this problem using MinRect function instead of boundingbox.Therefore I am able

2017-12-07 04:34:48 -0600 edited question Cmake - Compile problem for "Cuda" libraries

Cmake - Compile problem for "Cuda" libraries I have developed a program using opencv 3.0 with Visual studio 2013 and now

2017-12-07 03:57:31 -0600 asked a question Cmake - Compile problem for "Cuda" libraries

Cmake - Compile problem for "Cuda" libraries I have developed a program using opencv 3.0 with Visual studio 2013 and now

2017-12-04 08:50:53 -0600 edited question Image rotation problem in for loop(Geometric transformation)

Image rotation problem in for loop(Geometric transformation) Nowaday I am trying to write barcode reader program with op

2017-12-04 08:49:34 -0600 edited question Image rotation problem in for loop(Geometric transformation)

Image rotation problem in for loop(Geometric transformation) Nowaday I am trying to write barcode reader program with op

2017-12-04 08:47:41 -0600 edited question Image rotation problem in for loop(Geometric transformation)

Image rotation problem in for loop(Geometric transformation) Nowaday I am trying to write barcode reader program with op

2017-12-04 08:46:43 -0600 asked a question Image rotation problem in for loop(Geometric transformation)

Image rotation problem in for loop(Geometric transformation) The code works correctly, but the zbar plugin only reads th

2017-11-27 03:12:21 -0600 commented question Barcode recognition, Sobel derivatives and image transformation problem!

Unfortunately the system does not allow me to write it. "New user" restriction

2017-11-27 02:39:30 -0600 commented question Barcode recognition, Sobel derivatives and image transformation problem!

I removed this convertScaleAbs as you recommended.Also I solved reverse view problem for sobel derivative with using "ad

2017-11-27 02:39:07 -0600 commented question Barcode recognition, Sobel derivatives and image transformation problem!

I removed this convertScaleAbs as you recommended.Also I solved reverse view problem for sobel derivative with using add

2017-11-27 01:52:31 -0600 commented question Barcode recognition, Sobel derivatives and image transformation problem!

Thank you berak,I really apreciate your effort for my questions.But I think "convertscaleabs" function did almost the sa

2017-11-27 01:47:58 -0600 commented question Barcode recognition, Sobel derivatives and image transformation problem!

Thank you berak,I really apreciate your effort for my questions.But I think "convertscaleabs" function did almost the sa

2017-11-27 00:47:35 -0600 edited question Barcode recognition, Sobel derivatives and image transformation problem!

Barcode recognition, Sobel derivatives and image transformation problem! First of all, I am developing a program for bar