Jul 25, 2008

Image Analysis

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > VB Programming

free web hosting

Image Analysis

imacul8
Just wondering if anyone has had any experience in picture analysis in VB6.

Need to scan a image and compare it to a different image and the co-ords of the place where the image differs in color too the original.... shouldnt be to hard but ive not had much experience with this sorta stuff

any help would be great smile.gif

Reply

Galahad
Well, the best way would be to directly decode original picture, and scanned one, into some sort of pixel matrix, and compare them... Since I have absolutely no idea how to decode images into plain pixels, I'll post the way I'd do it...

Use two Picture boxes, let's name them Picture1 and Picture2... Load original picture into Picture1, and scanned one into Picture2... Now, what you need to do, is set picture boxes' properties, autosize to true, and autoredraw to true, and scalemode to pixel..

Next, your code would look something like this:
CODE

Dim x1 As Long, y1 As Long ' *** Picture1 Coordinates
For x1 = 0 To Picture1.ScaleWidth
    For y1 = 0 To Picture1.ScaleHeight
        If Picture1.Point(x1,y1) <> Picture2.Point(x1,y1) Then
            ' *** Do whatever you need to do if pixels are different
        Else
            ' *** Do whatever you need to do if pixels are the same
        Endif
    Next y1
Next x1

I believe this would work, but don't take my word for it... This would be the basic concept, which ofcourse assumes that two images have the same dimensions... This metod is slower than the method I described, where you would compare matrices of two pictures...

If this works, let me know... Or if you have any more questions... Ask them here, or drop me a PM...

 

 

 


Reply

imacul8
Well yea that method would work if i had two pictures... But i only have one to work with and it can be a random picture (like 5 different possibilities) so i cant compare the two images to find the difference. I have to scan the picture looking for a specific color...

I dont think i will worry bout it, all seems to hard :\

Reply

shadowx
Well if you want to look for a certain colour surely you could use some cod similar to that already posted. first of all find out the colour values in pixel terms for the colours you want to look for then use a modified version of the code above to search each pixel for this colour. And you could always look for more than one colour if you needed to scan for all dark shades of red for example.

Im not sure how the code would look but atleast it gives an idea of the structure to the code smile.gif Dont give up, keep looking!

Reply

imacul8
Thanx for the suggestions and ive basically got what needs to be done in my head just cant get it into the code... The colour i need to search for also changes and the contrast or whateva of the pic also changes sometimes its light etc.... i think i need to have the several different images saved and first of all try find which one it is, then using that match the difference between the 2...

If u have any more info on this please show me smile.gif

Reply

Galahad
Well... Ummm... Maybe you could give me some more info? Like, what's the type of the pictures? Do they have some sort of background, or something...

If they have background, and the color of background changes as contrast changes, you could just check 1st pixel, and find appropriate picture, from your picture base (no matter how many pictures you have there)

If the color you search for changes, do you know in advance what it is? If you do, you could just add a textbox, where you could enter color-code you're looking for, or add some sort of color picker...

Then, are you looking for a specific, exact color match, or are different shades allowed... If you don't need exact shade search, then you'll have a bit more programing to do, since you would need to check each pixel against a range of colors...

that would be about it... I never did any image analysis program, so I'm just talking theory here, and I most certainly won't be able to help you with any advanced code, but I'll do all I can...

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Recent Queries:-
  1. image analysis vb - 8.48 hr back. (1)
  2. compare images in vb6 - 10.98 hr back. (2)
  3. how to vb5 analyze a picture - 56.79 hr back. (1)
  4. compare pictures and looking for changes vb6 - 103.26 hr back. (1)
  5. picture1.point is -1 problem - 118.48 hr back. (1)
Similar Topics

Keywords : image analysis


    Looking for image, analysis

Searching Video's for image, analysis
advertisement



Image Analysis



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE