Ask Your Question

zms's profile - activity

2020-12-03 23:26:50 -0500 received badge  Notable Question (source)
2020-09-28 12:43:43 -0500 marked best answer Access and save information in Mat Array

i have declared a mat and i need to access and change the value one by one.

Mat M(1,63, CV_8UC1, Scalar(0,255,0));

and

 M.at<double>(1,i)=<data>;i++;

It does not work. Anyone can gelp?

Rgds Zamani

2020-02-13 20:31:59 -0500 received badge  Popular Question (source)
2019-10-29 23:52:45 -0500 received badge  Popular Question (source)
2019-09-15 17:43:33 -0500 received badge  Popular Question (source)
2019-07-17 00:02:31 -0500 received badge  Famous Question (source)
2019-06-09 22:01:56 -0500 received badge  Popular Question (source)
2019-05-13 16:51:09 -0500 received badge  Notable Question (source)
2019-04-18 13:31:16 -0500 received badge  Notable Question (source)
2019-01-29 10:50:38 -0500 received badge  Popular Question (source)
2018-10-30 02:42:26 -0500 asked a question What is the best value for thresholding for bimodal histogram

What is the best value for thresholding for bimodal histogram Hi all, I have thousands of images with different bimodal

2018-10-26 16:17:23 -0500 received badge  Notable Question (source)
2018-09-05 06:26:52 -0500 asked a question Getting the (HSL conversion) Lightness average Value from an image

Getting the (HSL conversion) Lightness average Value from an image Hi, I have hundreds of images that need to analyze t

2018-07-03 07:32:00 -0500 received badge  Famous Question (source)
2018-04-16 05:43:34 -0500 received badge  Popular Question (source)
2018-03-02 03:54:02 -0500 received badge  Popular Question (source)
2018-01-04 05:02:37 -0500 marked best answer how to know there is a transition in a string of binary numbers

hi, if i have a string of binary number scan from a binary image from this code

     for( int y=0; y< frame_gray.rows; y+=10){
    for (int x=0;x< frame_gray.cols;x+=1){

        if (frame_gray.at<uchar>(y,x)==0)
        {  cout << "0 binary=" << endl;}

        else
        {  cout << "1 binary=" << endl;width++;}
        //waitKey(0);

    }

    cout << "width=" << width << endl;
    width=0;
    cout << "new pixel line" << endl;
}

as example output is 0000000111111000000, how can i write a code to tell me there is two times of value transition 0-->1 and 1--->0? or

00001111100000111100000 there are 4 times of transition happened.

thanks

2017-11-30 03:42:15 -0500 asked a question Why my array had different data?

Why my array had different data? I'm debugging my code to get the largest and 2nd largest contour area using this code,

2017-11-30 03:42:10 -0500 asked a question Why my array had different data?

Why my array had different data? I'm debugging my code to get the largest and 2nd largest contour area using this code,

2017-11-21 04:36:13 -0500 commented answer How can i know the location of blobs/contour

thanks very much

2017-11-21 04:36:01 -0500 marked best answer How can i know the location of blobs/contour

I had tried few methods to get the location of the contour or blobs from a moving image. Yet still could not achieve. Below are the images. I had tried using contour hierarchy but the numbering of the hierarchy does not consistent as I'm using area size and perimeter to distinguish the blobs location. Still not successful.

The only thing that i want to know is whether the smaller blobs position is at the top of the bigger blobs or at the bottom of the bigger blobs as in image 3. Anyone can help?

image descriptionimage descriptionimage description

2017-11-21 03:53:30 -0500 commented question How to find the second Largest Contour in an image

HI Balaji, as edited, I did not stuck with the biggest contour. The problem that I had stucked is to get the [i] contour

2017-11-21 03:53:16 -0500 edited question How to find the second Largest Contour in an image

How to find the second Largest Contour in an image All the while, the example of coding is to calculate the biggest of t

2017-11-21 02:39:52 -0500 asked a question How to find the second Largest Contour in an image

How to find the second Largest Contour in an image All the while, the example of coding is to calculate the biggest of t

2017-11-21 02:39:48 -0500 asked a question How to find the second Largest Contour in an image

How to find the second Largest Contour in an image All the while, the example of coding is to calculate the biggest of t

2017-11-20 06:23:25 -0500 commented answer How can i know the location of blobs/contour

Hi, I'm a bit confuse here what does it mean of Point a, Point b, Point c? is it a coordinate pair? For example from th

2017-11-19 23:26:53 -0500 commented answer How can i know the location of blobs/contour

Hi VxW, at the moment i had successfully draw the line (top most - bottom most) in the bigger contour. the center gravi

2017-11-17 12:53:21 -0500 commented question How can i know the location of blobs/contour

hi Berak, what i meant for hierarchy is this one. But maybe I'm wrong. void findContours(InputOutputArray image, Outp

2017-11-17 00:10:49 -0500 edited question How can i know the location of blobs/contour

How can i know the location of blobs/contour I had tried few methods to get the location of the contour or blobs from a

2017-11-17 00:10:10 -0500 asked a question How can i know the location of blobs/contour

How can i know the location of blobs/contour I had tried few methods to get the location of the contour or blobs from a

2017-11-17 00:10:07 -0500 asked a question How can i know the location of blobs/contour

How can i know the location of blobs/contour I had tried few methods to get the location of the contour or blobs from a

2017-11-15 20:49:20 -0500 commented answer How to get the total of the same number in a MAT

thanks berak!

2017-11-14 04:51:26 -0500 commented answer How to get the total of the same number in a MAT

@berak, what is the data type of hist(0)? i tried to get the percentage by calculating it.. Mat_<int> hist(256, 1

2017-11-10 23:02:17 -0500 marked best answer contourArea meaning and arclength

Hi, I'm playing with the moment coding and i'm confuse with the result. What I understand is the contourarea and the moment code will give the same result. 1) Contour area - is it means the area inside a close loop? Must it close contour? 2) what is the unit of the contour? I obtained result as 1, 7.5 and etc and confuse. 3) arclength is measuring the countour in pixel?

Anyone can help?

2017-10-08 11:09:38 -0500 marked best answer Test Time Execution Validation for reading Frame at CPU i-7

Hello Team Member, Can anyone help to validate the test time execution for opencv to read the frame from video. I'm doing comparison with someone else data and found out the data is a bit different. I'm using processor Intel i7-4790 @3.60GHz and 16GB Memory. Using this code to get the test execution. I'm just trying to compare on how other do this and is my result and assumption correct which for reading the frame only will take around 10ms?

Here how I implement the code in the program

   double t = (double)getTickCount(); 
   bool bSuccess = cap.read(frame); // read a new frame from video

    if (!bSuccess) //if not success, break loop
    {
                    cout << "Cannot read the frame from video file" << endl;
                    break;
    }

   t = ((double)getTickCount() - t)/getTickFrequency(); 
   std::cout << "Times passed in seconds: " << t << std::endl;

and here is the snippet of the result - and I think the average is @10ms (is this right?) Times passed in seconds: 0.0117758 Times passed in seconds: 0.00500268 Times passed in seconds: 0.0114046 Times passed in seconds: 0.0110537 Times passed in seconds: 0.0152564 Times passed in seconds: 0.0102511 Times passed in seconds: 0.00492798 Times passed in seconds: 0.0109479 Times passed in seconds: 0.0115418 Times passed in seconds: 0.0102865 Times passed in seconds: 0.0124572 Times passed in seconds: 0.00492086 Times passed in seconds: 0.0155164 Times passed in seconds: 0.0100909 Times passed in seconds: 0.0152786 Times passed in seconds: 0.0222282 Times passed in seconds: 0.0128396 Times passed in seconds: 0.0119007 Times passed in seconds: 0.0145368 Times passed in seconds: 0.010985 Times passed in seconds: 0.0101251 Times passed in seconds: 0.00457987 Times passed in seconds: 0.0112319

Edited to add for verification @pklab, sorry for a bit slow response here as I need to digest the code and try to implement in my code. Since that I have a video file and from the glossary, it should be reading from it as below. Which means that, total time in this case would be the total time for reading the frame right?

while(1) { start = cv::getTickCount(); std::cout << std::endl << "Clock resolution: "<< 1000 * 1000 * 1000 / clockResolution << "ns" << std::endl;

   start = cv::getTickCount();

   bool bSuccess = cap.read(frame); // read a new frame from video

    if (!bSuccess) //if not success, break loop
    {
                    cout << "Cannot read the frame from video file" << endl;
                    break;
    }
  stop = cv::getTickCount();
  double totalTime = (stop - start) / cv::getTickFrequency(); // seconds
2017-10-08 11:09:35 -0500 received badge  Nice Question (source)
2017-09-21 03:55:36 -0500 received badge  Famous Question (source)
2017-09-05 20:14:43 -0500 commented question Degree Values after conversion

owh sorry, I'm using this in my opencv c++. I thought this would be the right forum to discuss. Anyway thanks!! alot

2017-09-05 19:19:43 -0500 asked a question Degree Values after conversion

Degree Values after conversion Hi All, I have few sets of pair coordinates. For each pair, i would like to get the value

2017-08-23 02:54:12 -0500 received badge  Famous Question (source)
2017-08-21 09:42:11 -0500 received badge  Notable Question (source)
2017-07-06 09:55:19 -0500 received badge  Popular Question (source)
2017-07-06 04:43:49 -0500 received badge  Notable Question (source)
2017-04-24 13:04:03 -0500 received badge  Taxonomist
2017-03-13 02:22:18 -0500 marked best answer How to get the total of the same number in a MAT

Hi, I have a mat M size -1 X48 M = [4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0]

How can i seggregate and know that inside the Mat there are 5 frequency for #3, 8 frequency for #2 and 5 frequency of #4.

Example for my code here not able to calculate #2 and only stated 0. Any advice?

 for(int y=0;y< 1;y++){
     for (int x=0;x< 48; x++){

        if (frame_gray.at<uchar>(y,x)==2)
        { two++;}
        else {}

     }  }

cout << "zero =" << zero << endl;
cout << "two =" << two << endl;
cout << "four =" << four << endl;

the output

M = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0]

zero =0 two =0 four =0

2017-03-13 02:22:02 -0500 commented answer How to get the total of the same number in a MAT

thanks @berak