1

I'm using this project: https://github.com/johnalthom13/VideoMosaicking

And when I try to use, I got Accesss Violation Reading Location. I pointed the line that give Accesss Violation Reading Location.

Why I'm getting this error, I can't understand

HSD
  • 17
  • 5
  • What location was it reading? These values (or values close) can tell you something: https://stackoverflow.com/questions/127386/in-visual-studio-c-what-are-the-memory-allocation-representations/127404#127404 – drescherjm Aug 15 '19 at 16:08
  • @drescherjm **Exception thrown at 0x12CAC893 (opencv_world343d.dll) in VideoMosaicking.exe: 0xC0000005: Accesss Violation Reading Location 0x00000000** – HSD Aug 15 '19 at 16:09
  • That is a null pointer. – drescherjm Aug 15 '19 at 16:10
  • so what I should do, master yoda @drescherjm? :) – HSD Aug 15 '19 at 16:10
  • 1
    Figure out what pointer is `0x00000000` in the debugger when the crash happens. – drescherjm Aug 15 '19 at 16:11
  • how can I figure out with myself? can you describe more? please – HSD Aug 15 '19 at 16:12
  • Are you doing this in Visual Studio? If so press retry to break into the debugger when the access violation happens. Then mouse over the variables in that line. – drescherjm Aug 15 '19 at 16:12
  • @drescherjm yes sir Vs 2017 – HSD Aug 15 '19 at 16:13
  • @drescherjm **I looked AUTOS. it's writing like that:** – HSD Aug 15 '19 at 16:15
  • I expect the problem is `matcher_` is a null pointer. – drescherjm Aug 15 '19 at 16:15
  • @drescherjm **owner 0x00000000 cv::details:PtrOwner*** – HSD Aug 15 '19 at 16:16
  • And @drescherjm **stored 0x00000000 cv::DescriptorMatcher*** – HSD Aug 15 '19 at 16:17
  • @drescherjm did i find the things what you said? – HSD Aug 15 '19 at 16:17
  • @drescherjm **owner and stored under the matcher_** – HSD Aug 15 '19 at 16:18
  • I think the problem is in whatever code that constructs a Stitcher – drescherjm Aug 15 '19 at 16:19
  • 4
    You're creating the `Stitcher` with a null matcher. Start looking at where you create it to find out where that null pointer comes from. – molbdnilo Aug 15 '19 at 16:20
  • @drescherjm this is the Stitcher code: https://github.com/johnalthom13/VideoMosaicking/blob/master/Stitcher.cpp – HSD Aug 15 '19 at 16:21
  • 3
    It's not the Stitcher code. Its the code that creates an instance of Stitcher. – drescherjm Aug 15 '19 at 16:22
  • @molbdnilo it's like you say make you a champion of the world in an instant. please can you evaluate the codes. – HSD Aug 15 '19 at 16:22
  • @drescherjm so what should I add the code? sir – HSD Aug 15 '19 at 16:23
  • It may be right here: https://github.com/johnalthom13/VideoMosaicking/blob/master/VideoMosaicking.cpp#L73 although I am not sure why this would fail. – drescherjm Aug 15 '19 at 16:23
  • @drescherjm so should I make it comment? – HSD Aug 15 '19 at 16:24
  • 1
    Here is the problem: https://github.com/johnalthom13/VideoMosaicking/blob/master/AlgorithmFactory.cpp#L57 the "FLANN" code is commented out so it returns a null pointer.. – drescherjm Aug 15 '19 at 16:25
  • @drescherjm so will I comment out this codes: **//if (name == "FLANN") { //return new cv::FlannBasedMatcher(); }** – HSD Aug 15 '19 at 16:27
  • You probably need to uncoment the code. However I am not sure why the author commented it out. Perhaps the code is broken or requires a different version of opencv. – drescherjm Aug 15 '19 at 16:28
  • @drescherjm thank you sir, I want your mail and I can bother you with my many question please :) – HSD Aug 15 '19 at 16:29
  • 3
    The code is on github. Ask the person that wrote it via raising an issue. Commenting out an if-condition line whose body is already commented out is meaningless. The author did this for a reason; *ask them*. – WhozCraig Aug 15 '19 at 16:30
  • 1
    This may be the reason for commenting out the code ***TODO Fix linking error*** to me that says the `cv::FlannBasedMatcher();` required an additional library to link and the author disabled the code instead of fixing that. I am no opencv expert so I don't know. – drescherjm Aug 15 '19 at 16:36
  • @WhozCraig I won't ask them – HSD Aug 15 '19 at 17:44
  • I'll ask to @drescherjm – HSD Aug 15 '19 at 17:44
  • 1
    There is no better (or more proper) person to ask than the very author whose code is an otherwise-black-box to you. @drescherjm has done an excellent job of diagnosing the issue; the rest is between you an the author of the code. VTC. – WhozCraig Aug 15 '19 at 17:47
  • 1
    Pfft. I'm a lot of things. Jealous isn't one of them. I'm impressed @drescherjm went the extra mile, and glad he was able to help. Truly. But his work is done; yours still has work between you and the original author of the library you're consuming. If they truly don't care about your questions, perhaps that is a sign that maybe that isn't the best supported library to be consuming, and you may consider alternatives. Regardless, have a nice day. – WhozCraig Aug 15 '19 at 17:51
  • See what happens when you uncomment the two commented out lines. What I mean is replace `//if (name == "FLANN")` with `if (name == "FLANN")` and `//return new cv::FlannBasedMatcher();` with `return new cv::FlannBasedMatcher();` if you get a linker error you need to consult the documentation of opencv on what library to link. I am not sure I can help any more than that. – drescherjm Aug 15 '19 at 18:01
  • ***I'm impressed @drescherjm went the extra mile*** I generally don't go that far if I am at work however today I am home sick so I had extra time. With that said, I am going need some rest.. – drescherjm Aug 15 '19 at 18:02
  • Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackoverflow.com/rooms/198015/discussion-on-question-by-hsd-accesss-violation-reading-location-critical-probl). – Samuel Liew Aug 15 '19 at 23:41
  • @drescherjm thank you sir,:) I fixed the problem. How can I reach you, whenever I want? – HSD Aug 16 '19 at 05:48
  • Just ask questions here. I am on StackOverlflow nearly every single day for years. – drescherjm Aug 16 '19 at 12:40
  • As for this question. I would create an official answer but I am not sure how much it will help future readers since it relies on content that is on an outside source. It's too big to move here and if you did just move the parts that I found the answer would be just uncomment the commented out code in the question. Does not sound very useful. Unless someone was using this exact same code on github. We may just want to delete the question. Not sure how others feel. – drescherjm Aug 16 '19 at 12:47

0 Answers0