COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### histogram difference

• Email
• Follow

```%
% Input = image (HxWxD)
% e.g.
%   % compute 16x16x16 colour histogram of the image
%   h = getPatchHist(im, 16);
%
% Output = 1D histogram vector, h
%
%   size(h) ==> (bins^D)x(1)
function h = getPatchHist(clip, bins)

if (nargin <= 1)
bins = 8;
end

z = size(clip,3);
clip2 = zeros(size(clip,1),size(clip,2));

f = 1;
for i = 1:z
clip2 = clip2 + f*floor(clip(:,:,i)*bins/256);
f=f*bins;
end

h = hist(makelinear(clip2), 0:(f-1));
h = h / sum(h);

can anyone explain me how the above code is working to calculate the histogram of a color image. just tell me wht the for loop is doing ?
```
 0
Reply kiran8049 (5) 5/11/2011 7:07:02 PM

See related articles to this posting

```It's basically concatenating the histograms of the 3 color channels
together into one 1D hist that is 3 times as long.  So clip2 will have
the red values in the range 0-15, the green values in the range 16-31,
and the blue values in the range 32 - 47.  Taking the hist will give
you a 1D histogram with values in the range 0-47 with the values
representing the color channels.

I don't see the use of doing it this way rather than the
straightforward intuitive way.
```
 0
Reply imageanalyst (7622) 5/11/2011 9:00:59 PM

1 Replies
47 Views

Similar Articles

12/13/2013 5:32:26 PM
[PageSpeed]

Similar Artilces:

Different Syntax for Different Assemblers
Hi all, I've just started learing assembly language and have obtained some tutorials and the MASM assembler for use. However, the tutorials assume that the reader have the TASM. I just want to know whether different assemblers( here MASM and TASM) have different syntax for the assembly code or not. Also if the code written for TASM is incompatible with MASM then what can I do to solve the problem? Many thanks in advance, James "James" <spamtrap@crayne.org> wrote in message news:1118851680.920342.142400@g44g2000cwa.googlegroups.com... > Hi all, > I've just sta...

Different sessions in different windows?
Hi all, The title says it all - I'm doing sessions with cookies. I can divide the data within the session easily enough but I can't see when the user creates a new window or closes an old one. TIA, C. What happens on the client web browser is not necessarily communicated to the web server. You cannot tell when the user creates or closes a browser window as nothing is sent to the server. The only time that the server knows what happened is when it receives an HTTP request (using either the GET or POST methods). -- Tony Marston http://www.tonymarston.net "Colin McKinno...

Help w/ Difference-in-Difference
Hello, I am trying to estimate a difference in difference regression in SAS but am not having much luck. I was hoping someone could advise me on how to code for the variables I am using (I know how to interpret but not run:( ) My study is on the effects of welfare reform on labor force participation and hours worked by single mothers w/ <h.s. diploma. I am using two control groups one married mothers w/ less than h.s. diploma, one single mothers w/ greater than h.s. diploma. I have two sets of individual data downloaded from the March CPS supplement and the following variables...

Different options for different modes?
Hi, I have need of different options for different modes. For example, the tab key should result in 4 ' ' characters when editing a C file but should insert a literal tab character when editing a ruby file. Would Someone be in a position to point Me towards the portion of the documentation which shows how to do this by means of entries in My .emacs file? (I have searched for this information to no avail.) On 2011-09-23, winkerbean <frankdmartinez@gmail.com> wrote: > I have need of different options for different modes. For example, the > tab key should result in 4 ' ...

Different Versions and Different Platforms
I have written a book and have hired a disigner to arrange my ideas for the cover in a way that works. He is working in PhotoShop 7.0 for MAC. I have PhotoShop 5.0 for PC. He tells me that he can't save his work in a format that I can bring up in 5.0. One method of solving this problem is for him to save each layer in jpeg format and let me assemble them. However, that strikes me as convoluted. Is there a simple solution to this problem? Many thanks. Robert E. Graves The Art of Psychic Dice Awaken the untapped psychic power within you to master the material world with your thoughts. ...

histogram
cud anybody help me implement Histogram Equalization using Neighborhood Metrics On Mar 25, 4:17=A0pm, afzu <afzal....@gmail.com> wrote: > cud anybody help me implement Histogram Equalization using > Neighborhood Metrics I'm not exactly what you're doing but take a look at ADAPT_HIST_EQUAL. From the help: The ADAPT_HIST_EQUAL function performs adaptive histogram equalization, a form of automatic image contrast enhancement. The algorithm is described in Pizer et. al., "Adaptive Histogram Equalization and its Variations.", Computer Vision, Graphics and...

FormatPercent rounds differently on different computers?
I have two machines, and FormatPercent() returns different values on the different machines. I'm using vb6. Machine 1 is an AMD64 laptop with XP sp2. ?formatpercent(.225,0) 23% Machine 2 is an intel pentium 4 desktop with XP, but no sp2 ?formatpercent(.225, 0) 22% Why is one machine rounding up, and the other rounding to even (banker's rounding)? ...

same executable on different systems different results
Please pardon the intrusion, I don't know which newsgroup this question belongs in. I have a large set of executables running on two different workstations. One is Red Hat 7.2, Linux 2.4.17. The other one I can't check right now, but it's very comparable. I have a set of 35 runs that I use for quality checking, and 32 of the 35 runs are identical between the two sets. However, three are different. They are not drastically different, just slightly different precisions. What would cause identical executables (ftp-d, so I know they are the same) to sometimes give different prec...

different size limits for different users
Given multiple classes of users, is there some way I can enforce different size limits? I.e. store the SIZE parameter from MAIL FROM: and at RCPT TO time find out what class the recipient is in, check to see if the message will be too big for the class and reject the receipient if it is? I'm wondering if there would be any way to do this with sendmail rules? Using a milter would be a secondary option. In article <41fcbff8@news.victoria.tc.ca> jnemeth@vtn1.victoria.tc.ca (John Nemeth) writes: > Given multiple classes of users, is there some way I can enforce >differ...

On redhat, different users = different @INC
Hi, We have RedHat 4EL and perl 5.8.5. Per a user's request I installed Date:Simple, using perl -MCPAN -e shell as the root user. Now root can find Date::Simple, but other users cannot. They do not want to include a lib statement in their scripts or invoke with a -I. The @INC libraries are close, but not identical. Does anyone know how to correct or resolve this? Any suggestions would be appreciated. Best regards, Russ On Aug 20, 3:00 pm, Russ <russell.bro...@perdue.com> wrote: > We have RedHat 4EL and perl 5.8.5. Per a user's request I > installed Date:Simple, us...

