PHP PHP programming, image processing

AI Thread Summary
The discussion centers on a project involving minimal image processing in PHP, where the goal is to identify the reference pad closest in color to a test pad from an image. The user is currently extracting RGB values from the pads through trial and error to compare colors. Another participant suggests posting existing code and points out that PHP can handle image processing, providing links to relevant documentation. The user also mentions prior experience with Objective C and OpenCV for iPhone programming, highlighting OpenCV as a comprehensive image processing library. Additionally, it is noted that using the LaB color space, which aligns more closely with human color perception, may yield better results than RGB for determining color similarity. The conversation emphasizes the complexities of color perception and the importance of selecting the right color space for accurate comparisons.
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: 574
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!
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...

Similar threads

Back
Top