void CttView::SeedFill(const int &x,const int &y,const COLORREF &color , CDC* pDC) { pDC->SetPixel(x,y,color); if(pDC->GetPixel(x+1,y)!=color)SeedFill(x+1,y, color, pDC); if(pDC->GetPixel(x-1,y)!=color)SeedFill(x-1,y, color, pDC); if(pDC->GetPixel(x,y+1)!=color)SeedFill(x,y+1, color, pDC); if(pDC->GetPixel(x,y-1)!=color)SeedFill(x,y-1, color, pDC); }
void AFH::Segmentation(Mat Gray) { Img.copyTo(Img_pre); Gray.copyTo(Img); HistOpr_Nnscore(); HistOpr_Thresh(); medianBlur(Flag, Smooth, 5); SeedFill(Smooth, Smooth.cols*Smooth.rows/2000, true); }
void CttView::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: 在此添加消息处理程序代码和/或调用默认值 if (m_gameON){ MakeBullet(CPoint(m_player_x,m_player_y),point); return; } if(m_graphtype<=2)m_point.push_back(point); else if(m_graphtype==3){ CDC* pDC = GetWindowDC(); SeedFill(point.x , point.y , RGB(0,0,0),pDC); }else if(m_graphtype==4){ CDC* pDC = GetWindowDC(); SeedLine(point.x , point.y ,RGB(123,23,3), RGB(0,0,0),pDC); } else if (m_graphtype == 5){ DuiChengX(point.x,point.y); } else if (m_graphtype == 6){ DuiChengY(point.x, point.y); } else if (m_graphtype == 7){ DuiChengXY(point.x, point.y); } else if (m_graphtype == 8){ GraphMove(point.x, point.y); } else if (m_graphtype == 9){ XuanZhuan(point.x, point.y); } else if (m_graphtype == 10){ SuoFang(point.x, point.y); } else if (m_graphtype == 11){ PointCai(point.x, point.y); } else if (m_graphtype == 12){ m_point.push_back(point); } CView::OnLButtonDown(nFlags, point); }