You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
Correlate pixel color to load value
3 views (last 30 days)
Show older comments
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
Walter Roberson
on 21 Sep 2020
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 ?
Himanshu Verma
on 21 Sep 2020
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.
Walter Roberson
on 21 Sep 2020
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 ?
Himanshu Verma
on 21 Sep 2020
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
Walter Roberson
on 23 Sep 2020
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.
Himanshu Verma
on 23 Sep 2020
@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
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.
Walter Roberson
on 23 Sep 2020
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?
Himanshu Verma
on 24 Sep 2020
@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.
Walter Roberson
on 24 Sep 2020
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.
Answers (0)
See Also
Categories
Find more on Image Processing and Computer Vision in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)