Ask Your Question

Ahmed's profile - activity

2020-11-23 11:30:24 -0500 commented question Cut faraway objects based on depth map

@break How would I fill the incoming depth F32_C4 with the required mask like intel ? I don't know how to convert it to

2020-11-23 09:01:00 -0500 commented question Cut faraway objects based on depth map

@berak, the depth image is F32_C4, I would like to cut far objects and extract the foreground as shown in intel example

2020-11-23 07:39:20 -0500 commented question Cut faraway objects based on depth map

@break thanks, the correct foreground is the one that near the camera like the laptop screen, and other far away pixels

2020-11-23 05:31:46 -0500 asked a question Cut faraway objects based on depth map

Cut faraway objects based on depth map I would like to do grabcut which uses a depth map that cuts away far objects, tha

2020-11-23 05:31:42 -0500 asked a question Cut faraway objects based on depth map

Cut faraway objects based on depth map I would like to do grabcut which uses a depth map that cuts away far objects, tha

2020-11-19 01:09:02 -0500 asked a question Is that an occlusion depth research problem?

Is that an occlusion depth research problem? I'm having a problem that I'm doing mixed reality application and the depth

2020-11-01 13:37:22 -0500 commented answer temporal effect on depth result in ghosty image

here is intel article about that topic https://dev.intelrealsense.com/docs/depth-post-processing#section-simple-post-pro

2020-11-01 13:35:40 -0500 commented answer temporal effect on depth result in ghosty image

The real question is, There is no method to do temporal removal at all in OpenCV that work out of the box ? even with mo

2020-11-01 13:11:41 -0500 commented answer temporal effect on depth result in ghosty image

If the camera doesn't move, still I get black lines the are drawing

2020-11-01 12:15:46 -0500 commented answer temporal effect on depth result in ghosty image

there was a problem with initializing the cv::avg, well it has the same ghosting effect!!! I'm getting Crazy

2020-11-01 11:59:44 -0500 commented answer temporal effect on depth result in ghosty image

