• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ShowImages类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中boofcv.gui.image.ShowImages的典型用法代码示例。如果您正苦于以下问题:Java ShowImages类的具体用法?Java ShowImages怎么用?Java ShowImages使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ShowImages类属于boofcv.gui.image包,在下文中一共展示了ShowImages类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: run

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
@Override
public void run() {
    if (!streaming) {
        addMouseListener(panel);
    }
    JFrame window = ShowImages.showWindow(panel, PlaySet.class.getSimpleName(),true);
    window.addKeyListener(new KeyAdapter() {
        @Override
        public void keyTyped(KeyEvent e) {
            if (e.getKeyChar() == 'x' && previousSet != null) {
                System.out.println("'Not a Set!'");
                ImageSuppliers.WebcamSaverImageSupplier.save(image);
            }
        }
    });

    if (streaming) {
        while (true) {
            image = imageSupplier.get();
            newImage(image);
        }
    }
}
 
开发者ID:tomwhite,项目名称:set-game,代码行数:24,代码来源:PlaySet.java


示例2: view

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
public static void view(File directory) {
    ListDisplayPanel panel = new ListDisplayPanel();
    int numCols = 20;

    int numImagesPerLabel = -1;
    char prevNumLabel = ' ';
    for (File d : directory.listFiles((dir, name) -> !name.matches("\\..*"))) {
        String label = d.getName();
        BufferedImage[] bufferedImages = Arrays.stream(d.listFiles((dir, name) -> name.matches(".*\\.jpg")))
                .map(f -> UtilImageIO.loadImage(f.getAbsolutePath()))
                .map(bi -> resize(bi, bi.getWidth() / 3, bi.getHeight() / 3))
                .collect(Collectors.toList())
                .toArray(new BufferedImage[0]);
        panel.addItem(new ImageGridPanel((bufferedImages.length / numCols) + 1, numCols, bufferedImages), label);
        System.out.println(label + "\t" + bufferedImages.length);
        if (prevNumLabel != label.charAt(0)) {
            numImagesPerLabel = bufferedImages.length;
            prevNumLabel = label.charAt(0);
        } else if (numImagesPerLabel != bufferedImages.length) {
            throw new IllegalStateException("Expected " + numImagesPerLabel + " images, but only found " + bufferedImages.length + " for " + label);
        }
    }

    ShowImages.showWindow(panel, ViewLabelledImagesV2.class.getSimpleName(), true);
}
 
开发者ID:tomwhite,项目名称:set-game,代码行数:26,代码来源:ViewLabelledImagesV2.java


示例3: processRgb

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
protected void processRgb(FrameMode mode, ByteBuffer frame, int timestamp) {
	if (mode.getVideoFormat() != VideoFormat.RGB) {
		System.out.println("Bad rgb format!");
	}

	if (outRgb == null) {
		rgb.reshape(mode.getWidth(), mode.getHeight());
		outRgb = new BufferedImage(rgb.width, rgb.height, BufferedImage.TYPE_INT_RGB);
		guiRgb = ShowImages.showWindow(outRgb, "RGB Image");
	}

	App.bufferRgbToMsU8(frame, rgb);
	ConvertBufferedImage.convertTo_U8(rgb, outRgb, true);

	drawButton(buttonMove, outRgb);
	drawButton(buttonStop, outRgb);
	drawButton(buttonLeft, outRgb);
	drawButton(buttonRight, outRgb);

	processButtonStatePhaseTwo(buttonMove, outRgb);
	processButtonStatePhaseTwo(buttonStop, outRgb);
	processButtonStatePhaseTwo(buttonLeft, outRgb);
	processButtonStatePhaseTwo(buttonRight, outRgb);

	guiRgb.repaint();
}
 
开发者ID:IBM-Cloud,项目名称:controller-kinect-bluemix,代码行数:27,代码来源:App.java


示例4: processRgb

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
protected void processRgb(FrameMode mode, ByteBuffer frame, int timestamp) {
  if (mode.getVideoFormat() != VideoFormat.RGB) {
    System.out.println("Bad rgb format!");
  }

  System.out.println("Got rgb!   " + timestamp);

  if (outRgb == null) {
    rgb.reshape(mode.getWidth(), mode.getHeight());
    outRgb = new BufferedImage(rgb.width, rgb.height, BufferedImage.TYPE_INT_RGB);
    guiRgb = ShowImages.showWindow(outRgb, "RGB Image");
  }

  UtilOpenKinect.bufferRgbToMsU8(frame, rgb);
  ConvertBufferedImage.convertTo_U8(rgb, outRgb, true);

  guiRgb.repaint();
}
 
