Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8116353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:48:12+00:00 2026-06-06T03:48:12+00:00

i have succesfully installed OpenCv & Qt in Ubuntu..i can debug and run some

  • 0

i have succesfully installed OpenCv & Qt in Ubuntu..i can debug and run some sample codes but when i create QtConsole Application i cant build it…
here is my sample code to randomly white some pixels in image

opencv2/core/core.hpp
opencv2/highgui/highgui.hpp
void salt(cv::Mat &image, int n)
{
    for(int k=0; k<n; k++)
    {
        int i=rand()%image.cols;
        int j=rand()%image.rows;

        if(image.channels() == 1)
        {
            image.at<uchar>(j,i)=255;
        }
        else if(image.channels() == 3)
        {
            image.at<cv::Vec3b>(j,i)[0]=255;
            image.at<cv::Vec3b>(j,i)[1]=255;
            image.at<cv::Vec3b>(j,i)[2]=255;
        }
    }
}

int main()
{
    cv::Mat resim = cv::imread("boldt.jpg");
    salt(resim,3000);
    cv::namedWindow("Cerceve");
    cv::imshow("Cerceve",resim);
}

I have added my libraires in .pro file like

INCLUDEPATH += /usr/local/include/opencv2

LIBS += -L/usr/local/lib -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_features2d -lopencv_calib3d

when I try to run program from Terminal
it says :

init done

opengl support available

and nothing happens..
there is no error while debugging

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T03:48:14+00:00Added an answer on June 6, 2026 at 3:48 am

    Add a cv::waitKey(..) at the end of main()

    cv::imshow("Cerceve",resim);
    cv::waitKey(0);
    return 0;
    

    Calling cv::waitKey(param) is crucial because it is what processes the event loop in the window you have opened (apart from returning the key the user pressed during the wait time). Here param is the number of milliseconds to wait before the function returns. Use 0 for infinite wait till some key is pressed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have just succesfully installed open atrium, but i can't find the configuration of
I have successfully installed mercurial on media temple grid server. But I can not
I installed the opencv-android plugin successfully and I can build and run the cvcamera
I have succesfully installed my service using InstallUtil, but I would like my service
I have succesfully installed Doxygen and GraphViz on my mac (running Lion OS), but
I have succesfully installed mysql-proxy and understood the way working and lua scripting. But
I have just successfully installed CakePHP and I see that I can edit the
i have successfully created distribution profiles and installed on my xcode organiser, but this
I followed their how-to: Phonegap Start Phonegap wiki I have succesfully installed the android
I have successfully installed & configured the M2E Maven plugin for Eclipse, along with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.