MATLAB user since 1987. MathWorker since 1993. Amateur French horn player. MATLAB design and development, image processing algorithms.

Image processing blog: https://blogs.mathworks.com/steve/

Answered

Binarize image for specific colour

Use the Color Thresholder app to generate the code needed to do this segmentation. See my 14-Oct-2019 and 25-Apr-2014 blog posts...

Binarize image for specific colour

Use the Color Thresholder app to generate the code needed to do this segmentation. See my 14-Oct-2019 and 25-Apr-2014 blog posts...

20 days ago | 0

Answered

Plotting signal of a region of interest

A possible explanation is that you have a variable called "size" or "mean" in your workspace. For example, if you have a variabl...

Plotting signal of a region of interest

A possible explanation is that you have a variable called "size" or "mean" in your workspace. For example, if you have a variabl...

23 days ago | 0

Answered

How to apply a threshold value to the cell array

I think writing a for-loop would be most straightforward way to go. Something like this: for k = 1:numel(C) C_k = C{k}; ...

How to apply a threshold value to the cell array

I think writing a for-loop would be most straightforward way to go. Something like this: for k = 1:numel(C) C_k = C{k}; ...

25 days ago | 0

| accepted

Answered

How to change the font of a pie chart?

The text labels created by the pie function are not controlled by the font properties of the containing axes object. They are in...

How to change the font of a pie chart?

The text labels created by the pie function are not controlled by the font properties of the containing axes object. They are in...

1 month ago | 1

| accepted

Answered

superimpose matrices (n,n,m) to (n,n,1)

Here are some options. Compute and plot the maximum value at each pixel: imagesc(max(a100,[],3)) Compute and plot the minimum...

superimpose matrices (n,n,m) to (n,n,1)

Here are some options. Compute and plot the maximum value at each pixel: imagesc(max(a100,[],3)) Compute and plot the minimum...

2 months ago | 0

| accepted

Answered

Image conversion from uint16 to uint8 mismatch

im2uint8 is using a scale factor of (255/65535), not 1/256. Note that scaling the maximum of the uint16 range, 65535, by 1/256 ...

Image conversion from uint16 to uint8 mismatch

im2uint8 is using a scale factor of (255/65535), not 1/256. Note that scaling the maximum of the uint16 range, 65535, by 1/256 ...

2 months ago | 1

| accepted

Answered

How do I map array values on a logical array

Use logical indexing. C = zeros(size(B)); C(logical(B)) = A

How do I map array values on a logical array

Use logical indexing. C = zeros(size(B)); C(logical(B)) = A

2 months ago | 1

| accepted

Answered

Create a 7x7 convolution kernel which has an equivalent effect to three passes with a 3x3 mean filter.

Convolution is associative: So, your 7x7 convolution kernel would be the convolution of the mean filters: Use the 'full' o...

Create a 7x7 convolution kernel which has an equivalent effect to three passes with a 3x3 mean filter.

Convolution is associative: So, your 7x7 convolution kernel would be the convolution of the mean filters: Use the 'full' o...

2 months ago | 0

Answered

pgm image lossless compression

Write the image to a PNG file. The PNG format uses lossless compression. imwrite(A,'myfile.png') Read it back in using imread....

pgm image lossless compression

Write the image to a PNG file. The PNG format uses lossless compression. imwrite(A,'myfile.png') Read it back in using imread....

2 months ago | 0

Published

How imshowpair and imfuse work

In this post, I'll explore how imshowpair and imfuse work.Reason: I was curious.Last month, I wrote about registering...

2 months ago

Answered

Shade area in graph for multiple y-axes

I rearranged your code a bit, putting both of the first two plotting functions (patch and plot) after the call to yaxis left. I ...

Shade area in graph for multiple y-axes

I rearranged your code a bit, putting both of the first two plotting functions (patch and plot) after the call to yaxis left. I ...

2 months ago | 0

| accepted

Answered

How to add percent change in barplot?

