All Projects → vivianhylee → Seam Carving

vivianhylee / Seam Carving

Seam Carving for Content Aware Image Resizing

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Seam Carving

Opencv Python Tutorial
📖 OpenCV-Python image processing tutorial for beginners
Stars: ✭ 2,425 (+1100.5%)
Mutual labels:  opencv
Pytorch Cpp
PyTorch C++ inference with LibTorch
Stars: ✭ 194 (-3.96%)
Mutual labels:  opencv
Acurustrack
A multi-object tracking component. Works in the conditions where identification and classical object trackers don't (e.g. shaky/unstable camera footage, occlusions, motion blur, covered faces, etc.). Works on any object despite their nature.
Stars: ✭ 196 (-2.97%)
Mutual labels:  opencv
Opencv Course
Learn OpenCV in 4 Hours - Code used in my Python and OpenCV course on freeCodeCamp.
Stars: ✭ 185 (-8.42%)
Mutual labels:  opencv
Opencv Practical Exercise
OpenCV practical exercise
Stars: ✭ 191 (-5.45%)
Mutual labels:  opencv
Person Detection And Tracking
A tensorflow implementation with SSD model for person detection and Kalman Filtering combined for tracking
Stars: ✭ 193 (-4.46%)
Mutual labels:  opencv
Bmw Yolov4 Inference Api Cpu
This is a repository for an nocode object detection inference API using the Yolov4 and Yolov3 Opencv.
Stars: ✭ 180 (-10.89%)
Mutual labels:  opencv
Traffic Signal Violation Detection System
A Computer Vision based Traffic Signal Violation Detection System from video footage using YOLOv3 & Tkinter. (GUI Included)
Stars: ✭ 200 (-0.99%)
Mutual labels:  opencv
Facerecognition
Webcam face recognition using tensorflow and opencv
Stars: ✭ 192 (-4.95%)
Mutual labels:  opencv
Facerec Python
个人毕业设计 - 基于树莓派、OpenCV及Python语言的人脸识别
Stars: ✭ 195 (-3.47%)
Mutual labels:  opencv
Omrchecker
Grade exams fast and accurately using a scanner 🖨 or your phone 🤳.
Stars: ✭ 189 (-6.44%)
Mutual labels:  opencv
Primestereomatch
A heterogeneous and fully parallel stereo matching algorithm for depth estimation, implementing a local adaptive support weight (ADSW) Guided Image Filter (GIF) cost aggregation stage. Developed in both C++ and OpenCL.
Stars: ✭ 191 (-5.45%)
Mutual labels:  opencv
Php Opencv
php wrapper for opencv
Stars: ✭ 194 (-3.96%)
Mutual labels:  opencv
Opticalflow visualization
Python optical flow visualization following Baker et al. (ICCV 2007) as used by the MPI-Sintel challenge
Stars: ✭ 183 (-9.41%)
Mutual labels:  opencv
End To End For Chinese Plate Recognition
基于u-net,cv2以及cnn的中文车牌定位,矫正和端到端识别软件,其中unet和cv2用于车牌定位和矫正,cnn进行车牌识别,unet和cnn都是基于tensorflow的keras实现
Stars: ✭ 197 (-2.48%)
Mutual labels:  opencv
Webcamera
Camera controls for the Web
Stars: ✭ 182 (-9.9%)
Mutual labels:  opencv
Node Digital Watermarking
A digital watermark is a kind of marker covertly embedded in a noise-tolerant signal such as an audio, video or image data. It is typically used to identify ownership of the copyright of such signal. "Watermarking" is the process of hiding digital information in a carrier signal; the hidden information should, but does not need to, contain a relation to the carrier signal. Digital watermarks may be used to verify the authenticity or integrity of the carrier signal or to show the identity of its owners. It is prominently used for tracing copyright infringements and for banknote authentication.
Stars: ✭ 193 (-4.46%)
Mutual labels:  opencv
Human Pose Estimation Opencv
Perform Human Pose Estimation in OpenCV Using OpenPose MobileNet
Stars: ✭ 201 (-0.5%)
Mutual labels:  opencv
Marvel
Marvel - Face Recognition With Android & OpenCV
Stars: ✭ 199 (-1.49%)
Mutual labels:  opencv
Perfectshow
Android virtual makeup app, apply cosmetics on human face.
Stars: ✭ 194 (-3.96%)
Mutual labels:  opencv

Seam Carving

Seam Carving for Content Aware Image Resizing and Object Removal

Introduction

The goal of this project is to perform content-aware image resizing for both reduction and expansion and image object removal with seam carving operator. This allows image to be resized without losing or distorting meaningful content from scaling. The code in this repository and technique described below is an implementation of the algorithm presented in Avidan and Shamir and Avidan, Rubinstein, and Shamir algorithms.

Algorithm Overview

Seam Removal

  1. Calculate energy map:

Energy is calculated by sum the absolute value of the gradient in both x direction and y direction for all three channel (B, G, R). Energy map is a 2D image with the same dimension as input image.

  1. Build accumulated cost matrix using forward energy:

This step is implemented with dynamic programming. The value of each pixel is equal to its corresponding value in the energy map added to the minimum new neighbor energy introduced by removing one of its three top neighbors (top-left, top-center, and top-right)

  1. Find and remove minimum seam from top to bottom edge:

Backtracking from the bottom to the top edge of the accumulated cost matrix to find the minimum seam. All the pixels in each row after the pixel to be removed are shifted over one column to the left if it has index greater than the minimum seam.

  1. Repeat step 1 - 3 until achieving targeting width

  2. Rotate image and repeat step 1 - 4 for vertical resizing:

Rotating image 90 degree counter-clockwise and repeat the same steps to remove rows.

Seam Insertion

Seam insertion can be thought of as inversion of seam removal and insert new artificial pixels/seams into the image. We first perform seam removal for n seams on a duplicated input image and record all the coordinates in the same order when removing. Then, we insert new seams to original input image in the same order at the recorded coordinates location. The inserted argificial pixel values are derived from an average of left and right neighbors.

Seam Removing and Insertion with Mask

When generating energy map, the region protected by mask are weighted with a very high positive value. This guarantees that the minimum seam will NOT be routed through the masked region so that we can provent pixels at this region from removing or distorting because of seam insertion.

Object Removal

  1. Remove object by seam removal

When generating energy map, the region protected by mask are weighted with a very high negative value. This guarantees that the minimum seam will be routed through the masked region. Seam removal is performed repeatly until masked region has been completely removed as stated above with one more step; the same minimum seam also has to be removed from the mask in order to get correct energy map for the next step.

  1. Seam insertion

Insering seams to return the image back to it's original dimensions.

Result 1

Original image

original image

Scaling up

image size expansion

Object removal

object removal

Result 2

Scaling down

animation image size reduction

Scaling up

animation image size expansion

Object removal

animation object removal

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].