Ask Your Question

julian403's profile - activity

2021-12-10 12:36:22 -0600 received badge  Notable Question (source)
2020-10-19 12:33:01 -0600 received badge  Famous Question (source)
2020-07-24 07:52:57 -0600 received badge  Popular Question (source)
2019-09-23 08:11:53 -0600 received badge  Notable Question (source)
2019-07-08 19:21:02 -0600 commented question Read camera data without camera visualization.

thanks for the repply but Camera API is not a part of NDK for many years. There are some attempts to make this Camera AP

2019-07-07 14:37:27 -0600 asked a question Read camera data without camera visualization.

Read camera data without camera visualization. Hello All. I started to use openCV on android studio and as my first co

2019-04-22 17:29:51 -0600 received badge  Popular Question (source)
2018-04-19 03:49:25 -0600 marked best answer Problem with image ROIs

Hello All. Im having this problem:

OpenCV Error: Assertion failed (0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows) in Mat, file /home/julian/opencv/opencv-3.2.0/modules/core/src/matrix.cpp, line 522 terminate called after throwing an instance of 'cv::Exception' what(): /home/julian/opencv/opencv-3.2.0/modules/core/src/matrix.cpp:522: error: (-215) 0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows in function Mat

I know where is the problem but I dont know how to fix it. this is the code:

#include <stdio.h>
#include <opencv2/opencv.hpp>
#include <opencv2/highgui.hpp>
#include <unistd.h>


using namespace cv;
using namespace std;

Mat frame1, frame2, frame3;
Mat img1, img2, img3, img4;
Mat _kernel;


int main(int argc,char ** argv)
{
    _kernel = cv::getStructuringElement(cv::MORPH_RECT, cv::Size2i(3, 3), cv::Point2i(1, 1));


vector<int> compression_params;
compression_params.push_back(IMWRITE_PNG_COMPRESSION);
compression_params.push_back(1);  

  VideoCapture cap(0);
  if (!cap.isOpened()) {
    cerr << "ERROR: Unable to open the camera" << endl;
    return 0;
  }

  cout << "Start grabbing, press a key on Live window to terminate" << endl;

    cap >> frame1;
        usleep (10000);
        cap>>frame2;

        subtract(frame1, frame2, frame3);
        threshold(frame3, frame3, 15, 255, CV_THRESH_BINARY);
        morphologyEx(frame3, frame3, CV_MOP_OPEN, _kernel, cv::Point2i(-1, -1), 1);
        cv:: cvtColor(frame3, frame3, CV_BGR2GRAY);

        img1=frame3(Rect(0,0, frame3.cols/2,frame3.rows/2));
        img2=frame3(Rect(0,frame3.rows/2, frame3.cols/2, frame3.rows ));
        img3=frame3(Rect(frame3.cols/2,0, frame3.cols,frame3.rows/2));
        img4=frame3(Rect(frame3.cols/2,frame3.rows/2, frame3.cols,frame3.rows));


imwrite("img1.png", img1, compression_params);
imwrite("img2.png", img2, compression_params);
imwrite("img3.png", img3, compression_params);
imwrite("img4.png", img4, compression_params);


return 1;
}

The problem is on

img1=frame3(Rect(0,0, frame3.cols/2,frame3.rows/2));
            img2=frame3(Rect(0,frame3.rows/2, frame3.cols/2, frame3.rows ));
            img3=frame3(Rect(frame3.cols/2,0, frame3.cols,frame3.rows/2));
            img4=frame3(Rect(frame3.cols/2,frame3.rows/2, frame3.cols,frame3.rows));

But what other way can I use to cut an image?

Thanks all

2018-04-18 12:11:55 -0600 commented question Problem with image ROIs