Different icons/.\panels on different desktop
Hi, how can I have different icons on different desktops (simmilar to having differnt backgrounds)? And same quesion about panels, and panel icons. -- Pozdrawiam, Rafaï¿½ Maj (w budowie: http//www.raf256.com/me-news/) ...

Different tab-widths for different projects?
I code for two different software projects that have different coding styles. It all comes down to 2 vs 4 spaces as tab-width. How do I switch most easily? Can I set up my emacs so that the C++ mode automatically uses tab-width 2 for files in the ~/project1 folder and tab-width 4 for files in the ~/project2 folder? Thanks! Andreas Schmidt <schmidt.2004@gmx.de> writes: > Can I set up my emacs so that the C++ mode automatically uses tab-width 2 > for files in the ~/project1 folder and tab-width 4 for files in the > ~/project2 folder? You can use two different ways. By F...

Different MTUs for different peers on the same LAN?
Like most others, we have a mixture of different NICs on the LAN, most of them not capable of the Jumbo Frames. Yet some boxes -- servers especially -- have newer NICs capable of 8-16Kb per frame, and our new switch can pass 9K frames. Can we somehow tell these servers, that larger Ethernet frames can be used, when talking to some machines (like fellow servers), but that the traditional 1500 bytes should still used for the rest? Obviously, we don't want to partition the LAN into subnets, which would be pessimal anyway because the (new) router would have to split the large frames into sm...

different bits of text in different colors?
Is there any way to display different bits of text in a Tk button, label, or menu button widget in different colors? As far as I can tell, the answer is no - you've just got a foreground color and a background color. It looks like the only way to do this would be to use a text widget and get the different colors via tags, which may not work nicely for my purpose. In the alternative, is there a Tcl/Tk internal way to obtain the image corresponding to a character so that one can manipulate the glyph as an image? My reading of the documentation for font and image doesn't reveal anything...

where is the difference
1. #include <iostream> using namespace std ; namespace PSPL { int y = 0 ; } namespace P = PSPL ; namespace { int y = 3 ; } void Fn() { cout << y ; } int main() { using namespace P ; Fn() ; return 0 ; } Output of this program is 3. 2. #include <iostream> using namespace std ; namespace PSPL { int y = 0 ; } namespace { int y = 3 ; } int main() { using namespace PSPL ; y = 3 ; cout << y ; return 0 ; } Output of this Program is compile time error. what/where is the Differnece between these two code fragments plz anybody help me to explain the differece. ...

Different document classes rendering figures different?
Hello, I'm composing a thesis and an article at the moment. For some reason, figures I've created in MATLAB with the aid of LaPrint.m render perfectly in my document with \documentclass[12]{article}, as shown here: http://www.prism.gatech.edu/~gtg611a/TeX/good.jpg However, when using \documentclass[12]{gatech-thesis}, the legend font increases and I get this: http://www.prism.gatech.edu/~gtg611a/TeX/bad.jpg The gatech-thesis.cls files and all related files can be found here: http://www.prism.gatech.edu/~gtg611a/TeX/gatech-thesis.zip The figure created using the following input ...

The Difference
The difference between Apple Computer and acceptable conduct is the difference between cunnilingus and cartography. "Bret Ludwig" <bretldwig@yahoo.com> stated in post 1124510233.347953.223100@z14g2000cwz.googlegroups.com on 8/19/05 8:57 PM: > The difference between Apple Computer and acceptable conduct is the > difference between cunnilingus and cartography. > Do you have a problem with any of the four? -- Life is not measured by the number of breaths we take, but by the moments that take our breath away. _________________________________________ Usenet Zon...

FFT Different APIs Returning Different Results
Hi All, I prototyped a piece of code using FFTW and it works great and I'm now trying to port it to the iPhone. The iPhone has it's own DSP library written by Apple which they say is 5x faster than the best competitor. However, when I pass the same data (exactly) into their routine I get a different result set (though interestingly if I graph the data they look similar). My question is... should all FFT implementations return the same results not withstanding a little rounding? Or can the results vary so dramatically? The values coming back from the Apple library are ...

Different results with the same code on two different machines
Hi everyone, I had an unusual encounter in the lab where I work at. I'm using the same m-file on two different machines below and I'm getting different results. This is not the first time by the way, so there must be something systematic that is happening. 1. Pentium dual core CPU, E5200 @ 2.5 GHz, 3.23 GB of RAM with matlab 7.5.0.342 (R2007b) version 2. Intel (R) core(TM)2 quad @ 2.66 GHz, 2.67 GHz 2.34 GB of RAM with matlab 7.4.0.287(R2007a) version. I'm already planning to install the same updated matlab version on both computers, but I thought the problem might be somewhere el...

different MIDI formats -- what's the difference?
Hello, Can someone please direct me to a resource where I can learn the differences between the different MIDI formats available? In particular, if I want to post a MIDI music file on a webpage, is one format considered more accessible than others? Thank you very much! Ted Shoemaker <shoemakerted@yahoo.com> wrote in message news:1153249009.680754.167730@h48g2000cwc.googlegroups.com... > Hello, > > Can someone please direct me to a resource where I can learn the > differences between the different MIDI formats available? In > particular, if I want to post a MIDI mu...