java - cvResize function with JavaCV -


says i'm using wrong types here. both img , image iplimages, type should using , how use it?

                    iplimage image = iplimage.create(120, 120, ipl_depth_8u, 4);                     //resize image                      cvresize(img,image);                      cvsaveimage("4-rjb" + capture + ".pgm", img); 

this should work

iplimage resizeimage = iplimage.create(120, 120, origimg.depth(), origimg.nchannels()); 

and here full example

opencvframegrabber framegrabber = new opencvframegrabber(video_in); try {     framegrabber.start();     iplimage origimg = framegrabber.grab();     iplimage resizedimage = iplimage.create(img_width, img_height, origimg.depth(), origimg.nchannels());      //cvsmooth(origimg, origimg);     cvresize(origimg, resizedimage);     cvsaveimage(image_out.getabsolutepath(),resizedimage);     cvreleaseimage(resizedimage);  } catch (opencvframegrabber.exception e) {     e.printstacktrace();     throw new nullpointerexception("fileextension"); } 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -