[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[其他] [已解决]能把拉花的照片从众多照片里面剔出来吗?

<a href="https://imgse.com/i/pCWQcjO"><img src="https://s1.ax1x.com/2023/07/11/pCWQcjO.md.jpg" alt="pCWQcjO.jpg" border="0" /></a>https://s1.ax1x.com/2023/07/11/pCWQcjO.jpg
1

评分人数

    • Batcher: 感谢给帖子标题标注[已解决]字样PB + 2

如题,能不能处理这种照片,或者说从众多的照片里面把这些拉花的照片找出来

TOP

回复 3# pd1 <img src="https://pic.imgdb.cn/item/64adfe8b1ddac507cc7eabc4.jpg">

TOP

回复 3# pd1 https://pic.imgdb.cn/item/64adfe8b1ddac507cc7eabc4.jpg

TOP

回复 3# pd1 https://pic.imgdb.cn/item/64adfed11ddac507cc7f8f2f.jpg

TOP

回复 3# pd1

TOP

回复 8# pd1


    好吧

TOP

回复 11# idwma

测试能找出拉花的照片了,感谢

TOP

回复 13# wanghan519


    感谢

TOP

回复 11# idwma

#@&cls&powershell "type '%~f0'|out-string|iex"&pause&exit
Add-Type -AssemblyName System.Drawing
$cp = New-Object CodeDom.Compiler.CompilerParameters
$cp.ReferencedAssemblies.Add([Reflection.Assembly]::GetAssembly([Drawing.Image]).Location) >$null
$cp.ReferencedAssemblies.Add([Reflection.Assembly]::GetAssembly([Linq.Enumerable]).Location) >$null
$cp.CompilerOptions ='/unsafe'

Add-Type -CompilerParameters $cp -TypeDefinition @'
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Collections.Generic;
using System.Linq;

public class test
{
    unsafe public static int main(string f)
    {
        Bitmap bitmap = new Bitmap(@f);
        int width = bitmap.Width;
        int height = bitmap.Height;
        int h = height/2;
        BitmapData bitmapData = bitmap.LockBits(new Rectangle(0, h, width, height-h), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
        byte* p = (byte*)(IntPtr)bitmapData.Scan0;
        Dictionary<int, int> b = new Dictionary<int, int>();
        for (int i = 0; i < width * (height-h) * 4; i+=4)
        {
            int c = (p[i+3] << 24) | (p[i+2] << 16) | (p[i+1] << 8) | p;
            b[c] = b.ContainsKey(c) ? b[c] + 1 : 1;
        }
        bitmap.UnlockBits(bitmapData);
        var d = b.OrderBy(x => x.Value).Select(x => x.Value).ToArray();
        return width*h/(d[d.Length-1]) < 30 ? 1 : 0;
    }
}
'@

mkdir 123
dir *.jpg|%{if([test]::main($_.FullName)){move $_.fullname '123'}}

TOP

回复 11# idwma
我加了你说的创建文件夹那句话过后运行他提示我+ ~~~~~~~~~
    + CategoryInfo          : ResourceExists: (C:\Users\Admin\Desktop\新建文件夹\123:String) [New-Item], IOException
    + FullyQualifiedErrorId : DirectoryExist,Microsoft.PowerShell.Commands.NewItemCommand

move : 另一个进程正在使用此文件,因此该进程无法访问此文件。
所在位置 行:39 字符: 43
+ dir *.jpg|%{if([test]::main($_.FullName)){move $_.fullname '123'}}
+                                           ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (C:\Users\Admin\Desktop\新建文件夹\003.jpg:FileInfo) [Move-Item], IOException
    + FullyQualifiedErrorId : MoveFileInfoItemIOError,Microsoft.PowerShell.Commands.MoveItemCommand

move : 另一个进程正在使用此文件,因此该进程无法访问此文件。
所在位置 行:39 字符: 43
+ dir *.jpg|%{if([test]::main($_.FullName)){move $_.fullname '123'}}
+                                           ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (C:\Users\Admin\Desktop\新建文件夹\005.jpg:FileInfo) [Move-Item], IOException
    + FullyQualifiedErrorId : MoveFileInfoItemIOError,Microsoft.PowerShell.Commands.MoveItemCommand

TOP

回复 20# idwma


感谢感谢,达到效果了

TOP

返回列表