Extracting digital numbers from color panels in images

Hello, Can anyone help me to fix this code? I am done with it, but it seems there is an error FIND ATTACHED Best,

2 Comments

You forgot to attach 'CIMG6786.jpg' so we can't run your code until then.

Sign in to comment.

 Accepted Answer

VARI has some nans because of a divide by zero. Set nans to zero like this
VARI(isnan(VARI)) = 0;
The other main problem with the code is that there are no comments in it, so it's not maintainable.

10 Comments

I still have an error: Error using .* Matrix dimensions find attached photo!
must agree.
Excuse me, would the nans affect the values? I tried to use that code... but it does not working! Can you help?
That's not my code. I did not use ndgrid.
I am sorry.. i did not get what do you mean exactly by that.. can you provide me with an example code? Here is my code if you can edit it! Thanks so much!
Put this as line 47:
VARI(isnan(VARI)) = 0;
it runs without error now, just a warning that you can ignore when you call imageinfo().
Great .. I have a question please.. when I tried to get the results.. it seems that i have some issues in the area surrounding to the ring that i need to extract from .. can you help? Thanks!
What do you want to do? Mask out the region outside the circle? If so just do
VCI(~mask) = 0;
EXG(~mask) = 0;
VARI(~mask) = 0;
That's perfect.. I changed some stuff and I am wondering if you can check the code now.. I hope everything is Ok.. Thanks!
In your get_image_point routine, you have
if size(loc)>1
which should probably be
if size(loc, 1)>1
However, you can skip the test by just coding
loc = loc(1,1:2);
without checking the size.
I have a question.. when I get VCI statistics, I noticed that the value of MAX is 34, which is unusual as the other entries MAX are 1, 1 , 1. Can you help me to fix that? Thanks

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!