Identify Different Types of Images
Identify Different Types of Images
I am having images in different formats like screenshots, images having handwritten/lines/shapes and pictures (nature/person/animal). How to identify them individually. Is there any way to do that?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Identify Different Types of Images
This post was not relevant to the topic. So I have moved it and changed the title.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Identify Different Types of Images
There are various techniques for identifying whether a photo contain people or animals etc. These are not simple techniques, and often involve "training" a system.Vanns wrote:Is there any way to do that?
For identifying whether the image is a screenshot, or hand-written shape, or photo, the process may be simpler. Do you have example images?
snibgo's IM pages: im.snibgo.com
Re: Identify Different Types of Images
Picture is
Screenshot is
Line drawing is
Screenshot is
Line drawing is
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Identify Different Types of Images
Code: Select all
%IM%convert screenshot-gimp-windowsvista.png -statistic standard-deviation 3x3 -grayscale Brightness -fill White +opaque Black -negate -format %[fx:mean] info:
0.337484
(Photos have virtually no areas of flat colour.)
The third image is grayscale with a very high mean (96%).
snibgo's IM pages: im.snibgo.com
Re: Identify Different Types of Images
For what parameter this value is evaluated? Can u please explain the command?
One third of the screenshot mean its size or?
One third of the screenshot mean its size or?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Identify Different Types of Images
%IM%convert screenshot-gimp-windowsvista.png : read the image.
-statistic standard-deviation 3x3 : for every pixel, for each colour channel, calculate the standard deviation of a 3x3 square centred on the pixel. Where we have a flat colour, all pixels are the same, so SD=0.
-grayscale Brightness : find the largest of all the colour channels.
-fill White +opaque Black : where a pixel isn't black, make it white. So any pixels with any SD > 0 will become white.
-negate : makes black into white and white into black. Now, any pixels with any SD > 0 will be black. Pixels with all SD=0 are white.
-format %[fx:mean] info: : Find the mean. As all pixels are either black or white, this is the proportion of pixels that are white.
So the answer, 0.337484, means that one-third of the pixels are the centre of 3x3 pixel squares where all 9 pixels are the same colour.
-statistic standard-deviation 3x3 : for every pixel, for each colour channel, calculate the standard deviation of a 3x3 square centred on the pixel. Where we have a flat colour, all pixels are the same, so SD=0.
-grayscale Brightness : find the largest of all the colour channels.
-fill White +opaque Black : where a pixel isn't black, make it white. So any pixels with any SD > 0 will become white.
-negate : makes black into white and white into black. Now, any pixels with any SD > 0 will be black. Pixels with all SD=0 are white.
-format %[fx:mean] info: : Find the mean. As all pixels are either black or white, this is the proportion of pixels that are white.
So the answer, 0.337484, means that one-third of the pixels are the centre of 3x3 pixel squares where all 9 pixels are the same colour.
snibgo's IM pages: im.snibgo.com
Re: Identify Different Types of Images
But when I tried with my laptop's screenshot, it is showing 0.886308
It is not around 0.33. What could we do in these cases?
It is not around 0.33. What could we do in these cases?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Identify Different Types of Images
Photos will have virtually no areas of flat colour, around 0.01. Screenshots and line drawing will have much higher numbers, perhaps between 0.1 and 1.0.
snibgo's IM pages: im.snibgo.com
Re: Identify Different Types of Images
How to make difference between screenshot and line drawings depending upon this value?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Identify Different Types of Images
I don't understand the question.
snibgo's IM pages: im.snibgo.com
Re: Identify Different Types of Images
Can u help me with jmagick function calls for the same command?
Re: Identify Different Types of Images
you not screen your wallpaper or open graphic program in case?Vanns wrote:But when I tried with my laptop's screenshot, it is showing 0.886308
It is not around 0.33. What could we do in these cases?
coz your example for screenshot is actualy 50% "Picture" and 50% drawed windows.
i'm affraid screenshot what guis tok about is open Exel or World.
Re: Identify Different Types of Images
Can we find out the same value using jmagick?convert screenshot-gimp-windowsvista.png -statistic standard-deviation 3x3 -grayscale Brightness -fill White +opaque Black -negate -format %[fx:mean] info:
0.337484