Correlate pixel color to load value

I'm working on a tensile sensor based image and I would like to create an equation to correlate pixel color to load. How can I do it without image processing toolbox? I have RGB colored image and the actual load at which that image was captured.
In the image below, the effective load is 500N.

11 Comments

What method did you have in mind? It sounds like the curve fitting toolbox is more what you are after.
Is the assumption that there was a discretized colormap, with all load values between A and B being assigned the same color, and B to C being assigned a potentially unrelated color?
Or is the assumption that there was a colormap over which interpolation was done, so that a value part way between A and B has had each of its RGB components independent interpolated between the RGB components assigned for A and B ?
Actually the specimen is on a tactile sensor. When we apply the load, the load value is displayed on the screen and image is generated showing the intensity of load (ranging from blue to red). There's no colorbar associated with it so I have to assign the value myself (sort of cuve fitting as pointed out by @Rik) such that the sum of all the values must be equal to the load value. Also, where there's no load, the white screen is present. So, while curve fitting it should assume that when white pixel is encountered, the value of that pixel should be zero.
Can you calibrate with low-area blocks of known weight? Especially if you can get something with little legs, so that the force is as close to pin-prick as you can get, to make it easier to calculate force per unit area ?
What I'm doing right now is to take the red, green and blue values from each pixel and multiply them with some weight. I'm assigning highest value to the red, lowest to the blue and average of two to the green. Then I add all the values to get the pressure intensity at that pixel. I multiply it with the pixel area to get the force. Then I add all the forces to get the actual load value. I'm iterating and adjusting the max. value of red color to arrive at the actual load.
But the problem I see in this method RGB values don't necessarily give me the maximum value where I can see the red color in the image. since the actual color is the combination of all 3, I'm not sure if the intensity of pressure will be accurate. Pressure intensity is required by me for further calculations
If you had enough images, with sufficient range of values so that all 256 colors appear multiple times, then in theory you could do a linear least squared fit using \ in order to find out the exact weight each different color contributes to the total load. I think you would need a minimum of 256 such images, but I am not positive on that at the moment.
But it would be a lot easier to calibrate, even if that just means gluing a slab of wood to a washer and putting different weights on the slab.
@Walter Roberson, thanks for the input. I do have images more than 256. But I have to analyse each image separately. The area covered keeps on increasing with the application of load and so does the pixel color. So the intensity of the pixel won't remain same for 2 images captured at 2 different loads.
Image Analyst has done something of this sort for thermal image analysis. I'll try to implement his method. I hope to hear from him as well.
Image Analyst
Image Analyst on 23 Sep 2020
Edited: Image Analyst on 23 Sep 2020
Why can't you get the original monochrome sensor load matrix? My demos usually require the Image Processing Toolbox. Could you get it? Maybe even a 30 day free trial if you can get everything done in that time. I agree with Walter that if you can't get a colorbar and don't know the values at the ends of the load range, then you're best off just collecting a set of images where you increase the load (hopefully uniformly and evenly over the whole field of view). That way you can build up a calibration curve where a displayed color is associated with a known weight/load.
If you were to take an object of known weight and move it around the sensor, then would the intensity profile remain consistent ?
If you were to measure one penny, and then were to measure two pennies together (that are as close as you can feasibly get to each other, such as two new pennies), then would the total measured load double but the individual profiles would stay the same?
@Image Analyst, it's sort of an industrial project and they need to use the tool in future and they don't have the Image Processing Toolbox license. That's why looking for alternative.
@Walter Roberson, yes, the total measured load would double but the individual profiles would stay the same.
Yup, I would definitely recommend calibration with known forces. And area of an object such as a penny should be easy enough to calculate especially as it is already known https://www.bluebulbprojects.com/measureofthings/results.php?p=1&comp=area&unit=in2&amt=0.442&sort=pr.

Sign in to comment.

Answers (0)

Categories

Asked:

on 21 Sep 2020

Commented:

on 24 Sep 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!