Skip to content

LeannAlexandra/imageTexturing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Texturing Project

This project applies texture to an input image using OpenCV and C++.

Table of Contents

Overview

Input Image
Input Image: Original image used for texture mapping. - Luca Bravo @Unsplash
Texture
Texture: Image used as a texture overlay. -Annie Sprat Unsplash
Final Image
Final Image: Resulting image with applied texture.

Prerequisites

Before running the program, ensure you have the following installed:

  • C++ compiler
  • OpenCV (version 4.x) installed

Setup

  1. Clone the Repository:
    git clone https://github.com/LeannAlexandra/imageTexturing.git
    cd imageTexturing
  2. Compile the Program:
    g++ -std=c++11 -o addTexture main.cpp `pkg-config --cflags --libs opencv4`
    OR, use the makefile:
    make

Makefile

# Makefile for Image Texturing Project
CXX = g++
CXXFLAGS = -std=c++11 `pkg-config --cflags opencv4`
LIBS = `pkg-config --libs opencv4`

SRCS = main.cpp
OBJS = $(SRCS:.cpp=.o)
TARGET = addTexture

all: $(TARGET)

$(TARGET): $(OBJS)
    $(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS)

%.o: %.cpp
    $(CXX) $(CXXFLAGS) -c -o $@ $<

clean:
    rm -f $(OBJS) $(TARGET)

Usage

  1. Run the Program:
    ./addTexture
  2. Expected Output:
  • The program will display the final texture in a window.
  • if the saveImage flag is set to true, the output image'output.jpg' will be saved in the project directory.

Functionality

The program reads an input image (inputImage.jpg) and a texture image (canvas.jpg) from the project directory.
It overlays the texture onto the input image and adjusts brightness based on texture intensity.
The resulting image is displayed and optionally saved to disk (exampleoutput.jpg).

Contributing

Contributions are welcome! If you have ideas for improvements or find any issues, please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

About

Texturing images in openCV

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published