28,516 total contributions since 2010

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

How to read a text file on a specific line having string and numeric data

You forgot to attach the file with the paper clip icon. Please do so. You could read in a line at a time with fgetl() and, if ...

How to read a text file on a specific line having string and numeric data

You forgot to attach the file with the paper clip icon. Please do so. You could read in a line at a time with fgetl() and, if ...

1일 ago | 0

Answered

gradient issue for matlab

If M is your matrix, have you tried imgradientxy()? [gx, gy] = imgradientxy(M); % Requires Image Processing Toolbox.

gradient issue for matlab

If M is your matrix, have you tried imgradientxy()? [gx, gy] = imgradientxy(M); % Requires Image Processing Toolbox.

2일 ago | 0

Answered

regionprops circularity value >1 and 0 ?

It seems like you're getting circularities less than 1 for perfectly rectangular blocks. The formula is not that accurate for s...

regionprops circularity value >1 and 0 ?

It seems like you're getting circularities less than 1 for perfectly rectangular blocks. The formula is not that accurate for s...

4일 ago | 0

| accepted

Answered

return row index of values greater than 0 to a 3 dimensional array

Try this: A = [2,-4,-0.5,0.34;0.01,4,-0.5,0.34;-10,4,-0.2,0.6;-10,4,-0.2,0.6;-19,15,-0.7,0.6]; [rows, columns] = find(A > 0)

return row index of values greater than 0 to a 3 dimensional array

Try this: A = [2,-4,-0.5,0.34;0.01,4,-0.5,0.34;-10,4,-0.2,0.6;-10,4,-0.2,0.6;-19,15,-0.7,0.6]; [rows, columns] = find(A > 0)

5일 ago | 0

| accepted

Answered

limits are too large

Try this: clc; clear all; M = 100; N = 100; u = linspace(0,.1,M); v = linspace(0,.2,N); [U, V] = meshgrid(u,v); X = ...

limits are too large

Try this: clc; clear all; M = 100; N = 100; u = linspace(0,.1,M); v = linspace(0,.2,N); [U, V] = meshgrid(u,v); X = ...

5일 ago | 0

| accepted

Answered

How to check Excel sheet data of one with Excel sheet data of another on matlab and print the output on another Excel sheet

To compare, use subtraction or the usual comparitive operators like ==, >=, <=, and ~=.

How to check Excel sheet data of one with Excel sheet data of another on matlab and print the output on another Excel sheet

To compare, use subtraction or the usual comparitive operators like ==, >=, <=, and ~=.

5일 ago | 0

| accepted

Answered

How can I recognize shapes of simple geometrical objects using optimization tools

Attach an image. In the meantime, see my attached shape recognition demo.

How can I recognize shapes of simple geometrical objects using optimization tools

Attach an image. In the meantime, see my attached shape recognition demo.

5일 ago | 0

Answered

i need to convert a folder of 200 .jpg images to .mat (to create 200 separate .mat files). i know there should be an easy matlab for loop to do this but I need help (newbie). thanks!

See the FAQ for code samples.

i need to convert a folder of 200 .jpg images to .mat (to create 200 separate .mat files). i know there should be an easy matlab for loop to do this but I need help (newbie). thanks!

See the FAQ for code samples.

5일 ago | 0

Answered

a and b constant

You say "The equation would be x= a*y+b" and this is the opposite to the way people usually do things, but it can be done. Just...

a and b constant

You say "The equation would be x= a*y+b" and this is the opposite to the way people usually do things, but it can be done. Just...

5일 ago | 0

| accepted

Answered

Need to find how many times in the matrix the Value 1 goes to Value 2

Here's one way: % Define data A{1} = [1 3 4 0]; % 4 elements (customers) A{2} = [4 2 3 1 5 3 5 2 1 2]; % 10 elements (custome...

Need to find how many times in the matrix the Value 1 goes to Value 2

Here's one way: % Define data A{1} = [1 3 4 0]; % 4 elements (customers) A{2} = [4 2 3 1 5 3 5 2 1 2]; % 10 elements (custome...

5일 ago | 0

Answered

How to solve a Multinomial Distribution IN MATLAB

