I have a binary image and I want to plot only the foreground pixels into a sparse image using MATLAB. I know that the pixel location of the foreground image (which is white) has to be known. For that I following code :
close all
clear all
original = imread('/gt_frame_2.bmp');
fig1 = figure(1)
[x y]=find([original])
The input used here appears as follows:
And the expected sparse image will be something as like this:
The above image in generated through GIMP. Just to give an idea of how a sparse image will look like. It contains pixels of the foreground image. But, not all the pixels are plotted.
After finding the X Y coordinates of the pixels I need to plot the same on to a sparse image. This where I am lost, I don't know how to plot a sparse image. Any kind of help is appreciated.