|
Hello
iam of student of BS compSc ,im working on my final project that is"Histogram-Based Fuzzy Filter" trying to implement research paper, but i m facing alot of problem do not know how to encode in C#,
i have done some work on image like conversion of rgb image into grayscale ,and also draw its histogram but no succes towards implementing this papper,
i have to complete this project in a 15 days
plz help me
-- modified at 1:50 Tuesday 29th August, 2006
|
|
|
|
|
Hello
Your title was quite clear in stating that you are facing a problem with images -and this is the C# forum BTW. Welcome -
Yet, your post itself didn't specify what exactly are you stuck with??
Asma Saleem wrote: i m facing alot of problem do not know how to encode in C#
At All?!! And what exactly are you expecting??
Asma Saleem wrote: plz help me
We realy want to help -that's why we are here after all-, but how??
Regards
|
|
|
|
|
plz help in converting code from matlab to C#, i m sending u code as i told im working in image processing , ihave done all work in matlab but now i hve convert it in to C# Code is below
%Reading image file and storing it in a variable.
imagex=imread('D:\MS_courses\ece655\Project\test_images\test_image3.jpg');
%RGB2GRAY converts RGB images to grayscale by eliminating the
%hue and saturation information while retaining the luminance.
%im2double takes an image as input, and returns an image of class double.
f = im2double(rgb2gray(imagex));
%f=[.1,.2,.3;.4,.5,.6;.7,.8,.9];
%Storing the number of rows and columns in separate output variables
[sizeM, sizeN] = size(f);
%Counter is used just to check the status of the program at all times.
counter = 0;
%for k=1:1:256
%gvalue_f(k) = 0;
%gvalue_N(k) = 0;
%end
%--------------------------------------------------------------------------
%This loops makes a window of 3*3 and scans over the image from left to
%right and top to bottom to get those pixel values that are most probably
%a function of Impulse, called Nimp.
for x=2:1:(sizeM-1)
for y=2:1:(sizeN-1)
k = x;
l = y;
x1 = f(k-1, l-1); x2 = f(k-1, l); x3 = f(k-1, l+1);
x4 = f(k, l-1); x5 = f(k, l); x6 = f(k, l+1);
x7 = f(k+1, l-1); x8 = f(k+1, l); x9 = f(k+1, l+1);
W = [x1,x2,x3,x4,x5,x6,x7,x8,x9];
x_sum = 0;
count = 0;
x_temp = 0;
wind(1,1) = W(1);
wind(1,2) = W(2);
wind(1,3) = W(3);
wind(2,1) = W(4);
wind(2,2) = W(5);
wind(2,3) = W(6);
wind(3,1) = W(7);
wind(3,2) = W(8);
wind(3,3) = W(9);
for m=1:1:3
for n=1:1:3
x_temp = wind(m,n);
if((x_temp == min(W)) | (x_temp == max(W)))% | (x_temp <= 10) | (x_temp >= 230))
Nimp_sub(m, n) = x_temp;
else
count = count + 1;
x_sum = x_sum + x_temp;
Nimp_sub(m, n) = 0;
end
end
end
%Nimp=size(f);
Nimp(k-1:k+1,l-1:l+1) = Nimp_sub;
counter = counter + 1
end
end
%---------------------------------------------------------------------------
%for k=2:1:sizeM-1
% for k=2:1:sizeN-1
% gvalue_f(f(k, l)) = gvalue_f(f(k, l)) + 1;
% Nimp_db = im2uint8(Nimp(k, l)) + 1;
% gvalue_N(Nimp_db(k, l)) = gvalue_N(Nimp_db(k, l)) + 1;
%end
%end
%Calculating the histograms of input image and Nimp (those pixels in the image
%which are most probably members of impulse noise).
temp_hist_f = hist(f, 256);
temp_hist_imp = hist(Nimp, 256);
for i=1:1:256
hist_f(i) = sum(temp_hist_f(i, );
hist_imp(i) = sum(temp_hist_imp(i, );
end
imshow(imagex);
title('Original Image');
figure;
imhist(imagex);
title('Histogram of Noise Added Image');
figure;
imhist(f);
title('Normalized Histogram of Noise Added Image');
figure;
|
|
|
|
|
Hello
I've never worked in Matlab -I'm a C++, C# developer-, so the code above is very unfamiliar. Yet I can get a grasp of what you are trying to do.
One Question:
Did you ever program in C#??
If you're asking someone to build your program from the scratch!! It's highly unlikely to find him here!! Sorry!
Regards
|
|
|
|
|
Hello,
I am aware of that I can open a website using the following snippet using MS IE,
System.Diagnostics.Process.Start("iexplore", "http://www.google.com");
But I dont want to specify Internet Explorer, I want to open the link using any installed default website explorer of the user.
Would anyone please give me an idea.
Thanks
|
|
|
|
|
In .NET 2.0 you can do this....
Help.ShowHelp(this, "http://www.google.com");
Steve Maier, MCSD MCAD MCTS
|
|
|
|
|
Hello
You can also do that in .Net 1.0 and 1.1 frameworks. Simply don't specify your application:
Process.Start("http://www.google.com.eg");
This way you are telling the "Windows Explorer" to open this "Document" -whether it's a website, pdf, image, etc...-. Windows Explorer doesn't open anything by itslef, rather it opens the default viewer associated with this type of "Document". In our case it will open the default web browser.
BTW: I use FireFox. And it works!
Regards
|
|
|
|
|
Hi Nader,
Thanks, IT REALLY WORKS....
|
|
|
|
|
Hi, folks!
I've made a sub-class of the System.Windows.Forms.RichTextBox called "MyRtfBox". Within my rtf box, I want to add a few properties which allow me to directly access some of the advanced properties of the rtf textbox, such as line count, getting the scrollbar thumb's position, etc. I'm glad to say that I've figured all of that out, EXCEPT for how to get and set the display rectangle using Windows Forms Messages!
I've looked all over the web and can't find any articles anywhere in C# that show how to use these two Messages. The examples I've seen in C++ and VB don't seem to translate well to C#. Does anyone have a clue?
When it's all set and done, I'd like to have a sub-classed RTF box with this public property...
//Taken from the Windows constants list.
private const int EM_GETRECT = 0x00b2;
private const int EM_SETRECT = 0x00b3;
public Rectangle DisplayRect
{
get
{
Rectangle rect = new Rectangle();
//Send a message to Windows somehow!
return rect;
}
set
{
//Send a message to Windows using the given Rectangle parameter.
}
}
Many thanks!!
Anthony
|
|
|
|
|
Okay, don't get hung up on the fact that I called the public property, "DisplayRect". I know there's already a public property on RTF boxes called DisplayRectangle.
The point of this exercise is to understand how to use the 2 Windows constants in sending messages to Windows asking for this info, and then setting a new value. Since there doesn't seem to be any other C#-specific examples out there in the world, this would be *really* useful!
Thanks!
Anthony
|
|
|
|
|
Hi!
I'd suppose you can use EM_GETRECT and EM_SETRECT just like any other windows message sent to your RTB.
The declaration of SendMessage is something like this:
[DllImport("user32.dll")]
private static extern int SendMessage(IntPtr hWnd, int msg, IntPtr wPar, IntPtr lPar); Then you can use this function to send the messages to your RTB. The last parameter (lPar) is used for the rectangle. You can use the Marshal.StructureToPtr() and Marshal.PtrToStructure() methods to transfer the rectangle data to your working structures.
That should do the trick...
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
I got an app where I use the backgroundworker and when it's done it fires off the BackgroundWorkerCompleted event. Which is all good. but I need to reused the object later on. I get an exception that the BackgroundWorker has already completed.
So I tried myBackgroundWorker = new BackgroundWorker(); but none of the events are hooked up any more and it just sits there.
Is there anyway to reset it? or do I have to set all the properties each time I use it?
-Kevin
|
|
|
|
|
kselman wrote: myBackgroundWorker = new BackgroundWorker();
You must reconnect the events, this is a new instance of BackgroundWorker. You can't rest the original because the thread has already completed its work and has been returned to the pool.
only two letters away from being an asset
|
|
|
|
|
If you're re-starting the worker with RunWorkerAsync() the only exception would be InvalidOperationException, which means the worker is still running (IsBusy is true).
What exception are you getting?
--Bob
|
|
|
|
|
Welp.. Its working now.. not sure what was going on with it before. Unfortunately I changed too many things between testing and Im no longer receiving the Exception. It said something about "Background Worker has already completed"
I think was I calling ReportProgress during the Completed event.. but I tried to recreate the problem to report to you here.. but that didnt cause the exception. I also had a pointer to a helper class that was init'd outside of the DoWork function, but I put that back in and it still works.. *shrug* sorry.. i usually dont jump the gun and post a request for help.. but It sure seemed that I could not re-use the B.W. with out hooking its events back up. Which is not the case.. Just calling RunWorkerAsync() re-runs it as expected.
You reply did help, because you seemed confident to be able to re-use RunWorkerAsync and sure enough the problem was on my end..
Thanks for the quick replies..
-- Kevin
|
|
|
|
|
Good to hear it's working. I have an instance of a class which is a subclass of BackgroundWorker that reuses DoWork many many times. Never had a problem with it.
- Bob
|
|
|
|
|
How should i insert a word document into database.
I defined a Blob field in the database and i used this code
FileStream fls;
fls = new FileStream(path, FileMode.Open, FileAccess.Read);
byte[] blob = new byte[fls.Length];
fls.Read(blob, 0, System.Convert.ToInt32(fls.Length));
fls.Close();
query = "insert into Example(BLOBField)values(:BlobParameter)";
OracleParameter blobParameter = new OracleParameter();
blobParameter.OracleType = OracleType.Blob;
blobParameter.ParameterName = "BlobParameter";
blobParameter.Value = blob;
conn.Open();
cmnd = new OracleCommand(query, conn);
cmnd.Parameters.Add(blobParameter);
cmnd.ExecuteNonQuery();
cmnd.Dispose();
conn.Close();
What am i doing wrong. Its throwing up an error. Is there any other way to do this.
Thanks
Kal
|
|
|
|
|
kalyanPaladugu wrote: Its throwing up an error.
It might be helpful to say what the error is you are getting.
only two letters away from being an asset
|
|
|
|
|
ORA-00600:internal error code, arguments:
[koklgloblen:bnd][],[],[],[],[],[],[]
Thats the error its throwing. Iam able to
insert ordinary values like int and varchar
but not blobs
|
|
|
|
|
I figured out the error. I was able to insert into the database.
My second question is how should i retrieve it from the database.
If i execute the statement select * from table name its showing as orablob in those
columns i inserted. Is that the normal behaviour. Can some body provide the code to retrieve the word document from the database
Thanks
Kal
|
|
|
|
|
kalyanPaladugu wrote: Can some body provide the code to retrieve the word document from the database
Probably
kalyanPaladugu wrote: I figured out the error. I was able to insert into the database.
How about you share your solution. Its called give and take
Objects in mirror are closer than they appear
|
|
|
|
|
Its the same thing. The above code in the first link should work. Previously i was inserting into
two blob fields in the database from the same file stream object and so it failed. So i created
two file stream objects for two blob fields and it seem to work.
So if you run the code as it is i posted it should work as it is only one blob field in the database and one file stream object to load that
Thanks
Kal
|
|
|
|
|
How to retrieve the data from the blob field in the database
Thanks
Kal
|
|
|
|
|
i want to make splash screen to my Winapp
my splash screen first will be with transparent 0
will two 2 the transparent will be 100%
0 , 10 , 20 ,. .. ,100 transparent
how can make thing like this
Palestine
|
|
|
|
|
|