latest highgui.hpp missing imread declaration.

asked 2014-07-22 07:30:02 -0500

JewelCV gravatar image

for installing opencv i pulled from git.

on running the simple display image program , i ran across the imread() cant be resolved error.

in older versions, i have seen imread declared in highgui.hpp

the present highgui.hpp i downloaded contains this:

ifndef __OPENCV_HIGHGUI_HPP__

define __OPENCV_HIGHGUI_HPP__

include "opencv2/core.hpp"

///////////////////////// graphical user interface ////////////////////////// namespace cv {

// Flags for namedWindow enum { WINDOW_NORMAL = 0x00000000, // the user can resize the window (no constraint) / also use to switch a fullscreen window to a normal size WINDOW_AUTOSIZE = 0x00000001, // the user cannot resize the window, the size is constrainted by the image displayed WINDOW_OPENGL = 0x00001000, // window with opengl support

   WINDOW_FULLSCREEN = 1,          // change the window to fullscreen
   WINDOW_FREERATIO  = 0x00000100, // the image expends as much as it can (no ratio constraint)
   WINDOW_KEEPRATIO  = 0x00000000  // the ratio of the image is respected
 };

// Flags for set / getWindowProperty enum { WND_PROP_FULLSCREEN = 0, // fullscreen property (can be WINDOW_NORMAL or WINDOW_FULLSCREEN) WND_PROP_AUTOSIZE = 1, // autosize property (can be WINDOW_NORMAL or WINDOW_AUTOSIZE) WND_PROP_ASPECT_RATIO = 2, // window's aspect ration (can be set to WINDOW_FREERATIO or WINDOW_KEEPRATIO); WND_PROP_OPENGL = 3 // opengl support };

enum { EVENT_MOUSEMOVE = 0, EVENT_LBUTTONDOWN = 1, EVENT_RBUTTONDOWN = 2, EVENT_MBUTTONDOWN = 3, EVENT_LBUTTONUP = 4, EVENT_RBUTTONUP = 5, EVENT_MBUTTONUP = 6, EVENT_LBUTTONDBLCLK = 7, EVENT_RBUTTONDBLCLK = 8, EVENT_MBUTTONDBLCLK = 9, EVENT_MOUSEWHEEL = 10, EVENT_MOUSEHWHEEL = 11 };

enum { EVENT_FLAG_LBUTTON = 1, EVENT_FLAG_RBUTTON = 2, EVENT_FLAG_MBUTTON = 4, EVENT_FLAG_CTRLKEY = 8, EVENT_FLAG_SHIFTKEY = 16, EVENT_FLAG_ALTKEY = 32 };

// Qt font enum { QT_FONT_LIGHT = 25, //QFont::Light, QT_FONT_NORMAL = 50, //QFont::Normal, QT_FONT_DEMIBOLD = 63, //QFont::DemiBold, QT_FONT_BOLD = 75, //QFont::Bold, QT_FONT_BLACK = 87 //QFont::Black };

// Qt font style enum { QT_STYLE_NORMAL = 0, //QFont::StyleNormal, QT_STYLE_ITALIC = 1, //QFont::StyleItalic, QT_STYLE_OBLIQUE = 2 //QFont::StyleOblique };

// Qt "button" type enum { QT_PUSH_BUTTON = 0, QT_CHECKBOX = 1, QT_RADIOBOX = 2 };

typedef void (MouseCallback)(int event, int x, int y, int flags, void userdata); typedef void (TrackbarCallback)(int pos, void userdata); typedef void (OpenGlDrawCallback)(void userdata); typedef void (ButtonCallback)(int state, void userdata);

CV_EXPORTS_W void namedWindow(const String& winname, int flags = WINDOW_AUTOSIZE);

CV_EXPORTS_W void destroyWindow(const String& winname);

CV_EXPORTS_W void destroyAllWindows();

CV_EXPORTS_W int startWindowThread();

CV_EXPORTS_W int waitKey(int delay = 0);

CV_EXPORTS_W void imshow(const String& winname, InputArray mat);

CV_EXPORTS_W void resizeWindow(const String& winname, int width, int height);

CV_EXPORTS_W void moveWindow(const String& winname, int x, int y);

CV_EXPORTS_W void setWindowProperty(const String& winname, int prop_id, double prop_value);

CV_EXPORTS_W double getWindowProperty(const String& winname, int prop_id);

//! assigns callback for mouse events CV_EXPORTS void setMouseCallback(const String& winname, MouseCallback onMouse, void* userdata = 0);

CV_EXPORTS int getMouseWheelDelta(int flags);

CV_EXPORTS int createTrackbar(const String& trackbarname, const String& winname, int* value, int count, TrackbarCallback onChange = 0, void* userdata = 0);

CV_EXPORTS_W int getTrackbarPos(const String& trackbarname, const String& winname);

CV_EXPORTS_W void setTrackbarPos(const String& trackbarname, const String& winname, int pos);

// OpenGL support CV_EXPORTS void imshow(const String& winname, const ogl::Texture2D& tex);

CV_EXPORTS void setOpenGlDrawCallback(const String& winname, OpenGlDrawCallback onOpenGlDraw, void* userdata = 0);

CV_EXPORTS void setOpenGlContext(const String& winname);

CV_EXPORTS void updateWindow(const String& winname);

// Only for Qt

struct QtFont { const char* nameFont; // Qt: nameFont Scalar color; // Qt: ColorFont -> cvScalar(blue_component, green_component, red_component[, alpha_component]) int font_face; // Qt: bool italic const int* ascii; // font data and metrics const int* greek; const int* cyrillic; float hscale, vscale; float shear ... (more)

edit retag flag offensive close merge delete

Comments

2

as of 3.0, the highgui module was split into highgui, videoio and imagecodecs. imread is in the latter.

but again, unless you're out for adventure, reconsider switching back to the 2.4 branch

berak gravatar imageberak ( 2014-07-22 08:43:00 -0500 )edit

@ berak - i did do that.

and this is just for future reference... as i intend to go out on an adventure soon..

cant i do "git checkout master" and then make the opencv library again to change into the latest library.

or do i have to run sudo make uninstall from the build directory.

how do i find whats diff between the branches and what does master mean?

JewelCV gravatar imageJewelCV ( 2014-07-27 10:33:18 -0500 )edit