If you want text labels instead of a line plot (Cris' suggestion), then try this code. It gets the Bar object as the output argu...

How to add percent change in barplot?

If you want text labels instead of a line plot (Cris' suggestion), then try this code. It gets the Bar object as the output argu...

2 months ago | 1

| accepted

Answered

Neighbor and center points of matrix

See my 25-Feb-2008 blog post called "Neighbor indexing" for a general technique. You'll need to pay careful attention to what h...

Neighbor and center points of matrix

See my 25-Feb-2008 blog post called "Neighbor indexing" for a general technique. You'll need to pay careful attention to what h...

2 months ago | 1

Answered

Fourier Transform of a signal

The fft function in MATLAB computes something called the discrete Fourier transform. Your problem here is asking you to find som...

Fourier Transform of a signal

The fft function in MATLAB computes something called the discrete Fourier transform. Your problem here is asking you to find som...

2 months ago | 0

Answered

How can I create a 3D array?

Try something like this: for i = 1:n-1 next_image = uigetfile('*p*'); ImageArray = cat(3,ImageArray,next_image); end...

How can I create a 3D array?

Try something like this: for i = 1:n-1 next_image = uigetfile('*p*'); ImageArray = cat(3,ImageArray,next_image); end...

2 months ago | 0

| accepted

Answered

customize export setup to generate SVG

Try this: h = findall(fig,'-property','FontName'); set(h,'FontName','San Serif'); print(fig,'-dsvg','mygraphic.svg')

customize export setup to generate SVG

Try this: h = findall(fig,'-property','FontName'); set(h,'FontName','San Serif'); print(fig,'-dsvg','mygraphic.svg')

2 months ago | 0

Published

Registering Hand-Held Pictures

The typical modern French* horn, pictured below, has about 23 total feet of tubing. At the beginning and the end, the tubing...

2 months ago

Answered

load rwb gives error

You're looking for a file called rwb.mat. Once you find it, put it in your current working folder or in a folder that's on the M...

load rwb gives error

You're looking for a file called rwb.mat. Once you find it, put it in your current working folder or in a folder that's on the M...

3 months ago | 1

| accepted

Answered

How to get the x and y coordinates of the each marker in a frame?

I used the Color Thresholder app to get code that segments your image based on the green color of the markers. Then I used regio...

How to get the x and y coordinates of the each marker in a frame?

I used the Color Thresholder app to get code that segments your image based on the green color of the markers. Then I used regio...

3 months ago | 0

Answered

Give an unknown number of parameters to feval

Put your parameters in a cell array and then use the syntax that expands a cell array into a comma-separated list: out = feval(...

Give an unknown number of parameters to feval

Put your parameters in a cell array and then use the syntax that expands a cell array into a comma-separated list: out = feval(...

3 months ago | 0

| accepted

Answered

Infinite Recursion in own Levenberg-Marquardt Code

I see that korrektur is calling itself recursively. I noticed also that the recursive call appears to be identical to the top-le...

Infinite Recursion in own Levenberg-Marquardt Code

I see that korrektur is calling itself recursively. I noticed also that the recursive call appears to be identical to the top-le...

3 months ago | 1

Answered

Text increments of the x-axis

Sure, you can set the XTicks property of the axes object directly. ax = gca; ax.XTicks = [1 2 3]; A shortcut for this is: xt...

Text increments of the x-axis

Sure, you can set the XTicks property of the axes object directly. ax = gca; ax.XTicks = [1 2 3]; A shortcut for this is: xt...

3 months ago | 0

Solved

Find nth maximum

Find nth maximum in a vector of integer numbers. Return NaN if no such number exists. x = [2 6 4 9 -10 3 1 5 -10]; So ...

3 months ago

Solved

Create an index-powered vector

Given a input vector x, return y as index-powered vector as shown below. Example x = [2 3 6 9] then y should be [...

3 months ago

Solved

Symmetry of vector

Determine whether the vector is symmetric or not (vector could be even or odd in length). For example: x = [1 2 3 3 2 1] ...

3 months ago

Answered

imshow doesn't display png image file

Your image is stored in the PNG file as unsigned 16-bit integers. When imshow displays a uint16 image, it uses the unsigned 16-b...

imshow doesn't display png image file

Your image is stored in the PNG file as unsigned 16-bit integers. When imshow displays a uint16 image, it uses the unsigned 16-b...

3 months ago | 1

| accepted

Solved

Create an n-by-n null matrix and fill with ones certain positions

The positions will be indicated by a z-by-2 matrix. Each row in this z-by-2 matrix will have the row and column in which a 1 has...

3 months ago

Answered

How to plot particle trajectories and normalise to 0,0 origin?

Here is one way you could do it. Read in the whole Excel file as a table. Then, in a loop, extract the particle data for each tr...

How to plot particle trajectories and normalise to 0,0 origin?

Here is one way you could do it. Read in the whole Excel file as a table. Then, in a loop, extract the particle data for each tr...

3 months ago | 1