0
$\begingroup$

I'm using an app for face redaction that doesn't allow access to the source code but only allows me to pass pixel values for red, green and blue channel upon which it creates a matrix with the same average RGB values for every ROI pixel value. For eg. if I give Red=32,Blue=123 and Green=233 it will assign these RGB values for every pixel of the ROI and then draws a colored patch on the face.

So I was wondering is there a general combination of RGB values of a pixel to distort it and make it look like it's blurred. I can also set the opacity value in the app.

Thanks.

$\endgroup$
  • $\begingroup$ Can you read the existing pixels of the image before deciding what RGB to give it? If so, you can just do the convolution yourself. $\endgroup$ – Dan Hulme Sep 11 at 10:46
  • $\begingroup$ Unfortunately I cant, I was looking for an RGB combination that resembles of a blurred pixel. Right now I'm testing it with (192,192,192) which gives you a light shade of grey patch on top of the face. $\endgroup$ – Mohsin Sep 11 at 10:55
  • $\begingroup$ Statistically speaking, independent of application, one might expect a 50% gray color to be the average color of all possible pictures. A 50% gray is pretty close to 192,192,192. So that lends some credibility to your approach. $\endgroup$ – Wyck Sep 19 at 13:40
3
$\begingroup$

Blurring an image depends on being able to read from the image. If you don’t have access to the pixel data, or external information about the image contents (e.g. average hue / luminance), there’s no way to find an overlay color that will look like you’ve blurred what it’s on top of.

$\endgroup$
1
$\begingroup$

Since you know vaguely what the pixels you're covering up look like (they are faces), your best bet to get the appearance of a blur is to really blur an image of a face in a standard image editing tool, then use the colour picker to choose a representative colour from that region. That's the closest you can get, but it still won't look blurred: as Noah Witherspoon said, that's impossible given these constraints.

Obviously it will work less well if the pictures you're operating on have different lighting conditions or faces of a different skin colour from the one you sample. And if the images being redacted are frames of a video, the motion of the video will give you away immediately.

Another approach might be to choose a colour that you know won't show up in the real images (e.g. programmer pink). Then, instead of showing the image that comes out of your tool, use the marked pixels to generate a mask, and use an actual blur tool on the original image so that only the pixels selected by the mask are blurred.

$\endgroup$
1
$\begingroup$

While you can't do what you're asking, you might be able to use a compromise. It turns out that all human skin tones have the same hue. They vary only in saturation and brightness. You can see this on the scopes that television engineers use to calibrate their signals. There's a line where skin tones should be if everything's set correctly.

You could choose that hue and some low saturation and middle value in HSV space, then convert it to RGB and use that as the color you put in the ROI.

It looks like on most vectorscopes the skin tone line is about 15° past red towards yellow. According to this article on skin tone correction if the lighting is typical studio lighting, caucasian skin would usually be around 50-75% brightness, asian and hispanic skin around 35-55% brightness and african skin around 15-50% brightness. So setting your color to HSV = (15°, 25% saturation, 50% brightness) is RGB = (128, 104, 96). If you know your subjects will be lighter or darker, adjust accordingly. Note that these values change when in bright outdoor light or dim indoor light, or when there's light with a strong color cast falling on them. But again, this is a compromise.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.