Ask Your Question

Balaji R's profile - activity

2020-10-25 08:03:27 -0600 received badge  Good Answer (source)
2020-10-05 23:13:45 -0600 received badge  Good Answer (source)
2020-09-28 11:07:32 -0600 received badge  Nice Question (source)
2020-09-11 21:34:19 -0600 received badge  Famous Question (source)
2020-08-12 14:40:37 -0600 received badge  Popular Question (source)
2020-06-08 02:40:27 -0600 received badge  Famous Question (source)
2020-03-24 20:49:24 -0600 received badge  Famous Question (source)
2019-07-03 21:20:03 -0600 received badge  Necromancer (source)
2019-07-03 07:30:12 -0600 answered a question YUYV422 to BGR

Just for the sake of completion I'm adding this answer. #include "opencv2/opencv.hpp" int main(int, char**) { cv::

2019-05-08 06:01:36 -0600 asked a question Feature Detection Module output not matching with Optimization mode Enabled

Feature Detection Module output not matching with Optimization mode Enabled Hi all, I'm working with 3D Reconstruction

2019-01-08 06:03:18 -0600 received badge  Notable Question (source)
2018-12-11 04:09:51 -0600 received badge  Nice Answer (source)
2018-12-08 10:49:13 -0600 received badge  Notable Question (source)
2018-11-15 10:57:23 -0600 received badge  Notable Question (source)
2018-09-10 15:02:12 -0600 marked best answer How to use Mat::forEach position parameter?

I want to know the pixel id of the Mat element using cv::Mat::forEach position parameter. I read the documentation here and tried the following code!

Code:

typedef cv::Point_<uchar> Pixel;
struct Operator {
    void operator ()(Pixel &pixel, const int * position) const 
    {           
        cout << format("[%d,%d]= %d \n",position[0],position[1],(int)pixel.x);      
    }
};

int main( int argc, char* argv[])
{    
    Mat mTest(Size(3, 2), CV_8UC1,Scalar(0));   
    randn(mTest,Scalar(125),Scalar(125));

    cout<< format (" Size : %d , %d \n",mTest.rows,mTest.cols);

    for (int Rows = 0; Rows < mTest.rows; Rows++)
    {
        for (int Cols = 0; Cols < mTest.cols; Cols++)
        {
            cout << format("[%d,%d]= %d \t",Rows,Cols,mTest.at<uchar>(Rows,Cols));
        }
        cout << "\n";
    }
    cout << "\n\n";

    mTest.forEach<Pixel>(Operator());

    waitKey();

    return 0;
}

Output:

 Size : 2 , 3
[0,0]= 125      [0,1]= 145      [0,2]= 37
[1,0]= 71       [1,1]= 255      [1,2]= 90


[0,0]= 125
[1,0]= 71
[0,1]= 37
[0,2]= 255
[1,1]= 90
[1,2]= 0
Press any key to continue . . .

As you can see there is a mismatch in the Actual Pixel ID and the Position parameter ID! So how to use the position parameter correctly?

Note: I've just noted that there is a different method described in the documentation

i.e forEachWithPosition but it is not available now?

2018-09-05 08:03:45 -0600 commented question Getting the (HSL conversion) Lightness average Value from an image

sorry your question is not clear! Do you want to find the min & max value of a HSL image? or a BGR Image? Are you co

2018-07-26 00:57:14 -0600 commented question Best method to save and load data in a file for opencv 3.1 version

Have you checked this? https://docs.opencv.org/3.0-beta/doc/tutorials/core/file_input_output_with_xml_yml/file_input_out

2018-07-24 02:08:09 -0600 commented question finding chessboard corners doesn't work on thresholded images

Actually it is not recommended to pre-process the input image before finding the corners, because this will alter the co

2018-07-19 01:36:35 -0600 commented question VideoCapure: uncompressed 16 bit video stream (Y16)

@berak Thanks for the update! You are Right!!

2018-07-19 01:15:01 -0600 commented question VideoCapure: uncompressed 16 bit video stream (Y16)

Opencv does not support Y16 format! You need to modify the source code to add Y16 support.

2018-07-18 19:24:40 -0600 received badge  Good Answer (source)
2018-07-18 01:38:37 -0600 edited question The camera is not working

The camera is not working I'm new and just starting to learn OpenCV. The camera is not initialized during image capture

2018-06-21 23:12:32 -0600 commented question How do I select the best serialization technique for Mat objects?

You can store and then restore various OpenCV data structures to/from XML. Refer this

