Skip to content

change the open_copy.cpp to this one if you are facing issues at catkin_ws #13

@AbdullahJirjees

Description

@AbdullahJirjees

#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <stdio.h>
#include <opencv2/opencv.hpp>

using namespace cv;
using namespace std;

int main()
{
Mat image;

// LOAD image
image = imread("/home/riotu/catkin_ws/src/ros_essentials_cpp/src/topic03_perception/images/chess.jpg", cv::IMREAD_COLOR);   // Read the file "image.jpg".
// This file "image.jpg" should be in the project folder.
// Else provide full address : "D:/images/image.jpg"

if(! image.data )  // Check for invalid input
{
    cout <<  "Could not open or find the image" << std::endl;
    return -1;
}

// DISPLAY image
namedWindow("window", cv::WINDOW_AUTOSIZE); // Create a window for display.
imshow("window", image); // Show our image inside it.

// SAVE image
imwrite("/home/riotu/tmp/copy_image.jpg", image); // it will store the image in name "result.jpg"

waitKey(0);  // Wait for a keystroke in the window
return 0;

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions