Ask Your Question

alexandra's profile - activity

2017-09-07 13:17:35 -0600 received badge  Famous Question (source)
2017-02-16 09:07:58 -0600 received badge  Notable Question (source)
2016-10-21 09:56:12 -0600 received badge  Popular Question (source)
2015-11-04 00:59:12 -0600 commented answer remove image borders

@ThomasB I try you code, but it give me an error at assert(src.channels() == 4). why?? how can i solve it??

2015-11-03 23:18:27 -0600 commented question Crop image after stitching

thanks, but it not helps. I don't need to do transformation, i need to select the right corners to crop the image without any black area left.

2015-11-03 23:15:23 -0600 commented answer Create mask to select the black area

How can i determine the corners (left, up, width, height) ?? the image have some curves, so i need to select the right corners to crop the image and remove all black area.

2015-11-02 05:45:06 -0600 asked a question Crop image after stitching

Hello, After i stitched 2 images using OpenCV C++, i want to crop the image to remove the black area around the stitched imgae.

image description

How can i do that ??

2015-11-02 04:09:49 -0600 commented answer remove image borders

Hello @yum, I have the same issue, do you find a solution ??

2015-11-02 04:02:13 -0600 commented question Create mask to select the black area

Thanks, but i think the best solution is to crop the image. do you know how to do it ??

2015-10-29 02:54:13 -0600 commented answer Create mask to select the black area

t try to use this command but it not work right

2015-10-29 02:22:09 -0600 commented question Create mask to select the black area

@theodore I try to use findContour but the biggest contour is not the contour of my image

2015-10-27 05:27:11 -0600 commented question Create mask to select the black area

The image is the result of stitching two image using opencv stitching module.

2015-10-27 02:43:07 -0600 asked a question Create mask to select the black area

I have a black area around my image and i want to create a mask using OpenCv C++ that select just this black area so that i can paint it later. how Can i do that with out affect the image it self.

I try to converted to grayscale image and then using threshold to converted it to binary, but its affect my image since its contain black pixels.

image description

This is the code i used to find the biggest contoure

#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp""
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/photo/photo.hpp"
#include <iostream>
using namespace cv;
using namespace std;
int main( )
{
    Mat src;
    src = imread("pano1.jpg", CV_LOAD_IMAGE_COLOR);
    Mat gray;
    cvtColor(src, gray, CV_BGR2GRAY);
    threshold(gray, gray,30, 255,THRESH_BINARY_INV); //Threshold the gray
    imshow("gray",gray);
    int largest_area=0;
    int largest_contour_index=0;
    Rect bounding_rect;
    vector<vector<Point>> contours; // Vector for storing contour
    vector<Vec4i> hierarchy;
    findContours( gray, contours, hierarchy,CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE );
    // iterate through each contour.
    for( int i = 0; i< contours.size(); i++ )
    {

    //  Find the area of contour
    double a=contourArea( contours[i],false); 
    if(a>largest_area){
        largest_area=a;cout<<i<<" area  "<<a<<endl;
        // Store the index of largest contour
        largest_contour_index=i;               
        // Find the bounding rectangle for biggest contour
        bounding_rect=boundingRect(contours[i]);
    }
}

Scalar color(255,255,255);  // color of the contour in the
//Draw the contour and rectangle
drawContours( src, contours,largest_contour_index, color, CV_FILLED,8,hierarchy);
rectangle(src, bounding_rect,  Scalar(0,255,0),2, 8,0);

Mat inpainted;
inpaint(src, gray, inpainted, 3, INPAINT_NS);
imshow("inpainted image", inpainted);
namedWindow( "Display window", CV_WINDOW_AUTOSIZE );
imshow( "Display window", src );    
waitKey(0);                                         
return 0;

}

This is the result of the code:

image description

Another question: if i want to crop the image instead of paint it, how can i do it??

Thanks in advance,

2015-10-20 05:50:23 -0600 commented answer Reconstruct stitched image

@berak thank you so much, but when i tested on another image the result is not good, there is a big different in color and its not the same as the example in the link i mentioned above. Why you are using s=30 ??

2015-10-20 04:29:14 -0600 commented question Reconstruct stitched image

I test this example link text its work fine but i want it to paint the black area without using the white painting ??

2015-10-20 03:42:45 -0600 commented question Reconstruct stitched image

how can i paint just the black area around my image??