thanks. it works img1=frame3(Rect(0,0,frame3.cols/2,frame3.rows/2)); img2=frame3(Rect(0, frame3.rows/2,frame3.cols/2,

2018-04-18 11:26:13 -0600 asked a question Problem with image ROIs

Problem with image cuts Hello All. Im having this problem: OpenCV Error: Assertion failed (0 <= roi.x && 0

2018-04-07 18:42:06 -0600 commented answer Work with operations pixel by pixel and loops

thanks for the reply.

2018-04-07 18:41:56 -0600 commented question Work with operations pixel by pixel and loops

Thanks for the reply. I will check the opencv function but for some proccess I like to use my own loops. Its more easy a

2018-04-06 20:37:41 -0600 asked a question Work with operations pixel by pixel and loops

Work with operations pixel by pixel and loops Hello All. I heard in this forum before that it isnt recomended work or

2018-04-02 11:56:11 -0600 commented answer High pass filter

Thanks That helped me because the impulse response I did use was wrong. with that IRR filter, it works (a little but it

2018-04-02 11:25:16 -0600 commented answer High pass filter

Thanks That helped me.

2018-04-01 15:40:31 -0600 answered a question High pass filter

This is the code. The output its not what I wanted: int main(int argc,char ** argv) { VideoCapture cap(0); if (

2018-03-31 10:58:07 -0600 commented question High pass filter

I will share the code and the image output tomorrow. Due to the server doesnt allow me to answer (I have to wait to 2 da

2018-03-31 08:17:10 -0600 commented answer multiply image with scalar

Thanks a lot

2018-03-31 08:13:35 -0600 received badge  Enthusiast
2018-03-30 23:26:17 -0600 edited question multiply image with scalar

multiply image with scalar Hello All. Its possible this operation?; cv::Mat A cv::Mat B cv::Mat C

2018-03-30 22:39:56 -0600 asked a question multiply image with scalar

multiply image with scalar Hello All. Its possible this operation?; cv::Mat A cv::Mat B cv::Mat C

2018-03-30 07:39:31 -0600 commented question High pass filter

I need to filter the image over the time with a passband frecuency of 50Hz, to get the just the movement

2018-03-30 07:34:00 -0600 commented question High pass filter

I need to filter the image over the time, to get the just the movement

2018-03-30 07:17:29 -0600 commented question High pass filter

I need to filter the image over the time

2018-03-29 22:21:53 -0600 asked a question High pass filter

High pass filter Hello All. I hope you are doing well. Is there a function for a high pass filter? I mean, a function

2018-01-30 07:43:12 -0600 commented question copy half image

you are right! thanks

2018-01-29 18:42:35 -0600 commented question copy half image

Oh, thanks a lot. But whats the problem with my code? I'm seeing that work in a low leves with opencv always get problem

2018-01-29 17:00:02 -0600 edited question copy half image

copy half image Hello All. I have an image: MAt gray which the size is 480*640 and its 1 channel and I need to copy

2018-01-29 16:58:18 -0600 received badge  Editor (source)
2018-01-29 16:58:18 -0600 edited question copy half image

copy half image Hello All. I have an image: MAt gray which the size is 480*640 and its 1 channel and I need to copy

2018-01-29 16:57:48 -0600 asked a question copy half image

copy half image Hello All. I have an image: MAt gray which the size is 480*640 and its 1 channel and I need to copy

2018-01-29 12:16:14 -0600 marked best answer write a Mat to txt file

Hello All.

I got a border image using Canny function. What Im trying to do is detect a movement using a high pass filter. So applying that filter the border which has a fast changes will still be present. I will read all pixel and find which its "white" (non zero)

image description

That image I got using Canny function.

For for debug it, I means to check that after apply the filter I get white pixel and I have to read that pixel and check the value I do:

    for(int y=0;y<480;y++)
{
    for(int x=0;x<680; x++)
    {
    fprintf(archivo, "%c\t", edges.at<uchar>(x,y));
    }
    fprintf(archivo, "\n");

}

But that doesnt work. Any help here?

Thanks in advance.

2018-01-29 09:56:19 -0600 asked a question write a Mat to txt file

write a Mat to txt file Hello All. I got a border image using Canny function. What Im trying to do is detect a movemen

2018-01-24 12:17:34 -0600 commented question 2 dim matrix, how can it be

Thank you very much.

2018-01-24 09:36:48 -0600 commented question 2 dim matrix, how can it be

But CV_32FC3 == 3 32bit float channels. There is 32 bits per color (B G R) and thats 96 bits deep pixel which gives 2^

2018-01-24 09:27:57 -0600 commented question 2 dim matrix, how can it be

Thanks a lot and the last one: So if CV_8U has a deep pixel of 24bits that implies that CV_32F has 96 bits?

2018-01-24 09:00:16 -0600 commented question 2 dim matrix, how can it be

Thanks. But, what do you means when you said "the pixels are interleaved"? Thats ones question that I still have becau

2018-01-24 08:56:58 -0600 commented answer 2 dim matrix, how can it be

Yes I can see the image and its colored

2018-01-24 08:55:55 -0600 commented question 2 dim matrix, how can it be

Thanks. But, what do you means when you said "the pixels are interleaved"? Thats ones question that I still have becau

2018-01-23 18:57:52 -0600 asked a question 2 dim matrix, how can it be

2 dim matrix, how can it be Hello. I hope you all are fine. Im new with this API and as every newbie I need a little h

2018-01-23 18:57:51 -0600 asked a question 2 dim matrix, how can it be

2 dim matrix, how can it be Hello. I hope you all are fine. Im new with this API and as every newbie I need a little h