I have got a result as shown in the following image. As you can see, there are some edges which are not all straight. I want this image to be similar to this one (I'm not sure why the grey shade appears. Maybe because I manually extracted it?). But, the main thing here is to be similar to the white edges. I tried using morphological operations, but with not much improvements.
Any ideas how to fix this issue?
Thanks.
I loaded your data into a variable called "toBeSolved."
Now this is an indexed image so there are 3 frames, as can be seen from:
The data content of each frame appears to be identical, so maybe all you care about is the grayscale information from 1-frame? If thats the case lets just take the first frame:
And then normalize the data to the max value in the image:
Now take a look at a mesh view and we see that, as expected, there is significant noise and corruption around the edges:
The appearance about the edges suggests trying a thresholding operation to the data. I experimented with the threshold value and found that 0.13 produces some improvement:
which gives:
or the grayscale, imshow(data2):
I don't know if this is acceptable to your application, the edges are not perfect, but it does seem improved over what you started with.
By the way, I checked out your "solved" data as well and that appears to also have the same underlying level of noise and edge defects as the "toBeSolved" file, but at least visually, the corruption in that image is harder to see duo to the gray-scale values around the edges.