G
G
German2019-01-17 21:37:39
C++ / C#
German, 2019-01-17 21:37:39

Many functions and other parts of OpenCV are missing?

Downloaded from office. OpenCV site for vc14 and vc15, I have Visual Studio 2017. exe unpacked files and stuff.
Decided to just compile a simple code to test:

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

int main( int argc, char** argv ) 
{
        // задаём высоту и ширину картинки
        int height = 620;
        int width = 440;
        // задаём точку для вывода текста
        CvPoint pt = cvPoint( height/4, width/2 );
        // Создаёи 8-битную, 3-канальную картинку
        IplImage* hw = cvCreateImage(cvSize(height, width), 8, 3);
        // заливаем картинку чёрным цветом
        cvSet(hw,cvScalar(0,0,0));
        // инициализация шрифта
        CvFont font;
        cvInitFont( &font, CV_FONT_HERSHEY_COMPLEX,1.0, 1.0, 0, 1, CV_AA);
        // используя шрифт выводим на картинку текст
        cvPutText(hw, "OpenCV Step By Step", pt, &font, CV_RGB(150, 0, 150) );

        // создаём окошко
        cvNamedWindow("Hello World", 0);
        // показываем картинку в созданном окне
        cvShowImage("Hello World", hw);
        // ждём нажатия клавиши
        cvWaitKey(0);
        
        // освобождаем ресурсы
        cvReleaseImage(&hw);
        cvDestroyWindow("Hello World");
        return 0;
}

However, there were problems with
#include <cv.h>
#include <highgui.h>

Replaced with
#include <opencv2/cv.h>
#include <opencv2/highgui.h>

Everything is in order with highgui.h, I found it, but cv.h is not in the include at all.
And somehow I can’t figure out what and how ... Help.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question