0
\$\begingroup\$

I want to create a program that determines all the areas of a given picture that have a different color, or the same color with different luminosities.

Are there known algorithms that do this job ? I would love to study such algorithms and implement them.

Thank you in advance for any help.

\$\endgroup\$
  • 1
    \$\begingroup\$ It might be worth converting the image into YCrCb and discarding the Luma component \$\endgroup\$ – OMGtechy Jan 19 '15 at 21:11
  • 2
    \$\begingroup\$ This is a big topic with lots of kinds of answers. You can make a histogram of brightness for all the pixels. But to decompose the 2d structure of the image, terms like feature extraction, boundary detection, flood-fill, and posterization may provide some starting points... \$\endgroup\$ – david van brink Jan 19 '15 at 21:22
  • \$\begingroup\$ I think this is too broad. You can start by what @david suggested. Otherwise try to reduce the scope of the question, for example, why do you want to do this ? maybe this is not the solution you want. Maybe if you tell us more we can give you better answers, so far I suspect the answers to be generic. \$\endgroup\$ – concept3d Jan 20 '15 at 10:15
  • \$\begingroup\$ @concept3d Thank you for the advice. I thought my question is clear, but I will edit it in few hours. Regards \$\endgroup\$ – user59526 Jan 20 '15 at 10:44
2
\$\begingroup\$

I've been researching Sobel Filters for edge detection. I then use that information to identify bounding information so I can crop out borders programmatically.

I also like OMGtechy's comment on converting to YCrCb or YUV and throwing out the Luma component. MSDN has an article on RGB to YUV Strangely enough, looks like it's HLSL (shader).

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ I hadn't heard of those filters, interesting. \$\endgroup\$ – OMGtechy Jan 20 '15 at 21:24
0
\$\begingroup\$

One possible approach is this:

  1. Convert to the YCrCb colour space and discard the Luma (Y) component.
  2. Compute a quality metric (see below),
  3. See if the quality metric is above a threshold (see below),

Quality Metrics

  • ASNR
  • PSNR
  • SSIM

Threshold

This will be largely trial and error; you'll just have to tweak it until you get the results you want. I'd start at about 50 for PSNR/ASNR, or 0.9 for SSIM and work from there.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ @Begueradj if you're happy with the answer, please accept it when you can. Otherwise, suggest improvements and I'll do my best to make them. Please note that problems with specific implementations are separate questions and should not be included in the answer to this one (although I may link them at a later date if people find this useful). \$\endgroup\$ – OMGtechy Jan 19 '15 at 21:26

Your Answer

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