Senior Scientist and Inventor in one of the world's 10 largest industrial corporations doing image analysis full time. Ph.D. in Optical Sciences specializing in imaging, image processing, and image analysis. 40+ years of military, academic, and (mostly) industrial experience with image analysis programming and algorithm development. Experience designing custom light booths and other imaging systems. Experience with color and monochrome imaging, video analysis, thermal, ultraviolet, hyperspectral, CT, MRI, radiography, profilometry, microscopy, NIR and Raman spectroscopy, etc. on a huge variety of subjects. Be sure to click "View All" in my File Exchange to see ALL of my demos and tutorials: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862

Professional Interests: Image analysis and processing

Answered

Counting the number of black pixels in an image

If "mask" is the image you want to count black pixels in, you can either do it like this: numBlackPixels = numel(mask) - nnz(ma...

Counting the number of black pixels in an image

If "mask" is the image you want to count black pixels in, you can either do it like this: numBlackPixels = numel(mask) - nnz(ma...

2 hours ago | 0

Answered

How difficult is it to move license to another computer?

Not hard. Once you have both computers, deactivate it on the old one. In MATLAB: Click the Home Tab, then Help, Lice...

How difficult is it to move license to another computer?

Not hard. Once you have both computers, deactivate it on the old one. In MATLAB: Click the Home Tab, then Help, Lice...

2 hours ago | 1

Answered

Shortest path algorithms in a heatmap.

See Steve's blog: http://blogs.mathworks.com/steve/2011/11/01/exploring-shortest-paths-part-1/

Shortest path algorithms in a heatmap.

See Steve's blog: http://blogs.mathworks.com/steve/2011/11/01/exploring-shortest-paths-part-1/

2 hours ago | 0

Answered

2020a prompting for an activation key

Try the "Installation and Licensing" section of the FAQ: https://www.mathworks.com/matlabcentral/answers/faqs

2020a prompting for an activation key

Try the "Installation and Licensing" section of the FAQ: https://www.mathworks.com/matlabcentral/answers/faqs

2 hours ago | 0

Answered

problem in installing matlab on my computer

See the FAQ: FAQ. Believe it or not, it's your quickest way to a solution.

problem in installing matlab on my computer

See the FAQ: FAQ. Believe it or not, it's your quickest way to a solution.

2 hours ago | 0

Answered

Polynomial curve fitting and equation of a curve from an image?

I measure all kinds of shapes all the time. It really depends on what you plan on doing with the information after you have it....

Polynomial curve fitting and equation of a curve from an image?

I measure all kinds of shapes all the time. It really depends on what you plan on doing with the information after you have it....

10 hours ago | 1

Answered

trouble understanding for loops

You forgot to use input() before the parentheses, among other things. Here is improved code: pv = input('What was your origina...

trouble understanding for loops

You forgot to use input() before the parentheses, among other things. Here is improved code: pv = input('What was your origina...

1 day ago | 0

Answered

use a text from a text box in a GUI

To get a string from an edit text box don't use the old obsolete get(), use the new OOP style: Especie = handles.Especie.String...

use a text from a text box in a GUI

To get a string from an edit text box don't use the old obsolete get(), use the new OOP style: Especie = handles.Especie.String...

1 day ago | 1

| accepted

Answered

How do I close all open scripts in the Editor window?

The following snippets may be useful for closing down: m-file editor windows, and/or variable editor windows OPTION 1: % Cl...

How do I close all open scripts in the Editor window?

The following snippets may be useful for closing down: m-file editor windows, and/or variable editor windows OPTION 1: % Cl...

1 day ago | 0

Answered

Approximating Probability using Monte Carlo Method

Hint: xy = rand(1000000, 2); or numPoints = 1000000; x = rand(numPoints, 1); y = rand(numPoints, 1); Look up norm in the h...

Approximating Probability using Monte Carlo Method

Hint: xy = rand(1000000, 2); or numPoints = 1000000; x = rand(numPoints, 1); y = rand(numPoints, 1); Look up norm in the h...

2 days ago | 0

Answered

Removing a column from any sized array help!!

Hint: m = magic(4) m(:,3) = []

Removing a column from any sized array help!!

Hint: m = magic(4) m(:,3) = []

2 days ago | 0

Answered

How can i convert some of images Matrices to be square symmetric Matrices?

Matrices do not need to be square to do PCA on them. Attached is an example where I do PCA on the 3-D color gamut of an RGB ima...

How can i convert some of images Matrices to be square symmetric Matrices?

Matrices do not need to be square to do PCA on them. Attached is an example where I do PCA on the 3-D color gamut of an RGB ima...

2 days ago | 0

Answered

Is there a command that writes code in another program?

fprintf() will do that. fid = fopen('program.m', 'wt'); % Open the file for writing. fprintf(fid, 'disp(x+variable^2)'); % Wri...

Is there a command that writes code in another program?

fprintf() will do that. fid = fopen('program.m', 'wt'); % Open the file for writing. fprintf(fid, 'disp(x+variable^2)'); % Wri...

2 days ago | 1

| accepted

Answered

Finding a number with conditions while using for loop

You need a continue. And you should print i, NOT n. Then, after the fprintf() put a break if sqrt(i) < 120 continue; % S...

Finding a number with conditions while using for loop

You need a continue. And you should print i, NOT n. Then, after the fprintf() put a break if sqrt(i) < 120 continue; % S...

2 days ago | 1

| accepted

Answered

How do I remove all fields of a structure that have at least one NaN?

If you want, you can try to use structfun() but it's rather cryptic. darova's solution is much more intuitive and readable. By...

How do I remove all fields of a structure that have at least one NaN?

If you want, you can try to use structfun() but it's rather cryptic. darova's solution is much more intuitive and readable. By...

2 days ago | 1

Answered

confusion matrix vs roc 100%

Why do you think you'd get any more points on the ROC curve than 1 from a single confusion matrix? You won't. One confusion ma...

confusion matrix vs roc 100%

Why do you think you'd get any more points on the ROC curve than 1 from a single confusion matrix? You won't. One confusion ma...

2 days ago | 0

| accepted

Answered

Rgb2gray error

Convert to gray scale: Filelist= dir('Clipboard*.png'); numberOfFiles = length(Filelist); for k = 1 : numberOfFiles % Don't u...

Rgb2gray error

Convert to gray scale: Filelist= dir('Clipboard*.png'); numberOfFiles = length(Filelist); for k = 1 : numberOfFiles % Don't u...

2 days ago | 0

| accepted

Answered

Sum of values stored in an array of handles

Are you SURE you set the Value property of the buttons when you created them? You'd need to have done that for your code, thoug...

Sum of values stored in an array of handles

Are you SURE you set the Value property of the buttons when you created them? You'd need to have done that for your code, thoug...

2 days ago | 0

| accepted

Answered

seperating higher and lower levels of a pulse

Please post a screenshot (a PNG file - it's easier for us to see immediately without saving your fig and then moving over to MAT...

seperating higher and lower levels of a pulse

Please post a screenshot (a PNG file - it's easier for us to see immediately without saving your fig and then moving over to MAT...

2 days ago | 0

Answered

How do I manage and pass information between my main app and all of its children?

You can find some help in the FAQ: https://matlab.fandom.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI....

How do I manage and pass information between my main app and all of its children?

You can find some help in the FAQ: https://matlab.fandom.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI....

2 days ago | 0

Answered

write an image file

You need to scale it to 0-255 first (which is what [] does), and then cast to uint8: image8 = uint8(rescale(im, 0, 255)); imwr...

write an image file

You need to scale it to 0-255 first (which is what [] does), and then cast to uint8: image8 = uint8(rescale(im, 0, 255)); imwr...

3 days ago | 1

| accepted

Answered

How to view images that were classified by mistake?

Are you using confusionchart() or confusionmat()? So, either way, you have a list of the true labels and the predicted labels. ...

How to view images that were classified by mistake?

Are you using confusionchart() or confusionmat()? So, either way, you have a list of the true labels and the predicted labels. ...

3 days ago | 0

Answered

how to detect horizontal or vertical lines code on OCTAVE

if y1 == y2 % Horizontal line. elseif x1 == x2 % Vertical line. else % Slanted line. end

how to detect horizontal or vertical lines code on OCTAVE

if y1 == y2 % Horizontal line. elseif x1 == x2 % Vertical line. else % Slanted line. end

3 days ago | 0

Answered

how to fit ellipse to an image with cylinderical shape

First of all, don't do an edge detection. I don't know why people always think edge detection is the first step in any image pr...

how to fit ellipse to an image with cylinderical shape

First of all, don't do an edge detection. I don't know why people always think edge detection is the first step in any image pr...

4 days ago | 1

Answered

How to find the distance of a point to a line (knowing all the points)?

See my demo. The GetPointLineDistance() function you want is in there. % Get the distance from a point (x3, y3) to % a line d...

How to find the distance of a point to a line (knowing all the points)?

See my demo. The GetPointLineDistance() function you want is in there. % Get the distance from a point (x3, y3) to % a line d...

4 days ago | 0

Answered

How to calculate the highest consecutive negative results in my code

This is trivial if you have the Image Processing Toolbox. Simply use regionprops(): v = [2 4 3 -1 -2 5 7 8 -1 -0.3 -1 -1 -1 -1...

How to calculate the highest consecutive negative results in my code

This is trivial if you have the Image Processing Toolbox. Simply use regionprops(): v = [2 4 3 -1 -2 5 7 8 -1 -0.3 -1 -1 -1 -1...

4 days ago | 0

| accepted

Answered

Finding Area of Polygon defined by roipoly

To get the answer in real world units like m^2 you have to get the area, using one of these 3 ways: areaInPixels = polyarea(x, ...

Finding Area of Polygon defined by roipoly

To get the answer in real world units like m^2 you have to get the area, using one of these 3 ways: areaInPixels = polyarea(x, ...

4 days ago | 0

Answered

Multiple conditional statements with logic

Try this: too_young = under_age(22, 21) too_young = under_age(11, 25) too_young = under_age(33) too_young = under_age(18) ...

Multiple conditional statements with logic

Try this: too_young = under_age(22, 21) too_young = under_age(11, 25) too_young = under_age(33) too_young = under_age(18) ...

4 days ago | 1

Answered

Comparing numerical values of a 5x2 cell

This will do it: ca = { 'Red Car', 50; 'Blue Car', 45; 'Green Car', 30; 'Black Car', 60; 'Yellow Car', 55} speeds = vert...

Comparing numerical values of a 5x2 cell

This will do it: ca = { 'Red Car', 50; 'Blue Car', 45; 'Green Car', 30; 'Black Car', 60; 'Yellow Car', 55} speeds = vert...

4 days ago | 0