PHP programming, image processing

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
4 replies · 4K views
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: 605
Physics 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!