<p>the image below uses an RGB scale (the values of the scale are displayed on the image) to show the magnetic field strength at each point on the map. I've been struggling to find a way to convert this image into an array that shows the x and y coordinates of the pixel along with the magnetic field value at each coordinate (using MATLAB)<a href="https://i.sstatic.net/Sz3BH.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Sz3BH.jpg" alt="Magentic field map u"></a></p>

CC BY-SA 4.0
2019-06-13T12:21:11.767Z
You need a function that maps a colour to a value. Possibly what you have at the bottom right but in the form of a function.
lightxbulb
CC BY-SA 4.0
2019-06-13T15:05:40.840Z
i'm not really sure what to do i'm stuck :(
Ahmed Abdulla
CC BY-SA 4.0
2019-06-16T01:37:38.547Z
It's going to be very hard for us to help you if we don't have more information. What are you stuck on? Do you know how to sample the pixels of an image? Do you know how to read an image into memory? Do you have any existing code you can show us?
user1118321
CC BY-SA 4.0
2019-06-16T10:54:56.960Z
if you cant figure out a function you can maybe just hard code the given values in the bottom right in the form of a map (key value pair) and just linearly interpolate if a value is in between. Don't know how accurate will that be though.
gallickgunner
<computational-geometry>
RGB map into numerical data
Ahmed Abdulla
# RGB map into numerical data

(Asked by: username_0 on 2019-06-13)

the image below uses an RGB scale (the values of the scale are displayed on the image) to show the magnetic field strength at each point on the map. I've been struggling to find a way to convert this image into an array that shows the x and y coordinates of the pixel along with the magnetic field value at each coordinate (using MATLAB)[![Magentic field map u](https://i.sstatic.net/Sz3BH.jpg)](https://i.sstatic.net/Sz3BH.jpg)

**Tags:** computational-geometry

> **Comments:**
> **username_1**: You need a function that maps a colour to a value. Possibly what you have at the bottom right but in the form of a function.  
> **username_0**: i'm not really sure what to do i'm stuck :(  
> **username_2**: It's going to be very hard for us to help you if we don't have more information. What are you stuck on? Do you know how to sample the pixels of an image? Do you know how to read an image into memory? Do you have any existing code you can show us?  
> **username_3**: if you cant figure out a function you can maybe just hard code the given values in the bottom right in the form of a map (key value pair) and just linearly interpolate if a value is in between. Don't know how accurate will that be though.  

---

## 0 answers