2015-10-20 02:49:00 -0600 commented question Reconstruct stitched image

Thanks, i will try it.

2015-10-20 01:00:02 -0600 asked a question Reconstruct stitched image

Hello,

I used OpencCV stitching class to stitch these images, but the result contain black area. I don't want to crop the image to remove the black area because some image details will be missed. Is there any way ( function or algorithm) to reconstruct the image so that the black area will be filled with appropriate pixels ??

image description

Regards,

2015-10-12 05:57:33 -0600 commented question which image will be above the other image in stitching process??

2.4.11 opencv and windows 7

2015-10-12 02:30:34 -0600 asked a question Stitching 2 images with different zooming setting

Hello,

The Opencv stitching module can stitch 2 images with different zooming setting. My question is how the zoom setting of the output image (stitched image) decided?? What i mean is that, if i have 2 images one with zoom in and one with zoom out and i want to stitch this two images together. When i look at the result of the stitching i observed that the zoom in image became zoom out and the zoom out image became zoom in and that is achieved in away that make the 2 images can be stitched together. How the zoom value of each image is decided ??

Regards,

I didn't use the stitcher detailed example.

I just read the images and use this command Stitcher::Status status = stitcher.stitch(vImg, rImg);

and the result is:

image description

I reduce the image quality so i can upload it.

As you can see the result is different in zooming than the input images and its like there is no different in zooming value between the two images , i want to know how to specify the zooming value of the result.

This image may explain what i need exactly to know

image description

As you can see image 1 has been zoomed in while image 2 has been zoomed out in the resulted image, how it decide the zooming value in the resulted image.

2015-10-07 03:35:45 -0600 commented question which image will be above the other image in stitching process??

they can't find this files:

#include <opencv2/core/utility.hpp>
#include "opencv2/imgcodecs.hpp"
#include "opencv2/stitching/detail/timelapsers.hpp"
2015-10-07 02:47:49 -0600 commented question which image will be above the other image in stitching process??

Thank you very much. I tried to run the example but there are some missing files, also i tried to understand how the seamFinder choose the seam line but i didn't find any explanation of this procedure !! if you know any useful resource please help me.

2015-10-05 04:43:35 -0600 commented question which image will be above the other image in stitching process??

What i mean is if i warp the second image into the first image the (overlap area) in the resulted image will be taking from the second image and vise versa. I am using Opencv stitching class and i want to know how it decide which image warping into other.

2015-10-05 04:05:10 -0600 commented question which image will be above the other image in stitching process??

Hello LBerger, thanks for the reference, but from what i understand the homography is a transformation matrix that helps in warp one image into other (is that true ??). what i want to know is how to decide which image is warp into another? for example, if i have two images to stitch and after extract and mach the features and compute the homography should i warp the second image into the first one or should i do the opposite??

2015-09-16 01:03:29 -0600 commented question which image will be above the other image in stitching process??

Thank you LBerger, if you know any useful link to explain the concept please provide me with them if possible.

2015-09-15 06:35:00 -0600 received badge  Student (source)
2015-09-15 05:57:50 -0600 received badge  Editor (source)
2015-09-15 05:56:35 -0600 asked a question which image will be above the other image in stitching process??

Hello,

In the stitcher class after extract and match features how its decide which image will be above the other image (the overlap area)?? I mean the overlap area will be taken from the first image or second image or it will be merged together ??

Thanks in advance,

2015-08-20 00:15:20 -0600 received badge  Enthusiast
2015-08-12 02:18:23 -0600 commented answer Image Stitching parameters seem that there is no one can explain it, please help us to understand it.

Thank you LBerger for your answer but what I want to know exactly is how to determine the best value for these parameters to give me the best processing time and quality.

2015-08-10 04:21:34 -0600 asked a question Image Stitching parameters seem that there is no one can explain it, please help us to understand it.

Hello,

I searched over all the websites and OpenCV documentation to understand the Image stitching parameters, but it seems that there is no one can explain it !!! There are also many users asked about this parameters, but there is no answer !!!

The parameters are :

setRegistrationResol( );
setSeamEstimationResol( );
setCompositingResol( );
setPanoConfidenceThresh( );

We need to understand it in order to optimize the stitching code in term of processing time and quality.

Can any one help us to understand it ?? and why the OpenCV documentation didn't explain this parameters ?!!

Thank you.