TilePoint Tile::drawTile(Point3 p, float edges[4], TileParam& t, int id, int dir) { float hEdgeW = t.edgeWidth * .5f; float hEdgeH = t.edgeHeight * .5f; float randomSeed = (float)id * 1.23f + 0.1234f; if (dir) { edges[0] += t.eH_var ? hEdgeH * (1.f + noise(edges[0], randomSeed) * t.edgeHeightVar) : hEdgeH; edges[2] -= t.eH_var ? hEdgeH * (1.f + noise(edges[2], randomSeed) * t.edgeHeightVar) : hEdgeH; edges[3] += t.eW_var ? hEdgeW * (1.f + noise(edges[3], randomSeed) * t.edgeWidthVar) : hEdgeW; edges[1] -= t.eW_var ? hEdgeW * (1.f + noise(edges[1], randomSeed) * t.edgeWidthVar) : hEdgeW; } else { edges[0] += t.eW_var ? hEdgeW * (1.f + noise(edges[0], randomSeed) * t.edgeWidthVar) : hEdgeW; edges[2] -= t.eW_var ? hEdgeW * (1.f + noise(edges[2], randomSeed) * t.edgeWidthVar) : hEdgeW; edges[3] += t.eH_var ? hEdgeH * (1.f + noise(edges[3], randomSeed) * t.edgeHeightVar) : hEdgeH; edges[1] -= t.eH_var ? hEdgeH * (1.f + noise(edges[1], randomSeed) * t.edgeHeightVar) : hEdgeH; } if (p.x < edges[0]) return TilePoint(); if (p.x > edges[2]) return TilePoint(); if (p.y < edges[3]) return TilePoint(); if (p.y > edges[1]) return TilePoint(); float width = edges[2] - edges[0]; float height = edges[1] - edges[3]; if (width < 0 || height < 0) return TilePoint(); TilePoint tp = corner(p.x - edges[0], p.y - edges[3], width, height, t); if (tp.d < 0) return tp; // On edge //if (t.tileID || t.mapUV) tp.id = id; if (t.center || (t.mapUV && dir)) tp.center = Point3(edges[0] + (edges[2] - edges[0]) * .5f, edges[3] + (edges[1] - edges[3]) * .5f, p.z); if (dir) { offsetEdges(edges, -tp.center.x, -tp.center.y); rotate90(edges[0], edges[3]); rotate90(edges[2], edges[1]); offsetEdges(edges, tp.center.x, tp.center.y); p -= tp.center; rotate90(p.x, p.y); p += tp.center; } if (t.mapUV) uvMapping(tp, p, edges, t, dir); if (dir) { offsetEdges(edges, -tp.center.x, -tp.center.y); rotate270(edges[0], edges[3]); rotate270(edges[2], edges[1]); offsetEdges(edges, tp.center.x, tp.center.y); p -= tp.center; rotate270(p.x, p.y); p += tp.center; } return tp; }
int rotate(int ** arr, int degrees, int size) { if(degrees % 90 != 0) { printf("Rotation must be a positive factor of 90.\n"); return(-1); } while(degrees > 270) { degrees -= 360; } switch(degrees) { case 90: rotate90(arr, size); break; case 180: rotate180(arr, size); break; case 270: rotate270(arr, size); break; } return(0); }
// rotate == 1 is 90 degrees, 2 is 180, 3 is 270 (positive is CCW). static __inline__ void rotate_fun(int rotate, char * source, int srcWidth, int srcHeight, char * destination, int dstWidth, int dstHeight){ switch( rotate ) { case 1: rotate90(source, srcWidth, srcHeight, destination, dstWidth, dstHeight); break; case 2: rotate180(source, srcWidth, srcHeight, destination, dstWidth, dstHeight); break; case 3: rotate270(source, srcWidth, srcHeight, destination, dstWidth, dstHeight); break; default: break; } }
bool ImageBufAlgo::rotate270 (ImageBuf &dst, const ImageBuf &src, ROI roi, int nthreads) { if (&dst == &src) { // Handle in-place operation ImageBuf tmp; tmp.swap (const_cast<ImageBuf&>(src)); return rotate270 (dst, tmp, roi, nthreads); } pvt::LoggedTimer logtime("IBA::rotate270"); ROI src_roi = roi.defined() ? roi : src.roi(); ROI src_roi_full = src.roi_full(); // Rotated full ROI swaps width and height, and keeps its origin // where the original origin was. ROI dst_roi_full (src_roi_full.xbegin, src_roi_full.xbegin+src_roi_full.height(), src_roi_full.ybegin, src_roi_full.ybegin+src_roi_full.width(), src_roi_full.zbegin, src_roi_full.zend, src_roi_full.chbegin, src_roi_full.chend); ROI dst_roi (src_roi.ybegin, src_roi.yend, src_roi_full.xend-src_roi.xend, src_roi_full.xend-src_roi.xbegin, src_roi.zbegin, src_roi.zend, src_roi.chbegin, src_roi.chend); ASSERT (dst_roi.width() == src_roi.height() && dst_roi.height() == src_roi.width()); bool dst_initialized = dst.initialized(); if (! IBAprep (dst_roi, &dst, &src)) return false; if (! dst_initialized) dst.set_roi_full (dst_roi_full); bool ok; OIIO_DISPATCH_COMMON_TYPES2 (ok, "rotate270", rotate270_, dst.spec().format, src.spec().format, dst, src, dst_roi, nthreads); return ok; }
void img_rotate( Handle self, Byte * new_data, int new_line_size, int degrees) { PImage i = ( PImage ) self; if (( i-> type & imBPP) < 8 ) croak("Not implemented"); switch ( degrees ) { case 90: rotate90(i, new_data, new_line_size); break; case 180: rotate180(i, new_data); break; case 270: rotate270(i, new_data, new_line_size); break; } }
ToolsMenu::ToolsMenu(ImageViewer* iv, QWidget* parent) : QWidget(parent), ui(new Ui::ToolsMenu) { ui->setupUi(this); setLayout(ui->verticalLayoutWidget->layout()); m_viewer = (ImageViewer*) iv; m_tools = new Tools(m_viewer, this); // locking tools menu when performing transformation connect(m_viewer, SIGNAL(lockTools()), this, SLOT(disableAllTools())); connect(m_viewer, SIGNAL(unlockTools()), this, SLOT(enableAllTools())); /* ------------------------------------------------------- * ROTATION * ------------------------------------------------------- */ connect(ui->rotate90Button, SIGNAL(clicked()), m_tools, SLOT(rotate90())); connect(ui->rotate180Button, SIGNAL(clicked()), m_tools, SLOT(rotate180())); connect(ui->rotate270Button, SIGNAL(clicked()), m_tools, SLOT(rotate270())); /* ------------------------------------------------------- * HISTOGRAM * ------------------------------------------------------- */ QMenu* hMenu = new QMenu(ui->histogramButton); hMenu->addAction( QIcon(":/icons/icons/chart_curve_error.png"), QString("Equalize histograms"), m_tools, SLOT(histogramEqualize()) ); hMenu->addAction( QIcon(":/icons/icons/chart_curve_go.png"), QString("Stretch histograms"), m_tools, SLOT(histogramStretch()) ); ui->histogramButton->setMenu(hMenu); /* ------------------------------------------------------- * FILTERS (convolution, blur) * ------------------------------------------------------- */ QMenu* bMenu = new QMenu(ui->blurButton); bMenu->addAction( QIcon(":/icons/icons/draw_convolve.png"), QString("Gaussian blur"), m_tools, SLOT(blurGauss()) ); bMenu->addAction( QIcon(":/icons/icons/draw_convolve.png"), QString("Uniform blur"), m_tools, SLOT(blurUniform()) ); bMenu->addAction( QIcon(":/icons/icons/flag_airfield_vehicle_safety.png"), QString("Custom linear filter"), m_tools, SLOT(blurLinear()) ); ui->blurButton->setMenu(bMenu); /* ------------------------------------------------------- * BINARIZATION * ------------------------------------------------------- */ QMenu* binMenu = new QMenu(ui->binarizationButton); binMenu->addAction( QIcon(":/icons/icons/universal_binary.png"), QString("Manual"), m_tools, SLOT(binManual()) ); binMenu->addAction( QIcon(":/icons/icons/universal_binary.png"), QString("Gradient"), m_tools, SLOT(binGradient()) ); binMenu->addAction( QIcon(":/icons/icons/universal_binary.png"), QString("Iterative bimodal"), m_tools, SLOT(binIterBimodal()) ); binMenu->addAction( QIcon(":/icons/icons/universal_binary.png"), QString("Niblack"), m_tools, SLOT(binNiblack()) ); binMenu->addAction( QIcon(":/icons/icons/universal_binary.png"), QString("Otsu"), m_tools, SLOT(binOtsu()) ); ui->binarizationButton->setMenu(binMenu); /* ------------------------------------------------------- * NOISE REDUCTION * ------------------------------------------------------- */ QMenu* nMenu = new QMenu(ui->noiseButton); nMenu->addAction( QIcon(":/icons/icons/checkerboard.png"), QString("Median"), m_tools, SLOT(noiseMedian()) ); nMenu->addAction( QIcon(":/icons/icons/checkerboard.png"), QString("Bilateral"), m_tools, SLOT(noiseBilateral()) ); ui->noiseButton->setMenu(nMenu); /* ------------------------------------------------------- * MORPHOLOGICAL * ------------------------------------------------------- */ QMenu* morphMenu = new QMenu(ui->morphButton); morphMenu->addAction( QIcon(":/icons/icons/arrow_out.png"), QString("Dilate"), m_tools, SLOT(morphDilate()) ); morphMenu->addAction( QIcon(":/icons/icons/arrow_in.png"), QString("Erode"), m_tools, SLOT(morphErode()) ); morphMenu->addAction( QIcon(":/icons/icons/arrow_divide.png"), QString("Open"), m_tools, SLOT(morphOpen()) ); morphMenu->addAction( QIcon(":/icons/icons/arrow_join.png"), QString("Close"), m_tools, SLOT(morphClose()) ); ui->morphButton->setMenu(morphMenu); /* ------------------------------------------------------- * EDGE DETECTION * ------------------------------------------------------- */ QMenu* eMenu = new QMenu(ui->edgeButton); eMenu->addAction( QIcon(":/icons/icons/key_s.png"), QString("Sobel"), m_tools, SLOT(edgeSobel()) ); eMenu->addAction( QIcon(":/icons/icons/key_p.png"), QString("Prewitt"), m_tools, SLOT(edgePrewitt()) ); eMenu->addAction( QIcon(":/icons/icons/key_r.png"), QString("Roberts"), m_tools, SLOT(edgeRoberts()) ); eMenu->addAction( QIcon(":/icons/icons/edge_detection.png"), QString("Laplacian"), m_tools, SLOT(edgeLaplacian()) ); eMenu->addAction( QIcon(":/icons/icons/edge_detection.png"), QString("Zero-crossing (LoG)"), m_tools, SLOT(edgeZero()) ); eMenu->addAction( QIcon(":/icons/icons/edge_detection.png"), QString("Canny"), m_tools, SLOT(edgeCanny()) ); ui->edgeButton->setMenu(eMenu); /* ------------------------------------------------------- * TEXTURES * ------------------------------------------------------- */ QMenu* texMenu = new QMenu(ui->textureButton); texMenu->addAction( QIcon(":/icons/icons/flag_airfield_vehicle_safety.png"), QString("Height map"), m_tools, SLOT(mapHeight()) ); texMenu->addAction( QIcon(":/icons/icons/flag_airfield_vehicle_safety.png"), QString("Normal map"), m_tools, SLOT(mapNormal()) ); texMenu->addAction( QIcon(":/icons/icons/flag_airfield_vehicle_safety.png"), QString("Horizon map"), m_tools, SLOT(mapHorizon()) ); ui->textureButton->setMenu(texMenu); /* ------------------------------------------------------- * TRANSFORMATIONS * ------------------------------------------------------- */ QMenu* transMenu = new QMenu(ui->transformationsButton); transMenu->addAction( QIcon(":/icons/icons/videodisplay.png"), QString("Hough"), m_tools, SLOT(houghTransform()) ); transMenu->addAction( QIcon(":/icons/icons/videodisplay.png"), QString("Hough - lines"), m_tools, SLOT(houghLines()) ); transMenu->addAction( QIcon(":/icons/icons/videodisplay.png"), QString("Hough - rectangles"), m_tools, SLOT(houghRectangles()) ); transMenu->addAction( QIcon(":/icons/icons/videodisplay.png"), QString("Segmentation"), m_tools, SLOT(segmentation()) ); ui->transformationsButton->setMenu(transMenu); /* ------------------------------------------------------- * CORNER DETECTION * ------------------------------------------------------- */ QMenu* cornerMenu = new QMenu(ui->cornerButton); cornerMenu->addAction( QIcon(":/icons/icons/things_digital.png"), QString("Harris"), m_tools, SLOT(cornerHarris()) ); ui->cornerButton->setMenu(cornerMenu); }
int main(void) { char property[PROPERTY_VALUE_MAX]; int fd = dup(STDOUT_FILENO); //unsigned long fb_lock[2] = {MTKFB_LOCK_FRONT_BUFFER, (unsigned long)NULL}; //unsigned long fb_unlock[2] = {MTKFB_UNLOCK_FRONT_BUFFER, (unsigned long)NULL}; //unsigned long fb_capture[2] = {MTKFB_CAPTURE_FRAMEBUFFER, (unsigned long)NULL}; void *base = NULL, *base_align = NULL; int capture_buffer_size = 0, capture_buffer_size_align = 0; struct fb_var_screeninfo vinfo; int fb; uint32_t bytespp; uint32_t w, h, f; size_t size = 0; int should_munlock = 0; ALOGI("Enter lcdc_screen_cap."); if (fd < 0) { ALOGE("[DDMSCap]Dup STDOUT_FILENO failed!\n"); goto done; } if (0 > (fb = open("/dev/graphics/fb0", O_RDONLY))) { ALOGE("[DDMSCap]Open /dev/graphics/fb0 failed!\n"); goto done; } fcntl(fb, F_SETFD, FD_CLOEXEC); if(ioctl(fb, FBIOGET_VSCREENINFO, &vinfo) < 0) { ALOGI("[DDMSCap]FBIOGET_VSCREENINFO FAILED!\n"); goto done; } if (vinfoToPixelFormat(&vinfo, &bytespp, &f) == 0) { w = vinfo.xres; h = vinfo.yres; size = w * h * bytespp; ALOGI("[DDMSCap]screen_width = %d, screen_height = %d, bpp = %d, format = %d, size = %d\n", w, h, bytespp, f, size); } { capture_buffer_size = w * h * bytespp; capture_buffer_size_align = capture_buffer_size + 32; //for M4U 32-byte alignment base_align = malloc(capture_buffer_size_align); if(base_align == NULL) { ALOGE("[DDMSCap]pmem_alloc size 0x%08x failed", capture_buffer_size_align); goto done; } else { ALOGE("[DDMSCap]pmem_alloc size = 0x%08x, addr = 0x%08x", capture_buffer_size_align, (unsigned int)base_align); } if(mlock(base_align, capture_buffer_size_align)) { ALOGI("[DDMSCap] mlock fail! va=0x%x, size=%d, err=%d, %s\n", base_align, capture_buffer_size_align, errno, strerror(errno)); should_munlock = 0; //goto done; } else { should_munlock = 1; } base = (void *)((unsigned long)base_align + 32 - ((unsigned long)base_align & 0x1F)); //for M4U 32-byte alignment ALOGI("[DDMSCap]pmem_alloc base = 0x%08x", (unsigned int)base); //fb_capture[1] = (unsigned long)&base; ALOGI("[DDMSCap]start capture\n"); if(ioctl(fb, MTKFB_CAPTURE_FRAMEBUFFER, (unsigned long)&base) < 0) { ALOGE("[DDMSCap]ioctl of MTKFB_CAPTURE_FRAMEBUFFER fail\n"); goto done; } ALOGI("[DDMSCap]capture finished\n"); } if (base) { int displayOrientation = 0; if (property_get("ro.sf.hwrotation", property, NULL) > 0) { displayOrientation = atoi(property); } switch(displayOrientation) { case 0: { ALOGI("[DDMSCap]rotate 0 degree\n"); write(fd, &w, 4); write(fd, &h, 4); write(fd, &f, 4); //write(fd, base, size); writex(fd, base, size); } break; case 90: ALOGI("[DDMSCap]rotate 90 degree\n"); if(rotate90(w,h,f,bytespp,base,size,capture_buffer_size,fd) < 0) goto done; break; case 180: ALOGI("[DDMSCap]rotate 180 degree\n"); if(rotate180(w,h,f,bytespp,base,size,capture_buffer_size,fd) < 0) goto done; break; case 270: ALOGI("[DDMSCap]rotate 270 degree\n"); if(rotate270(w,h,f,bytespp,base,size,capture_buffer_size,fd) < 0) goto done; break; } } done: if (NULL != base_align) { if(should_munlock) munlock(base_align, capture_buffer_size_align); free(base_align); } if(fb >= 0) close(fb); if(fd >= 0) close(fd); ALOGI("[DDMSCap]all capture procedure finished\n"); return 0; }
static int get_file_func (CameraFilesystem *fs, const char *folder, const char *filename, CameraFileType type, CameraFile *file, void *data, GPContext *context) { Camera *camera = data; int idx, size; #ifdef HAVE_GD int ret; gdImagePtr im, rotated; void *gdpng; #endif idx = get_file_idx(camera->pl, folder, filename); if (idx < 0) return idx; if (type == GP_FILE_TYPE_RAW) { unsigned char *raw; size = st2205_read_raw_file (camera, idx, &raw); if (size < 0) return size; gp_file_set_mime_type (file, GP_MIME_RAW); gp_file_set_name (file, filename); gp_file_set_data_and_size (file, (char *)raw, size); return GP_OK; } #ifdef HAVE_GD if (type != GP_FILE_TYPE_NORMAL) return GP_ERROR_NOT_SUPPORTED; im = gdImageCreateTrueColor(camera->pl->width, camera->pl->height); if (im == NULL) return GP_ERROR_NO_MEMORY; ret = st2205_read_file(camera, idx, im->tpixels); if (ret < 0) { gdImageDestroy (im); return ret; } if (needs_rotation (camera)) { rotated = gdImageCreateTrueColor (im->sy, im->sx); if (rotated == NULL) { gdImageDestroy (im); return GP_ERROR_NO_MEMORY; } rotate270 (im, rotated); gdImageDestroy (im); im = rotated; } gdpng = gdImagePngPtr(im, &size); gdImageDestroy (im); if (gdpng == NULL) return GP_ERROR_NO_MEMORY; ret = gp_file_set_mime_type (file, GP_MIME_PNG); if (ret < 0) { gdFree (gdpng); return ret; } ret = gp_file_set_name (file, filename); if (ret < 0) { gdFree (gdpng); return ret; } ret = gp_file_append (file, gdpng, size); gdFree (gdpng); return ret; #else gp_log(GP_LOG_ERROR,"st2205", "GD decompression not supported - no libGD present during build"); return GP_ERROR_NOT_SUPPORTED; #endif }
int main() { // load image and get some image properties IplImage *p_image = cvLoadImage("lena.jpg"); //IplImage *p_image = cvLoadImage("obama_90_sw.bmp"); // create new image structure // for the grayscale output image IplImage *p_grayImage = cvCreateImage(cvSize( p_image->width, p_image->height ), IPL_DEPTH_8U, 1 ); // set type CV_RGB2GRAY to convert // RGB image to grayscale cvCvtColor(p_image, p_grayImage,CV_RGB2GRAY); // some local variables int width = p_grayImage->width; int height = p_grayImage->height; int width_step = p_grayImage->widthStep; int x,y; printf("width: %i\n", width); printf("heigth: %i\n", height); // allocation of a two-dimensional array uchar ** array = (uchar **) malloc(sizeof(uchar *) * height); uchar ** tmpArray = (uchar **) malloc(sizeof(uchar *) * height); for (y = 0; y < height; y++) { array[y] = (uchar *) malloc(sizeof(uchar ) * width); tmpArray[y] = (uchar *) malloc(sizeof(uchar ) * width); } // copy IplImage to allocated array copyIplImageToArray(height,width,p_grayImage,tmpArray); // implementation of algorithm 1 invertGray(height,width,tmpArray,array); // save result saveArrayToImage(height,width,array,p_grayImage); // create a new image (90 Grad Drehung) IplImage *p_rotate90 = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 1); rotate90(height,width,tmpArray,array); saveArrayToImage(height,width,array,p_rotate90); // create a new image (180 Grad Drehung) IplImage *p_rotate180 = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 1); rotate180(height,width,tmpArray,array); saveArrayToImage(height,width,array,p_rotate180); // create a new image (270 Grad Drehung) IplImage *p_rotate270 = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 1); rotate270(height,width,tmpArray,array); saveArrayToImage(height,width,array,p_rotate270); // create a new image (Vertikale Spiegelung) IplImage *p_flipvertical = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 1); flipvertical(height,width,tmpArray,array); saveArrayToImage(height,width,array,p_flipvertical); // create a new image (Horizontale Spiegelung) IplImage *p_fliphorizontal = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 1); fliphorizontal(height,width,tmpArray,array); saveArrayToImage(height,width,array,p_fliphorizontal); // create a new image (Beide Spiegelungen) IplImage *p_flipboth = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 1); flipboth(height,width,tmpArray,array); saveArrayToImage(height,width,array,p_flipboth); // create a new image (Skalierung Faktor 2) IplImage *p_scale2 = cvCreateImage(cvSize(width*2, height*2), IPL_DEPTH_8U, 1); scale2(height,width,tmpArray,p_scale2); //Speichert auch // create a new image (Skalierung Faktor 1/2) IplImage *p_scalehalf = cvCreateImage(cvSize(width/2, height/2), IPL_DEPTH_8U, 1); scalehalf(height,width,tmpArray,p_scalehalf); //Speichert auch // create a new image (GrauwertSprünge horizontal) IplImage *p_grayhor = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 1); grayhor(height,width,tmpArray,array); saveArrayToImage(height,width,array,p_grayhor); // create a new image (GrauwertSprünge vertikal) IplImage *p_grayvert = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 1); grayvert(height,width,tmpArray,array); saveArrayToImage(height,width,array,p_grayvert); // create a new image (GrauwertSprünge beide) IplImage *p_grayboth = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 1); graytotal(height,width,tmpArray,array); saveArrayToImage(height,width,array,p_grayboth); // create a new image (Mittelung 2x2) IplImage *p_mid2x2 = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 1); mid2x2(height,width,tmpArray,array); saveArrayToImage(height,width,array,p_mid2x2); // create a new image (Mittelung 2x2) IplImage *p_mid3x3 = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 1); mid3x3(height,width,tmpArray,array); saveArrayToImage(height,width,array,p_mid3x3); // show images cvNamedWindow("original", 1); cvShowImage("original", p_image); cvNamedWindow("invertedGray", 1); cvShowImage("invertedGray", p_grayImage); cvNamedWindow("Drehung 90 Grad", 1); cvShowImage("Drehung 90 Grad", p_rotate90); cvNamedWindow("Drehung 180 Grad", 1); cvShowImage("Drehung 180 Grad", p_rotate180); cvNamedWindow("Drehung 270 Grad", 1); cvShowImage("Drehung 270 Grad", p_rotate270); cvNamedWindow("Spiegelung vertikal", 1); cvShowImage("Spiegelung vertikal", p_flipvertical); cvNamedWindow("Spiegelung horizontal", 1); cvShowImage("Spiegelung horizontal", p_fliphorizontal); cvNamedWindow("Beide Spiegelungen", 1); cvShowImage("Beide Spiegelungen", p_flipboth); cvNamedWindow("Skalierung Faktor 2", 1); cvShowImage("Skalierung Faktor 2", p_scale2); cvNamedWindow("Skalierung Faktor 1/2", 1); cvShowImage("Skalierung Faktor 1/2", p_scalehalf); cvNamedWindow("Grauwertsprünge horizontal", 1); cvShowImage("Grauwertsprünge horizontal", p_grayhor); cvNamedWindow("Grauwertsprünge vertikal", 1); cvShowImage("Grauwertsprünge vertikal", p_grayvert); cvNamedWindow("Grauwertsprünge beide", 1); cvShowImage("Grauwertsprünge beide", p_grayboth); cvNamedWindow("Mittelung 2x2", 1); cvShowImage("Mittelung 2x2", p_mid2x2); cvNamedWindow("Mittelung 3x3", 1); cvShowImage("Mittelung 3x3", p_mid3x3); // wait for 'esc' key cvWaitKey(0); // clean up cvReleaseImage(&p_grayImage); cvDestroyWindow("invertedGray"); cvReleaseImage(&p_image); cvDestroyWindow("original"); cvReleaseImage(&p_rotate90); cvDestroyWindow("Drehung 90 Grad"); cvReleaseImage(&p_rotate180); cvDestroyWindow("Drehung 180 Grad"); cvReleaseImage(&p_rotate270); cvDestroyWindow("Drehung 270 Grad"); cvReleaseImage(&p_flipvertical); cvDestroyWindow("Spiegelung vertikal"); cvReleaseImage(&p_fliphorizontal); cvDestroyWindow("Spiegelung horizontal"); cvReleaseImage(&p_flipboth); cvDestroyWindow("Beide Spiegelungen"); cvReleaseImage(&p_scale2); cvDestroyWindow("Skalierung Faktor 2"); cvReleaseImage(&p_scalehalf); cvDestroyWindow("Skalierung Faktor 1/2"); cvReleaseImage(&p_grayhor); cvDestroyWindow("Grauwertsprünge horizontal"); cvReleaseImage(&p_grayvert); cvDestroyWindow("Grauwertsprünge vertikal"); cvReleaseImage(&p_grayboth); cvDestroyWindow("Grauwertsprünge beide"); cvReleaseImage(&p_mid2x2); cvDestroyWindow("Mittelung 2x2"); cvReleaseImage(&p_mid3x3); cvDestroyWindow("Mittelung 3x3"); for (y = 0; y < height; y++) { free(array[y]); free(tmpArray[y]); } free(array); free(tmpArray); //cvSaveImage // bye bye printf("Goodbye\n"); return 0; }