i want to get contour in foundTemplates
#incode found.sample.contour.SourceBoundingRect is return rectangle
ForEach found In processor.foundTemplates
% Dim foundRect As Rectangle = found.sample.contour.SourceBoundingRect
Dim text AsString = found.template.name
Next
Hi
Great article! have you any publication about this article ?
I was wondering if you could give me any reference(written in English or in Chinese).
Or where can I found this reference?
Thank you for any help you can provide in this situation.
In principle, the theory is simple. It is based on the obvious facts of complex analysis.
But you can see more theorems in this book: Фурман Я.А. "Введение в контурный анализ". Unfortunately it is on Russian only.
Of course it can.
The demo contains augmented reality feature. You can see how it works it at the end of the video.
The implementation see in method DrawAugmentedReality of MainForm ...
Hi
How i can add the opencv_core220.dll,opencv_highgui220.dll,opencv_imgproc220.dll as reference, I'm having this problem "...could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component".i am using VS2010
thanks
This means add files that start with the name Emgu only for the project and copy,past the opencv dll files in the bin folder And Thank you very much for your help
The project is written under FW4. So VS2008 in not supported.
But in general, code is very simple and it can be rewritten under any framework. Complexities can be only with wrappers for OpenCV.
What do you mean?
It is my algorithm. Basics of contour analyse is described in "Введение в контурный анализ", Фурман Я.А. here[^] (russian only).
But there is mathematic only. There are no algorithms, optimization or descriptors...
Can this be used in matching objects from the image itself? For example if there is no template beforehand, we capture one blob from the image and compare it with other blobs in the image and find out how many similar objects with the similar shape are there (regardless of their rotation or scale).
I have tried to develop a solution for my problem using the source code in this project. However I am unable to understand
1- Why the Templates class has initialized the templateSize to 30 ?
2- What does this line do in 'TemplateFinder' line 52
interCorr = template.contour.InterCorrelation(sample.contour).FindMaxNorma();
3- Similarly, in 'ImageProcessor' at line 95, I understand that it creates a template but what is the significance of the parameters being passed.
Template sample = new Template(arr, contour.Area, samples.templateSize);
1- Why the Templates class has initialized the templateSize to 30 ?
See image above (this[^]). 30 is best contour length by ratio succes/fail.
mastercoded wrote:
2- What does this line do in 'TemplateFinder' line 52 interCorr =
template.contour.InterCorrelation(sample.contour).FindMaxNorma();
Method InterCorrelation() rotates the contour and finds dot product between contour and template. Each result is stored in the new contour, which returns the method. Result is array of values described in formula (7).
Next it finds maximum of these values by method FindMaxNorma(). This is result of the formula (8).
Norma of interCorr is rating of similarity between contour and template. Angle of interCorr is angle of best rotation contour relative to template.
mastercoded wrote:
3- Similarly, in 'ImageProcessor' at line 95, I understand that it creates a
template but what is the significance of the parameters being passed.
Template sample = new Template(arr, contour.Area, samples.templateSize);
arr is array of points of source contour. contour.Area is area of source contour. The Template stores it to know area of source contour (it can be useful for following calculations). samples.templateSize is required length of template after equalization. Usually it is 30. Source contour can contain any count of points, but template after equalization will be length 30.
I use your project to detect geometry shapes.
I want to store template objects as is(without serialization) in MSSQL DB.
I have some difficulties to store Imaginary and Real numbers in DB because they have very high precision(17-18 digits after the point).
So my question is if I will store only 15 digits after the point, will this effect on the quality of the shapes recognition?
Excellent!
I want to use it to recognize geometry, like circle, oval, rectangle and so on, it seems not work directly, how could I do?
I think I should change the matching algorithm, so it can recognize rectangle with different length and width, and other geometries.
The Contour Analysis differentiates rectangles with different aspect ratio. So you do not need to change the matching algorithm. Also it differentiates circle and oval, oval and rectangle, etc.
Sorry, I didn't make it clear.
I mean I need to recognize geometries, despite their different aspect ratio or size. Rectangles with different aspect ratio all belong to rectangle, but it's impossible to record all of them in templates database. And keep one rectangle to template database is not work for different rectangles.
So how do I recognize that a shape is one curtain geometry or not.
Thanks very much for your reply.
Your Sample is excellent.Thank you for your sharing.I want to recognise a rectangle from an Image,I don't no how to extract it from my two-valued Image.I'm a beginner of Image recognition.Can you give me some suggestion or simple sample?Thank you very much!
I load my image A into frame, then I change another image B quickly, and click "create template" button quickly.
I find that sometimes it draw the image A,with image B's contour, sometimes not.
I think it is because the processor's template is lock. it cannot refresh so fast enough.
Do you think so? I am sorry for my bad English.Thanks for your share.
Hi,
This article contains only a demo that demonstrates the algorithm. This is not a complete application. Therefore, there is possible some bugs.
I can not say anything specific to your problem, sorry.
Thanks for your reply. I have solved that problem. In my application, I just need recognize some iamges,so I delete the Application_Idle() method. I plaste the ProcessFrame() to where it needs,then sleep(1500) and open "create templete". I used your code to recognize tire mark, and it works very well. Thank you.
Great job love the program. How would I change the frame feed to an embeded web browser placed into the program.
Or just a rough direction to look in would be great. Have placed an embeded web browser in your program that is displaying a feed from a web camera and would like to have a play getting your software to work on that feed.
Excellent code, it work like a charm.
one small favor to ask, can you compile it for Emgu 2.4.0.1717 and open CV libraries 240?.
I been trying but I just can not make it to work.
I'd change the references on all projects and compile properly (on Debug) but when it run it show below exception
<pre>///<summary> Create a capture using the specific camera</summary>///<paramname="camIndex"> The index of the camera to create capture from, starting from 0</param>public Capture(int camIndex)
{
_captureModuleType = CaptureModuleType.Camera;
#if TEST_CAPTURE
#else
_ptr = CvInvoke.cvCreateCameraCapture(camIndex);
if (_ptr == IntPtr.Zero)
{
thrownew NullReferenceException(String.Format("Error: Unable to create capture from camera {0}", camIndex));
}
#endif
}</pre>
System.TypeInitializationException was unhandled
Message=The type initializer for 'Emgu.CV.CvInvoke' threw an exception.
Source=Emgu.CV
TypeName=Emgu.CV.CvInvoke
StackTrace:
at Emgu.CV.CvInvoke.cvCreateCameraCapture(Int32 index)
at Emgu.CV.Capture..ctor(Int32 camIndex)
at Emgu.CV.Capture..ctor()
at ContourAnalysisDemo.MainForm.StartCapture() in C:\Emgu\ContourAnalysis\ContourAnalysisDemo\MainForm.cs:line 94
at ContourAnalysisDemo.MainForm..ctor() in C:\Emgu\ContourAnalysis\ContourAnalysisDemo\MainForm.cs:line 57
at ContourAnalysisDemo.Program.Main() in C:\Emgu\ContourAnalysis\ContourAnalysisDemo\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.DllNotFoundException
Message=Unable to load DLL 'opencv_core240': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Source=Emgu.CV
TypeName=""
StackTrace:
at Emgu.CV.CvInvoke.cvRedirectError(CvErrorCallback errorHandler, IntPtr userdata, IntPtr prevUserdata)
at Emgu.CV.CvInvoke..cctor()
InnerException:
It would seem this would be a good tool to detect if only a single "X" (a big one across most the page, corner to corner) is on the page?
What I have in mind is batch scanning of documents with an "X" page inserted between like-grouped document sets, such as
DocSet_PersonA
X-page
DocSet_PersonB
X-page
DocSet_PersonC
X-Page
I could then be able to organize the DocSets accordingly.
Also, can this solution be used to detect if a page is blank (including no graphics or characters)?
Char thin
1.
can CA run correctly on char's after thinging, means,
the char's template will be feeded, with thin'd char's (one pixel 'curves')
2.
what is the function to feed image templates (labeling)
so it can be compared, by CA with 'data' char images ?
I have done OCR work with contour tracing in the distant past, so I can appreciate his innovative approach here using complex numbers as simply brilliant.