Skip to content

Commit

Permalink
Fixes to make main.o target work include CvSize constructor and chang…
Browse files Browse the repository at this point in the history
…es to Makefile to reflect correct libraries.
  • Loading branch information
Dennis Evangelista committed Jul 28, 2017
1 parent 06cd3c8 commit 937ebb4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ cToMatlab
outputImages
*~
*.jpg
*.o
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ INCS =
LIBS =


DEFINCS = -I/usr/include -I/usr/include/opencv2
DEFLIBS = -L/usr/lib
LINKLIBS = -lopencv_core -lopencv_highgui -lopencv_imgproc
DEFINCS = -I/usr/local/include/opencv -I/usr/local/include/opencv2
DEFLIBS = -L/usr/local/lib
LINKLIBS = -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_video -lopencv_imgcodecs -lopencv_cvv -lopencv_videoio

CPP = g++
CC = gcc
OBJ = main.o cvcalibinit3.o
LINKOBJ = main.o cvcalibinit3.o
BIN = FindCorners.exe
BIN = FindCorners
RM = rm -f


Expand Down
19 changes: 12 additions & 7 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ If you use this code, please cite the following articles:
#include <string.h>
#include <time.h>

#include <opencv/cv.h>
#include <opencv/highgui.h>

#include <fstream>
using namespace std;
using std::ifstream;
Expand All @@ -58,7 +61,7 @@ int main( int argc, char** argv )


// Initializations
CvSize board_size = {7,6};
CvSize board_size = CvSize(7,6);
const char* input_filename = 0;
CvCapture* capture = 0;
FILE* f = 0;
Expand All @@ -67,7 +70,7 @@ int main( int argc, char** argv )
CvSeq* image_points_seq = 0;
int elem_size;
CvPoint2D32f* image_points_buf = 0;
CvSize img_size = {0,0};
CvSize img_size = CvSize(0,0);
int found = -2;
int min_number_of_corners = 42;
input_filename = "pictures.txt";
Expand Down Expand Up @@ -158,8 +161,9 @@ int main( int argc, char** argv )
{
// Initializations
IplImage *view = 0, *view_gray = 0;
int count = 0, blink = 0;
CvSize text_size = {0,0};

int count = 0, blink = 0;
CvSize text_size = CvSize(0,0);
int base_line = 0;
// Load the correct image...
if( f && fgets( imagename, sizeof(imagename)-2, f ))
Expand Down Expand Up @@ -189,10 +193,11 @@ int main( int argc, char** argv )
// ...Or capture the correct frame from the video
else if( capture )
{
IplImage* view0 = cvQueryFrame( capture );
if( view0 )
IplImage* view0 = cvQueryFrame( capture );

if( view0 )
{
view = cvCreateImage( cvGetSize(view0), IPL_DEPTH_8U, view0->nChannels );
//view = cvLoadImage( cvGetSize(view0), IPL_DEPTH_8U, view0->nChannels );
if( view0->origin == IPL_ORIGIN_BL )
cvFlip( view0, view, 0 );
else
Expand Down

0 comments on commit 937ebb4

Please sign in to comment.