2018-06-20 05:36:50 -0600 commented question Numerical Stability of solvePoly

Should we report this bug?

2018-06-20 05:35:30 -0600 commented question Numerical Stability of solvePoly

Looks like you are getting max error in terms of 1.25E-06.

2018-06-20 04:07:55 -0600 commented question Numerical Stability of solvePoly

@LBerger Thank you for your comments. I've disabled all the optimizations in both the places. Still the results are same

2018-06-20 04:01:43 -0600 commented question Numerical Stability of solvePoly

@LBerger Thank you for your comments. I've disabled all the optimizations in both the places. Still the results are same

2018-06-20 03:59:50 -0600 commented question Numerical Stability of solvePoly

@LBerger Thank you for your comments. I've disabled all the optimizations in both the places. Still the results are same

2018-06-20 03:51:17 -0600 commented question Numerical Stability of solvePoly

@LBerger Thank you for your comments. I've disabled all the optimizations in both the places. Still the results are same

2018-06-20 00:25:52 -0600 edited question Memory leaking c++ w/VS12

Memory leaking c++ w/VS12 Hello everyone, I am trying to create a simple program to load an image (6398*1080) and have

2018-06-18 05:18:44 -0600 edited question Numerical Stability of solvePoly

Numerical Stability of solvePoly I'm working with OpenCV 5 point Essential Matrix Computation Algorithm and I'm facing N

2018-06-18 05:12:53 -0600 edited question Numerical Stability of solvePoly

Numerical Stability of solvePoly I'm working with OpenCV 5 point Essential Matrix Computation Algorithm and I'm facing N

2018-06-18 05:06:09 -0600 asked a question Numerical Stability of solvePoly

Numerical Stability of solvePoly I'm working with OpenCV 5 point Essential Matrix Computation Algorithm and I'm facing N

2018-05-02 23:15:45 -0600 commented answer How to detect led is blinking or not at multiple frequency?

@prabzz " didn't get result" is not a useful answer! Please explicitly specify your problem!

2018-05-02 08:02:53 -0600 commented question How to detect led is blinking or not at multiple frequency?

"current output and desired output" Please update these images also.

2018-05-02 07:41:28 -0600 commented question How to detect led is blinking or not at multiple frequency?

Please share your input image ,current output and desired output! Please try to make a complete code.

2018-04-19 22:16:05 -0600 received badge  Popular Question (source)
2018-04-10 14:41:11 -0600 received badge  Notable Question (source)
2018-04-05 00:33:28 -0600 commented question Stereo Calibration Not Working

without seeing your actual calibration images it is difficult to identify your problem!

2018-04-04 02:07:21 -0600 commented question Stereo Calibration Not Working

Please read this useful post! https://stackoverflow.com/questions/12794876/how-to-verify-the-correctness-of-calibration-

2018-04-04 01:27:02 -0600 commented question Stereo Calibration Not Working

That's definitely because of bad calibration! Calibrate your stereo camera again!

2018-04-04 01:25:20 -0600 commented question Dust Detection at Mining site

why don't you try it and come back if you have any specific issue?

2018-03-23 02:03:17 -0600 commented question How to add the points[4] to the contours by using opencv framework

I think you have already posted here and got the answers. What else do you need?

2018-03-21 23:22:51 -0600 commented question Best way to get Contour's extreme points with C++?

"I tried with houghLine but its not really accurate" Can you show us the results so that we can help further?

2018-03-21 05:15:47 -0600 commented answer Algorithm recommendation for texture analysis/segmentation

I'm sorry your answer is based on Color based segmentation! But the OP question was about Texture based segmentation! e.

2018-03-21 00:20:34 -0600 commented question Best way to get Contour's extreme points with C++?

Could you please add the complete code (including the Pre-processing step)? In my opinion you should find Hough Line Tr

2018-03-21 00:03:37 -0600 commented question Algorithm recommendation for texture analysis/segmentation

The world is moving towards Deep Neural Networks! Why not try those? 1 2

2018-03-20 23:56:28 -0600 commented question Algorithm recommendation for texture analysis/segmentation

The world is moving towards Deep Neural Networks! Why not try those? 1 2

2018-03-20 23:05:34 -0600 commented question Edge/Contour identification

I would say comparing contours is unnecessary here! You can find Lines in the Two Images and compare its x,y Co-Ordinat

2018-03-20 22:45:38 -0600 commented question Best way to get Contour's extreme points with C++?

your Image and this code makes no sense! Could you please add the complete code (including the Pre-processing step)? In