本文整理汇总了C++中displayImage函数的典型用法代码示例。如果您正苦于以下问题:C++ displayImage函数的具体用法?C++ displayImage怎么用?C++ displayImage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了displayImage函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: displayImage
void CorrectPerspective::UpdateEditor(cv::String windowName, cv::Mat source)
{
m_editorSourceImageSize.x = source.cols;
m_editorSourceImageSize.y = source.rows;
//cv::Mat displayImage = source.clone();
cv::Mat displayImage(cv::Size(m_editorSourceImageSize.x * 2, m_editorSourceImageSize.y * 2), CV_8UC3, cv::Scalar(0, 0, 0));
cv::Mat dst = displayImage(cv::Rect(m_editorSourceImageSize.x / 2,
m_editorSourceImageSize.y / 2,
m_editorSourceImageSize.x,
m_editorSourceImageSize.y
));
source.copyTo(dst);
cv::line(displayImage, m_points[0], m_points[1], cv::Scalar(255, 255, 255), 1, CV_AA, 0);
cv::line(displayImage, m_points[0], m_points[2], cv::Scalar(0, 255, 255), 1, CV_AA, 0);
cv::line(displayImage, m_points[2], m_points[3], cv::Scalar(0, 0, 255), 1, CV_AA, 0);
cv::line(displayImage, m_points[3], m_points[1], cv::Scalar(255, 0, 255), 1, CV_AA, 0);
//cv::resize(displayImage, displayImage, cv::Size(displayImage.cols / 2, displayImage.rows / 2));
cv::setMouseCallback(windowName, CorrectPerspective::CallBackFunc, this);
m_editorSourceImageSize *= 2;
imshow(windowName, displayImage);
}
开发者ID:DonkDH,项目名称:TouchTable,代码行数:28,代码来源:CorrectPerspective.cpp
示例2: QImage
/**
* Reculer le vidéo lentement
* @brief MainWindow::on_backwardButton_clicked
*/
void MainWindow::on_backwardButton_clicked()
{
//QImage img;
vector<Point2f> vlist;
myPlayer->Stop();
double framecourant = myPlayer->getCurrentFrame();
if(framecourant > 0){
Mat img = myPlayer->showImage(--framecourant);
//Modifier ListWidget
if(this->flagVisualier == true){
myPlayer->drawTrack(framecourant,img);
QImage qimg = QImage((unsigned char*) img.data, img.cols, img.rows, QImage::Format_RGB888);
//Modifier ListWidget
QStringList list = myPlayer->getStrList();
ui->listWidget->clear();
ui->listWidget->addItems(list);
displayImage(qimg, framecourant, "");
}
if(this->flagTraiter == true){
QImage qimg = QImage((unsigned char*) img.data, img.cols, img.rows, QImage::Format_RGB888);
displayImage(qimg, framecourant, "");
}
}
}
开发者ID:bigflower123,项目名称:PFE,代码行数:29,代码来源:mainwindow.cpp
示例3: result
void ColibriMainWindow::computeImage(IplImage * iplImage) {
if(!iplImage) return;
#ifndef NO_PLUGIN
// fprintf(stderr, "[Colibri] %s:%d : process sequence '%s' on image (%dx%dx%d)\n",
// __func__, __LINE__,
// mFilterManager.getPluginSequenceFile(),
// iplImage->width, iplImage->height, iplImage->depth
// );
// Process this image with filters
int retproc = mFilterManager.processImage(iplImage, &mOutputImage);
#else
/// \todo port to Win32
int retproc = -1; // do not display this result (because mOutputImage is null
#endif
// Display image as output
if(retproc > 0 && mOutputImage)
{
displayImage(mOutputImage);
}
else
{
displayImage(iplImage);
}
}
开发者ID:cseyve,项目名称:piaf,代码行数:26,代码来源:colibrimainwindow.cpp
示例4: loop
void loop() {
displayImage("parrot.bmp");
HAL_Delay(5000);
displayImage("dolphin.bmp");
HAL_Delay(5000);
displayImage("monkey.bmp");
HAL_Delay(5000);
}
开发者ID:levichevdmitry,项目名称:stm32-fatfs-examples,代码行数:8,代码来源:main.c
示例5: displayImage
void ImageViewWidget::displayMat(cv::Mat frame, bool scale)
{
if(frame.channels()==3){
cv::Mat3b im;// = frame;
frame.convertTo(im,CV_8UC3);
displayImage(im,scale);
}else{
cv::Mat_<double> im;// = frame;
frame.convertTo(im,CV_64F);
displayImage(im,scale);
}
}
开发者ID:jinghuaguo,项目名称:PicoScan,代码行数:12,代码来源:imageviewwidget.cpp
示例6: if
void PDFViewerWindow::renderedThumbnailIncoming(QSharedPointer< RenderedPage > renderedThumbnail)
{
if ( !m_enabled )
return;
/* If a thumbnail for the page we're waiting for is incoming and we have no page at all, its better than nothing */
if ( renderedThumbnail->getPageNumber() == currentPageNumber
&& currentImage.isNull() )
{
QImage myHalf;
if ( myPart == PagePart::LeftHalf )
{
myHalf = renderedThumbnail->getImage().copy(0, 0, renderedThumbnail->getImage().width()/2, renderedThumbnail->getImage().height());
}
else if ( myPart == PagePart::RightHalf )
{
myHalf = renderedThumbnail->getImage().copy(renderedThumbnail->getImage().width()/2, 0, renderedThumbnail->getImage().width()/2, renderedThumbnail->getImage().height());
}
else if ( myPart == PagePart::FullPage )
{
myHalf = renderedThumbnail->getImage();
}
displayImage(myHalf);
}
addThumbnail(renderedThumbnail->getPageNumber(), renderedThumbnail->getImage());
}
开发者ID:wwwdata,项目名称:dspdfviewer,代码行数:27,代码来源:pdfviewerwindow.cpp
示例7: store_one
/* store one frame or one field */
void store_one (char *outname, unsigned char *src[], int offset, int incr, int height)
{
switch (outtype)
{
case T_YUV:
store_yuv (outname, src, offset, incr, height);
break;
case T_YUV_CONC:
store_yuv_append (outname, src, offset, incr, height);
break;
case T_SIF:
store_sif (outname, src, offset, incr, height);
break;
case T_TGA:
store_ppm_tga (outname, src, offset, incr, height, 1);
break;
case T_PPM:
store_ppm_tga (outname, src, offset, incr, height, 0);
break;
#ifdef DISPLAY
case T_X11:
if (enhancement_layer_num == 1)
dither (src);
break;
#endif
#ifdef WINDOWS
case T_WIN:
if (enhancement_layer_num == 1)
displayImage (src[0], src[2], src[1]);
break;
#endif
default:
break;
}
}
开发者ID:pierz,项目名称:vic,代码行数:36,代码来源:store.c
示例8: displayImage
/**
* Appelle le fonction to show video and show data in ListWidget
* @brief MainWindow::updatePlayerUI
* @param img: image to display
* @param tmpInfo: information of coordinates
*/
void MainWindow::updatePlayerUI(QImage img, QString tmpInfo)
{
if (!img.isNull())
{
displayImage(img, myPlayer->getCurrentFrame(),tmpInfo);
}
}
开发者ID:bigflower123,项目名称:PFE,代码行数:13,代码来源:mainwindow.cpp
示例9: sprintf_s
/**
* Mouse pressed, show the coordiantes and draw a point at that position
* @brief MainWindow::myMousePressed
* @param x
* @param y
*/
void MainWindow::myMousePressed(int x, int y)
{
myPlayer->Stop();
this->flagmovepresse = false;
double framecourant = myPlayer->getCurrentFrame();
org = myPlayer->getcurrentImage(framecourant);
org.copyTo(img);//Copy the original images to 'img'
sprintf_s(temp,"(%d,%d)",x,y);
//Get width and height of the original video
imgheight = myPlayer->getFrameHeight();
imgwidth = myPlayer->getFrameWidth();
//Get width and height of the VideoLabel
labelheight = ui->VideoLbl->size().height();
labelwidth = ui->VideoLbl->size().width();
//Get width and height scale
heightscale = imgheight/labelheight;
widthscale = imgwidth/labelwidth;
//Le coordiante of point in the original image
pre_pt = Point(x*widthscale,y*heightscale);
putText(img,temp,pre_pt,FONT_HERSHEY_SIMPLEX,0.8,Scalar(255,0,0,0),2,8);//Display coordinates in the window
circle(img,pre_pt,2,Scalar(255,0,0,0),CV_FILLED,CV_AA,0);//draw circle
QImage qimg = QImage((const unsigned char*)(img.data),
img.cols,img.rows,QImage::Format_RGB888);
displayImage(qimg,framecourant,"");
ui->statusBar->showMessage(QString("Mouse press (%1,%2)").arg(x).arg(y));
}
开发者ID:bigflower123,项目名称:PFE,代码行数:34,代码来源:mainwindow.cpp
示例10: while
// play video stream
void DisplayOpencvStream::playVideo()
{
cv::VideoCapture capture;
bool isStream = capture.open(videoStreamUrl);
cv::Mat rgb;
cv::Mat resizedRgb;
while (isStream && cv::waitKey(40)!=27)
{
bool isFrame = capture.read(rgb);
if (isFrame)
{
cv::resize(rgb,resizedRgb,cv::Size(0.25*rgb.cols,0.25*rgb.rows));
cv::imshow(videoStreamUrl,resizedRgb);
displayImage(resizedRgb);
}
}
cv::destroyWindow(videoStreamUrl);
}
开发者ID:babasileye,项目名称:DisplayOpencvStream,代码行数:27,代码来源:displayopencvstream.cpp
示例11: QFileDialog
void ossimQtSingleImageWindow::openImage()
{
QString caption = "iview : open image";
QString directory;
if (!theLastOpenedDirectory.empty())
{
if (theLastOpenedDirectory.exists())
{
directory = theLastOpenedDirectory.c_str();
}
}
QFileDialog* fd = new QFileDialog( this, caption, directory );
fd->setFileMode( QFileDialog::ExistingFile );
ossimFilename fileName;
if ( fd->exec() == QDialog::Accepted )
{
fileName = fd->selectedFile().ascii();
theLastOpenedDirectory = fileName.path();
}
delete fd;
fd = 0;
if (fileName.empty())
{
return;
}
displayImage(fileName);
}
开发者ID:renyu310,项目名称:ossim-svn,代码行数:33,代码来源:ossimQtSingleImageWindow.cpp
示例12: displayImage
void DataInspectionDialog::onImageBoxChange(int index)
{
if (index != imageIndex) {
imageIndex = index;
displayImage();
}
}
开发者ID:johnsonjonaris,项目名称:CoNECt,代码行数:7,代码来源:datainspectiondialog.cpp
示例13: while
void QNode::takePicture(int nrPicture, QString url, bool display)
{
bool running = true;
int picture_taken = 0;
QString tmpUrl;
while(running)
{
if(picture_flag)
{
tmpUrl = url;
tmpUrl.append("_");
tmpUrl.append(QString::number(picture_taken+1));
tmpUrl.append(".pcd");
//take picture here
if(rgb_enabled){
pcl::io::savePCDFileASCII(tmpUrl.toUtf8().constData(), cloudRGB);
picture_taken = picture_taken + 1;
}
else{
pcl::io::savePCDFileASCII(tmpUrl.toUtf8().constData(), cloud);
picture_taken = picture_taken + 1;
}
picture_flag = false;
}
if(picture_taken == nrPicture)
{
running = false;
}
}
if(display){
Q_EMIT displayImage(tmpUrl);
}
}
开发者ID:bj0rkedal,项目名称:qt_turntable,代码行数:33,代码来源:qnode.cpp
示例14: dest
void ImageViewWidget::displayImage(cv::Mat_<double> image, bool scale)
{
double inScale = 1.0;
origW = image.cols;
origH = image.rows;
QImage dest(image.cols, image.rows, QImage::Format_ARGB32);
for (int y = 0; y < image.rows; ++y) {
const double *srcrow = image[y];
QRgb *destrow = (QRgb*)dest.scanLine(y);
for (int x = 0; x < image.cols; ++x) {
int color = 255u-(unsigned int)(srcrow[x] * inScale);
uint ucolor;
if(color<0) ucolor = 0;
else if(color>255) ucolor = 255;
else ucolor = 255-color;
destrow[x] = qRgba(ucolor, ucolor, ucolor, 255);
}
}
if(scale){
dest = dest.scaled(size(),Qt::KeepAspectRatio,
hq? Qt::SmoothTransformation : Qt::FastTransformation);
}
displayImage(dest);
}
开发者ID:jinghuaguo,项目名称:PicoScan,代码行数:27,代码来源:imageviewwidget.cpp
示例15: image
void Matrix::importImage(const QString& fn)
{
QImage image(fn);
if (image.isNull())
return;
x_start = 0.0;
x_end = image.width() - 1.0;
y_start = 0.0;
y_end = image.height() - 1.0;
double *buffer = d_matrix_model->dataCopy();
if (buffer){
d_undo_stack->push(new MatrixSetImageCommand(d_matrix_model, image, d_view_type, 0,
numRows() - 1, 0, numCols() - 1, buffer, tr("Import Image") + " \"" + fn + "\""));
emit modifiedWindow(this);
modifiedData(this);
} else if (ignoreUndo()){
d_matrix_model->setImage(image);
setViewType(ImageView, false);
displayImage(image);
emit modifiedWindow(this);
modifiedData(this);
}
setWindowLabel(fn);
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:27,代码来源:Matrix.cpp
示例16: getTime
// Attempts to recognize the plate. Returns a confidence level. Updates teh "stateCode" variable
// with the value of the country/state
int StateIdentifier::recognize(Mat img, char* stateCode)
{
timespec startTime;
getTime(&startTime);
cvtColor(img, img, CV_BGR2GRAY);
resize(img, img, getSizeMaintainingAspect(img, config->stateIdImageWidthPx, config->stateIdimageHeightPx));
Mat plateImg(img.size(), img.type());
//plateImg = equalizeBrightness(img);
img.copyTo(plateImg);
Mat debugImg(plateImg.size(), plateImg.type());
plateImg.copyTo(debugImg);
vector<int> matchesArray(featureMatcher->numTrainingElements());
RecognitionResult result = featureMatcher->recognize(plateImg, true, &debugImg, true, matchesArray );
if (this->config->debugStateId)
{
displayImage(config, "State Identifier1", plateImg);
displayImage(config, "State Identifier", debugImg);
cout << result.haswinner << " : " << result.confidence << " : " << result.winner << endl;
}
if (config->debugTiming)
{
timespec endTime;
getTime(&endTime);
cout << "State Identification Time: " << diffclock(startTime, endTime) << "ms." << endl;
}
if (result.haswinner == false)
return 0;
strcpy(stateCode, result.winner.c_str());
return result.confidence;
}
开发者ID:Blejzer,项目名称:openalpr,代码行数:49,代码来源:stateidentifier.cpp
示例17: applicationWindow
void Matrix::setDefaultColorMap()
{
d_color_map_type = Default;
d_color_map = applicationWindow()->d_3D_color_map;
if (d_view_type == ImageView)
displayImage(d_matrix_model->renderImage());
emit modifiedWindow(this);
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:8,代码来源:Matrix.cpp
示例18: QwtLinearColorMap
void Matrix::setGrayScale()
{
d_color_map_type = GrayScale;
d_color_map = QwtLinearColorMap(Qt::black, Qt::white);
if (d_view_type == ImageView)
displayImage(d_matrix_model->renderImage());
emit modifiedWindow(this);
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:8,代码来源:Matrix.cpp
示例19: showImage
void showImage ( const NICE::ColorImage& image,
const std::string& title,
const bool copy ) {
// display image and wait for the user to close
// the window
displayImage ( &image, title, copy );
QtFramework::exec ( false );
}
开发者ID:cvjena,项目名称:nice-core,代码行数:8,代码来源:ImageDisplay.cpp
示例20: SDL_SetAlpha
void PartyMenu::display()
{
SDL_SetAlpha(cursor, SDL_SRCALPHA, 0);
SDL_Rect cursorCoordinates;
cursorCoordinates.x=cursorXPosition;
cursorCoordinates.y=cursorYPosition;
SDL_BlitSurface(background,NULL,SDL_GetVideoSurface(),NULL);
displayImage(characterPane,85+charPaneXVariation,78);
displayCharacterData();
displayImage(menuPane,983,40+menuPaneYVariation);
if(cursorOpaque)
{
SDL_BlitSurface(cursor,NULL,SDL_GetVideoSurface(),&cursorCoordinates);
}
displayMenuList();
text.displayWord("01234567890 9999 9999",500,300);
}
开发者ID:alexbredy,项目名称:Ultimate-Abyss,代码行数:18,代码来源:partymenu.cpp
注:本文中的displayImage函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论