i hope this will be helpful
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include <iostream>
using namespace cv;
int main()
{
int lineType = LINE_AA; // change it to LINE_8 to see non-antialiased graphics
Mat image = Mat::zeros(400, 400, CV_8UC3);
for(int angle = 0; angle<360; )
{
Point center(200, 200);
Point perimeter;
int radius = 150;
Scalar randomColor((rand() & 255), (rand() & 255), (rand() & 255));
ellipse( image, center, Size(radius, radius), angle, 45, 0, randomColor, 2, lineType);
perimeter.x = (int)round(center.x + radius * cos(angle * CV_PI / 180.0));
perimeter.y = (int)round(center.y + radius * sin(angle * CV_PI / 180.0));
line(image, center, perimeter, randomColor, 2, lineType);
angle = angle + 45;
perimeter.x = (int)round(center.x + 150 * cos(angle * CV_PI / 180.0));
perimeter.y = (int)round(center.y + 150 * sin(angle * CV_PI / 180.0));
line(image, center, perimeter, randomColor, 2, lineType);
imshow("slices", image);
waitKey(0);
}
return 0;
}
you need to detect a pizza and draw 8 slices or detect slices in a pizza ? in both cases please provide your code. and remember... cv2.line() can't cut your pizza ;-)
it seems like you have already post a question about this...
I can detect a pizza but unable to draw slices. Here is my code
import cv2 import cv2.cv as cv
import numpy as np
def main():
the image contains 10 slices :)