Jump to content

  • Log In with Google      Sign In   
  • Create Account


Quick question I had today.


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
12 replies to this topic

#1 Marzdor   Members   -  Reputation: 180

Like
0Likes
Like

Posted 14 October 2013 - 01:41 PM

Hey I was just wondering if it is possible to scan a picture (lets say a .jpg) and scan it to look for a specific thing in the picture.

 

 

For example lets say i have a folder with 100+ .jpg files that and i want to scan them all for the word "One Piece" so that they can be filtered out to a sub folder called "One Piece".  

 

 

 

With Python as the language being used. (If not Python then name one that could do it)


Edited by Marzdor, 14 October 2013 - 01:42 PM.


Sponsor:

#2 Paradigm Shifter   Crossbones+   -  Reputation: 5202

Like
0Likes
Like

Posted 14 October 2013 - 01:46 PM

Not easily. Depends on the font, the font size, whether the font is antialiased, how lossy the compression is (causing artifacts), the rotation of the letters, etc.

 

It's pattern recognition/optical character recognition which is complicated and rarely 100% accurate unless you put unrealistic or simplifying constraints on the content of the image.

 

Case study: there is software which attempts to filter out pictures of nudie ladies/men which often gives false positives for various dessert foods (trifle, blancmange, cherry topped cakes, etc.). Also have a go at google image search "show similar pictures" when you drag a picture onto the search box.


Edited by Paradigm Shifter, 14 October 2013 - 01:48 PM.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

#3 Marzdor   Members   -  Reputation: 180

Like
0Likes
Like

Posted 14 October 2013 - 02:09 PM

Ok thanks that basically told me what i needed to know so i should try another way of doing it then.



#4 Paradigm Shifter   Crossbones+   -  Reputation: 5202

Like
0Likes
Like

Posted 14 October 2013 - 02:16 PM

Things like automatic online poker playing bots only search for a few pixels from the card numbers/letter/suit colour and test just those pixels in a certain location so they can recognise a card from known reference deck images as well (so they cheat and don't scan the whole card- just enough pixels to disambiguate any 2 cards).

 

The best pattern recognition computer is your brain when connected to your eyeball input devices; my advice - do it manually if you must (or pay someone else to do it for you ;)).


Edited by Paradigm Shifter, 14 October 2013 - 02:16 PM.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

#5 swiftcoder   Senior Moderators   -  Reputation: 9723

Like
0Likes
Like

Posted 14 October 2013 - 03:12 PM


do it manually if you must (or pay someone else to do it for you ;))

It's a vastly underestimated resource: mildly-skilled computer users are dirt cheap in most of the world.

 

Contrary to popular myth, Interns are not terribly cheap. And can land you in a whole world of legal trouble when unpaid.


Edited by swiftcoder, 14 October 2013 - 03:13 PM.

Tristam MacDonald - Software Engineer @Amazon - [swiftcoding]


#6 Paradigm Shifter   Crossbones+   -  Reputation: 5202

Like
1Likes
Like

Posted 14 October 2013 - 03:15 PM

I'm not going to pay someone in (insert cheap outsourcing country here) to look at my dessert picture folder and categorise it into blancmange/trifle/cherry cakes for me though ;)


"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

#7 swiftcoder   Senior Moderators   -  Reputation: 9723

Like
0Likes
Like

Posted 14 October 2013 - 03:19 PM


I'm not going to pay someone in (insert cheap outsourcing country here) to look at my dessert picture folder and categorise it into blancmange/trifle/cherry cakes for me though ;)

Why not, though?

 

You can spend an hour of your own time, which is worth, what, $50? Or you could pay a student/foreigner $10/hour for 2 hours...

 

Apologies for being entirely off-topic at this point.


Edited by swiftcoder, 14 October 2013 - 03:20 PM.

Tristam MacDonald - Software Engineer @Amazon - [swiftcoding]


#8 Paradigm Shifter   Crossbones+   -  Reputation: 5202

Like
0Likes
Like

Posted 14 October 2013 - 03:22 PM

I'm not the OP, for a start, I just answered the original question and started off the dessert theme and continued it for several posts too many I think ;) Some desserts are not suitable for viewing by sensitive and/or prying eyes.


"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

#9 swiftcoder   Senior Moderators   -  Reputation: 9723

Like
1Likes
Like

Posted 14 October 2013 - 03:31 PM

That's why they invented anonymity and the internet blink.png

 

Back on topic: the largest collection of data/algorithms in this topic is probably the efforts of people trying to defeat CAPTCHA images.

 

There is a handy overview of the topic here.


Tristam MacDonald - Software Engineer @Amazon - [swiftcoding]


#10 Paradigm Shifter   Crossbones+   -  Reputation: 5202

Like
2Likes
Like

Posted 14 October 2013 - 03:41 PM

I think those are specifically designed to defeat my brain and eye peripherals too. They are still pretty contrived (in terms of unrealistic/simplifying constraints after all, they are generated by a computer algorithm) compared to the more general problem of identifying text from an arbitrary image.

 

Maybe if the OP described the problem in more detail it may help (e.g. is it a caption on a video still, logo or text appearing in a video, just reading arbitrary handwritten text from a picture). EDIT: Then we can say "It's just too hard!" with more confidence ;) EDIT2: Then direct them over to the AI forum where AI Dave can say the same thing but mention neural nets and stuffs ;)


Edited by Paradigm Shifter, 14 October 2013 - 03:46 PM.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

#11 kd7tck   Members   -  Reputation: 715

Like
0Likes
Like

Posted 14 October 2013 - 08:41 PM

This is best solved with machine learning.



#12 TheComet   Members   -  Reputation: 1438

Like
0Likes
Like

Posted 16 October 2013 - 06:45 AM

You're going to spend far more time on writing a program than actually just doing it yourself in this situation. As mentioned before, you require a fuzzy computation of the image, because there are too many factors and imperfections (lighting, contrast, projection, compression loss, etc. etc.)


YOUR_OPINION >/dev/null


#13 samoth   Crossbones+   -  Reputation: 4628

Like
1Likes
Like

Posted 16 October 2013 - 08:22 AM

You're going to spend far more time on writing a program than actually just doing it yourself in this situation.

 

From my experience, that is very much true for outsourcing the job, too. You first spend 2 hours writing a process document, or alternatively you spend 2 hours to train that person (for something you could have done yourself in 2 hours, too). Then the person says that they've understood the task, and a week later you get back something which isn't necessarily what you asked for. So you pick up the phone for a "WTF is this shit?" call, and waste another 15 minutes to find out that they hadn't understood what you were asking but said "yes, yes" anyway. So you explain it again, hoping they do it right this time. And if you're particularly unlucky, their supervisor hears about it, and asks for another call to discuss the issue, for customer satisfaction, you know. Which means you waste another hour for nothing.

 

But back to topic: Finding all images with "One Piece" in them sounds like it's maybe a simple special case of a very complicated problem (e.g. photos from collectible cards or such, which are all somewhat similarly colored (cartoon image!) and all have one somewhat identical region).

In that case, you can probably get away with first pruning everything that's obviously not what you want using a histogram, and then matching sub-regions of a very downsampled version of the image. The logo area will have the same averaged color (or very nearly so) in every photo if it's for example downsampled 16 or 32 times (or more), even if there are some variations.

 

Such as for example in this One Piece photo that I stole from the internet, the "mostly black" area with the "mostly blue and some black" logo will result in two black squares left and right of a dark blue square:

 

(seems like the gd.net server doesn't like me posting images directly, so here it is...)

 

ffme.png


Edited by samoth, 16 October 2013 - 08:26 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS