91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 6.71MB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2023-11-17
  • 語言: C/C++
  • 標簽: C++??圖像處理??

資源簡介

一個基于C++的灰度圖像偽彩色處理程序源代碼。供大家參考。

資源截圖

代碼片段和文件信息

//?OpenCV_1.cpp?:?定義控制臺應用程序的入口點。
//
//彩虹圖的顏色分配取一下值
//?R?G?B?gray
//----------------------------------
//?紅?255?0?0?255
//?橙?255?127?0?204
//?黃?255?255?0?153
//?綠?0?255?0?102
//?青?0?255?255?51
//?藍?0?0?255?0

#include?
#include?
using?namespace?cv;
using?namespace?std;
int?main(int?argc?char*?argv[])
{

Mat?img?=?imread(“143225_IR.bmp“?CV_LOAD_IMAGE_GRAYSCALE);//采用灰度格式讀取圖片
namedWindow(“bmp_img“);
imshow(“bmp_img“?img);

Mat?img_pseudocolor(img.rows?img.cols?CV_8UC3);//構造RGB圖像,參數CV_8UC3教程文檔里面有講解
int?tmp?=?0;
for?(int?y?=?0;?y {
for?(int?x?=?0;?x {
tmp?=?img.at(y?x);

//img_pseudocolor.at(y?x)[0]?=?abs(255?-?tmp);?//blue
//img_pseudocolor.at(y?x)[1]?=?abs(127?-?tmp);?//green
//img_pseudocolor.at(y?x)[2]?=?abs(0?-?tmp);?//red

/*if?(0<=tmp<=75)
img_pseudocolor.at(y?x)[0]?=?abs(11.6+1.504*tmp);?//blue
else?if?(75 img_pseudocolor.at(y?x)[0]?=?abs(184.06667?-?0.872*tmp);?//blue
else
img_pseudocolor.at(y?x)[0]?=?abs(4.53187*tmp-916.89011);?//blue
img_pseudocolor.at(y?x)[1]?=?abs(0.00444*tmp*tmp-0.12047*tmp+4.69224);?//green
img_pseudocolor.at(y?x)[2]?=?abs(20.2594+1.10083*tmp);?//red*/

if?(0?<=?tmp?<=?125)
img_pseudocolor.at(y?x)[0]?=?abs(55.60714?+?3.43843*tmp?-?0.02711*tmp*tmp);?//blue

else
img_pseudocolor.at(y?x)[0]?=?abs(841.85728?-?9.59932*tmp?+?0.02762*tmp*tmp);?//blue
????img_pseudocolor.at(y?x)[1]?=?abs(0.00336*tmp*tmp?+?0.000916564*tmp?+?30.45043);?//green
????img_pseudocolor.at(y?x)[2]?=?abs(6.38595?+?2.64406*tmp?-?0.0074*tmp*tmp);?//red*/
}
}


/*IplImage?*img1?=?cvCreateImage(cvSize(256?50)?IPL_DEPTH_8U?3);
cvZero(img1);//相當于初始化圖片,值都為0,矩陣大小為640*480
for?(int?i?=?0;?i?
img1[:?i?0]?=?img_pseudocolor[i][0]
map_image_arr[:?i?1]?=?img_pseudocolor[i][1]
map_image_arr[:?i?2]?=?img_pseudocolor[i][2]
map_image?=?Image.fromarray(map_image_arr)
map_image.show()
map_image.save(“colormap.png“)*/



namedWindow(“img_pseudocolor“);
imshow(“img_pseudocolor“?img_pseudocolor);
imwrite(“20180622_142641_IRp.bmp“?img_pseudocolor);

Mat?img_color(img.rows?img.cols?CV_8UC3);//構造RGB圖像
#define?IMG_B(imgyx)?img.at(yx)[0]
#define?IMG_G(imgyx)?img.at(yx)[1]
#define?IMG_R(imgyx)?img.at(yx)[2]
uchar?tmp2?=?0;
for?(int?y?=?0;?y {
for?(int?x?=?0;?x {
tmp2?=?img.at(y?x);




if?(tmp2?<=?51)
{
IMG_B(img_color?y?x)?=?255;
IMG_G(img_color?y?x)?=?tmp2?*?5;
IMG_R(img_color?y?x)?=?0;
}
else?if?(tmp2?<=?102)
{
tmp2?-=?51;
IMG_B(img_color?y?x)?=?255?-?tmp2?*?5;
IMG_G(img_color?y?x)?=?255;
IMG

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

????..A..H.?????28160??2018-12-10?16:30??Pesudo_color\.vs\Pesudo_color\v14\.suo

?????文件?????614454??2018-08-27?14:01??Pesudo_color\Pesudo_color\140100_IR.bmp

?????文件?????614454??2018-08-27?14:05??Pesudo_color\Pesudo_color\140524_IR.bmp

?????文件?????614454??2018-08-27?14:09??Pesudo_color\Pesudo_color\140927_IR.bmp

?????文件?????614454??2018-08-27?14:14??Pesudo_color\Pesudo_color\141424_IR.bmp

?????文件?????614454??2018-08-27?14:18??Pesudo_color\Pesudo_color\141805_IR.bmp

?????文件?????614454??2018-08-27?14:27??Pesudo_color\Pesudo_color\142755_IR.bmp

?????文件?????614454??2018-08-27?14:32??Pesudo_color\Pesudo_color\143225_IR.bmp

?????文件?????614454??2018-08-27?14:37??Pesudo_color\Pesudo_color\143749_IR.bmp

?????文件?????614454??2018-08-27?14:42??Pesudo_color\Pesudo_color\144250_IR.bmp

?????文件?????614454??2018-08-27?14:48??Pesudo_color\Pesudo_color\144856_IR.bmp

?????文件?????614454??2018-08-27?15:01??Pesudo_color\Pesudo_color\150134_IR.bmp

?????文件?????614454??2018-08-27?15:08??Pesudo_color\Pesudo_color\150809_IR.bmp

?????文件?????614454??2018-08-27?15:15??Pesudo_color\Pesudo_color\151529_IR.bmp

?????文件?????614454??2018-08-27?15:20??Pesudo_color\Pesudo_color\152031_IR.bmp

?????文件?????614454??2018-08-27?15:22??Pesudo_color\Pesudo_color\152257_IR.bmp

?????文件?????614454??2018-08-27?15:28??Pesudo_color\Pesudo_color\152833_IR.bmp

?????文件?????308278??2018-06-22?14:26??Pesudo_color\Pesudo_color\20180622_142641_IR.bmp

?????文件?????921654??2018-12-10?14:02??Pesudo_color\Pesudo_color\20180622_142641_IRp.bmp

?????文件?????921654??2018-12-10?14:02??Pesudo_color\Pesudo_color\20180622_142641_IRr.bmp

?????文件?????308278??2018-06-22?14:27??Pesudo_color\Pesudo_color\20180622_142707_IR.bmp

?????文件?????308278??2018-06-22?14:31??Pesudo_color\Pesudo_color\20180622_143142_IR.bmp

?????文件?????308278??2018-06-22?14:32??Pesudo_color\Pesudo_color\20180622_143206_IR.bmp

?????文件?????308278??2018-06-22?14:32??Pesudo_color\Pesudo_color\20180622_143234_IR.bmp

?????文件????????140??2018-11-20?10:52??Pesudo_color\Pesudo_color\Debug\Pesudo_color.log

?????文件????????598??2018-11-19?11:23??Pesudo_color\Pesudo_color\Debug\Pesudo_color.tlog\cl.command.1.tlog

?????文件??????16796??2018-11-19?11:23??Pesudo_color\Pesudo_color\Debug\Pesudo_color.tlog\CL.read.1.tlog

?????文件????????528??2018-11-19?11:23??Pesudo_color\Pesudo_color\Debug\Pesudo_color.tlog\CL.write.1.tlog

?????文件??????????2??2018-11-20?10:52??Pesudo_color\Pesudo_color\Debug\Pesudo_color.tlog\link.command.1.tlog

?????文件??????????2??2018-11-20?10:52??Pesudo_color\Pesudo_color\Debug\Pesudo_color.tlog\link.read.1.tlog

............此處省略49個文件信息

評論

共有 條評論