Need help coding pixel values for an image
3 次查看(过去 30 天)
显示 更早的评论
I am working on an experiemnt where we take IR images with a contour scale and then take those images to matlab to assign tempertaure values for each pixel from the given scale.
This is how it was explained to me, how could i put this into a code:
- take the length of the scale and read the picture in matlab and output it back into matlab
- Image Is a set of pixels in different colors- a matrix of values/numbers. Take the number of pixels and divide them linearly between the two extremes (given on the bottom of the images) and create a linear scale.
- Take a pixel and read that pixel and find its grade scale RGB value in matlab. Go across each pixel and put it into a loop.
- For every pixel read the value and see where it falls and do a linear interpolation. Come up with the temperature of each pixel.
0 个评论
回答(2 个)
Rijuta
2023-9-8
Hi Molly,
I understand that you want to code pixel values for an image. To implement the described process in MATLAB, you can follow these steps:
1. Read the image into MATLAB using the `imread` function.
2. Determine the length of the contour scale and calculate the temperature range per pixel. If the scale has `n` divisions and the temperature range is from `T_min` to `T_max`, the temperature range will be given by temperature_range = (T_max - T_min) / n.
3. Extract the RGB values of a pixel in the grade scale. You can use the `impixel` function to interactively select a pixel and obtain its RGB value.
4. Define a loop to iterate over each pixel in the image and calculate the corresponding temperature
5. The resulting will contain the calculated temperature values for each pixel in the original image.
I hope these steps help you achieve the required results. Please refer to the links below for related documentation:
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!