{"id":23277737,"url":"https://github.com/mazen-daghari/systemc-opencv-project","last_synced_at":"2026-05-08T14:44:59.347Z","repository":{"id":261652984,"uuid":"884948323","full_name":"mazen-daghari/systemc-opencv-project","owner":"mazen-daghari","description":"systemc opencv guide ","archived":false,"fork":false,"pushed_at":"2024-12-13T19:04:34.000Z","size":5354,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-04T06:37:27.324Z","etag":null,"topics":["c-code","opencv","systemc","visual-studio","windows"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mazen-daghari.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-07T17:12:09.000Z","updated_at":"2024-12-13T19:04:38.000Z","dependencies_parsed_at":"2024-12-19T22:14:42.432Z","dependency_job_id":"cddd1622-e508-47dc-8513-df7ccb38a215","html_url":"https://github.com/mazen-daghari/systemc-opencv-project","commit_stats":null,"previous_names":["mazen-daghari/systemc-opencv-project"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mazen-daghari/systemc-opencv-project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mazen-daghari%2Fsystemc-opencv-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mazen-daghari%2Fsystemc-opencv-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mazen-daghari%2Fsystemc-opencv-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mazen-daghari%2Fsystemc-opencv-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mazen-daghari","download_url":"https://codeload.github.com/mazen-daghari/systemc-opencv-project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mazen-daghari%2Fsystemc-opencv-project/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32785390,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-code","opencv","systemc","visual-studio","windows"],"created_at":"2024-12-19T22:14:08.167Z","updated_at":"2026-05-08T14:44:59.324Z","avatar_url":"https://github.com/mazen-daghari.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# systemc-opencv-project\n\nsystemc opencv guide \n-\n\nLet's walk through the entire process of creating a SystemC project that reads an image, applies a black and white filter, applies a custom filter, and displays both the original and processed images using OpenCV. This tutorial will cover everything from setting up your environment to writing and running the code.\n\nStep 1: Setting Up Your Environment\n-\n\nInstall SystemC:\n\nDownload SystemC from the Accellera website.\n\nFollow the installation instructions provided in the SystemC documentation.\n\nInstall OpenCV:\n\nDownload OpenCV from the OpenCV website.\n\nFollow the installation instructions provided in the OpenCV documentation.\n\nSet Up Your Project Directory:\n\nCreate a directory for your project. For example, systemc_opencv_project.\n\nInside this directory, create two subdirectories: src for source files and include for header files.\n\n\nStep 2: Writing the Code\n-\n\n\nImage Processor Module (image_processor.cpp)\nCreate a file named image_processor.cpp in the src directory and add the following code:\n\ncpp\n#include \u003csystemc.h\u003e\n#include \u003copencv2/opencv.hpp\u003e\n\nSC_MODULE(ImageProcessor) {\n    sc_in\u003cbool\u003e clk;\n    sc_in\u003cbool\u003e reset;\n\n    void process() {\n        while (true) {\n            wait(); // Wait for clock edge\n            if (reset.read() == true) {\n                std::cout \u003c\u003c \"Reset signal received\" \u003c\u003c std::endl;\n                continue;\n            }\n\n            cv::Mat image = cv::imread(\"image.jpg\", cv::IMREAD_COLOR); // Load the image in color\n\n            if (!image.empty()) { // Check if the image was loaded correctly\n                cv::imshow(\"Original Image\", image); // Display the original image\n\n                cv::Mat gray_image;\n                cv::cvtColor(image, gray_image, cv::COLOR_BGR2GRAY); // Convert to black and white\n\n                // Apply custom filter\n                cv::Mat custom_filtered_image;\n                cv::Mat kernel = (cv::Mat_\u003cfloat\u003e(1, 2) \u003c\u003c -1, 0);\n                cv::filter2D(gray_image, custom_filtered_image, -1, kernel);\n\n                // Display the processed images\n                cv::imshow(\"Black and White Image\", gray_image);\n                cv::imshow(\"Custom Filtered Image\", custom_filtered_image);\n                cv::waitKey(0); // Wait for a key press to close the windows\n            } else {\n                std::cerr \u003c\u003c \"Error loading the image.\" \u003c\u003c std::endl;\n            }\n        }\n    }\n\n    SC_CTOR(ImageProcessor) {\n        SC_THREAD(process);\n        sensitive \u003c\u003c clk.pos();\n    } \n    };\n\n\nMain File (main.cpp)\n\nCreate a file named main.cpp in the src directory and add the following code:\n\ncpp\n\n#include \u003csystemc.h\u003e\n#include \"image_processor.cpp\" // Include the ImageProcessor module\nint sc_main(int argc, char* argv[]) { sc_clock clk(\"clk\", 10, SC_NS);\n    sc_signal\u003cbool\u003e reset;\n    \n    ImageProcessor image_processor(\"image_processor\");\n    image_processor.clk(clk);\n    image_processor.reset(reset);\n    \n    // Simulation\n    sc_start(0, SC_NS);\n    reset.write(false);\n    sc_start(10, SC_NS);\n    reset.write(true);\n    sc_start(10, SC_NS);\n    reset.write(false);\n    sc_start(100, SC_NS);\n\n    return 0;}\n\nStep 3: Creating the Makefile\n-\n\nCreate a file named Makefile in the root directory of your project and add the following code:\n\nmakefile\nCXX = g++\nCXXFLAGS = -I/usr/local/include/opencv4 -I$(SYSTEMC_HOME)/include -Wno-unused-variable -Wno-sign-compare -Wno-maybe-uninitialized\nLDFLAGS = -L/usr/local/lib -lopencv_core -lopencv_imgcodecs -lopencv_imgproc -lopencv_highgui -L$(SYSTEMC_HOME)/lib-linux64 -lsystemc\n\nall: main\n\nmain: main.o image_processor.o\n    $(CXX) -o main main.o image_processor.o $(LDFLAGS)\n\nmain.o: src/main.cpp\n    $(CXX) $(CXXFLAGS) -c src/main.cpp\n\nimage_processor.o: src/image_processor.cpp\n    $(CXX) $(CXXFLAGS) -c src/image_processor.cpp\n\nclean:\n    rm -f *.o main\n\n    \nStep 4: Compiling and Running the Project\n-\n\nCompile the Project:\n\nOpen a terminal and navigate to your project directory.\n\nRun the following command to compile the project:\n\nsh\nmake\nRun the Executable:\n\nEnsure that the image file image.jpg is in the same directory as your executable.\n\nRun the executable:\n\nsh\n./main\n\nStep 5: Observing the Output\n-\n\nThe program will display three windows:\n\nOriginal Image: Shows the original image.\n\nBlack and White Image: Shows the image after applying the black and white filter.\n\nCustom Filtered Image: Shows the image after applying the custom filter with the kernel [-1, 0].\n\nPress any key to close the windows.\n\n\nYou've successfully created a SystemC project that integrates with OpenCV to read, process, and display images. This tutorial covered setting up the environment, writing the code, creating a Makefile, and running the project.\n\nfeel free to mail me on :\n\ndagmazen@gmail.com\n-\n\nfull installation guide (read installation_tutorial.pdf on repository)\n-\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmazen-daghari%2Fsystemc-opencv-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmazen-daghari%2Fsystemc-opencv-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmazen-daghari%2Fsystemc-opencv-project/lists"}