-
Notifications
You must be signed in to change notification settings - Fork 0
Description
I ran j90randomsizej80 on about 1000 images, and generated a histogram of the sizes. For each images in the attack, I used the minimum of width and height as value for the histogram. For instance, a 500x400 image would "count as" 400px image, because the detection algorithm problems are to be expected on the smaller dimension.
This is not what I expected to see. I thought that most images would be > 500px and practically no image would be < 400px.
I also saw that j90randomsizej80 supposedly should change the aspect ratio of the input images.
Line 101 in de200a2
| # Generate 2D resolutions based on the resolution areas and aspect ratio range |
Seems that it doesn't (which may be part of the problem why the distribution is not correct).
Seems that using convert input.jpg -resize 200x200 output.jpg (or similar) doesn't change the aspect ratio.
However what I would really like to test here is random resizing while maintaining aspect ratio, so either we should make j90randomsizej80 do this, or we should have two attacks, one with and the other without aspect ratio change.
Tools:
Find minimum size (min (width, height)) of each image:
#!/bin/bash
# shell script: min-width.sh
for i in $(find . -iname *.json)
do
egrep '(width|height)' $i | sed 's/[":,]//g' | awk '$1 == "width" {w=$2;} $1 == "height" {h=$2;}END{if (w<h){print w;}else{print h}}'
done
Gnuplot script:
set terminal pngcairo size 800,600 enhanced font 'Verdana,10'
set output 'hist.png'
binwidth=20
bin(x,width)=width*floor(x/width)
plot '<./min-width.sh' using (bin($1,binwidth)):(1.0) smooth freq with boxes