tried your solution, I get access violation on avg+=q, being avg is empty while (key != 'q') { zed.retri

2020-11-01 11:59:21 -0500 commented answer temporal effect on depth result in ghosty image

tried your solution, I get access violation on avg+=q, being avg is empty while (key != 'q') { zed.retrieve

2020-11-01 11:12:07 -0500 commented question temporal effect on depth result in ghosty image

@break, it's not actually ghosting, it's the image is keeping accumlating black color while I'm moving, that's the behav

2020-11-01 10:30:03 -0500 commented question temporal effect on depth result in ghosty image

@break I'm using ZED Camera, it has a very bad depth image, I would like : Temporal filter The temporal filter is intend

2020-11-01 10:01:31 -0500 commented question temporal effect on depth result in ghosty image

@break ok, lets focus on something, how would I do temporal remove on a depth image ?

2020-11-01 09:43:06 -0500 commented question temporal effect on depth result in ghosty image

@breal I uploaded a video, which shows two things 1. Speckles 2. Ghosting after filtering the depth. https://www.youtube

2020-11-01 09:27:57 -0500 commented question temporal effect on depth result in ghosty image

@break the depth image is C1_32F

2020-11-01 09:27:32 -0500 commented question temporal effect on depth result in ghosty image

@break I removed that line you mentioned, I'm getting an echo buffer still, like the picture is accumlated to black ever

2020-11-01 04:33:12 -0500 commented question temporal effect on depth result in ghosty image

@break, I wanna do temporal filtering on that image, I see a lot of spots that appear in the screen. Yes the camera move

2020-11-01 03:41:49 -0500 commented question temporal effect on depth result in ghosty image

@break I added a single image

2020-11-01 03:41:39 -0500 edited question temporal effect on depth result in ghosty image

temporal effect on depth result in ghosty image Hi, I'm trying to do temporarl removal on depth image, and I'm getting a

2020-11-01 03:38:25 -0500 edited question temporal effect on depth result in ghosty image

temporal effect on depth result in ghosty image Hi, I'm trying to do temporarl removal on depth image, and I'm getting a

2020-11-01 03:32:53 -0500 asked a question temporal effect on depth result in ghosty image

temporal effect on depth result in ghosty image Hi, I'm trying to do temporarl removal on depth image, and I'm getting a

2020-10-31 03:15:26 -0500 commented question Spatial and temporal on depth image

Thanks I will try it. Have another problem. Also the above code that does temporarily filtering isn't working. In each f

2020-10-30 14:57:41 -0500 asked a question Spatial and temporal on depth image

Spatial and temporal on depth image Hi, I would like to do Spatial and temporal on a depth image. spatial average can

2020-10-30 11:58:36 -0500 commented question Calculating moving average using OpenCV for depth image

@break Please help me

2020-10-30 10:09:43 -0500 commented question Calculating moving average using OpenCV for depth image

@break tried to do it, I get exceptions. Can you please to show spatial and temporar average example on that CV_32F that

2020-10-30 08:58:16 -0500 commented question Calculating moving average using OpenCV for depth image

https://www.stereolabs.com/docs/opencv/

2020-10-30 08:50:01 -0500 commented question Calculating moving average using OpenCV for depth image

@break i showed the function in the post. Can you show me example of using filter2D and temporal average please in an an

2020-10-30 08:49:35 -0500 edited question Calculating moving average using OpenCV for depth image

Calculating moving average using OpenCV for depth image I'm trying to calculate moving average for a depth image. The de

2020-10-30 06:09:30 -0500 commented question Calculating moving average using OpenCV for depth image

@break, I would like to do both spatial and temporal domain. Thanks a lot you are an expert. Yes I want to do both, plea

2020-10-30 06:05:54 -0500 commented question Calculating moving average using OpenCV for depth image

@berak, sorry I'm a beginner, That's what I get from the Zed camera, I want do to exponentially moving average over the

2020-10-30 05:20:12 -0500 commented question Calculating moving average using OpenCV for depth image

I just want to accumlate the depth_image_ocv which has the format CV_8UC4

2020-10-30 05:18:38 -0500 commented question Calculating moving average using OpenCV for depth image

the format of depth_image_cv CV_8UC4 that's the format

2020-10-30 04:18:36 -0500 asked a question Calculating moving average using OpenCV for depth image

Calculating moving average using OpenCV for depth image I'm trying to calculate moving average for a depth image. The de

2020-10-28 01:30:43 -0500 marked best answer Getting picture contours

I'm trying to extract the following image, and do perspective correction but its not working as expected.

image description here is my full code

#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include <iostream>

using namespace cv;
using namespace std;
double angle(cv::Point pt1, cv::Point pt2, cv::Point pt0) {
    double dx1 = pt1.x - pt0.x;
    double dy1 = pt1.y - pt0.y;
    double dx2 = pt2.x - pt0.x;
    double dy2 = pt2.y - pt0.y;
    return (dx1*dx2 + dy1*dy2) / sqrt((dx1*dx1 + dy1*dy1)*(dx2*dx2 + dy2*dy2) + 1e-10);
}

void find_squares(Mat& image, vector<vector<Point> >& squares)
{
    // blur will enhance edge detection
    Mat blurred(image);
    Mat dst;
    medianBlur(image, dst, 9);

    Mat gray0(dst.size(), CV_8U), gray;
    vector<vector<Point> > contours;

    // find squares in every color plane of the image
    for (int c = 0; c < 3; c++)
    {
        int ch[] = { c, 0 };
        mixChannels(&dst, 1, &gray0, 1, ch, 1);

        // try several threshold levels
        const int threshold_level = 2;
        for (int l = 0; l < threshold_level; l++)
        {
            // Use Canny instead of zero threshold level!
            // Canny helps to catch squares with gradient shading
            if (l == 0)
            {
                Canny(gray0, gray, 10, 20, 3); // 

                                               // Dilate helps to remove potential holes between edge segments
                dilate(gray, gray, Mat(), Point(-1, -1));
            }
            else
            {
                gray = gray0 >= (l + 1) * 255 / threshold_level;
            }

            // Find contours and store them in a list
            findContours(gray, contours, CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE);

            // Test contours
            vector<Point> approx;
            for (size_t i = 0; i < contours.size(); i++)
            {
                // approximate contour with accuracy proportional
                // to the contour perimeter
                approxPolyDP(Mat(contours[i]), approx, arcLength(Mat(contours[i]), true)*0.02, true);

                // Note: absolute value of an area is used because
                // area may be positive or negative - in accordance with the
                // contour orientation
                if (approx.size() == 4 &&
                    fabs(contourArea(Mat(approx))) > 1000 &&
                    isContourConvex(Mat(approx)))
                {
                    double maxCosine = 0;

                    for (int j = 2; j < 5; j++)
                    {
                        double cosine = fabs(angle(approx[j % 4], approx[j - 2], approx[j - 1]));
                        maxCosine = MAX(maxCosine, cosine);
                    }

                    if (maxCosine < 0.3)
                        squares.push_back(approx);
                }
            }
        }
    }
}


cv::Mat debugSquares(std::vector<std::vector<cv::Point> > squares, cv::Mat image)
{
    for (int i = 0; i< squares.size(); i++) {
        // draw contour
        cv::drawContours(image, squares, i, cv::Scalar(255, 0, 0), 1, 8, std::vector<cv::Vec4i>(), 0, cv::Point());

        // draw bounding rect
        cv::Rect rect = boundingRect(cv::Mat(squares[i]));
        cv::rectangle(image, rect.tl(), rect.br(), cv::Scalar(0, 255, 0), 2, 8, 0);

        // draw rotated rect
        cv::RotatedRect minRect = minAreaRect(cv::Mat(squares[i]));
        cv::Point2f rect_points[4];
        minRect.points(rect_points);
        for (int j = 0; j < 4; j++) {
            cv::line(image, rect_points[j], rect_points[(j + 1) % 4], cv::Scalar(0, 0, 255), 1, 8); // blue
        }
    }

    return image;
}


static std::vector<cv::Point> extremePoints(std::vector<cv::Point>pts)
{
    int  xmin = 0, ymin = 0, xmax = -1, ymax = -1, i;
    Point ptxmin, ptymin, ptxmax, ptymax;

    Point pt = pts[0];

    ptxmin = ptymin = ptxmax = ptymax = pt;
    xmin = xmax = pt.x;
    ymin = ymax = pt.y;

    for (size_t i = 1; i < pts.size(); i++)
    {
        pt = pts[i];

        if (xmin > pt.x)
        {
            xmin ...
(more)
2019-09-23 09:48:27 -0500 received badge  Notable Question (source)
2019-03-14 04:58:11 -0500 commented answer Calculating a trajectory using a homography projection

I transformed the coordinates of the bounding box, but I can't visualize it, please look at the edited post code. I did

2019-03-14 04:57:36 -0500 edited question Calculating a trajectory using a homography projection

Calculating a trajectory using a homography projection I have the homography matrix and I projected a scene using that h

2019-03-13 11:44:29 -0500 commented answer Calculating a trajectory using a homography projection

Can you post an answer ? with code please ? I don't get you

2019-03-12 13:31:48 -0500 asked a question Calculating a trajectory using a homography projection

Calculating a trajectory using a homography projection I have the homography matrix and I projected a scene using that h

2018-12-08 17:16:33 -0500 received badge  Popular Question (source)
2018-12-07 02:27:19 -0500 commented question ID card and wrapping it identification

@blues can you show an answer with the pipeline please ?

2018-12-06 06:57:39 -0500 asked a question ID card and wrapping it identification

ID card and wrapping it identification I have the following ID, and I want to detect it, and warp it. Main problems Tha

2018-12-05 18:27:26 -0500 asked a question Detecting ID Card

Detecting ID Card Hi, I'm trying to detect the following card And warp it, rotate it, to be centered on the screen.

2018-12-04 09:13:08 -0500 asked a question Getting the best threshold for each channel

Getting the best threshold for each channel Hi, I'm trying to threshold an image for each channel, but I don't know the

2018-11-27 11:48:51 -0500 commented answer Extracting information from national id

these are garbage letters, it seems it couldn't decode the image correctly. My guess is the words should be gab filled..

2018-11-27 11:48:12 -0500 commented answer Extracting information from national id

no it's not correct all

2018-11-26 16:05:17 -0500 asked a question mat data type = 0 is not supported

mat data type = 0 is not supported I'm trying the following python opencv code and it says mat data type = 0 is not supp

2018-11-26 12:15:07 -0500 commented answer Extracting information from national id

yes but I want to do ocr on arabic, and the arabic engine needs the letters to be gab filled.. bolded.. how would I fill