Smart Separate is an app that processes images by carving out selected object and put it on various backgrounds. Its algorithm uses OpenCV library contour feature. User can input files by loading a existing image or take a photo. The user can also save the processed image to desired path.
This app is built on openFrameworks, so if you don't have that downloaded, please check it out and set it up.
A list of openFrameworks add-ons that are needed:
After installing the prerequisites above, we can install this app with the following steps:
-
Clone this repository or download zip into the
openFrameworks/apps/
folder, where openFrameworks is the folder of all the openFrameworks file. -
Open the application in the following path
openFrameworks/projectGenerator/projectGenerator
.
- Besides Project Name, click on
import
, and select the folder of this app you just downloaded. - Click on
Generate
. - Click on
Open in IDE
.
- Run this app with your IDE.
When you first open the app, a menu looks like the following will show up.
If you click Load Image
and select a local image, you will see the following window.
Where the image on the left will be replaced by your choice of image. The image will be processed once you click on it.
The buttons on the right has the following functionalities:
- Reset: Reset the image back to original.
- Background arrows: Click on the left and right arrow after processing the image. The white default background will be replaced by patterned images.
- Save Image: Save the processed image to a specific path.
- Load Image: Load another image. Any new change of the current image will be discarded.
- Use Camera: Turn on the camera and take a picture to process.
Possible processed result can look like the following.
When the processed image doesn't look satisfactory, try click on different color points.
After having fun with the image, you can save it using the Save Image
button.
If you want to take a picture, you can click on the Use Camera
button, and it will redirect you to a page looks like the following.
A picture will be taken when you click on OK
. Then you can use this picture or retake one.
This app can be further improved by adding the following features:
- Real time image processing when camera is turned on (This is currently impossible because the runtime of the algorithm is really slow).
- Change threshold of contour when loading different images, so that objects with similar color as background can also be precisely contoured
- User can upload personal backgrounds.