I have an binary image as shown below.
As can be seen in the image there is an edge which looks like an arc of an ellipse, as illustrated below and I manually marked it as red. These red pixels should be found by the code.
My goal is to fit an ellipse to the pixels that are colored in red in the above picture. This fitted ellipse is shown in below.
Could someone kindly tell me how I can get the pixels that are marked as red in the second image using MATLAB? I will then use them for an elliptical fitting.
The problem you are describing is extremely non-trivial. This article describes some of the existing methods. It is nice because it is a survey that will point you to other articles.
As you may have guessed, not having both ends of the ellipse to work with makes things infinitely more complex. If that were not the case, you could use the Hough transform. There is already a script available on the mathworks site do do this.
All that being said, I recommend Googling "ellipse detection". It may not help directly with the MATLAB implementation, but will at least give you an idea of the magnitude of the problem you are trying to solve.