現在剛開始做影像處理,不知道從哪里下載用來處理的影像,各位大大有沒有可供下載的網站或者能下載的途徑呀?
想找有特征的影像,類似網路上專門用來測驗連通域和專門用來測驗腐蝕膨脹的那種,BMP格式的影像,謝謝大大
uj5u.com熱心網友回復:
隨便搜個物體檢測的資料集。uj5u.com熱心網友回復:
您好,主要是不需要特別大的資料集。我的需要是我在做某一塊時有1到2張剛好合適的測驗圖就好了,就像是數字影像處理一書中的那種特別明顯的影像就好了。主要是不清楚怎么尋找或者怎么自己做出來。。。

uj5u.com熱心網友回復:
百度或必應搜索圖片也可以用啊。uj5u.com熱心網友回復:
百度或者必應的圖片都不是指定的格式,格式工廠轉換出來的影像不是BMP的標準格式,所以不清楚怎么找標準的影像
uj5u.com熱心網友回復:
不是標準的BMP,你可以自己用
c++ opencv
python opencv pillow
gdi+
Image Magick
……
自己撰寫一個小程式,轉換成標準BMP格式。
以下為gdi+程式,僅供參考:
Private Type GdiplusStartupInput
GdiplusVersion As Long
DebugEventCallback As Long
SuppressBackgroundThread As Long
SuppressExternalCodecs As Long
End Type
Private Declare Function GdiplusStartup Lib "gdiplus" (token As Long, inputbuf As GdiplusStartupInput, Optional ByVal outputbuf As Long = 0) As Long
Private Declare Function GdipCreateBitmapFromScan0 Lib "gdiplus" (ByVal Width As Long, ByVal Height As Long, ByVal stride As Long, ByVal PixelFormat As Long, scan0 As Any, bitmap As Long) As Long
Private Declare Function GdipCreatePen1 Lib "gdiplus" (ByVal color As Long, ByVal Width As Single, ByVal unit As Long, pen As Long) As Long
Private Declare Function GdipGetImageGraphicsContext Lib "gdiplus" (ByVal Image As Long, graphics As Long) As Long
Private Declare Function GdipDrawLine Lib "gdiplus" (ByVal graphics As Long, ByVal pen As Long, ByVal x1 As Single, ByVal y1 As Single, ByVal x2 As Single, ByVal y2 As Single) As Long
Private Declare Function CLSIDFromString Lib "ole32" (ByVal lpsz As Long, pclsid As Any) As Long
Private Declare Function GdipSaveImageToFile Lib "gdiplus" (ByVal Image As Long, ByVal filename As Long, clsidEncoder As Any, encoderParams As Any) As Long
Private Declare Function GdipDeletePen Lib "gdiplus" (ByVal pen As Long) As Long
Private Declare Function GdipDeleteGraphics Lib "gdiplus" (ByVal graphics As Long) As Long
Private Declare Function GdipDisposeImage Lib "gdiplus" (ByVal Image As Long) As Long
Private Declare Function GdiplusShutdown Lib "gdiplus" (ByVal token As Long) As Long
Private Sub Command1_Click()
Const PNGFile As String = "D:\1.png"
Const PixelFormat32bppARGB As Long = &H26200A
Const CLSID_PNG As String = "{557CF406-1A04-11D3-9A73-0000F81EF32E}"
Dim token As Long
Dim GpInput As GdiplusStartupInput
Dim ReturnValue As Long
Dim bitmap As Long
Dim graphics As Long
Dim pen As Long
Dim PngClsid(15) As Byte
Dim Params(7) As Long
'初始化GDI
GpInput.GdiplusVersion = 1
ReturnValue = GdiplusStartup(token, GpInput)
If ReturnValue <> 0 Then MsgBox "GDI初始化失敗": Exit Sub
'新建Bitmap
GdipCreateBitmapFromScan0 100, 100, 0, PixelFormat32bppARGB, ByVal 0, bitmap
'新建pen
GdipCreatePen1 &H80FF0000, 10, 0, pen '半透明的紅色
'畫線
GdipGetImageGraphicsContext bitmap, graphics
GdipDrawLine graphics, pen, 10, 20, 60, 70
'保存為PNG
CLSIDFromString StrPtr(CLSID_PNG), PngClsid(0)
GdipSaveImageToFile bitmap, StrPtr(PNGFile), PngClsid(0), Params(0)
'掃地作業
GdipDeletePen pen
GdipDeleteGraphics graphics
GdipDisposeImage bitmap
GdiplusShutdown token
End Sub
Platform SDK: GDI+
Retrieving the Class Identifier for an Encoder
The function GetEncoderClsid in the following example receives the MIME type of an encoder and returns the class identifier (CLSID) of that encoder. The MIME types of the encoders built into GDI+ are as follows:
image/bmp
image/jpeg
image/gif
image/tiff
image/png
The function calls GetImageEncoders to get an array of ImageCodecInfo objects. If one of the ImageCodecInfo objects in that array represents the requested encoder, the function returns the index of the ImageCodecInfo object and copies the CLSID into the variable pointed to by pClsid. If the function fails, it returns –1.
int GetEncoderClsid(const WCHAR* format, CLSID* pClsid)
{
UINT num = 0; // number of image encoders
UINT size = 0; // size of the image encoder array in bytes
ImageCodecInfo* pImageCodecInfo = NULL;
GetImageEncodersSize(&num, &size);
if(size == 0)
return -1; // Failure
pImageCodecInfo = (ImageCodecInfo*)(malloc(size));
if(pImageCodecInfo == NULL)
return -1; // Failure
GetImageEncoders(num, size, pImageCodecInfo);
for(UINT j = 0; j < num; ++j)
{
if( wcscmp(pImageCodecInfo[j].MimeType, format) == 0 )
{
*pClsid = pImageCodecInfo[j].Clsid;
free(pImageCodecInfo);
return j; // Success
}
}
free(pImageCodecInfo);
return -1; // Failure
}
The following console application calls the GetEncoderClsid function to determine the CLSID of the PNG encoder:
#include <windows.h>
#include <gdiplus.h>
#include <stdio.h>
using namespace Gdiplus;
#include "GdiplusHelperFunctions.h"
INT main()
{
// Initialize GDI+.
GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
CLSID encoderClsid;
INT result;
WCHAR strGuid[39];
result = GetEncoderClsid(L"image/png", &encoderClsid);
if(result < 0)
{
printf("The PNG encoder is not installed.\n");
}
else
{
StringFromGUID2(encoderClsid, strGuid, 39);
printf("An ImageCodecInfo object representing the PNG encoder\n");
printf("was found at position %d in the array.\n", result);
wprintf(L"The CLSID of the PNG encoder is %s.\n", strGuid);
}
GdiplusShutdown(gdiplusToken);
return 0;
}
When you run the preceding console application, you get an output similar to the following:
An ImageCodecInfo object representing the PNG encoder
was found at position 4 in the array.
The CLSID of the PNG encoder is {557CF406-1A04-11D3-9A73-0000F81EF32E}.
Platform SDK Release: August 2001 What did you think of this topic?
Let us know. Order a Platform SDK CD Online
(U.S/Canada) (International)
uj5u.com熱心網友回復:
提醒:Image Magick自帶命令列工具convert.exe可用于批量轉換圖片格式。
uj5u.com熱心網友回復:
https://imagemagick.org/index.php
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/284379.html
標籤:其它技術問題
上一篇:C++輸出菱形
下一篇:JS物件簡介