Ask Your Question
1

How can I get an effect similar to Curve Adjustment Layers of Photoshop using OpenCV?

asked 2013-07-15 12:05:48 -0600

bonzo gravatar image

Hello all.

I am trying to create some custom processing filters for photographs taken on my phone. For one of the processing steps, I'd like to understand how the Curve Adjustment function in Photoshop actually works so that I can replicate the effects using morphological functions in OpenCV.

If anyone can provide any links that could provide any material to this end, I would really appreciate it. Thanks!

edit retag flag offensive close merge delete

Comments

Do you have some image samples, it could help for going to the right direction.

Mathieu Barnachon gravatar imageMathieu Barnachon ( 2013-07-15 17:02:56 -0600 )edit

Not to be rude, but for your first question you would be better served on an actual Photoshop forum. This topic doesn't really comply to the Q&A forum rules (see FAQ)

StevenPuttemans gravatar imageStevenPuttemans ( 2013-07-16 08:00:33 -0600 )edit
1

I agree and i apologize for stepping out of line. However, I had posted this on a Photoshop forum initially - but due to no response, I thought I'd take a shot here.

bonzo gravatar imagebonzo ( 2013-07-17 02:16:06 -0600 )edit

You do not have to appologize, since people are giving you some hints, I will keep the topic open. Just know that topics like this risk getting closed due to not being the focus of the forum :)

StevenPuttemans gravatar imageStevenPuttemans ( 2013-07-17 02:46:39 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
4

answered 2013-07-16 08:46:56 -0600

Tim Redfern gravatar image

cv::LUT is great for this kind of thing. Create one or more lookup tables for the curves (either the same for all or seperate ones for RGB), and then map all of the pixel values through it to do the remap.

edit flag offensive delete link more

Comments

thanks! will try it out! any code samples you might be able to share?

bonzo gravatar imagebonzo ( 2013-07-17 02:23:06 -0600 )edit
1

answered 2013-07-16 08:03:22 -0600

Basically this first hit from google explains what the functions do, and how they should be implemented.

It is in fact a simple mapping of values, which can be implemented by writing a pixel value conversion function for each color channel. Keep in mind with this that the color channels are BGR in OpenCV and not RGB.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-07-15 12:05:48 -0600

Seen: 3,460 times

Last updated: Jul 16 '13