Ask Your Question
0

Error in Opencv stitching project

asked 2015-10-16 01:35:41 -0600

updated 2020-11-15 00:57:54 -0600

image descriptionimage description(/upfiles/14449968823861101.jpg) I'm building the Opencv stitching project by adding the available files by myself. The project gets build without any error but there is an error, when I run it without debugging. I'm using static libraries. The error is shown in this screenshot. When I debug this program then it throws the following message while going from line no. 97 to line no. 98.

Error when debugged: "First-chance exception at 0x000007FEDB3CC7CB (opencv_world300.dll) in ConsoleApplication1.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.

If there is a handler for this exception, the program may be safely continued."

Thank-you in advance.

#include <iostream>
#include <opencv2\core\core.hpp>
#include <opencv2\highgui\highgui.hpp>
#include <opencv2\imgproc\imgproc.hpp>
#include <opencv2\stitching.hpp>
#include <vector>
using namespace std;
using namespace cv;
vector<Mat> imgs;
int main(){
Mat img1 = imread("E:/seecs/thesis/ConsoleApplication1/ConsoleApplication1/panorama_image1.jpg");
if (img1.empty())
{
cout << "Can't read image '" << "'\n";
return -1;
}
imgs.push_back(img1);
Mat img2 = imread("E:/seecs/thesis/ConsoleApplication1/ConsoleApplication1/panorama_image2.jpg");
if (img2.empty())
{
cout << "Can't read image '" << "'\n";
return -1;
}
imgs.push_back(img2);
Mat panoramaImage;
Stitcher stitcher = Stitcher::createDefault();
Stitcher::Status stitcherStatus = stitcher.stitch(imgs,panoramaImage);
waitKey(0);
return 0;
}

image description

CMAKE OUTPUT

Performing Test HAVE_CXX_FSIGNED_CHAR
Performing Test HAVE_CXX_FSIGNED_CHAR - Failed
Performing Test HAVE_C_FSIGNED_CHAR
Performing Test HAVE_C_FSIGNED_CHAR - Failed
Check if the system is big endian
Searching 16 bit integer
Looking for sys/types.h
Looking for sys/types.h - found
Looking for stdint.h
Looking for stdint.h - found
Looking for stddef.h
Looking for stddef.h - found
Check size of unsigned short
Check size of unsigned short - done
Using unsigned short
Check if the system is big endian - little endian
Looking for fseeko
Looking for fseeko - not found
Looking for unistd.h
Looking for unistd.h - not found
Check size of off64_t
Check size of off64_t - failed
Looking for assert.h
Looking for assert.h - found
Looking for fcntl.h
Looking for fcntl.h - found
Looking for io.h
Looking for io.h - found
Looking for jbg_newlen
Looking for jbg_newlen - not found
Looking for mmap
Looking for mmap - not found
Looking for search.h
Looking for search.h - found
Looking for string.h
Looking for string.h - found
Looking for unistd.h
Looking for unistd.h - not found
ICV: Removing previous unpacked package: C:/opencv_3.0/opencv/sources/3rdparty/ippicv/unpack
ICV: Unpacking ippicv_windows_20141027.zip to C:/opencv_3.0/opencv/sources/3rdparty/ippicv/unpack...
ICV: Package successfully downloaded
found IPP (ICV version): 8.2.1 [8.2.1]
at: C:/opencv_3.0/opencv/sources/3rdparty/ippicv/unpack/ippicv_win
Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) 
To enable PlantUML support, set PLANTUML_JAR environment variable or pass -DPLANTUML_JAR=<filepath> option to cmake
Could NOT find PythonInterp (missing:  PYTHON_EXECUTABLE) (Required is at least version "2.7")
Could NOT find PythonInterp (missing:  PYTHON_EXECUTABLE) (Required is at least version "2.6")
Could NOT find PythonInterp (missing:  PYTHON_EXECUTABLE) (Required is at least version "3.4")
Could NOT find PythonInterp (missing:  PYTHON_EXECUTABLE) (Required is at least version ...
(more)
edit retag flag offensive close merge delete

Comments

Okay, screenshots with debug errors --> avoid those. They are unreadable and clog up a topic. Secondly, provide the code that you are running, which file and what exact piece of code is generating this error? It seems to me that you are trying to read something which is in a directory where you do not have reading rights OR you are trying to load something from memory that is not there.

StevenPuttemans gravatar imageStevenPuttemans ( 2015-10-16 03:25:17 -0600 )edit

Are you sure you have loaded the images? it seems to be an empty address

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-10-16 04:27:43 -0600 )edit