I believe that formula in MATLAB would be p = factorial(10) / (factorial(2) * factorial(5) * factorial(3)) * (0.225)^2 * (0.544...

How to solve a Multinomial Distribution IN MATLAB

I believe that formula in MATLAB would be p = factorial(10) / (factorial(2) * factorial(5) * factorial(3)) * (0.225)^2 * (0.544...

5일 ago | 0

Answered

Timing concerning certain functions, in this case a convolution.

See attached manual convolution. Yes, it will be very slow. This is because you need to access every single element in the e...

Timing concerning certain functions, in this case a convolution.

See attached manual convolution. Yes, it will be very slow. This is because you need to access every single element in the e...

6일 ago | 0

| accepted

Answered

How do I make sure variables aren't overwritten in loops?

I suggest you load up rows in a table. See documentation for the table() function.

How do I make sure variables aren't overwritten in loops?

I suggest you load up rows in a table. See documentation for the table() function.

6일 ago | 0

| accepted

Answered

subtracting images processing,

Try [] to scale your data to your display imshow(c, []);

subtracting images processing,

Try [] to scale your data to your display imshow(c, []);

6일 ago | 0

Answered

Find cell and return index

Your Match is not a pattern in your "a" so that's why it didn't find it. {21 31 1} is nowhere in a. If it still does not work ...

Find cell and return index

Your Match is not a pattern in your "a" so that's why it didn't find it. {21 31 1} is nowhere in a. If it still does not work ...

6일 ago | 1

| accepted

Answered

How do i convert a bmp or jpeg image to a hexadecimal

See my attached demo. Change %d to %x and it should write out the location and values to a list in a text file.

How do i convert a bmp or jpeg image to a hexadecimal

See my attached demo. Change %d to %x and it should write out the location and values to a list in a text file.

6일 ago | 0

Answered

Remove strong Noise in signal

Try this: % Get threshold based on first 5 points. It should be bigger than the tallest of those, say by 10% or whatever thre...

Remove strong Noise in signal

Try this: % Get threshold based on first 5 points. It should be bigger than the tallest of those, say by 10% or whatever thre...

6일 ago | 0

Answered

How to randomly divide an M by M region into n sub regions

Try voronoi() if you want random points, or superpixels() if you have an image and want some sort of decision-based boundaries.

How to randomly divide an M by M region into n sub regions

Try voronoi() if you want random points, or superpixels() if you have an image and want some sort of decision-based boundaries.

6일 ago | 0

Answered

how to align the line detected to the middle of the image

Presumably you know the angle if the line(s) since you plotted them over the grayscale image. So use imrotate() to rotate it, t...

how to align the line detected to the middle of the image

Presumably you know the angle if the line(s) since you plotted them over the grayscale image. So use imrotate() to rotate it, t...

6일 ago | 0

| accepted

Answered

How can I use loops to perform different functions on every other array element?

Try this: v = [100;60;70;42;52;31.2;41.2;24.72] nOut = zeros(length(v), 1); % Instantiate column vector for output n. for k =...

How can I use loops to perform different functions on every other array element?

Try this: v = [100;60;70;42;52;31.2;41.2;24.72] nOut = zeros(length(v), 1); % Instantiate column vector for output n. for k =...

6일 ago | 0

Answered

How can I fill boundary by white pixel?

Use poly2mask(), as long as your x and y are in order. It will turn your (x,y) vertex coordinate list into a filled mask (a log...

How can I fill boundary by white pixel?

Use poly2mask(), as long as your x and y are in order. It will turn your (x,y) vertex coordinate list into a filled mask (a log...

6일 ago | 1

Answered

i got this error

You appear to have a script called contour.m. This script takes no arguments - that's why it's a script and not a function. Un...

i got this error

You appear to have a script called contour.m. This script takes no arguments - that's why it's a script and not a function. Un...

6일 ago | 0

Answered

How do I find a and b in terms of n ?

Just plug x^3 into the upper equation. I think a is 3*2*n = 6n, and b is still 2n.

How do I find a and b in terms of n ?

Just plug x^3 into the upper equation. I think a is 3*2*n = 6n, and b is still 2n.

7일 ago | 2

| accepted

Answered

How do I set up a project or solution?

MATLAB now (in R2019a) has “projects” where you can keep collections of files. See Working with Projects For example say I had...

How do I set up a project or solution?

MATLAB now (in R2019a) has “projects” where you can keep collections of files. See Working with Projects For example say I had...

7일 ago | 0

Answered

How can I divide height and width of 4 separate bounding boxes and compare it so that I can extract the object based on certain critera

Since you created the bounding boxes of the objects in the binary image, presumably with regionprops(), you already know their h...

How can I divide height and width of 4 separate bounding boxes and compare it so that I can extract the object based on certain critera

Since you created the bounding boxes of the objects in the binary image, presumably with regionprops(), you already know their h...

7일 ago | 0

| accepted

Answered

Extract color with in region

% Extract your color channels redChannel = rgbImage(:, :, 1); greenChannel = rgbImage(:, :, 2); blueChannel = rgbImage(:, :, ...

Extract color with in region

% Extract your color channels redChannel = rgbImage(:, :, 1); greenChannel = rgbImage(:, :, 2); blueChannel = rgbImage(:, :, ...

7일 ago | 0

Answered

How to make a matrix with negative indexes?

It's explained pretty well in the FAQ: click here

How to make a matrix with negative indexes?

It's explained pretty well in the FAQ: click here

7일 ago | 0

Answered

I have two datasets and I want to put them in one struct

Try s = load('cst1.mat'); data.cst1 = s.cst1; s = load('cst2.mat'); data.cst2 = s.cst2;

I have two datasets and I want to put them in one struct

Try s = load('cst1.mat'); data.cst1 = s.cst1; s = load('cst2.mat'); data.cst2 = s.cst2;

8일 ago | 0

Answered

Convert Grayscale image to XYZ file..

See my attached code. It produces a CSV text file with x,y,gray level.

Convert Grayscale image to XYZ file..

See my attached code. It produces a CSV text file with x,y,gray level.

8일 ago | 0