How can I read all 0 values from all rows and columns?
Show older comments
Hi guys,
I'm trying to draw a centre point for all the rectangles from the picture below.
When I import the image and convert using the function "rgb2gray" I end up getting a 2D table.
The point here is to draw a line so I can follow a trajectory.
I tried to use some computer vision functions but it wasn't working as expected so I think the best approach will be getting the centre point and then draw a line connecting all the dots.
The zero values from my table represent the black lines from the image.
This is what I have.
screen=imread('screenshoot_S10+_screen_test.jpg') %importing image
gray_rows =rgb2gray(screen) %converting into a 2D table
gray= gray_rows' %converting previews rows into columns
l = find((gray_rows( ) == 0))
c= find( (gray()== 0))'
For some reasson my c var is not reading the rows of table "grey".

Accepted Answer
More Answers (0)
Categories
Find more on Convert Image Type in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


