How to transfer graph data into MATLAB using image processing?
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
0 comentarios
Respuestas (2)
Asad Mirza
el 25 de Feb. de 2019
5 comentarios
Asad Mirza
el 26 de Feb. de 2019
Editada: Asad Mirza
el 26 de Feb. de 2019
Easiest way is find the gradient of the image and then set a threshold value to what counts as a verticle line. But it's a quick and dirty way and prone to errors.
im=imread('image.jpeg');
im=rgb2gray(im);
[gx gy]=imgradientxy(im);
Verts=gx>800; %% gx for verticle lines or gy for horizontal lines
imshow(Verts);
Image Analyst
el 26 de Feb. de 2019
If it were me, and it was just this one picture (not hundreds of pictures), I'd
- bring it into Photoshop
- Crop the image to the bounding box
- Resize the image to 2100 pixels high.
- Enlarge the canvass to 2400 pixels by extending out the bottom
- Paint white over all the non-signal parts using the paintbrush tool(this is the only time-consuming part)
- Save it out as a PNG image
- Bring the image into MATLAB and scan the image column by column looking for the last black pixel
I'm attaching a rough estimate of what I get through Step 6. Of course this is a very very low resolution image so it's very difficult to determine what is signal and what is grid or numbers. It's essentially a judgment call so that's why I chose to do pre-processing manually in Photoshop.
For Step 7:
for col = 1 : columns
rowOfSignal(col) = find(grayImage(:, col) < 128, 1, 'last');
end
% Convert to range 300 - 2400
signalValue = 2400 - rowOfSignal;
0 comentarios
Ver también
Categorías
Más información sobre Geometric Transformation and Image Registration en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!