04-28-2013 10:10 PM
Hello,
I would like to plot a graph showing grey level vs radius by reading a the pixel from a BMP file.
So I have to find out what's the radius of each pixel of square from the center of the circle and find out the corresponding grey level of that same pixel. A grey level of a white pixel is 0 while a black one is 255. Each pixel is 32mm by 32mm. I'm using a 24 bit BMP file and after I find out all the radius and grey level of each pixel, I have to plot the data into a graph.
Can someone show me how to implement it.
Thanks:)
The following attachment is what I have done so far which is just the starting point of my entire program and still searching for the right answers.
Im also trying to adjust the lens to see each pixel even better.
04-29-2013 02:40 AM
Hi enriquez,
why do you create the very same topic as a LHX? Can't you join up when working on the same homework?
Read the BMP, pick the line with the center point, show that line (!) on a graph. To pick the image data you should use the components cluster delivered by "Read BMP file" function...
04-29-2013 04:10 AM
Regarding LHX, We are actually comparing our produce output in the graph thats why we are doing it seperately:) Btw, how do I pick the line with the center point, I didnt get that part.
Thanks for the help:)
04-29-2013 05:55 AM
04-30-2013 04:39 AM
ok I've tried your suggestion but I can't figure out how to get to the center point which is (20,20) and calculate radius from there
Do I use IMAQ point distance or any other IMAQ calibration functions?
04-30-2013 04:50 AM
Hi LHX,
you should know the datatypes you get from ReadBMPFile, read the context help...
- You have to know the center point. If it's just the center of the image you can calc the corresponding row/column from "Rectangle" data provided by the FileRead function.
- You have to index the correct row/column. Indexing row 0 will surely not give you the center point...
- Just using BuildArray from the image data will also not give you useful data, as said before: You have to know what kind of data you receive...
05-03-2013 03:37 AM
Hi,
We are still having difficulties till now and we havent figure out how to read from the center point. The attachment below is what we have done so far but the result is still wrong. We want the result to start from 255 and slowly go down to 0 then 255 again according to the grey level and radius of the BMP file.
Also, we want to read from center to right, center to bottom and center to right diagonal.
So what can we do to attain the results that we want and what are we doing wrong?
Thanks:)
05-06-2013 12:27 AM - edited 05-06-2013 12:47 AM
Hi Everyone,
Ignore the question above because I already solved it, the part that i'm having difficulty with is reading the pixel lens diagonally starting from the center point of the lens.
I just urgently need a response, thank you so much!:)
05-06-2013 02:48 AM
05-06-2013 03:03 AM
What I meant is how do I manipulate the array to read from the center to the right diagonal? and how do I make another graph that shows the upside down result of the radius graph?