Skip to content

hmnd1257/Separate_Figures

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Separating images from multiple merged images

Introduction

When the image we want is combined with several images in one image, there are cases where we want to get only the image we want. It's not difficult when the amount of images you want to get is small, but when the amount of images that humans cannot execute, it's impossible to get the image you want. So, we propose a code that can easily get the image you want.

Requirements

  • Python >= 3.6.13
  • opencv >= 4.6.0

Getting Started

Installation

  • Clone this repo :
git clone https://github.com/hmnd1257/Separate_Figures.git
cd Separate_Figures
  • You can install all the requirements by executing below :
# in <path-to-this-repo>/
pip install -r requirements.txt

Run

  1. Our dataset structure
    • This is the dataset structure we used.
dataset/
    |____XXXX.jpeg # [.png, .jpg] format is also acceptable.
    |____OOOO.jpeg 
    |____....
  1. Run
    • If the save path(contour, ROI images) doesn't exist, it is automatically created.
# in <path-to-this-repo>/
python main.py --baseroot './dataset' --results_dir './results'

Run on your own dataset

Step 1: Download your own images datasets.
Step 2: Open main.py in python idle.
Step 3: Modify Arguments to set --baseroot, --results_dir and other parameters.
Step 4: Run main.py

Example: If you leave the other settings as default except for the path option, run the following command :

# in <path-to-this-repo>/
python main.py --baseroot <your_image_baseroot> --results_dir <save_path>

Arguments

  • <--baseroot> (required): Path to the dataset directory.
  • <--results_dir> (required): The path where the resulting image is saved.
  • <--padding> Add a white background with padding technique to better find the Region of interest (default: True).
  • <--pixel> Sets the padding size (default: 10).
  • <--extension> When saving a separated image, the extension of the image is set (default: .jpeg).

Results

Input
Output
Contour
Separated image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages