Is there histo function in MATLAB? - image

histo function in MATLAB, does anyone knows what it does? histo(image) what does this return?
I found in google but there I couldnt find any predefined function in MATLAB. Is there some new includes in Latest MATLAB. If anyone knows please explain what is happening below.
hist=histo(image);
pdf=hist/sum(hist);
t_new=round(sum(pdf.*[0:255]));

histo() is probably a user-defined function that counts image historgram. You can use built-in Matlab function hist() instead:
n = hist(image)
Read more:
http://en.wikipedia.org/wiki/Histogram
http://en.wikipedia.org/wiki/Histogram_equalization

The MATLAB command for calculating image histogram is imhist
It is used as
hist = imhist(image);

Related

Excel cube: create new measure as sum of existing measures

I have no idea what to put in the formula box, and the help (https://support.microsoft.com/en-us/office/create-a-measure-in-power-pivot-d3cc1495-b4e5-48e7-ba98-163022a71198?ns=excel&version=90&syslcid=1033&uilcid=1033&appver=zxl900&helpid=149601&ui=en-us&rs=en-us&ad=us) says simple enter a formula.
Is there any documentation?
Neither
=SUM(dsv_FactIncome[ClientValue], dsv_FactIncome[PartnerValue])
nor
=SUMX(dsv_FactIncome[ClientValue], dsv_FactIncome[PartnerValue])
are acceptable to it, either.
This is DAX and your syntax is incorrect. Try
=SUM(dsv_FactIncome[ClientValue]) + SUM(dsv_FactIncome[PartnerValue])

surface feature detection on image processing

An example of detectSURFFeatures in comparison of 2 image is in below. I couldn't make detectSURFFeatures function work in my MATLAB. no help or doc detectSURFFeatures gives any clue. the error says " > UncalibratedSterio
Undefined function 'detectSURFFeatures' for input arguments of type 'uint8'." but the function itself can cover uint8 as i know. what should i do?
%Rectified Sterio Image Uncalibrated
% There is no calibration of cameras
I1 = rgb2gray(imread('right_me.jpg'));
I2 = rgb2gray(imread('left_me.jpg'));
Value = 2000.0;
blobs1 = detectSURFFeatures(I1, 'MetricThreshold', Value);
blobs2 = detectSURFFeatures(I2, 'MetricThreshold', Value);
figure;
imshow(I1);
hold on;
plot(selectStrongest(blobs1, 30));
title('Thirty strongest SURF features in I1');
figure;
imshow(I2);
hold on;
plot(selectStrongest(blobs2, 30));
title('Thirty strongest SURF features in I2');
You are getting that error because detectSURFFeatures does not exist in your MATLAB distribution. You must have at least R2011b, as that was when detectSURFFeatures was available: http://www.mathworks.com/help/vision/release-notes.html#R2011b
I suspect you have an older version of MATLAB than R2011b and so if you want to make it easy on yourself, you need to upgrade your version of MATLAB. However, if I may make a suggestion, I suggest the mexopencv project by Kota Yamaguchi: http://kyamagu.github.io/mexopencv/
He wrote OpenCV wrappers that can directly interface with MATLAB and so you can actually call OpenCV's SURF feature detection and matching methods from MATLAB but you will need to install OpenCV to do that. It will be a bit of work to get it working, but this is one solution I can provide if you don't want to upgrade your version of MATLAB.
Good luck!

Reading RAW16 images in MATLAB

I am trying to read a RAW16 image in MATLAB. After going through another question here on StackOverflow, I figured I could read it like reading a file and then doing some simple matrix transposes. However, I am running into a weird problem. The image below is what I am getting. I do not understand why this overlap exists and am not entirely sure how to solve the issue. Could someone help?
Code:
fin = fopen('raw13.raw','r');
ima = fread(fin, [col*2 row],'uint8');
temp = zeros(col,row);
j=1;
for i=1:2:col*2-1
temp(j,:) = ima(i,:) + ima(i+1,:)*2^8; %The first element is the lower 8bits and the second element is the higher 8bits
j = j+1;
end
imshow(temp',[0 2^16-1])
In case anyone is having the same problem as me.
It seems the .RAW file that I obtained was somehow corrupted. Using a lower version of the FlyCapture program resulted in a better RAW file and the code that I used worked like a charm
I use col*3 in line 3 and line 5, then it displays the image well.
but i use 8 bit raw image form pointgray camera,and i dont know 'imshow(temp',[0 2^16-1])' would work...

healpy synfast: how to define the random seed

I'm using healpy.synfast to create maps, but it seems that healpy does not have the "iseed" function (as in here: http://healpix.jpl.nasa.gov/html/facilitiesnode14.htm) which let me define the random seed to be used for the generation of alms from the power spectrum.
Could anyone tell me how to achieve the "iseed" function in healpy? Thanks!
healpy internally uses np.random.standard_normal to generate the real and imaginary components of the alms, see sphtfunc.py.
Therefore you can use the numpy.random.seed function to set the seed, as:
numpy.random.seed(1234)
before running synfast.

matlab size function throw an exception

I'm trying to get the size of an image in matlab, here is the code:
img = imread('folder\image1.jpg');
size(img);
I'm getting this error :
"Subscript indices must either be real positive integers or logicals"
I dont know why this happens, any help to know the issue would be appreciated
Thanks,
Judging from your comments your error occurs because you overloaded the size function with a variable.

Resources