Hello folks, I have a rather large image, whose size is around 6000 x 5000 pixels... I would like to perfom image normalization and other such operations...which include some mathematical calculation for each pixel.. But when I do this on my image, it take about 20 mins to finish... How to speed it up...?? Here is the normalization code which I am running.. public void NormalizeImage(ref Bitmap objBitmap, int iMaxColor) { DateTime dt = System.DateTime.Now; System.Diagnostics.Trace.WriteLine(" Normalizing Image: " + dt); int iX = objBitmap.Size.Width; int iY = objBitmap.Size.Height; int iMaxINTColor = 16777215; try { for (int i = 0; i < iX; i++) { for (int j = 0; j < iY; j++) { int iPrevColorVal = objBitmap.GetPixel(i, j).ToArgb(); //if (iPrevColorVal < 0) // iPrevColorVal = iPrevColorVal * -1; int iNormalizedVal = System.Convert.ToInt32(Math.Pow((iPrevColorVal / iMaxColor), 1)) * iMaxINTColor; objBitmap.SetPixel(i, j, Color.FromArgb(iNormalizedVal)); } } } catch { System.Diagnostics.Debug.Assert(false); } DateTime dt2 = System.DateTime.Now; System.Diagnostics.Trace.WriteLine("Done Normalizing Image:" + dt2); }
safee ullah
Posts
-
Pixel operations on a very large image in c# -
Guys where to put matlab question?Yeah... VC is like eating a badly cooked meal, While Matlab is like visting the Giza pyramids on a month long sub-saharan tour :P So i chose matlab! :)) Btw the squid....welll its like when one tries to eat the pencil rubber in childhood days...its the same with a squid...just the difference being that you dont get rubbed by your mommy for wasting your pencil eraser... :P Btw I have tried raw fish, i.e. sushi ; Live fish, swirling in a pond of blood...so eating squid is like the "aaloo wala paratha or bieryanee" in pakistan :P
-
Guys where to put matlab question?Hi, Guys where to put matlab question? Thanks! safee
-
problem with strings greater then 32ksyes i have it in a bstr...now i need to break that string into 32k segments..for further manipulations.. how to do it? regards safee
-
problem with strings greater then 32kshello there .. there is a slight problem that i am facing with strings greater then 32k i have a variant bstr containing a string which is greater then 32ks.. 1. how do i store this thing? into a buffer?, but then how do i get the size of the bstr string so that i can create a buf of that size? 2. how do i truncate this bstr string into strings of sizes 32ks? thanks for the time regards
-
variant arrays..any place to get detailed info on variant arrays..and how to use them??
-
variant types..hey thanks ian.. one more thing plz..how do i then get the value from this variant? thanks
-
How to Get property value if it returns BSTRu have forgotten the last line return pvResult.bstrval; (offcourse after making your method of the type returning bstr) and if u already have it there in your code..then take a look at the following code, also if it doenot work then try looking into the dispatch map..have u given the correct VTs there for the return type?? //******************************* //body of a method returning BSTR DISPPARAMS * DispParam1 = new DISPPARAMS(); EXCEPINFO excep; UINT nArgErr; VARIANT *pVarRes = new VARIANT(); DispParam1->cArgs = 0; //number of arguments DispParam1->cNamedArgs = 0;// Number of named arguments. DispParam1->rgdispidNamedArgs = NULL; // Dispatch IDs of named arguments. IF1BookImpl::Invoke(DISPID_F1_Text, IID_NULL , ::GetUserDefaultLCID(), DISPATCH_PROPERTYGET, DispParam1, pVarRes , &excep, &nArgErr); delete DispParam1; return pVarRes->bstrVal; //******************************* regards safee
-
Inside Ole Kraig BrockSchmidt, samples neededhi there people.. i lost my cd which came along Inside Ole (MS press) by Kraig BrockSchmidt...any body with a copy... or any link? many thanks
-
Problems with 160 Gb Seagate HDDyes..but the drive is already formated using NTFS..and no file is greater the 800 mbs..
-
Problems with 160 Gb Seagate HDDThanks Guys..and Happy new Year to u all :) The thing with the hard disk is that even after partitioning this problem has continued...mines a 3 years old p3..I upgraded the BIOS as well... so any ideas about what to do after that :) take care guys.. regards
-
Problems with 160 Gb Seagate HDDhi there.. Thanks for your time.. I am facing strange problems with my 160 Gb seagate hard disk. Firstly it was showing it as 134 Gbs , then i installed the SP4 for win 2k Adv Svr. Now it shows it as 160 Gbs. But when the data inside it exceeds 134 Gb, It starts writing on the previously written files hence "pasting" new video data inside the alrady existing videos :)) now when i play that old video , some parts of it are gone and contain new videos from other files which i recently pasted :( PLZ PLZ help me in this..it has been a month..seagates own drive wizard doesnot help too.. thanks regards
-
help in an active x controlhi there.. thanks for your time.. i needed to know if its possible to know if a control is UI Activated already or not? and secondly which function is called when a control is UI DeActivated? regards safee
-
help in an active x controlhi there.. thanks for your time.. i needed to know if its possible to know if a control is UI Activated already or not? and secondly which function is called when a control is UI DeActivated? regards safee
-
Control doesnot show in the UIDeactivated modeguys.. As i wrote earlier..my control doesnot show up when i host the control in the test container...now this is only happening in the UIDeactivated mode.. how can i set my control to draw itself and show in the UIDeactivated mode inside the test container..? thanks again
-
strange problem with activex controlhi there.. guys i wanted to know if u have a control and u place it in a container, but the control doesnt show rather just a boundary rectangle is visible..but when i execute the container with the control..the container is visible.. is it something to do with designmode or something or something else?? thanks
-
any body knowing menu merging?guys.. any body done menu merging for an inplace active control?
-
verbs and shared menus in Active x Controlhi there.. Thanks for the time firstly.. I wanted to know how can u add a shared menu to your active x control..also do we need to attach a verb to be able to use Shared Menus? kind regards safee
-
verbs and shared menus in Active x Controlhi there.. Thanks for the time firstly.. I wanted to know how can u add a shared menu to your active x control..also do we need to attach a verb to be able to use Shared Menus? kind regards safee
-
help needed in an OLE Controlhi there everybody.. wanted some help. ne ideas what can be the problem with mycontrol... it gives a dialog "class not registered" followed by an other one "could not open the document".. any ideas whether there is a problem with the container or the control? and where to debug from ..ne ideas?? thanks..