| asda333 (43) | ||||
|
Hi I am doing a project, which requires me to create a program which would calibrate the camera. I need help as i have written the code but there seems to be some problem really would appreciate any help. the code is below.
any help, i am a beginner to opencv, so help would be appreciated thanks | ||||
|
|
||||
| L B (3806) | |||
|
You keep mixing up floats and doubles. Stop using floats, use only doubles. That means no Point2f, only Point2d, etc. The error is because of this:
| |||
|
Last edited on
|
|||
| asda333 (43) | ||
|
ok so after converting point2f and point3f to 2d and 3d respectively i still get an error
now this is just a very confusing error, it doesn't point to a line of code in my program just says error thanks | ||
|
|
||
| MikeyBoy (234) | ||
That's because it's a linker error. It doesn't relate to any particular line if code - it means that it's finished compiling the code and is trying to link the objects together. It's telling you that some of your code is using some symbols, and that those symbols are not defined anywhere in the objects you've told the linker to link together. I don't know opencv, but I'd guess the problem is that you're not linking against the correct library. | ||
|
|
||
| L B (3806) | |
| Yes, a linker error means that your code is correct syntactically but you're missing some code that it needs. Are you properly linking to the OpenCV library? | |
|
|
|
| asda333 (43) | |
|
Yes, i followed an online video tutorial, which showed how to install and create a basic project which worked nicely, a camera capture. in the debugger i listed the files with the d.lib appended to the library files and for the release i listed the library without the d appended to the end of it like just .lib i will try and switch the 2 around and see if that makes any difference EDIT: I just switched the 2 property sheets the debug in the release and the release in the debug and it succeeded. that's strange. Also when i run it, it crashes, that's why the camera screen is black and its all crashed. i will try and implement it differently. for camera calibration i should convert image to grayscale detect edges and from the edges detected, detect the corners and store those values in a vector, which i think the vector should store 2 values for x and y in one vector i think instead of detect chessboard corners, which takes a long time to load. any suggestions on how i can implement the camera calibration method. thanks | |
|
Last edited on
|
|
| Bandar (45) | |
| Which IDE do you use? By the way , not all tutorials in the Internet are accurate. Some of them missing a lot of steps. I tried some of them until I gave up but eventually I found out an excellent installation and it seems to me more standard to link your header files and obj. files. You have to understand some notions to be able to at least understand the errors not to solve them. For example, what does the linker do? What are the files that the linker needs? What are the source file, header file, obj. file, and .exe file? What is the difference between Release Mode and Debug Mode? What does the compiler do? These questions are crucial. If you don't understand these questions, then you have to follow any tutorial blindly and as a result, you will face a myriad of problems. Not to mention that you will eventually give up. | |
|
Last edited on
|
|
| asda333 (43) | |
|
I use visual studio 2010. Thanks btw does it crash because my computer is slow? | |
|
|
|
| asda333 (43) | |||
Ok so i deleted everything and starting from fresh
when i run it, error dialog pops up saying Unhandled exception at 0x76bdfc16 in basiccalibration.exe; Microsoft C++ exception: cv::Exception at memory location 0x0023ef04 Just error after error i don't know what to do. | |||
|
|
|||
| MikeyBoy (234) | |
| This is the point at which you fall back on the programmer's best friend, a debugger. Find out where it's crashing, and that should help you discover why it's crashing. | |
|
|
|
| asda333 (43) | |
|
It was crashing at imshow. now that step is ruined as this is a problem with opencv library, damn is there any way to find out why an unhandled exception occurs. i tested a code which runs but when i place my chessboard in view, it crashes and says unhandled exception on the console it says OpenCV error: Assertion failed <ncorners> = 0 && corners.depth<> == CV_32F in unknow function, file \...\...\src\opencv\modules\imgproc\src\cornersubpix.cpp, line 257. | |
|
|
|