Ask Your Question

Farrakh Javed's profile - activity

2020-03-04 06:54:22 -0600 received badge  Famous Question (source)
2017-11-02 21:01:01 -0600 received badge  Notable Question (source)
2017-08-22 19:50:54 -0600 received badge  Student (source)
2017-02-06 04:55:18 -0600 received badge  Notable Question (source)
2016-05-28 02:19:47 -0600 received badge  Popular Question (source)
2016-04-03 02:45:55 -0600 received badge  Popular Question (source)
2014-05-26 02:48:31 -0600 answered a question addweighted for mix of two image

This is not working for different size images.

2014-05-23 00:45:23 -0600 asked a question Transparent Border Area - Opencv

Hi guys, I am merging two images, after merging foreground image have colored border which i don't want. I am using below code to merge background and foreground image.

public void overlayImage1(Mat background, Mat foreground,Mat output)//, Point location) { background.copyTo(output); Mat dst = new Mat(); Imgproc.resize(foreground, dst, background.size()); double alpha; for(int y = 0; y < background.rows() ; ++y) { for(int x = 0; x < background.cols() ; ++x) { double info[] = dst.get(y, x); alpha = info[3]; if(alpha>0) {
double infof[] = dst.get(y, x); output.put(y, x, infof); } } } }

Below is output image.image description

2014-05-22 06:45:05 -0600 received badge  Supporter (source)
2014-05-22 06:39:13 -0600 commented question Converting JPEG to PNG Image With Alpha transparency

Okay, thanks.

2014-05-22 06:23:37 -0600 commented question Converting JPEG to PNG Image With Alpha transparency

I want png image with alpha channel that is very simple question. PNG is saved as RGB channels. Where is Alpha like in format RGBA?

2014-05-22 05:48:58 -0600 commented question Converting JPEG to PNG Image With Alpha transparency

I dont want to convert to gray scale, I want png format image, If we simply save jpg image to png format it is saved but without alpha channel. I need alpha channel in it. Can you tell me how to do that?

2014-05-22 05:45:47 -0600 commented question Converting JPEG to PNG Image With Alpha transparency

@berak Thanks, Let me try with this.

2014-05-22 05:15:42 -0600 asked a question Converting JPEG to PNG Image With Alpha transparency

Hi guys, I'm trying to convert image from jpeg format to png format. I'm also trying to apply Alpha on image so png save imag must be with alpha channel. I am not able to execute this(result.push_back<mat>(mask);) line in the code successfully.

Mat jpegImageMat = Highgui.imread("mnt/sdcard/aaawatermark/bird.jpg");
Mat gray_image = new Mat(), mask = new Mat(), rgba_image = new Mat();
List<Mat> result = new ArrayList<Mat>();
Core.split(jpegImageMat, result);
Imgproc.cvtColor(jpegImageMat, gray_image, Imgproc.COLOR_BGR2RGBA);
Imgproc.threshold(gray_image, mask, 128, 255, Imgproc.THRESH_BINARY);
result.push_back<Mat>(mask);
Core.merge(result, rgba_image);
Highgui.imwrite("mnt/sdcard/aaawatermark1/rgba.png", rgba_image);

Anybody help me will be appreciated.

2014-05-21 02:29:43 -0600 commented answer Image Background Transparency - OpenCV

For CV_8UC3 it is working. I think i am missing alpha value, but don't know how to solve this.

2014-05-21 02:21:13 -0600 commented answer Image Background Transparency - OpenCV

After making change as you suggested, i lost my watermark image(above rotated image).

2014-05-21 02:01:07 -0600 commented answer Image Background Transparency - OpenCV

If i omit the colorScalar from Mat function, default black background is applied. I can see different colors in background if i change Scalar values.

2014-05-21 01:59:05 -0600 commented answer Image Background Transparency - OpenCV

targetSize = new Size(newWidthHeight[0], newWidthHeight[1]);

I'm doing this, but not getting transparency. targetSize = new Size(newWidthHeight[0], newWidthHeight[1]); Scalar colorScalar = new Scalar(125,125,200,0.6); targetMat = new Mat(targetSize, scaledImage.type(),colorScalar);

2014-05-21 00:49:29 -0600 commented answer Image Background Transparency - OpenCV

Thanks for the reply, Can you tell me how to pass this parameter to target mat?

2014-05-21 00:15:51 -0600 received badge  Organizer (source)
2014-05-21 00:07:27 -0600 received badge  Editor (source)
2014-05-21 00:06:40 -0600 asked a question Image Background Transparency - OpenCV

Hi, I'm using this code to make image background transparent, but i'm not getting the background transparent.

Imgproc.warpAffine(targetMat, resultMat, rotImage, targetSize, Imgproc.INTER_CUBIC,        
Imgproc.BORDER_TRANSPARENT,new Scalar(255,255,255,0));

image description

2014-05-20 07:31:15 -0600 commented answer How to remove black background from grabcut output image in OpenCV android ?

You are right. I'm using opencv4Adnroid library. so i think i am not able to do that.

2014-05-20 07:02:00 -0600 commented answer How to remove black background from grabcut output image in OpenCV android ?

Please reply as soon as possible. Thanks in advance.

2014-05-20 07:01:19 -0600 commented answer How to remove black background from grabcut output image in OpenCV android ?

I'm not able to convert to java code for alpha and tmp. Kindly tell me how aplha is populated?

2014-05-20 07:00:19 -0600 received badge  Critic (source)
2014-05-20 06:37:52 -0600 commented answer How to remove black background from grabcut output image in OpenCV android ?

Can you give me your java code to remove the block background.Very Thanks

2014-05-11 23:34:17 -0600 asked a question WaterMark Application

Hi, I want to create an application in android using open cv. My application include's functions are given below:

  1. Read image in any format (JPEG, PNG, GIFF) etc.
  2. Rotate and scale image, save rotated and scaled image.
  3. Create composite image means placing one image on another image and creating one image from them.
  4. Place text on image and save that image with text.

I tried to implement these functionality using JMagick library but did not get any success. Kindly tell me that above functionalities are possible to implement in open cv for android. Thanks.