Community Profile

photo

DGM


Last seen: Today
490 total contributions since 2015

Hi, I'm nobody.
I don't belong here, but I have nothing better to do.
Matlab used to be part of my work.
Now it's part of my hobbies.
That's pretty sad, really.

Contact

DGM's Badges

  • 3 Month Streak
  • 5-Star Galaxy Level 4
  • Revival Level 3
  • Knowledgeable Level 4
  • Pro
  • Explorer
  • Thankful Level 2
  • First Answer
  • Personal Best Downloads Level 3
  • First Review
  • First Submission

View details...

Contributions in
View by

Answered
I need help with pixel neighborhood operations
If you have Image Processing Toolbox, you likely don't need to resort to any sort of pointwise looping code. Most such operatio...

ongeveer 8 uur ago | 0

| accepted

Answered
Extracting all possible vectors from a big vector
Sure they're vectors. v=[1 2 3 4]; v = uint16(v); % there's no point doing this repeatedly in the loop C = {}; for k = 1:n...

ongeveer 24 uur ago | 0

| accepted

Answered
Change output view of pin cushion distortion
Maybe try something like s = r - (b/rmax.^2)*r.^3; % this is the same as before s = s/(max(s(:))/rmax); % or use whatever scal...

1 dag ago | 0

Answered
Hello, can anyone solve this preallocation problem in my code?
You had allocated an empty vector and were growing it by concatenation. It works, but is often slower. Since you know the size...

1 dag ago | 0

Answered
Weird output image after applying mask
The output of edge() is logical. When roifilt2() goes to composite the filtered and original images, this causes the non-filter...

1 dag ago | 0

Answered
How to calculate entropy of a DICOM image (16-bit depth)?
Just open up entropy() or look at the docs to see how it works. % just grab some image and make it into an example inpict = ...

1 dag ago | 0

Answered
I have 4 bits combinations, and I want to change the size of the matrix HT depending on these combinations, the description below
Not sure how you want to handle HT, but here goes: n = 4; %number of bits % don't need all those loops A = dec2bin(0:2^n-1)...

1 dag ago | 0

| accepted

Answered
My pictures have a format of [227 227 1] so I had the idea to triplicate my processed pictures and put them back into one to get a format of [227 227 3], how can I do this?
To rearrange a single-channel intensity image into a grayscale RGB image, you can just do Argb = repmat(Aint,[1 1 3]); I don't...

1 dag ago | 0

Answered
How to do OR operation of two images (DFT and Binary)?
I'm not sure what you're actually trying to do. Your description makes sense, but you're doing the bitwise OR of a logical imag...

1 dag ago | 0

Answered
How do I code this for loop?
I don't know how you're getting anything out of it, since the index isn't even being used. You could do this: vd_inc = 1:100; ...

2 dagen ago | 0

| accepted

Answered
Remove Grid Lines from a Graph
It depends what you want and what you expect. If all you want is one or two pictures, it's by far easier to do this manually ou...

2 dagen ago | 0

Answered
error while running watershed
I don't know how you'd be getting that error unless there's a problem with conndef.m Maybe it's being shadowed, so check the pa...

2 dagen ago | 0

Answered
How can I divide the colorbar into just two ranges?
One way is to specify the colormap and caxis(); consider the example [x y z] = sphere(30); surf(x,y,z); axis equal datar...

2 dagen ago | 0

Answered
How do I leave the answer in real number form instead of natural exponents
That appears to be a symbolic vector. You should just be able to do double(gradientdescent) and get a plain numeric result

6 dagen ago | 1

| accepted

Answered
Reverse calculation for weighted average
Let's say we're trying to back calculate x= [a b c d e] that were used to generate the mean and sum. Is there a way to solve fo...

7 dagen ago | 1

| accepted

Answered
program that reads the color value in the CIE xyz color space and represents it on 3d space coordinates
Maybe this is of use. % generate two clusters of color points lab1 = randn(100,3).*[40 10 20] + [40 -40 40]; lab2 = randn(1...

7 dagen ago | 0

Answered
not enough input arguments
The error is occurring because you're not providing the function odDetect with any arguments. A function will throw the error o...

7 dagen ago | 0

Answered
How to run a for loop with two functions (nested for loop?)
Pretty sure that you're just intending to process alpha one element at a time, so just do that. Of course, you're overwriting a...

9 dagen ago | 0

| accepted

Answered
how can I plot the intersection of two cylinders?
Like everything, there are probably better ways, especially to get the edges closed. The simple way is to just plot the surface...

9 dagen ago | 0

| accepted

Answered
It can't read an image, it says the path does not exist even though the path does exist
Nobody here can guess the contents of the index file you're reading or the actual filenames on your disk. You can start by gene...

9 dagen ago | 0

Answered
Subtraction of cell values with a fixed value
You could use cellfun() if you wanted. s = [1 39]; A = randi([1 20],s(1),s(2)); k = 100; % the number to subtract blocksiz...

9 dagen ago | 0

| accepted

Answered
For loop to create a new matrix taking a cluster of columns from existing matrix
Blockwise sum along dim 2 using a cell array s = [1300 36]; % set the array size FR_mat = randi([1 20],s(1),s(2)); C = mat2...

9 dagen ago | 1

| accepted

Answered
how to shift decimals ? !!
It all depends on the number format you specify: mynumber = 3.023155942378474e+42; title(sprintf('My Number is %.4e',mynumber)...

10 dagen ago | 0

| accepted

Answered
Creating rgb vector based on Z data for standard colorbar
This is an old method. I kind of wonder if there's anything newer that makes this simple... % make a custom colormap n = 256;...

10 dagen ago | 1

| accepted

Answered
fourier image of angled shape, and changes when cropping
Because the results of fft2() are scaled to match the geometry of the image it operates on, the shape of objects in the fft imag...

10 dagen ago | 0

Answered
I am converting a 3D image to a set of 2D images(slices), but the images I receive are not of good quality, so there is a loss of information. Is there a solution? please help
Well here goes. I'm pretty sure the main problems were in the normalization, but there were other issues that could be simplifi...

10 dagen ago | 0

| accepted

Answered
segmentation of rice grains and sub plotting individual grains
You don't need the inner plot loop, and some other stuff can be simplified. I just removed the figure and imshow previews for b...

10 dagen ago | 0

| accepted

Answered
why the image processing usually use this eqution?
This example code implements a type of sliding filter. In this case, the filter size is defined by the filter kernel w (3x3). ...

10 dagen ago | 0

Answered
Get mean and stdev from all values
If column 1 is sorted: % build test array idx = repelem(1:10,randi(6,10,1)); idx = idx(1:20); D = [idx.' rand(20,1)]; % the ...

10 dagen ago | 0

| accepted

Answered
How to get the max orthogonal (perpendicular) distances from a set of coordinates
I'm sure this can be done much more efficiently, and I hope someone is motivated to prove that point. I'm cheating by using pol...

11 dagen ago | 1

| accepted

Load more