Answered
With the grayscale image 150*100 how should I find out the number of text pixels(black) and background pixel (white)count I have used histogram but I can't accurately predict the pixel count
Convert image into binary (suppose bw_image); white_pixels_count=sum(bw_image(:)); black_pixel_count=(num_of_rows*num_of...

8 years ago | 0

| accepted

Answered
How can i resolve this error?
% Have you check here the format of Wiener filter I2=wiener2(image,[m n]); % Here [m n] specifies the size (m-by-n) of ...

8 years ago | 0

Answered
how to use the output of a 1st part of a program to the 2nd part of the same program as a input?
%First Part function ...... end %2nd Part %Call the function %Do finding

8 years ago | 0

| accepted

Answered
I want to apply Marker-Controlled Watershed Segmentation on a folder containing .jpg images..So what modifications are required in the following code and I also want to store that results in a folder
path_directory='tomato'; % 'Folder name' original_files=dir([path_directory '/*.jpg']); %Note on Image Format for k=1:...

8 years ago | 1

| accepted

Answered
Convert Grayscale Image to a Black and White Image by Certain Threshold Number
bw_image=im2bw(gray_image); %By Default here threshold is 0.5 Or bw_image=im2bw(gray_image,threshold_value); Choose...

8 years ago | 0

Answered
Save SSIM index output
%Try [ssimval, ssimmap]=ssim(A,B); imshow(ssimmap,[]); saveas(gcf,'test.jpg'); NewImage=imread('test.jpg');

8 years ago | 1

| accepted

Answered
How can I read and show a dicom volume?
Have you used this one? Detail <https://in.mathworks.com/help/images/ref/dicomreadvolume.html Here> [V,spatial,dim] = dicom...

8 years ago | 1

Answered
How can I move the colorbar in a surf plot?
surf(peaks); set(gca,'FontSize',8); cb=colorbar; <</matlabcentral/answers/uploaded_files/132407/99.png>>

8 years ago | 1

Answered
How to calculate true positive , true negative, false positive and false negative as we have segmented and ground truth
%Last year I answered this way, you can avoid the loop (Recommended) TP=0;FP=0;TN=0;FN=0; for i=1:400; for...

8 years ago | 1

| accepted

Answered
how to build video from several images?
Check <https://in.mathworks.com/matlabcentral/answers/280635-make-video-from-images#answer_219680 here> It would be helpful.

8 years ago | 0

Answered
what changes are to be made in the following code to convert all the images in grayscale?
Code: Call the all image in the folder on by one, convert to grayscale and save it one by one in the mentioned path destination(...

8 years ago | 1

| accepted

Answered
Plot bar with 2 different axis
Check <https://in.mathworks.com/matlabcentral/answers/164738-bar-plot-with-two-y-axes#answer_160635 here>, it would be helpful. ...

8 years ago | 0

| accepted

Answered
I want to separate the colour RGB and HSV Image, how I do to separate and combine that?
RGB Component from RGB Image r=rgbimage(:,:,1) %Red Component g=rgbimage(:,:,2) %Green Component b=rgbimage(:,:,3) %B...

8 years ago | 2

| accepted

Answered
Finding neighbours in a matrix
You can do it one by one, I don't think there is any direct command for that. Suppose the present matrix position is i,j, matri...

8 years ago | 0

Answered
How create a decreasing axis for a histogram plot?
i=rgb2gray(imread('1.jpg')); h=histc(i(:), 0:255); plot(h) set(gca, 'XDir','reverse') <</matlabcentral/answers/upl...

8 years ago | 0

| accepted

Answered
How to save "corrplot" figures?
Have you tried this? saveas(gcf,'filename.png'); %Use to display save as image

8 years ago | 0

| accepted

Answered
how to save spectrogram of signal as image ? i have given my code.
x=train_data(91,:,1); N=1000; fs=250; t=(1:N)/fs; Fn=fs/2; Wp=[8 30]/Fn; % Passband Frequency (Normalised) ...

8 years ago | 0

| accepted

Answered
Error using .* Matrix dimensions must agree on line I_f1=I_f.*(H_em) i didn't understand how to remove this bug.
Ensure that I_f and (H_em) having the same size. Analyze(size) of one by one line, you will get the error. *Note* [f1,f2]...

8 years ago | 0

| accepted

Answered
Lots of errors but code still runs fine?
%No Code Error clc; clear all; close all; fun=@(t,x) x.^3+x.^2-12*x; figure, fplot(@(x) fun(0,x),[-5,5]) gri...

8 years ago | 0

| accepted

Answered
why regiongrowing function is not working and it shows undefined function
Save <https://in.mathworks.com/matlabcentral/fileexchange/19084-region-growing this> custom function in your working directory a...

8 years ago | 1

| accepted

Answered
How to draw multiple plots in one plot in Matlab??
Plot(1); hold on; plot(2); ..... plot(n) hold off; Another way, if all having the same x scale, you can ...

8 years ago | 0

Answered
how to save spectrogram of signal as image ?
% You can do it in multiples ways, for example, check the following sample code N=1024; n=0:N-1; w0=2*pi/5; ...

8 years ago | 1

| accepted

Answered
How to create a vector with a sequence 1, u, u(u-1), u(u-1)(u-2)....
u=input('Enter the value of u (more than 1): '); n=input('Enter the numbers of Elements required: '); a(1)=1; for i=2...

8 years ago | 0

Answered
How to generate a sine signal having four different frequency?
t=0:.01:5; noiseAmplitude=randi(5); noise=noiseAmplitude* rand(1, length(t)); w1=10;w2=17;w3=23;w4=60; y1=sin(w1*t)+ noise;...

8 years ago | 0

| accepted

Answered
how can I change the value of each pixel of an image (i want to change the brightness of an image)
You can do the following, there are multiple ways to adjust the brightness new_image=image+n %where n is the value-add to ...

8 years ago | 0

| accepted

Answered
How to generate a random number of n bits length?
function bit_result=rand_bits(n) result=randi([2^(n-1), 2^n]); bit_result=de2bi(result,n) end

8 years ago | 1

Answered
Inner Matrix Dimensions Must Agree
* Matrix multiplication rows of the first matrix should be equal columns of the second matrix * you have considering one mat...

8 years ago | 0

Answered
How to vectorize this code to eliminate nested For loops?
nEnergy(:,:) = (Energy(:,:) - min(Energy(:,:))) / (max(Energy(:,:)) - min(Energy(:,:))); weight(:,:) = dot(nEnergy(:,:), delt...

8 years ago | 0

Answered
How can I only swap the first and last element of a vector?
a=[-5 4 -4 6 8 -3]; b=a; b(1)=a(length(a)); b(length(a))=a(1,1); <</matlabcentral/answers/uploaded_files/131054/11...

8 years ago | 0

Answered
Is there anybody that have PAPR reduction in OFDM code ?
The code is available in File Exchange, Check <https://in.mathworks.com/matlabcentral/fileexchange/46440-ofdm-with-papr-reductio...

8 years ago | 0

Load more