开发者ID:MyRobotLab,项目名称:myrobotlab,代码行数:19,代码来源:KinectStreamer.java


示例5: processRgb

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
protected void processRgb( FrameMode mode, ByteBuffer frame, int timestamp ) {
	if( mode.getVideoFormat() != VideoFormat.RGB ) {
		System.out.println("Bad rgb format!");
	}

	System.out.println("Got rgb! "+timestamp);

	if( outRgb == null ) {
		rgb.reshape(mode.getWidth(),mode.getHeight());
		outRgb = new BufferedImage(rgb.width,rgb.height,BufferedImage.TYPE_INT_RGB);
		guiRgb = ShowImages.showWindow(outRgb,"RGB Image");
	}

	UtilOpenKinect.bufferRgbToMsU8(frame, rgb);
	ConvertBufferedImage.convertTo_U8(rgb,outRgb);

	guiRgb.repaint();
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:19,代码来源:OpenKinectStreamingTest.java


示例6: process

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
public void process() throws IOException {
	parseFrame(0);

	outRgb = new BufferedImage(rgb.getWidth(),rgb.getHeight(),BufferedImage.TYPE_INT_RGB);
	outDepth = new BufferedImage(depth.getWidth(),depth.getHeight(),BufferedImage.TYPE_INT_RGB);

	gui = new ImageGridPanel(1,2,outRgb,outDepth);
	ShowImages.showWindow(gui,"Kinect Data");

	int frame = 1;
	while( true ) {
		parseFrame(frame++);
		ConvertBufferedImage.convertTo_U8(rgb,outRgb);
		VisualizeImageData.disparity(depth, outDepth, 0, UtilOpenKinect.FREENECT_DEPTH_MM_MAX_VALUE, 0);
		gui.repaint();
		BoofMiscOps.pause(30);
	}
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:19,代码来源:PlaybackKinectLogApp.java


示例7: main

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
public static void main( String args[] ) {

		// load images with lens distortion removed
		String dir = "../data/applet/stereo/";
		BufferedImage imageA = UtilImageIO.loadImage(dir + "mono_wall_01.jpg");
		BufferedImage imageB = UtilImageIO.loadImage(dir + "mono_wall_03.jpg");

		// Find a set of point feature matches
		List<AssociatedPair> matches = ExampleFundamentalMatrix.computeMatches(imageA,imageB);

		// Prune matches using the epipolar constraint
		List<AssociatedPair> inliers = new ArrayList<AssociatedPair>();
		DenseMatrix64F F = ExampleFundamentalMatrix.robustFundamental(matches, inliers);

		// display the inlier matches found using the robust estimator
		AssociationPanel panel = new AssociationPanel(20);
		panel.setAssociation(inliers);
		panel.setImages(imageA,imageB);

		ShowImages.showWindow(panel, "Inlier Pairs");

		rectify(F,inliers,imageA,imageB);
	}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:24,代码来源:ExampleRectifyUncalibratedStereo.java


示例8: main

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
public static void main(String args[]) {

		ShowImageDerivative<ImageFloat32,ImageFloat32> app
				= new ShowImageDerivative<ImageFloat32,ImageFloat32>(ImageFloat32.class,ImageFloat32.class);
//		ShowImageDerivative<ImageUInt8, ImageSInt16> app
//				= new ShowImageDerivative<ImageUInt8,ImageSInt16>(ImageUInt8.class,ImageSInt16.class);

		List<PathLabel> inputs = new ArrayList<PathLabel>();
		inputs.add(new PathLabel("shapes","../data/evaluation/shapes01.png"));
		inputs.add(new PathLabel("sunflowers","../data/evaluation/sunflowers.png"));
		inputs.add(new PathLabel("beach","../data/evaluation/scale/beach02.jpg"));
		inputs.add(new PathLabel("xray","../data/applet/xray01.jpg"));

		app.setInputList(inputs);

		// wait for it to process one image so that the size isn't all screwed up
		while( !app.getHasProcessedImage() ) {
			Thread.yield();
		}

		ShowImages.showWindow(app, "Image Derivative");
	}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:23,代码来源:ShowImageDerivative.java


示例9: printClickedColor

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
/**
 * Shows a color image and allows the user to select a pixel, convert it to HSV, print
 * the HSV values, and calls the function below to display similar pixels.
 */
public static void printClickedColor( final BufferedImage image ) {
	ImagePanel gui = new ImagePanel(image);
	gui.addMouseListener(new MouseAdapter() {
		@Override
		public void mouseClicked(MouseEvent e) {
			float[] color = new float[3];
			int rgb = image.getRGB(e.getX(),e.getY());
			ColorHsv.rgbToHsv((rgb >> 16) & 0xFF,(rgb >> 8) & 0xFF , rgb&0xFF,color);
			System.out.println("h = " + color[0]);
			System.out.println("s = "+color[1]);
			System.out.println("v = "+color[2]);

			showSelectedColor("Selected",image,(float)color[0],(float)color[1]);
		}
	});

	ShowImages.showWindow(gui,"Color Selector");
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:23,代码来源:ExampleSegmentColor.java


示例10: detectLineSegments

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
/**
 * Detects segments inside the image
 *
 * @param image Input image.
 * @param imageType Type of image processed by line detector.
 * @param derivType Type of image derivative.
 */
public static<T extends ImageSingleBand, D extends ImageSingleBand>
void detectLineSegments( BufferedImage image ,
						 Class<T> imageType ,
						 Class<D> derivType )
{
	// convert the line into a single band image
	T input = ConvertBufferedImage.convertFromSingle(image, null, imageType );

	// Comment/uncomment to try a different type of line detector
	DetectLineSegmentsGridRansac<T,D> detector = FactoryDetectLineAlgs.lineRansac(40, 30, 2.36, true, imageType, derivType);

	List<LineSegment2D_F32> found = detector.detect(input);

	// display the results
	ImageLinePanel gui = new ImageLinePanel();
	gui.setBackground(image);
	gui.setLineSegments(found);
	gui.setPreferredSize(new Dimension(image.getWidth(),image.getHeight()));

	ShowImages.showWindow(gui,"Found Line Segments");
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:29,代码来源:ExampleLineDetection.java


示例11: independent

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
/**
 * Many operations designed to only work on {@link boofcv.struct.image.ImageSingleBand} can be applied
 * to a MultiSpectral image by feeding in each band one at a time.
 */
public static void independent( BufferedImage input ) {
	// convert the BufferedImage into a MultiSpectral
	MultiSpectral<ImageUInt8> image = ConvertBufferedImage.convertFromMulti(input,null,ImageUInt8.class);

	// declare the output blurred image
	MultiSpectral<ImageUInt8> blurred =
			new MultiSpectral<ImageUInt8>(ImageUInt8.class,image.width,image.height,image.getNumBands());
	
	// Apply Gaussian blur to each band in the image
	for( int i = 0; i < image.getNumBands(); i++ ) {
		// note that the generalized version of BlurImageOps is not being used, but the type
		// specific version.
		BlurImageOps.gaussian(image.getBand(i),blurred.getBand(i),-1,5,null);
	}
	
	// Declare the BufferedImage manually to ensure that the color bands have the same ordering on input
	// and output
	BufferedImage output = new BufferedImage(image.width,image.height,input.getType());
	ConvertBufferedImage.convertTo(blurred, output);
	ShowImages.showWindow(input,"Input");
	ShowImages.showWindow(output,"Ouput");
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:27,代码来源:ExampleMultiSpectralImages.java


示例12: convertToGray

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
/**
 * There is no real perfect way that everyone agrees on for converting color images into gray scale
 * images.  Two examples of how to convert a MultiSpectral image into a gray scale image are shown 
 * in this example.
 */
public static void convertToGray( BufferedImage input ) {
	// convert the BufferedImage into a MultiSpectral
	MultiSpectral<ImageUInt8> image = ConvertBufferedImage.convertFromMulti(input,null,ImageUInt8.class);
	
	ImageUInt8 gray = new ImageUInt8( image.width,image.height);
	
	// creates a gray scale image by averaging intensity value across pixels
	GPixelMath.averageBand(image, gray);
	BufferedImage outputAve = ConvertBufferedImage.convertTo(gray,null);

	// create an output image just from the first band
	BufferedImage outputBand0 = ConvertBufferedImage.convertTo(image.getBand(0),null);

	ShowImages.showWindow(outputAve,"Average");
	ShowImages.showWindow(outputBand0,"Band 0");
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:22,代码来源:ExampleMultiSpectralImages.java


示例13: process

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
/**
 * Processes the sequence of images and displays the tracked features in a window
 */
public void process(SimpleImageSequence<T> sequence) {

	// Figure out how large the GUI window should be
	T frame = sequence.next();
	gui.setPreferredSize(new Dimension(frame.getWidth(),frame.getHeight()));
	ShowImages.showWindow(gui,"KTL Tracker");

	// process each frame in the image sequence
	while( sequence.hasNext() ) {
		frame = sequence.next();

		// tell the tracker to process the frame
		tracker.process(frame);

		// if there are too few tracks spawn more
		if( tracker.getActiveTracks(null).size() < 100 )
			tracker.spawnTracks();

		// visualize tracking results
		updateGUI(sequence);

		// wait for a fraction of a second so it doesn't process to fast
		BoofMiscOps.pause(100);
	}
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:29,代码来源:ExamplePointFeatureTracker.java


示例14: showMatchIntensity

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
/**
 * Computes the template match intensity image and displays the results. Brighter intensity indicates
 * a better match to the template.
 */
public static void showMatchIntensity(ImageFloat32 image, ImageFloat32 template) {

	// create algorithm for computing intensity image
	TemplateMatchingIntensity<ImageFloat32> matchIntensity =
			FactoryTemplateMatching.createIntensity(TemplateScoreType.SUM_DIFF_SQ, ImageFloat32.class);

	// apply the template to the image
	matchIntensity.process(image, template);

	// get the results
	ImageFloat32 intensity = matchIntensity.getIntensity();

	// adjust the intensity image so that white indicates a good match and black a poor match
	// the scale is kept linear to highlight how ambiguous the solution is
	float min = ImageStatistics.min(intensity);
	float max = ImageStatistics.max(intensity);
	float range = max - min;
	PixelMath.plus(intensity, -min, intensity);
	PixelMath.divide(intensity, range, intensity);
	PixelMath.multiply(intensity, 255.0f, intensity);

	BufferedImage output = new BufferedImage(image.width, image.height, BufferedImage.TYPE_INT_BGR);
	VisualizeImageData.grayMagnitude(intensity, output, -1);
	ShowImages.showWindow(output, "Match Intensity");
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:30,代码来源:ExampleTemplateMatching.java


示例15: process

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
/**
 * Updates and displays the pyramid.
 */
public void process( BufferedImage image ) {
	T input = ConvertBufferedImage.convertFromSingle(image, null, imageType);
	pyramid.process(input);

	ImagePyramidPanel<T> gui = new ImagePyramidPanel<T>();
	gui.set(pyramid, true);
	gui.render();

	ShowImages.showWindow(gui,"Image Pyramid Float");

	// To get an image at any of the scales simply call this get function
	T imageAtScale = pyramid.getLayer(1);

	ShowImages.showWindow(ConvertBufferedImage.convertTo(imageAtScale,null),"Image at layer 1");
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:19,代码来源:ExamplePyramidFloat.java


示例16: updateGUI

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
@Override
public void updateGUI(BufferedImage guiImage, ImageUInt8 origImage) {

	if (panelX == null) {
		panelX = ShowImages.showWindow(derivX, "Derivative X-Axis");
		panelY = ShowImages.showWindow(derivY, "Derivative Y-Axis");
		original = ShowImages.showWindow( guiImage , "Original" );
		addComponent(panelX);
		addComponent(panelY);
	} else {
		original.setBufferedImage(guiImage);
		int maxX = ImageStatistics.maxAbs(derivX);
		int maxY = ImageStatistics.maxAbs(derivY);

		if( drawGray ) {
			VisualizeImageData.grayMagnitude(derivX,panelX.getImage(),maxX);
			VisualizeImageData.grayMagnitude(derivY,panelY.getImage(),maxY);
		} else {
			VisualizeImageData.colorizeSign(derivX,panelX.getImage(),maxX);
			VisualizeImageData.colorizeSign(derivY,panelY.getImage(),maxY);
		}
		panelX.repaint();
		panelY.repaint();
		original.repaint();
	}
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:27,代码来源:VideoShowImageDerivative.java


示例17: sharpen

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
/**
	 * When an image is sharpened the intensity of edges are made more extreme while flat regions remain unchanged.
	 */
	public static void sharpen() {
//		BufferedImage buffered = UtilImageIO.loadImage("../data/applet/enhance/dull.jpg");
		BufferedImage buffered = UtilImageIO.loadImage("../data/applet/enhance/dark.jpg");
		ImageUInt8 gray = ConvertBufferedImage.convertFrom(buffered,(ImageUInt8)null);
		ImageUInt8 adjusted = new ImageUInt8(gray.width, gray.height);


		ListDisplayPanel panel = new ListDisplayPanel();

		EnhanceImageOps.sharpen4(gray, adjusted);
		panel.addImage(ConvertBufferedImage.convertTo(adjusted,null),"Sharpen-4");

		EnhanceImageOps.sharpen8(gray, adjusted);
		panel.addImage(ConvertBufferedImage.convertTo(adjusted,null),"Sharpen-8");

		panel.addImage(ConvertBufferedImage.convertTo(gray,null),"Original");

		panel.setPreferredSize(new Dimension(gray.width,gray.height));
		ShowImages.showWindow(panel,"Sharpen");
	}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:24,代码来源:ExampleImageEnhancement.java


示例18: procedural

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
public static void procedural( ImageUInt8 input )
{
	ImageUInt8 blurred = new ImageUInt8(input.width,input.height);
	ImageSInt16 derivX = new ImageSInt16(input.width,input.height);
	ImageSInt16 derivY = new ImageSInt16(input.width,input.height);

	// Gaussian blur: Convolve a Gaussian kernel
	BlurImageOps.gaussian(input,blurred,-1,blurRadius,null);

	// Calculate image's derivative
	GradientSobel.process(blurred, derivX, derivY, FactoryImageBorderAlgs.extend(input));

	// display the results
	BufferedImage outputImage = VisualizeImageData.colorizeSign(derivX,null,-1);
	ShowImages.showWindow(outputImage,"Procedural Fixed Type");
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:17,代码来源:ExampleImageFilter.java


示例19: generalized

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
public static <T extends ImageSingleBand, D extends ImageSingleBand>
void generalized( T input )
{
	Class<T> inputType = (Class<T>)input.getClass();
	Class<D> derivType = GImageDerivativeOps.getDerivativeType(inputType);

	T blurred = GeneralizedImageOps.createSingleBand(inputType, input.width, input.height);
	D derivX = GeneralizedImageOps.createSingleBand(derivType, input.width, input.height);
	D derivY = GeneralizedImageOps.createSingleBand(derivType, input.width, input.height);

	// Gaussian blur: Convolve a Gaussian kernel
	GBlurImageOps.gaussian(input, blurred, -1, blurRadius, null);

	// Calculate image's derivative
	GImageDerivativeOps.sobel(blurred, derivX, derivY, BorderType.EXTENDED);

	// display the results
	BufferedImage outputImage = VisualizeImageData.colorizeSign(derivX,null,-1);
	ShowImages.showWindow(outputImage,"Generalized "+inputType.getSimpleName());
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:21,代码来源:ExampleImageFilter.java


示例20: filter

import boofcv.gui.image.ShowImages; //导入依赖的package包/类
public static <T extends ImageSingleBand, D extends ImageSingleBand>
void filter( T input )
{
	Class<T> inputType = (Class<T>)input.getClass();
	Class<D> derivType = GImageDerivativeOps.getDerivativeType(inputType);

	T blurred = GeneralizedImageOps.createSingleBand(inputType, input.width, input.height);
	D derivX = GeneralizedImageOps.createSingleBand(derivType, input.width, input.height);
	D derivY = GeneralizedImageOps.createSingleBand(derivType, input.width, input.height);

	// declare image filters
	BlurFilter<T> filterBlur = FactoryBlurFilter.gaussian(inputType, -1, blurRadius);
	ImageGradient<T,D> gradient = FactoryDerivative.sobel(inputType, derivType);

	// process the image
	filterBlur.process(input,blurred);
	gradient.process(blurred,derivX,derivY);

	// display the results
	BufferedImage outputImage = VisualizeImageData.colorizeSign(derivX,null,-1);
	ShowImages.showWindow(outputImage,"Filter "+inputType.getSimpleName());
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:23,代码来源:ExampleImageFilter.java



注:本文中的boofcv.gui.image.ShowImages类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ToStringSerializer类代码示例发布时间:2022-05-22
下一篇:
Java AxisAlignedBB类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap