How to determine if changing a foreground pixel color to a background pixel color creates an unconnected line in an image.

2 views (last 30 days)
For this problem I started by trying to using impixel to get pixel values into a matrix and when one pixel is changed from a forground to a background color they would equal and you could see the value of the line become broken. However I am finding this to be an incorrect approach to this program. I started with this small piece of code but if there is a better way of doing this than please by all means correct and help me.
%Read image into workspace
RGB = imread('christmas tree.jpeg');
%Determine column c and row r indicies of pixel extract
c = [1 14 146 200];
r = [1 22 156 100];
%Return the data at the selected pixel locations
pixels = impixel(RGB,c,r)

Answers (0)

Categories

Find more on Images 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!