Image Analysis Preprocessing Arithmetic and Logic Operations Spatial Filters Image Quantization.
Image filters
-
Upload
inplacesapp -
Category
Documents
-
view
848 -
download
0
description
Transcript of Image filters
![Page 2: Image filters](https://reader033.fdocuments.net/reader033/viewer/2022061207/54854d9fb47959d80c8b4db7/html5/thumbnails/2.jpg)
IMAGE BLEND MODES
Image blend modes“Modes determine how two layers are blended into each other” – Wikipedia
Really nice looking image filters can be created using two of the most basic image blend modes
•OVERLAY•ADD(Most of the filters in InPlaces app uses just these two blends)(screenshot of image blending modes available in
Adobe Photoshop)
![Page 3: Image filters](https://reader033.fdocuments.net/reader033/viewer/2022061207/54854d9fb47959d80c8b4db7/html5/thumbnails/3.jpg)
EXAMPLE
FilmThick filterUses just the Overlay and Add blend mode & is a result of two very basic steps if you use Photoshop or any other image editing software.
(screenshot from InPlaces app with FilmThick filter)
![Page 4: Image filters](https://reader033.fdocuments.net/reader033/viewer/2022061207/54854d9fb47959d80c8b4db7/html5/thumbnails/4.jpg)
FILMTHICK FILTER
STEP 1 : Duplicate layer_1 as layer_2 and do the overlay
STEP 2 : Create a new layer_3 with RGB (154, 0, 205) & alpha at 22% and add it over layer_1 and layer_2
Try this with your favorite photo editing tool (Adobe Photoshop, Corel PhotoPaint)
![Page 5: Image filters](https://reader033.fdocuments.net/reader033/viewer/2022061207/54854d9fb47959d80c8b4db7/html5/thumbnails/5.jpg)
DOING IT WITH OPENCV
OpenCV is a library of programming functions for real time computer vision. In simple words playing with your images and videos.
Modules of OpenCVcore, imgproc, video, calib3d, features2d, objdetect, highgui, gpu
All you needimgproc module
Website : http://opencv.org
![Page 6: Image filters](https://reader033.fdocuments.net/reader033/viewer/2022061207/54854d9fb47959d80c8b4db7/html5/thumbnails/6.jpg)
OPENCV BASICS
How we see How OpenCV sees, A Matrix (data type: cvMat)
NOTE: RGB image has 3 layers &could be split into the contributing 3 channels usingOpenCV’s split() function
![Page 7: Image filters](https://reader033.fdocuments.net/reader033/viewer/2022061207/54854d9fb47959d80c8b4db7/html5/thumbnails/7.jpg)
THE CODE
cv::Mat filmThick (cv::Mat src){cv::Mat colorTone;
src = overlay(src, src);
colorTone = cv::imread("rgb_154_0_205.jpg“);
addWeighted(src, 1.0, colorTone, 0.22, 0, src);
return (src);}
(Result of Step 1 from Slide 4)
(Result of step 2)
![Page 8: Image filters](https://reader033.fdocuments.net/reader033/viewer/2022061207/54854d9fb47959d80c8b4db7/html5/thumbnails/8.jpg)
THE CODE – FUNCTIONS()
addWeightedOpenCV comes with the addWeighted function. This is nothing but the "Add" blend you see in Photoshop. Check doc here
OverlayOpenCV does not come with a function to perform overlay blend. So we had to code it.
Technically the algorithm happens to bereturn (v2 < 128) ? (2 * v1 * v2 / 255):(255 - 2 * (255 - v1) * (255 - v2) / 255);
V1 being the intensity of any given pixel from the sourceV2 being the intensity of any given pixel from the overlaying image
![Page 9: Image filters](https://reader033.fdocuments.net/reader033/viewer/2022061207/54854d9fb47959d80c8b4db7/html5/thumbnails/9.jpg)
THE CODE - EXPLAINED
https://gist.github.com/inplacesapp/5415458
Check out the sample C++ code
![Page 10: Image filters](https://reader033.fdocuments.net/reader033/viewer/2022061207/54854d9fb47959d80c8b4db7/html5/thumbnails/10.jpg)
ONE MORE TIP
Vignetting
![Page 11: Image filters](https://reader033.fdocuments.net/reader033/viewer/2022061207/54854d9fb47959d80c8b4db7/html5/thumbnails/11.jpg)
THE END
www.inplac.es“inplacesapp” on twitter & facebook