PHP programming, image processing

Click For Summary

Discussion Overview

The discussion revolves around a PHP programming project focused on image processing, specifically identifying the closest color match between test pads and reference pads in an image. The scope includes technical challenges related to color comparison and the use of PHP for image manipulation.

Discussion Character

  • Technical explanation
  • Exploratory
  • Debate/contested

Main Points Raised

  • One participant describes their approach of using trial and error to find the RGB values of colored pads in an image to determine color proximity.
  • Another participant expresses uncertainty about the term "trial and erroring" in this context but agrees with the general approach described.
  • A request is made for the participant to share their existing code to better understand their implementation.
  • One participant notes their surprise at PHP's capability for image processing and provides links to PHP documentation as a potential resource.
  • A participant shares their experience with image processing using Objective C and OpenCV, suggesting that LaB color space may be more effective than RGB for color comparison due to its alignment with human color perception.

Areas of Agreement / Disagreement

Participants generally agree on the approach of using RGB values for color matching, but there is no consensus on the best method for determining color proximity, with some advocating for the use of LaB color space instead of RGB.

Contextual Notes

There are limitations regarding the definitions of "closeness" in color matching and the potential dependency on the chosen color space. The discussion does not resolve how to implement these concepts in practice.

Who May Find This Useful

This discussion may be useful for individuals interested in PHP programming, image processing techniques, and color theory in the context of software development.

eprparadox
Messages
133
Reaction score
2
Hello!


So this is minimally image processing, but I didn't know what else to name this thread.

I'm working on a project and basically, I have this image (see attached file) that's provided to me. That's all I have to work with. The first column of colored pads represents my test pad. The other colored pads represent the reference pads.

For each pad in the first column, I need to look across that row via my PHP code and find the reference pad that is closest to it in color.

I'm working with this in PHP. Does anyone have any clever solutions to this problem?

Some of the stuff I've been doing thus far is trial and erroring my way to the center of one of the pads and taking it's RGB value and then finding my way to the middle of other colored squares and finding its RGB value and comparing to see which RGB value matches the best.

Thanks ahead of time for the help.
 

Attachments

  • CroppedPic_320.png
    CroppedPic_320.png
    17.3 KB · Views: 593
Technology news on Phys.org
eprparadox said:
Some of the stuff I've been doing thus far is trial and erroring my way to the center of one of the pads and taking it's RGB value and then finding my way to the middle of other colored squares and finding its RGB value and comparing to see which RGB value matches the best.

Although I am not quite sure what "trial and erroring" means in this context, the majority of what you said seems to be how I would attempt this program.
 
Can you post the code up that you have so far?
 
Hey thanks a lot for everyone's responses! I was actually just testing in PHP (they do have some ability to find the RGB values of pixels in images) because I know PHP a bit better.

But ultimately, I programmed for an iPhone and so I used Objective C and I used this computer vision library created by Intel called OpenCV. It's a pretty cool library with an array of image processing tools. Just FYI in case you all are ever in need of an all-encompassing image processing archive and you're unaware of this as I was.

And in terms of figuring out how "close" two colors are to one another, it's better to use a color space known as LaB and not RGB. Although it does depend on how you're defining "how close two colors are:, Lab is supposedly a device independent color space is suppose to match human perception of color the best. Take that for whatever it's worth. But color perception is a pretty involved process to say the least!

Anyways, I'm rambling but thanks again for the responses!
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 6 ·
Replies
6
Views
7K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 8 ·
Replies
8
Views
6K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 4 ·
Replies
4
Views
7K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
2
Views
1K