I'm using this website first time so, sorry for any inconvinience in reading the code

Ayesha Siddique gravatar imageAyesha Siddique ( 2015-10-16 05:11:08 -0600 )edit
1

MkZHh, next time, code should go into your question , not into a comment. also there's a "10101" button for code formatting. you'll learn ;) (no prob, we all start like this)

berak gravatar imageberak ( 2015-10-16 05:12:22 -0600 )edit

I'm neither using CUDA nor OPENCL or etc. I'm only opencv 3.0 on Windows 7 and x64 platform. I've added the following header files: autocalib, blenders, camera exposure_compensate, matchers, motion_estimators, opencl_kernels_stitching, opencv, seam_finders, stitching, timelapsers, util, util_inl, wrapers, wrapers_inl. The CPP files are: blenders, camera exposure_compensate, matchers, motion_estimators, opencl_kernels_stitching, seam_finders, stitching, timelapsers, util, wrapers, wrapers_cuda

Ayesha Siddique gravatar imageAyesha Siddique ( 2015-10-16 05:27:23 -0600 )edit

You're missing an "o" here: Stitcher::Status stitcherStatus = stitcher.stitch(imgs,panramaImage); (should be Stitcher::Status stitcherStatus = stitcher.stitch(imgs,panoramaImage);)

LorenaGdL gravatar imageLorenaGdL ( 2015-10-16 05:34:28 -0600 )edit

While I was decreasing the spaces between the lines, this "o" was erased but actually, it is present in my code as I've checked it. So, the problem lies somewhere else.

Ayesha Siddique gravatar imageAyesha Siddique ( 2015-10-16 06:01:05 -0600 )edit

Acccording to Matlab the size of the two images are 600x400 each and the images are present in the directory.If I just write a code in the same file with imread command to just read image and then imshow command.Then the image is displayed correctly as the result.How can I avoid this problem that I've told you above. It seems that the data goes into "imgs" but in the stitcher.cpp (that comes with stitching directory), the "estimatetransform" gets no data. I think that the problem lies there. As you are an expert so, you can tell it better that where is the problem and what should be its solution. :) Please ignore the screenshot and consider this error written in the first statement:

Ayesha Siddique gravatar imageAyesha Siddique ( 2015-10-16 06:02:35 -0600 )edit

I see no estimateTransform in the code you have posted...

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-10-16 06:17:22 -0600 )edit
1

@MkZHh could you provide the images?

LorenaGdL gravatar imageLorenaGdL ( 2015-10-16 06:30:38 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
5

answered 2015-10-17 10:48:49 -0600

updated 2015-10-17 10:49:21 -0600

The problem with your program is that: you compiled the solution (project) in Debug mode but your .dll file (of OpenCV) was built in Release mode. I have tested your code and encountered the same error when run the program built in Debug mode with .dll files built in Release mode. Hence, to solve the problem, just switch to Release mode and rebuild your solution. And remember this statement:

imshow("Panorama image", panoramaImage);

before the waitKey(0); line.

edit flag offensive delete link more
3

answered 2015-10-22 05:57:03 -0600

Thank-you all. I tried using @LBerger's method and it worked well but I've to use Microsoft Visual Studio 2013 Win 64 instead of Microsoft Visual Studio 2013 and although I've 64-bit Windows but I've to build using Win32 platform in Visual Studio for perfect build and run.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-10-16 01:35:41 -0600

Seen: 2,252 times

Last updated: Oct 22 '15