Board index » delphi » Find images count in a bigger image...
Vladimir Alexandrov
![]() Delphi Developer |
Sat, 11 Sep 2004 19:43:23 GMT
|
Vladimir Alexandrov
![]() Delphi Developer |
Sat, 11 Sep 2004 19:43:23 GMT
Find images count in a bigger image...
Hi,
I have taken a image from another window which do not belong to my application and contains a lot of smaller images(like parts of a chess desk).What I want to do is get the count of the smaller images within the the big image(in other words to get the count of the equal looking cells within the chess grid). I thought when I have the smaller image I can somehow compare pixels but that seems to be a bad idea. I have no experince with graphics so I thought it will be better to ask. Any better ideas,examples,components are welcome. Thanks --- |
Jens Grusche
![]() Delphi Developer |
Mon, 13 Sep 2004 03:14:01 GMT
Re:Find images count in a bigger image...Quote> I have taken a image from another window which do not belong to my how the image you are searching for looks like, it is relatively easy. Something like (pseudo code)... Found := 0; I have not tested this algorithm! Jens |
Vladimir Alexandro
![]() Delphi Developer |
Mon, 13 Sep 2004 06:35:12 GMT
Re:Find images count in a bigger image...Thanks for the answer Jens! I tryed your suggestion but could not get it to work.(maybe because I do not understand the idea of the algorithm as I am new to graphics handling using Delphi) Maybe I can make myself clearer in what I want. I have a small 30x30 pixels procedure TForm1.Button1Click(Sender: TObject); showmessage(inttostr(found)); Can you take a look at it and see what is wrong? Thanks |
Nils
![]() Delphi Developer |
Tue, 14 Sep 2004 03:23:42 GMT
Re:Find images count in a bigger image...Hi Vladimir, As long as you're looking for *exactly identical* parts in the image, 1) First of all, change all Pixels[x,y] to Scanline routines. 2) Since you are looking for occurance of a certain sequence: Suppose that your first scanline (top pixel row of the small image) is You will want to find the occurrance of this "search string" inside the How to do that? The approach by Jens is the "classical search algorith". But FastStrings by Peter Morris, found on www.stuckindoors.com where you can find an example of the Boyer Moore algorithm. You will have to If you want to find occurances that are *similar*, then you need to consider By the way, if you want to play an intelligent version of the checkers game (grin) Nils QuoteVladimir Alexandrov <valexandrovNOS...@hotmail.com> wrote in message Quote> Thanks for the answer Jens! |
Vladimir Alexandro
![]() Delphi Developer |
Tue, 14 Sep 2004 18:44:38 GMT
Re:Find images count in a bigger image...Hi Nils, Thanks for the great info. I tryed to make what I want using ScanLine. But I have a bit stupid question: How do I make the bitmap to a string? And also how do I get from ScanLine to the string which I will search for in the complete string of the main image. I have never used ScanLine and in the help there is just a very simple example which didn't help me a lot. I will try to search google and other sites to see if I will find some examples. Thanks. Quote"Nils" <n.ha...@quicknet.nl> wrote in message news:3ca36c96_2@dnews... |
Nils
![]() Delphi Developer |
Wed, 15 Sep 2004 21:40:50 GMT
Re:Find images count in a bigger image...There are some very good scanline examples on Earl F. Glynn's site. Nils QuoteVladimir Alexandrov <valexandrovNOS...@hotmail.com> wrote in message Quote> Hi Nils, |
Vladimir Alexandro
![]() Delphi Developer |
Thu, 16 Sep 2004 20:24:31 GMT
Re:Find images count in a bigger image...Quote> There are some very good scanline examples on Earl F. Glynn's site. --- |
1. Placing a small bitmap image inside a bigger bitmap image
2. Image, Hot Image and Disabled Image
3. How to count objects in a digital image
4. Image[count]!=Image1...Image33
5. Trivial:Counting clWhite in Thresholded Image
6. Q: Loading big files to SQLever image fields
8. a big problem working on images