新增3通道校正,调整0A 寄存器

This commit is contained in:
modehua 2023-10-30 00:56:55 -07:00
parent e4614bd436
commit 7288701891
3 changed files with 34 additions and 10 deletions

View File

@ -77,7 +77,7 @@ union CamZ_Reg_A_New
unsigned int psen: 1; //使能相移 写低写高
unsigned int psincdec : 1; //相移动反向
unsigned int clr_psedon : 1;//清除相完成 写低写高
unsigned int dpi: 2; //1: 300DPI 0: 600DPI
unsigned int dpi: 2;//bit 12 //1: 300DPI 0: 600DPI
unsigned int dpi_200: 1; //dpi=1的时候 dpi_200=1 200dpi dpi=1的时候 dpi_200=0 300dpi dpi=0的时候 dpi_200=0 600dpi
};
};

View File

@ -16,7 +16,7 @@
const int vsp_A = 45;
const int vsp_B = 45;
#define ARRAYLEN(table) (sizeof(table) / sizeof(table[0]))
// using namespace cv;
MultiFrameCapture::MultiFrameCapture(ScannerGlue glue) :
snaped_index(0),
@ -553,15 +553,20 @@ void MultiFrameCapture::procimage()
}
}
static int temp_val = 0;
#define CIS_6CH
bool MultiFrameCapture::saveLutImg(int dpi, int mode, bool black)
{
printf("校正DPI[%d] 校正颜色:%s\n",dpi==1?200:(dpi==2?300:600),mode == IMAGE_COLOR?"彩色":"灰色");
int config_dpi = dpi ;
#ifdef CIS_6CH
const int offset_indexs[] = {3, 4, 5, 2, 1, 0 ,0, 1, 2, 5, 4, 3};
#else
const int offset_indexs[] = {2, 1, 0, 0, 1 ,2};
#endif
int channels = mode == IMAGE_COLOR ? 3 : 1;
int height = 60;
int width = config_dpi == 0x02 ? 864 : (config_dpi == 0x03 ? 1728 : 576);
int orgimgwidth = width * 2 * 3 * channels;
printf("orgimgwidth:%d\r\n",orgimgwidth);
@ -602,9 +607,16 @@ bool MultiFrameCapture::saveLutImg(int dpi, int mode, bool black)
FPGAConfigParam param = GetFpgaparam(dpi, mode);
if (black) // 暗场
{
#ifdef CIS_6CH
volatile double offValues[12]{0};
double offValues_min[12]{0};
int blockcount = 12;
#else
volatile double offValues[6]{0};
double offValues_min[6]{0};
int blockcount = 6;
#endif
int bandwidth = mrgmat.cols / blockcount;
for (int n = 0; n < blockcount; n++)
{
@ -632,7 +644,8 @@ bool MultiFrameCapture::saveLutImg(int dpi, int mode, bool black)
{
unsigned int offsets[6]; // = (int *)(s == 0 ? &param.OffsetF[0] : &param.OffsetB[0]);
memcpy(offsets, (s == 0 ? &param.OffsetF[0] : &param.OffsetB[0]), sizeof(param.OffsetF));
for (int j = 0; j < 6; j++)
int total_chs = ARRAYLEN(offset_indexs);
for (int j = 0; j < total_chs/2; j++)
{
int k = s * 6 + j;
// double diff = BLACK_DIFF(offValues[k]);

View File

@ -11,6 +11,17 @@ using namespace std;
* G400/G300 *
******************************************/
#define G300
//#define CIS_6CH
#define CIS_3CH
#ifdef CIS_6CH
#undef CIS_3CH
#elif define CIS_3CH
#undef CIS_6CHC
#else
#endif
/******************************************
* SPEEDMODE==3 60PPM *
* SPEEDMODE==4 70PPM *
@ -51,11 +62,11 @@ typedef struct
static std::map<int , sp_COLOR_or_GRAY>mapFradme_SP={
{1,{0x08ED1003,0x1ACC1002,CON(G340,230429)}},//40 ppm
{2,{0x06DB1003,0x14A01002,CON(G350,230429)}},//50 ppm
{3,{0x05591003,0x100E1002,CON(G360,230429)}},//60 ppm
{4,{0x04421003,0x0CD11002,CON(G370,230429)}},//70 ppm
{5,{0x036c1003,0x0A421002,CON(G380,230429)}},//80 ppm
{1,{0x08ED1003,0x1ACC1002,CON(G34D,231027)}},//40 ppm
{2,{0x06DB1003,0x14A01002,CON(G35D,231027)}},//50 ppm
{3,{0x05591003,0x100E1002,CON(G36D,231027)}},//60 ppm
{4,{0x04421003,0x0CD11002,CON(G37D,231027)}},//70 ppm
{5,{0x036c1003,0x0A421002,CON(G38D,231027)}},//80 ppm
};
enum class LedStatus