我正在使用此Java库从图像中删除水印:https://github.com/kendricktan/byebyewatermark
在以下代码中,我尝试将<FrameLayout
android:layout_margin="16dp"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/thumbImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="@drawable/top_tracks_song" />
<FrameLayout
android:id="@+id/frameLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/test">
</FrameLayout>
</FrameLayout>
转换为IplImage
:
org.bytedeco.javacv.Frame
执行previewImgBtn.addactionListener(new actionListener() {
public void actionPerformed(actionEvent e) {
// If the image path isn't set
if (watermarkedImgPath.equals("") || thumnbailImgPath.equals("") || maskedImgPath.equals("")){
statusLabel.setText("please select yer images");
}
else{
IplImage watermarkedImage = cvLoadImage(watermarkedImgPath);
// Our cleaned image
IplImage cleanedImage = new IplImage();
cleanedImage = IplImage.create(watermarkedImage.cvSize(),watermarkedImage.depth(),watermarkedImage.nChannels());
cleanedImage = getcleanImage();
CanvasFrame frame = new CanvasFrame("preview",CanvasFrame.getDefaultGamma());
OpenCVFrameConverter.ToIplImage converter = new OpenCVFrameConverter.ToIplImage();
// Next line results in following error:
// The method convert(IplImage) in the type OpenCVFrameConverter.ToIplImage is not applicable for the arguments (opencv_core.IplImage)
Frame newImage = converter.convert(cleanedImage);
frame.showImage(newImage);
}
}
});
时出现以下错误:
converter.convert(cleanedImage)
我已导入以下库:
The method convert(IplImage) in the type OpenCVFrameConverter.ToIplImage is not applicable for the arguments (opencv_core.IplImage)
如何解决?
谢谢!